Help using Base SAS procedures

Using linear regression with categorical and continuous covariates

Reply
New Contributor
Posts: 2

Using linear regression with categorical and continuous covariates

I am trying to do a linear regression to computer whether body weight can predict blood pressure after controlling for age, healthstatus, and physical activity. Here, my DV (blood pressure) is continuous and my IV(body weight)  is continuous. Also, I have several covariate IVs; age is continous, healthstatus is categorical (dummy coded 1-5), and physical activity is continous (# hours doing physical activity). To do this, should I use proc glm or proc reg?

SAS Employee
Posts: 340

Re: Using linear regression with categorical and continuous covariates

Posted in reply to cassifields

I recommend proc glm. There you can use the class statement to dummy code the categorical variables.

You can use also proc reg, but then first you need to pre-process your data (creating dummy variables "manually").

New Contributor
Posts: 2

Re: Using linear regression with categorical and continuous covariates

Posted in reply to gergely_batho

Can you check multicollinearity using proc glm?

Super User
Posts: 10,046

Re: Using linear regression with categorical and continuous covariates

Posted in reply to cassifields

You can use STEPWISE BACKWISW ... option of MODEL to get rid of multicollinearity and get the best model .

Respected Advisor
Posts: 2,655

Re: Using linear regression with categorical and continuous covariates

"Best models" with categorical variables are messy, and those methods in PROC REG really won't help.  The categorical dummy variables are by definition collinear.

I would approach this with PROC GLM or MIXED, and look at the chapter on Analysis of Covariance in SAS for Mixed Models, 2nd ed.

Steve Denham

Super User
Posts: 10,046

Re: Using linear regression with categorical and continuous covariates

Posted in reply to SteveDenham

Doc Steve,

Sorry to make you confused . My statistical background was not as good as you were .

Ask a Question
Discussion stats
  • 5 replies
  • 315 views
  • 0 likes
  • 4 in conversation