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.
Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.
Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.
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.