06-10-2014 01:10 PM
Hello, I'm kinda new to the statistical world and am working with SAS to do a data analysis.
I know that I have a dependent variable based on age and bmi and I want to do a mean adjustment of the dependent variable based on these two independent variables.
proc reg only shows that they are, in fact, predictor variables. Also, N = 150
code so far:
proc reg data=test;
model depvar = age bmi / cbi;
So I know that the dependent variable is based off of age and bmi. I'm, just not sure what code to use to actually adjust the values of the dependent variable based on them. Any help would be appreciated. Thanks!
06-10-2014 01:17 PM
Figure out what your output should be and then it becomes a question of how to get SAS to be. Generally a good solution with stats question.
I'd find an example of what you need online, a stats paper or something and then use that as a reference trying to recreate it. Once you can do that, then you move on to your actual data.
06-10-2014 06:23 PM
I am not certain I understand what kind of adjustment you require but I have met the
situation where the effect of covariables had to be subtracted from the dependent variable,
which can be done in the following way :
/* Define reference age and BMI */
/* Add one observation with reference age and BMI to the dataset */
if _n_=1 then do;
age = &refAge;
bmi = &refBMI;
/* Get the predicted values (including for the reference age and BMI) and individual residuals */
proc reg data=refTest;
model depvar = age bmi / clb;
output out=outTest r=resid p=pred;
/* Compute adjusted dependent variable as predicted dependent variable at reference age and BMI
plus individual departure from regression mean (the residual) */
if _n_=1 then refDepvar = pred;
stdDepvar = refDepvar + resid;