Entering covariates into a linear regression model.

Accepted Solution Solved
Reply
New Contributor
Posts: 3
Accepted Solution

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
Respected Advisor
Posts: 4,609

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

View solution in original post


All Replies
Solution
‎05-25-2016 11:47 PM
Respected Advisor
Posts: 4,609

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?

Respected Advisor
Posts: 4,609

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.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 349 views
  • 0 likes
  • 2 in conversation