Hello,
I have a large dataset (n= 78,000) and am trying to run a hierarchical regression, controlling for multiple variables. I am new to using SAS and I am having difficulty getting SAS to run the regression reading all four levels of the province data that I have. The class level information from the results indicates it is only reading "Ontario's" data, and not the other 3 (AB, BC, QC) provinces. Other analysis I have run, have read each level of data fine.
This is the code I am using:
proc glimmix data=work.combined;
CLASS approach province income enrolment urban CANNABIS_FREQ BINGE_DRINKING WEEKLY_SPENDING
SMOKING_STATUS;
MODEL CANNABIS_FREQ = SEX3 GRADE GETHNCL1 GETHNCC1 GETHNCN1 GETHNCA1 GETHNCH1
GETHNCM1 SMOKING_STATUS BINGE_DRINKING WEEKLY_SPENDING / SOLUTION;
RANDOM CANNABIS_FREQ / SUBJECT=approach SOLUTION;
run;
and I attached my results output.
Any help is greatly appreciated!
It's not clear you can "fix" missings. You can substitute some number for these missing, there's a lot of literature on how to do this, and also SAS has PROC MI. If the missings are all in a single column (you'd have to look to see if that is the case), then you could delete that variable from the model in PROC GLIMMIX.
Some possibilities:
Side comment: income is really a class variable? Enrollment is a class variable? This may cause problems somewhere along the line, although probably not the problem you mentioned about province.
Thanks for your response and the side notes to consider.
This is the result I have after running a procfreq:
What about the missing values for the other provinces? You need to check that as well.
Is there a message in the LOG from PROC GLIMMIX about missing values?
Thanks for your response.
The message in log is:
It's not clear you can "fix" missings. You can substitute some number for these missing, there's a lot of literature on how to do this, and also SAS has PROC MI. If the missings are all in a single column (you'd have to look to see if that is the case), then you could delete that variable from the model in PROC GLIMMIX.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.