Hello Experts,
I'm wondering why the mean is not equal to 0 ?
My code is :
proc standard data=sashelp.cars mean=0 std=1 out=bdd;
var _numeric_;
run;
proc means data=bdd;
var _numeric_;
run;
Thank you for your help !
If you want PROC MEANS to only display a fixed number of decimal places use the MAXDEC= option.
proc standard data=sashelp.cars mean=0 std=1 out=bdd;
run;
proc means maxdec=4;
run;
This is roundoff error. It happens when digital computers do math on numbers that are not integers and not 2 to the power of any negative integer. For any real-world purpose, you can treat these as exactly zero.
If you look in data set BDD, you can see for example, that cylinders (which is an integer in SASDATA.CARS) is not an integer and not 2 to the power of any negative integer.
If you want PROC MEANS to only display a fixed number of decimal places use the MAXDEC= option.
proc standard data=sashelp.cars mean=0 std=1 out=bdd;
run;
proc means maxdec=4;
run;
Why does removing the minus sign make the slightest bit of difference? Why would you do that? What is the benefit?
Dive into keynotes, announcements and breakthroughs on demand.
Explore Now →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.