Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Home
- /
- Analytics
- /
- Stat Procs
- /
- Using categorical covariates in ANCOVA with Proc glm function

Options

- RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

🔒 This topic is **solved** and **locked**.
Need further help from the community? Please
sign in and ask a **new** question.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Posted 04-10-2019 08:23 PM
(1870 views)

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?

1 ACCEPTED SOLUTION

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

Paige Miller

2 REPLIES 2

- 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

Paige Miller

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Thanks! I really appreciate your help.

**Available on demand!**

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

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.