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.
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
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.
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.
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.