01-11-2017 01:53 PM
I have this logistic regression model and would like to extract the p value of the interaction term "drug*var1".
proc glm data=test;
model bodyweight = drug var1 drug*var1;
Problem is I need to do this 600 times because there are var1, var2, var3..... .... var600. Any thoughts appreciated!!
01-11-2017 02:10 PM - edited 01-11-2017 02:11 PM
Transpose the 600 variable to observations with and BY variable that IDs them. Then run your program with BY statement.
01-11-2017 02:34 PM
thanks for the quick reply
not sure if I understand fully and I have attached the screen shots of dataset and the transposed screenshot.
can u be more specific how to plug variable names into this regression model?
proc glm data=transposed;
model bodyweight= drug var1 drug*var1
01-11-2017 02:44 PM
Don't show screen shots. Include example data in your post that can me copied and pasted into a program.
01-11-2017 02:52 PM
the dataset (call it dataset1) looks like this
after transposing it (call it dataset2), it looks like this and I added varname as the header
How do I plug the variables (var1....var3) into the regression model?
01-11-2017 03:17 PM
Run this example and study how it works.
proc transpose data=sashelp.class out=class; by name age sex; var height weight; run; proc sort data=class; by _name_; run; proc print; run; proc glm; by _name_; class sex; model age= sex sex*col1; run;