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;
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: