Why attach a file to share a hand full of values?
date sample tylocation target levels 6-May main EU N.GIII 32 6-May dupe EU N.GIII 456 7-May main PR CII 645465 7-May dupe PR CII 0 20-May main HU AGI 0 20-May dupe HU AGI 64875833
Can you code the rules that explain which values you want to ignore? Use them to make a NEW variable (so your original data is not lost) which has MISSING values where you don't want to use the original value.
data for_analysis;
set have;
new_var = levels;
if levels=0 then new_var=.;
run;
Now you can take the MEAN() of your new variable.
Turn the zeros into missing values.
Also, most of us refuse to download Excel (or Microsoft Office) files as they can be a security threat. The proper way to include data is as text in working SAS data step code (examples and instructions)
Why attach a file to share a hand full of values?
date sample tylocation target levels 6-May main EU N.GIII 32 6-May dupe EU N.GIII 456 7-May main PR CII 645465 7-May dupe PR CII 0 20-May main HU AGI 0 20-May dupe HU AGI 64875833
Can you code the rules that explain which values you want to ignore? Use them to make a NEW variable (so your original data is not lost) which has MISSING values where you don't want to use the original value.
data for_analysis;
set have;
new_var = levels;
if levels=0 then new_var=.;
run;
Now you can take the MEAN() of your new variable.
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9.
Lock in the best rate now before the price increases on April 1.
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.