Hello,
I would like to run the proc reg procedure stratified by some categorical variables.
this is what I did without stratification:
Proc reg data=DATA; Model DEPENDENT=independent_1 ; run;
Now, I would like to calculate the estimated effect of the variable "independent_1" on DEPENDENT but stratified by Independent_2. "Independent_2" variable has four categories (0, 1, 2, 3). I would like to see for Independent_2=0 then what is the estimated effect of the variable "independent_1" on DEPENDENT.
Thank you
Batts
You can create regressions by categorical variable with the same slope across each level of the categorical variable, or you can four regressions with different slopes.
proc glm data=data;
class independent_2;
model dependent = independent_1 independent_2
independent_1*independent_2
/solution;
run;
This gives four different slopes. If you want them to have the same slopes, remove independent_1*independent_2
Did you use the /SOLUTION option? If so, the estimates should be shown in the output.
Please show us the code you used. (Click on the running man icon and paste the code into that window)
Please show us the output you obtained.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and save with the early bird rate—just $795!
ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.
Find more tutorials on the SAS Users YouTube channel.