Maybe add a WHERE statement to Tom's code, e.g.
proc summary data=have;
by date location;
var ph_level;
output out=want mean=mean_ph_level;
where ph_level ne 0;
run;
or
proc summary data=have;
by date location;
var ph_level;
output out=want mean=mean_ph_level;
where NOT (location='Dup' and ph_level=0) ;
run;
Should be simple.
proc summary data=have;
by date location;
var ph_level;
output out=want mean=mean_ph_level;
run;
I don't understand this part "the non-zero duplicate samples with the main samples". 0 should be a perfectly valid value of pH. Why would you want to exclude them?
Maybe add a WHERE statement to Tom's code, e.g.
proc summary data=have;
by date location;
var ph_level;
output out=want mean=mean_ph_level;
where ph_level ne 0;
run;
or
proc summary data=have;
by date location;
var ph_level;
output out=want mean=mean_ph_level;
where NOT (location='Dup' and ph_level=0) ;
run;
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
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.