BookmarkSubscribeRSS Feed
CathyVI
Pyrite | Level 9

What does it mean if I'm asked to adjust for a variable?

Using sashelp.heart dataset, i want to run a linear regression of weight as my dependent variable and height as my independent variable adjusting for AgeAtStart.

 

Is this code correct?

proc reg data=sashelp.heart;

model weight =height AgeAtStart;

run;

If I want to add more independent variable like diastolic, systolic, and still adjusting for AgeAtStart how will I arrange the code? Is this correct?

 

proc reg data=sashelp.heart;

model weight =height diastolic systolic AgeAtStart;

run;

 

5 REPLIES 5
tarheel13
Rhodochrosite | Level 12
Proc reg is for linear regression so it does not look correct since you saw you want logistic regression. Read this: https://stats.idre.ucla.edu/sas/dae/logit-regression/

CathyVI
Pyrite | Level 9
Sorry I meant to say Linear regression
tarheel13
Rhodochrosite | Level 12
Okay if it’s linear then your code is fine.
Ksharp
Super User
I don't understand your question. Do you mean constant coefficient of AgeAtStart be 1 ?
maybe @Rick_SAS know something more .
Rick_SAS
SAS Super FREQ

As you say, "adjusting for a variable" (or "controlling for a variable") is related to including that variable in an appropriate regression model. For a good explanation and example, see regression - Explain model adjustment, in plain English - Cross Validated (stackexchange.com)

 

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 5 replies
  • 2055 views
  • 1 like
  • 4 in conversation