weight
32
23
I am doing proc means of the variable above...
Instead of giving 27.5 it gives me 28?????
Could you please help??
Regards
Are you sure you don't have some round-up format somewhere in your options (something like maxdec = 0);
This is what I get...
data a;
input weight;
cards;
32
23
;
run;
proc summary data = a print;
var weight;
run;
Analysis Variable : weight
N Mean Std Dev Minimum Maximum
ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ
2 27.5000000 6.3639610 23.0000000 32.0000000
ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ
Sorry I did aa Proc Summary with means option for that variable(Weight) and I get 28?????
Are you sure you don't have some round-up format somewhere in your options (something like maxdec = 0);
This is what I get...
data a;
input weight;
cards;
32
23
;
run;
proc summary data = a print;
var weight;
run;
Analysis Variable : weight
N Mean Std Dev Minimum Maximum
ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ
2 27.5000000 6.3639610 23.0000000 32.0000000
ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ
Hi,
Interesting. I do not have any formats added.
Regards
When I ran this code, commented out the class statement, because in my made up date I didn't have one,
I get the right output.
proc summary data=a nway;
*class Descrip;
var weight;
output out=summary_T(drop=_type_ _freq_) mean(weight)=;
run;
Are you value maybe rounded up in your data table?
can you show the code?
Anca.
proc summary data=subset_merge nway;
class Descrip;
var weight;
output out=summary_T(drop=_type_ _freq_) mean(weight)=;
run;
I think it would have to deal with function to get the decimal points
Does the following fix the issue?
Also, run a proc contents on the input (subset_merge) and output data (summary_t) and post it here please if you're still having issues.
proc summary data=subset_merge nway;
class Descrip;
var weight;
output out=summary_T(drop=_type_ _freq_) mean(weight)=;
format weight;
run;
Hi,
Thanks for the follow up. I got it.
Actually to the original value a format was added and i could see only the interger values.
Sorry about thaT
Regards
Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.
Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.