BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hello,

I am documenting some code written by a former employee. I am not tremendously familiar with proc GLM, but I understand the basics. I am working with a statistician to make sure the code is doing what it should. What would putting class variables in the model statement achieve?

In our dataset, we have 3 independent variables, a1-a3, which are really just a^1, a^2, and a^3. We have three categorical variables, c1, c2, and c3. The procedure written is:

proc glm data = mydata;
class c2 c3;
model b=a1 a2 a3 c2*c3 /noint solution ss3;
lsmeans c2*c3;
by c1;
output out=myoutput p=predicted_value;
run;

Neither the statistician nor I could figure out what adding c2*c3 to the accomplish, since they are not continuous variables. Any insight would be very helpful!

Thank you,
Michael
1 REPLY 1
Olivier
Pyrite | Level 9
Hello.

In PROC GLM (as well as other modelling procedures), the * sign does not mean "multiply" (as I think you thought) but "cross". X2*X3 is cross-effect for X2 and X3, which means groups defined by values of BOTH X2 and X3, and not groups for X2 on one hand, and groups for X3 on another hand.
Imagine you have a study of respiratory capacity (lung volume or something like that) recorded for patients, some of whom are smokers, other non-smokers ; some are men, other women.
When you just test the SEX effect, you will know if lung volume is different for men and women (it usually is). When you just test the SMOKE_HABIT effect, you will know if smoking decreases the lung capacity, regardless of sex.
What you test when considering the SEX*SMOKE_HABIT is if among women and men taken separately, smoking alters the respiratory capacity.

I hope it is clear enough for you.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

New Learning Events in April

 

Join us for two new fee-based courses: Administrative Healthcare Data and SAS via Live Web Monday-Thursday, April 24-27 from 1:00 to 4:30 PM ET each day. And Administrative Healthcare Data and SAS: Hands-On Programming Workshop via Live Web on Friday, April 28 from 9:00 AM to 5:00 PM ET.

LEARN MORE

Discussion stats
  • 1 reply
  • 844 views
  • 0 likes
  • 2 in conversation