Hi.
I wonder how I can choose Phoneme_stress condition of 0 and 1 and drop 2, 3, 4, and 5.
Neither of below codes worked.
Could you please help me following codes?
data a1.prediss1;
set a1.prediss;
where Error=0 And [Phoneme_stress=0 or Phonem_stress=1];
run;
data a1.Prediss1;
set a1.Prediss;
if Phonem_stress in (2, 3, 4, 5) then delete;
where error=0;
run;
Thank you.
Either of these changes should work:
data a1.prediss1;
set a1.prediss;
where Error=0 And (Phoneme_stress in (0, 1));
run;
data a1.Prediss1;
set a1.Prediss;
if Phonem_stress in (2, 3, 4, 5) and error ne 0 then delete;
run;
Either of these changes should work:
data a1.prediss1;
set a1.prediss;
where Error=0 And (Phoneme_stress in (0, 1));
run;
data a1.Prediss1;
set a1.Prediss;
if Phonem_stress in (2, 3, 4, 5) and error ne 0 then delete;
run;
Thank you.
Your second program might be fine as is ... as long as you are spelling the variable name correctly. Is it Phoneme_stress, or is it Phonem_stress?
Also, you never explained ERROR and what that is about. So all we can do is assume you have used it correctly.
I wanted to included only error=0 values in all those conditions I wanted to include (phoneme_stress=0 or 1).
Does it change any of the codes I created or received from Reeza?
It doesn't change either of @Reeza's programs. You might want to select one or the other, based on how you want bad data to be handled. What should happen of Phoneme_stress is missing, or 8, for example?
After exploring a little bit, I found following two codes worked.
data a1.prediss1;
set a1.prediss;
where Error=0 And (Phoneme_stress in (0, 1));
run;
data a1.Prediss1;
set a1.Prediss;
where error=0;
if Phoneme_stress in (2, 3, 4, 5) then delete;
run;
I wanted to include only Error=0. Error is a dichotomous variable.
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.
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.