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;
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!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.