Hi,
I have the following code below but is there a line that I could include so that I would be able to get the mean of all of the records for the 'PROV' variable, excluding all of the missing values for that variable when calculating the mean? Would this be possible without deleting the record at the start as I would like to preserve all of the data in the dataset? Thanks.
data April_analysis;
set card_v_2019;
run;
proc means data=April_analysis mean SUM MAXDEC=2 ;
var PROV;
output out=PROVISION_BALANCE_MEAN;
run;
SAS dpes that automatically. If you were to ask for a few more statistics on the PROC MEANS line, you might be able to see that more clearly:
proc means data=April_analysis mean SUM N NMISS MAXDEC=2 ;
SAS dpes that automatically. If you were to ask for a few more statistics on the PROC MEANS line, you might be able to see that more clearly:
proc means data=April_analysis mean SUM N NMISS MAXDEC=2 ;
Ex these give the same result:
data temp;
value = 1;
output;
value =2;
output;
run;
proc means data=temp mean;
var value;
run;
data temp2;
value = 1;
output;
value =2;
output;
value=.;
output;
run;
proc means data=temp2 mean;
var value;
run;
Register today and join us virtually on June 16!
sasglobalforum.com | #SASGF
View now: on-demand content for SAS users
@noling you are doing mean on the same temp dataset
try this
data temp;
value = 1;
output;
value =2;
output;
run;
proc means data=temp mean;
var value;
run;
data temp2;
value = 1;
output;
value =4;
output;
value=.;
output;
run;
proc means data=temp2 mean;
var value;
run;
Thanks for catching my typo 🙂 Same result, but I edited my comment.
Register today and join us virtually on June 16!
sasglobalforum.com | #SASGF
View now: on-demand content for SAS users
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.