BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
robertrao
Quartz | Level 8

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

1 ACCEPTED SOLUTION

Accepted Solutions
AncaTilea
Pyrite | Level 9

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

ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ

View solution in original post

8 REPLIES 8
robertrao
Quartz | Level 8

Sorry I did aa Proc Summary with means option for that variable(Weight) and I get 28?????

AncaTilea
Pyrite | Level 9

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

ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ

robertrao
Quartz | Level 8

Hi,

Interesting. I do not have any formats added.

Regards

AncaTilea
Pyrite | Level 9

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?

AncaTilea
Pyrite | Level 9

can you show the code?

Anca.

robertrao
Quartz | Level 8

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

Reeza
Super User

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;

robertrao
Quartz | Level 8

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

What is Bayesian Analysis?

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 8 replies
  • 2583 views
  • 0 likes
  • 3 in conversation