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

Greetings SASsers,

I am setting up a bootstrap analysis of a multinomial model in Proc Logistic and getting this warning:
WARNING: The current by-group is not processed because the ordering of the levels of Smoker_NXT are different from their ordering across all by-groups.
which is unexpected because my data is sorted. My log file, lightly edited for brevity:

NOTE: Copyright (c) 2016 by SAS Institute Inc., Cary, NC, USA. 
NOTE: SAS (r) Proprietary Software 9.4 (TS1M7)
Licensed to UNIVERSITY OF NEW MEXICO - ADMIN, Site 70080754.
NOTE: This session is executing on the X64_10PRO platform.

2791 proc sort data=boots2; by Replicate Smoker_NXT ; 2793 run; NOTE: There were 243174 observations read from the data set WORK.BOOTS2. 2808 proc logistic data=boots2 order=formatted plots=none ; 2809 by Replicate; 2813 class Wave(ref='1') AgeStartCIGS(ref='18-24') 2813 ! Age1stIview(ref='18-24') Sex(ref='Male') 2814 Race(ref='White alone') Hispanic(ref='Non-Hispanic') 2815 Smoker(ref='No') Smoker_NXT(ref='No') ENDSer(ref='No') 2816 Start2SMK(ref='No') SmkHistory(ref=first) / param=glm; 2817 2818 model Smoker_NXT = AgeStartCIGS Age1stIview Sex Race Hispanic Wave|Smoker|ENDSer SmkHistory Start2SMK / noint 2819 ! link=glogit Singular=1E-7 ; 2820 weight tWGT ; 2829 run; WARNING: The current by-group is not processed because the ordering of the levels of Smoker_NXT are different from their ordering across all by-groups. NOTE: The above message was for the following BY group: Sample Replicate Number=1 NOTE: There were 243174 observations read from the data set WORK.BOOTS2. NOTE: PROCEDURE LOGISTIC used (Total process time):

I get this warning for all By-Replicate groups, even for only a single group, but not if I remove the "BY Replicate;" statement.

My code:

proc sort data=boots2;  
by Replicate Smoker_NXT   ; 
run;

proc logistic data=boots2 order=data plots=none ;
by Replicate;
class   Wave(ref='1')  AgeStartCIGS(ref='18-24') Age1stIview(ref='18-24') Sex(ref='Male')  Race(ref='White alone') Hispanic(ref='Non-Hispanic') Smoker(ref='No') Smoker_NXT(ref='No') ENDSer(ref='No') 		Start2SMK(ref='No')  SmkHistory(ref=first)  /  param=glm;
model Smoker_NXT = AgeStartCIGS Age1stIview Sex Race Hispanic Wave|Smoker|ENDSer SmkHistory Start2SMK  /  noint link=glogit  Singular=1E-7  ;
weight tWGT ;
run;

Note1: "order=data" was suggested in one of the warning message, but it doesn't resolve the warning. 
Note2: The warning goes away if I switch from Param=GLM to Param=REF, but I am hoping to use LSMEANS to get the interaction results.

TIA!

1 ACCEPTED SOLUTION

Accepted Solutions
Ksharp
Super User

1)

Firstly, make sure in each of Replicate, you have both No and Yes. 

a.k.a you have right data structure to build a LOGISTIC Model.

Use this code to check:

proc freq data=boots2 ;
table Replicate*Smoker_NXT /list;
run;

 

 

2)

I think your code should like:

 

class   Wave(ref='1')  AgeStartCIGS(ref='18-24') Age1stIview(ref='18-24') Sex(ref='Male')  
Race(ref='White alone') Hispanic(ref='Non-Hispanic') Smoker(ref='No') Smoker_NXT(ref='No')
ENDSer(ref='No') Start2SMK(ref='No') SmkHistory(ref=first) / param=glm; model Smoker_NXT = AgeStartCIGS Age1stIview Sex Race Hispanic Wave|Smoker|ENDSer SmkHistory
Start2SMK / noint link=glogit Singular=1E-7 ; -----> class Wave(ref='1') AgeStartCIGS(ref='18-24') Age1stIview(ref='18-24') Sex(ref='Male')
Race(ref='White alone') Hispanic(ref='Non-Hispanic') Smoker(ref='No')
ENDSer(ref='No') Start2SMK(ref='No') SmkHistory(ref=first) / param=glm; model Smoker_NXT(ref='No') = AgeStartCIGS Age1stIview Sex Race Hispanic Wave|Smoker|ENDSer SmkHistory
Start2SMK / noint link=glogit Singular=1E-7 ;

NOTE: there is not Smoker_NXT in CLASS statement.

 

 

 

If that still does not work, try using another level of Smoker_NXT( ref='Yes'):

 

class   Wave(ref='1')  AgeStartCIGS(ref='18-24') Age1stIview(ref='18-24') Sex(ref='Male') 
Race(ref='White alone') Hispanic(ref='Non-Hispanic') Smoker(ref='No')  
ENDSer(ref='No') 		Start2SMK(ref='No')  SmkHistory(ref=first)  /  param=glm;
model Smoker_NXT(ref='Yes') = AgeStartCIGS Age1stIview Sex Race Hispanic Wave|Smoker|ENDSer SmkHistory
Start2SMK  /  noint link=glogit  Singular=1E-7  

 

 

 

View solution in original post

4 REPLIES 4
Tom
Super User Tom
Super User

Does every value of Replicate have the same set of values of Smoker_NXT?

Do any of the other analysis variables have missing values? PROC LOGISTIC should eliminate those observations.  Could that cause one of the values of Smoker_NXT to drop out for a group?

EastwoodDC42
Calcite | Level 5

@Tom 
Does every value of Replicate have the same set of values of Smoker_NXT?


They do. I suspect some interaction between the glogit link and by-processing.

Each subject might be surveyed up to 7 times, and the third level of response is "No Response" to the survey. On consideration I can drop the non-response and simplify to a logistic regression. 

Thanks for your time!


Ksharp
Super User

1)

Firstly, make sure in each of Replicate, you have both No and Yes. 

a.k.a you have right data structure to build a LOGISTIC Model.

Use this code to check:

proc freq data=boots2 ;
table Replicate*Smoker_NXT /list;
run;

 

 

2)

I think your code should like:

 

class   Wave(ref='1')  AgeStartCIGS(ref='18-24') Age1stIview(ref='18-24') Sex(ref='Male')  
Race(ref='White alone') Hispanic(ref='Non-Hispanic') Smoker(ref='No') Smoker_NXT(ref='No')
ENDSer(ref='No') Start2SMK(ref='No') SmkHistory(ref=first) / param=glm; model Smoker_NXT = AgeStartCIGS Age1stIview Sex Race Hispanic Wave|Smoker|ENDSer SmkHistory
Start2SMK / noint link=glogit Singular=1E-7 ; -----> class Wave(ref='1') AgeStartCIGS(ref='18-24') Age1stIview(ref='18-24') Sex(ref='Male')
Race(ref='White alone') Hispanic(ref='Non-Hispanic') Smoker(ref='No')
ENDSer(ref='No') Start2SMK(ref='No') SmkHistory(ref=first) / param=glm; model Smoker_NXT(ref='No') = AgeStartCIGS Age1stIview Sex Race Hispanic Wave|Smoker|ENDSer SmkHistory
Start2SMK / noint link=glogit Singular=1E-7 ;

NOTE: there is not Smoker_NXT in CLASS statement.

 

 

 

If that still does not work, try using another level of Smoker_NXT( ref='Yes'):

 

class   Wave(ref='1')  AgeStartCIGS(ref='18-24') Age1stIview(ref='18-24') Sex(ref='Male') 
Race(ref='White alone') Hispanic(ref='Non-Hispanic') Smoker(ref='No')  
ENDSer(ref='No') 		Start2SMK(ref='No')  SmkHistory(ref=first)  /  param=glm;
model Smoker_NXT(ref='Yes') = AgeStartCIGS Age1stIview Sex Race Hispanic Wave|Smoker|ENDSer SmkHistory
Start2SMK  /  noint link=glogit  Singular=1E-7  

 

 

 

EastwoodDC42
Calcite | Level 5

@Ksharp 
You suggestion of removing Smoker_NXT from the CLASS statement appears to have resolved the level-ordering problem (Hurray!), but now I have convergence issues. As I noted to @Tom above, I can simplify the model, which might solve the convergence problems too. 

Thanks again for your time!

 

Dan

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

What is ANOVA?

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.

Discussion stats
  • 4 replies
  • 908 views
  • 0 likes
  • 3 in conversation