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
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.