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;
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)
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.
Ready to level-up your skills? Choose your own adventure.