BookmarkSubscribeRSS Feed
jb2022
Calcite | Level 5

Hello! I am a relatively new SAS user and have tried to search forums for help so hope that someone here may be able to help. 

 

I have a dataset with repeated measures of a continuous variable at two timepoints (pre vs. post), 1 categorical IV (group, 2 levels), and 2 covariates (race=categorical, 3 levels, and age = continuous). I am looking for parameter estimates collapsed across both timepoints for both the class group and both covariates. When I use the solutions statement, SAS produces the parameter estimates but there are two per variable, one at the pre timepoint and one at the post timepoint, which is not what I want.

 

Any help is appreciated, thanks!

 

example code:

 

PROC GLM data = data1;

CLASS group race;

MODEL DV_pre DV_post = group race age /solution;

REPEATED Time 2 / summary;

RUN;

 

General data structure:

 

ID# Group Age Race   Pre Post

1       1       30      0         5     4

2       2       44      1         5     3

3       1       50      2         4     2

 

2 REPLIES 2
ballardw
Super User

To get a single parameter estimate would require a single dependent variable on the model statement.

 

I am not sure what "collapsed across both time points" would actually mean. Maybe add a variable to your data set that is calculated from the values of Pre and Post, such as a mean, for each record and use that as the dependent variable.

StatDave
SAS Super FREQ

PROC GLM is giving you parameters for models fit separately to the two response variables before it gives multivariate and repeated measures tests. More modern methods are available which include random effects models and Generalized Estimating Equations (GEE) models. Both of these will provide a single set of parameter estimates. But both need the data to be arranged differently with the multiple measurements per subject in separate observations. The following statements fit a GEE model after rearranging the data appropriately. Note that you didn't include any RACE values in your data. The TYPE=EXCH option in the REPEATED statement estimates and uses the correlation between the PRE and POST measurements in the analysis. The procedure output includes the correlation estimate.

data a;
input ID Group Age Gender Pre Post;
y=pre;  time="pre "; output;
y=post; time="post"; output;
datalines;
1       1       30      0         5     4
2       2       44      1         5     3
3       1       50      1         4     2
... the rest of your data ....
;
proc gee;
class group race id;
model y = group race age;
repeated subject=id / type=exch;
run;

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 966 views
  • 2 likes
  • 3 in conversation