BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
kmardinian
Quartz | Level 8
I am working with a dataset where I only want ages 18-45, so I created a flag for it. But when I seem to run a surveylogistic with it, I get this WARNING with the DOMAIN statment;
 
 
 

 

1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
61
62 proc surveylogistic data=assign ;
63 repweight rakedw1--rakedw80 / jkcoefs=1;
64 weight rakedw0;
65 class fruitveg (ref="ALWAYS") age (ref='Ages 18 to 26') ethn (ref="White") BMI (ref='UNDERWEIGHT/NORMAL WEIGHT') sugar
65 ! (ref='0 to 100 sugar drinks per month') exercise (ref="Less than 30 min walking/week") educ (ref="Less than High School")
65 ! income (ref="0 tp 50,000") / param=ref ;
66 model diabetesoutcome(ref= "NO") = fruitveg age ethn BMI sugar exercise educ income;
67 domain flag;
68 format diabetesoutcome diabetesoutcomex. fruitveg fruitvegx. age agex. gender genderx. ethn ethnx. BMI BMIx. sugar
68 ! sugarx. exercise exercisex. smoke smokex. educ educx. income incomex. geo geox.;
69 run;
 
NOTE: PROC SURVEYLOGISTIC is modeling the probability that diabetesoutcome='TYPE 2'.
WARNING: Convergence was not attained in domain flag=1.
WARNING: No analysis for domain flag=1.
NOTE: Convergence criterion (GCONV=1E-8) satisfied.
NOTE: PROC SURVEYLOGISTIC is modeling the probability that diabetesoutcome='TYPE 2'.
NOTE: Convergence criterion (GCONV=1E-8) satisfied.
NOTE: PROCEDURE SURVEYLOGISTIC used (Total process time):
real time 3.03 seconds
cpu time 3.00 seconds
 
 But when I switch the DOMAIN statement to a WHERE statement I do not get a WARNING, and I am trying to understand why that is and whether it will affect my results. Thank you!
1 ACCEPTED SOLUTION

Accepted Solutions
SAS_Rob
SAS Employee

Unless the sample sizes of the age groups are fixed, that is part of your study design, then you should not use a WHERE statement.  My suggestion to avoid the issue is to set all the response variables for the group that you are NOT interested in to missing and then use the NOMCAR option on the SURVEYLOGISTIC statement.  This will give you a valid subgroup analysis (since the NOMCAR option treats missing values as a subgroup) and fit only the model you are interested in.

View solution in original post

2 REPLIES 2
PeterClemmensen
Tourmaline | Level 20

The DOMAIN statement requests analysis for each level/domain in your domain variable. In your case you have two domains: 1(Age 18-45) and 0(outside age 18-45).

 

The where statement simply excludes observations where the condition in the where statement is not satisfied.

 

Provide some sample of your data if you want a more usable answer 🙂

 

Also consult the PROC SURVEYLOGISTIC Documentation

SAS_Rob
SAS Employee

Unless the sample sizes of the age groups are fixed, that is part of your study design, then you should not use a WHERE statement.  My suggestion to avoid the issue is to set all the response variables for the group that you are NOT interested in to missing and then use the NOMCAR option on the SURVEYLOGISTIC statement.  This will give you a valid subgroup analysis (since the NOMCAR option treats missing values as a subgroup) and fit only the model you are interested in.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 2 replies
  • 1802 views
  • 0 likes
  • 3 in conversation