Hello!
Can anyone explain to me how to create a where statement with three conditions? I am running an ANOVA test and I want to only include responses where the indic variable equals 0, where the maxiwhite variable equals 0, and where the maxdidsa equals 0. This is the code I have, and there were no problems in the log, but I want to make sure set it up correctly and don't need to put the three where statements together before the ANOVA.
data gpa;
set import;
where indic = 1;
where also maxiwhite = 0;
run;
proc anova; class mipell; model mfinalgpa = mipell; means mipell / tukey; where maxdidsa = 1;
run;
Thank you!!
How about this:
proc anova data=import(where=(maxdidsa = 1 and indic=1 and maxiwhite=0));
class mipell;
model mfinalgpa = mipell;
means mipell / tukey;
run;
You syntax is correct, but creating an intermediate table is unnecessary and wasteful.
proc anova data=IMPORT;
where MAXDIDSA=1 and INDIC=1 and MAXIWHITE=0;
class MIPELL;
model MFINALGPA = MIPELL;
means MIPELL / tukey;
run;
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.
Ready to level-up your skills? Choose your own adventure.