- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hello, I'm using ANCOVA for anlayzing RCT data.
I'm using Proc glm now. In ANCOVA, it seems to be common to use continous covariates, not categorical covariates.
However, in my data, the covariates are categorical variables(e.g. race, gender).
Is it right to use categorical variables as covariates in ANCOVA with proc glm function?
In proc glm, we can only use categorical variables with 'class statement'.
As I add variables in my model gradually, the results of main variables(independent variables) are changing.
It seems that the results of indepedent variables are being adjusted gradually.
However, I'm not sure about the process and outcome.
* In addition
There were some people who had similar problems with me, but the answers to them was a bit ambiguous for me, and most of them answer with SPSS syntax, not SAS.
the syntax is like below... for simplicity, I assume that there is no interaction between variables.
proc glm data=DATA plot=meanplot(cl);
class trt race gender;
model outcome = trt race gender age baseline/solution;
lsmeans trt/tdiff pdiff cl adjust = bon;
run;
As you see, trt is treatement, which is independent variables and race and gender are categorical covariates.
the results of lsmeans is changing as I add categorical covariates gradually, but is it right procedure?
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
There's nothing wrong with categorical variables in a PROC GLM model, whether it is ANCOVA or ANOVA or any other model GLM can fit.
The problem is that as you add variables, then the effects of other variables will change (unless the added variable is orthogonal to the variables already in the model). This is expected behavior, but sometimes not pleasing from an intuitive point of view.
Paige Miller
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
There's nothing wrong with categorical variables in a PROC GLM model, whether it is ANCOVA or ANOVA or any other model GLM can fit.
The problem is that as you add variables, then the effects of other variables will change (unless the added variable is orthogonal to the variables already in the model). This is expected behavior, but sometimes not pleasing from an intuitive point of view.
Paige Miller
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Thanks! I really appreciate your help.