Solved
New Contributor
Posts: 3

# Entering covariates into a linear regression model.

I have a SAS related question --

I am running a simple linear regression, with three different groups of participants as the predictors (with group 1 as the reference), the outcome a continuous social support variable, and five covariates. Three of the covariates are dichotomized (age, sex, & education), one is a three-level nominal variable (marital status), and the last is continuous (it's a chronic disease index). My question is: do I need to specify the different types of covariates in the SAS coding somehow?

Would this coding example be correct?:

proc glm data=work.example;

class group age sex education marital education chronic_diseases;

model social_support = group age sex education marital education chronic_diseases;

estimate 'group 1 vs group 2' group -1 1 0;

estimate 'group 1 vs group 3' group -1 0 1;

run;

Accepted Solutions
Solution
‎05-25-2016 11:47 PM
Posts: 5,543

## Re: Entering covariates into a linear regression model.

How many values does chronic_diseases index take? By putting it in the class statement, you are estimating a parameter for each value of the index. If instead you want to establish a linear relationship between social_support and chronic_diseases (and thus estimate a single parameter for that effect) then take chronic_diseases off the class variables list.

You will probably also want to investigate the possibility of interactions between your predictors. For example marital*sex would test if marital has the same effect for both sexes.

PG

All Replies
Solution
‎05-25-2016 11:47 PM
Posts: 5,543

## Re: Entering covariates into a linear regression model.

How many values does chronic_diseases index take? By putting it in the class statement, you are estimating a parameter for each value of the index. If instead you want to establish a linear relationship between social_support and chronic_diseases (and thus estimate a single parameter for that effect) then take chronic_diseases off the class variables list.

You will probably also want to investigate the possibility of interactions between your predictors. For example marital*sex would test if marital has the same effect for both sexes.

PG
New Contributor
Posts: 3

## Re: Entering covariates into a linear regression model.

There are 34 items on the chronic disease index. So, in other words, the class statement is only for categorical covariates?

Posts: 5,543

## Re: Entering covariates into a linear regression model.

That's right! Or for a continuous variable with few distinct values that you want to treat as categorical.

PG
New Contributor
Posts: 3

## Re: Entering covariates into a linear regression model.

Thanks!

🔒 This topic is solved and locked.