BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
megan2
Calcite | Level 5

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. 

Screen Shot 2020-03-27 at 3.22.27 PM.png

 

Any help is greatly appreciated!

1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

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.

--
Paige Miller

View solution in original post

6 REPLIES 6
PaigeMiller
Diamond | Level 26

Some possibilities:

 

  1. The data set only has ON data. Do a PROC FREQ on work.combined and show us the results
  2. The data set has complete non-missing data only for ON. The other three provinces have missing data somewhere on every observation.

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.

--
Paige Miller
megan2
Calcite | Level 5

Thanks for your response and the side notes to consider. 

 

This is the result I have after running a procfreq: Screen Shot 2020-03-27 at 3.38.40 PM.png

PaigeMiller
Diamond | Level 26

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?

--
Paige Miller
megan2
Calcite | Level 5

Thanks for your response. 

 

The message in log is: 

NOTE: Some observations are not used in the analysis because of: missing fixed effects (n=68756), missing subject effects (n=1204).
NOTE: The GLIMMIX procedure is modeling the probabilities of levels of CANNABIS_FREQ having lower Ordered Values in the Response
Profile table.
NOTE: Convergence criterion (PCONV=1.11022E-8) satisfied.
NOTE: PROCEDURE GLIMMIX used (Total process time):
real time 0.63 seconds
cpu time 0.56 seconds
 
How would I go about fixing the missing data? 
 
 

 

Reeza
Super User
You can't fix your missing data. Basically if you run a proc means on your data perhaps there's only a measurement that's collected in Ontario?

proc means data=combined;
class province;
var _numeric_;
run;

proc freq data=combined;
table province*_character_;
run;

One of those will show you which variable is missing for all provinces except Ontario.
PaigeMiller
Diamond | Level 26

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.

--
Paige Miller

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 6 replies
  • 2355 views
  • 1 like
  • 3 in conversation