Author: Bailey DeBarmore Do you want to model trajectories by calculating transition probabilities? You can do this in Stata with just a little extension of your longitudinal data analysis skills. We'll be using xttrans (built in to Stata) or xttrans2 (a module you can download). Your data will need to be in LONG format. To reshape from wide to long, use: reshape long stub, i(id) j(time) Where stub is the stubname of your variable, i is the variable that uniquely identifies observations in your data set, and j is the time variable.
0 Comments
Trying to figure out how to model a categorical predictor in your regression?
Done this code a million times but can never remember the syntax for the class statement? Want to generate exponentiated estimates and confidence intervals? We'll give examples for binary, 3 levels, 4 levels, and stratified. Author: Bailey DeBarmore Short post today on how to use the MEAN function in SAS 9.4. Let's get started.
It seems like every time I need to calculate a mean variable in SAS, I find myself looking up which CALL functions deal with missing values in this way, and which in that way. For example, blood pressure readings are often taken 3 times, and then we average those 3 readings together for a mean value. In some code I ran earlier this morning, I kept getting negative values in my "avg_bp" variable. What's up with that? |
Practical solutions for conducting great epidemiology methods. Transparency in code. Attitude of constant improvement. Appreciate our stuff?
All
September 2020
|