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;
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.