Help using Base SAS procedures

Proc Summary

Accepted Solution Solved
Reply
Super Contributor
Posts: 1,040
Accepted Solution

Proc Summary

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


Accepted Solutions
Solution
‎01-14-2013 01:12 PM
Super Contributor
Posts: 543

Re: Proc Summary

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


All Replies
Super Contributor
Posts: 1,040

Re: Proc Summary

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

Solution
‎01-14-2013 01:12 PM
Super Contributor
Posts: 543

Re: Proc Summary

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

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

Super Contributor
Posts: 1,040

Re: Proc Summary

Hi,

Interesting. I do not have any formats added.

Regards

Super Contributor
Posts: 543

Re: Proc Summary

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?

Super Contributor
Posts: 543

Re: Proc Summary

can you show the code?

Anca.

Super Contributor
Posts: 1,040

Re: Proc Summary

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

Super User
Posts: 17,823

Re: Proc Summary

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;

Super Contributor
Posts: 1,040

Re: Proc Summary

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

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

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