BookmarkSubscribeRSS Feed
sdwhite1989
Calcite | Level 5

I am using proc surveylogistic and place my code below. However, I am receiving the following message in my log.

 

 

"Only one cluster in a stratum. The estimate of variance will omit this stratum"

 

proc surveylogistic data = Mylib.newbrfss_subgroup2;
Class Age65older (ref='1') _EDUCAG (ref='1') _INCOMG (ref='1')  _RFBMI5 (ref='2') _IMPRACE (ref='1') 
_SMOKER3 (ref='4') _ASTHMS1 (ref='3') /param=ref ;
Domain Nonsmoker;
Strata _Ststr;
Cluster _Psu;
Weight _LLCPWT;
model MISS_AnyTeeth (event='1')= Fem_NoDrinker Fem_ModDrinker Fem_HeavyDrinker Male_NoDrinker Male_ModDrinker Male_HeavyDrinker
Age65older _EDUCAG _INCOMG _DENVST2 _RFBMI5 _IMPRACE DIABETE3 _SMOKER3 _ASTHMS1 CVDSTRK3 ; run; 
6 REPLIES 6
ballardw
Super User

Try running

proc freq data = Mylib.newbrfss_subgroup2;

   tables  Nonsmoker * _Ststr * _psu / list;

run;

 

If one or more lines has a freq of 1 those are the culprits. If there is only one _psu then there is NO variability within the stratum.

You may have to include a WHERE clause for the class variables to be non-missing.

 

It may be that your Nonsmoker is very unbalanced in some geographic area (_ststr), assuming nonsmoker is basically a  yes/no value of some sort.

ballardw
Super User

Dangerous to be running procs without understanding the options.

 

Domain requests an analysis for each level of the variable (subpopulation) in addition to the whole data set.

I would expect to get output related to 1) Non-smoker respondents (from the name of the variable) 2) Smokers (if that is another level) and possibly 3) indeterminate respondents (refused or did not answer enough questions to know the smoking status).

 

liiiiiiiib
Calcite | Level 5

sorry, i met the same question as well. I don't understand your reply about where clause. should i add the where clause following the class variables?  like this ? what should I add? I have found the ommited stratum,but waht should I do to avoid the situation?

And whether an omitted stratum will have an influence on the outcomes? please help me! pleeeeeeeeeeeease! thank you! 

proc surveylogistic data=final nomcar varmethod=taylor; strata sdmvstra/list; cluster sdmvpsu; weight wtmec12yr; domain dmadult;
class riagendr(param=ref ref="1") race(param=ref ref="3") dmdurcat(param=ref ref="1") hbA1c_control(param=ref ref="1") nhdlcontrol(param=ref ref="1") obese(param=ref ref="0") bpmet_old(param=ref ref="0") ratio(param=ref ref="2")/where;
model drcat(desc)=ratio ridageyr riagendr dmdurcat race hbA1c_control nhdlcontrol bpmet_old obese/noint clparm vadjust=none;run;

 

ballardw
Super User

@liiiiiiiib wrote:

sorry, i met the same question as well. I don't understand your reply about where clause. should i add the where clause following the class variables?  like this ? what should I add? I have found the ommited stratum,but waht should I do to avoid the situation?

And whether an omitted stratum will have an influence on the outcomes? please help me! pleeeeeeeeeeeease! thank you! 

proc surveylogistic data=final nomcar varmethod=taylor; strata sdmvstra/list; cluster sdmvpsu; weight wtmec12yr; domain dmadult;
class riagendr(param=ref ref="1") race(param=ref ref="3") dmdurcat(param=ref ref="1") hbA1c_control(param=ref ref="1") nhdlcontrol(param=ref ref="1") obese(param=ref ref="0") bpmet_old(param=ref ref="0") ratio(param=ref ref="2")/where;
model drcat(desc)=ratio ridageyr riagendr dmdurcat race hbA1c_control nhdlcontrol bpmet_old obese/noint clparm vadjust=none;run;

 


Did you run a Proc FREQ on your class variables as shown? Did it identify the combination(s) where there is only one observation in the combination?

 

The WHERE suggestion might be of use if one or more of your class variables is missing frequently. Which could result in singular clusters. The WHERE statement is a separate statement, not an option. Would look like (generic):

Where not missing(var1) and not missing(othervar) and not missing(thatvar);

The variable names would be your variables.

 

This may remove the message but it does that by, very likely, removing entire clusters and those values won't appear at all in the model. It also comes from some work with the BRFSS survey where we had that message because of some of the "strata" which were related to something basically added by the weighting scheme after collection and not really the sample design.

 

 

 

Basically your data will generate that message with your combination of variables. It is just telling you that some caution may be needed when using those domains / clusters as there is no variability within those in your current data. Depending on

Zard
SAS Employee

The log message is a Note and not an Error. When you have clusters and strata, clusters are nested within strata in the SAS survey procedures. If there is a stratum with only a single cluster in it, the within-stratum variance cannot be computed. (You can look at the variance estimation formula and see where (n_h - 1) introduces a division by zero). The message is letting you know this stratum is omitted from the variance calculation, treating its contribution as zero. The results are valid, but if you don't want to make the zero assumption, you would need to make prior adjustments to your data such as collapsing strata.

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!

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
  • 6 replies
  • 3249 views
  • 4 likes
  • 4 in conversation