BookmarkSubscribeRSS Feed
teja04
Calcite | Level 5

Hi all,

I want to calculate N, MEAN(SD), MEDIAN, (MIN)(MAX) for the following data.

Input DATA:

 

ID         NAME       CODE       VALUE      VISITNUM       PRODUCT       PREWGHT     POSTWGHT    WGHTCHG     

1             A             XXX            79             2                    T400                  92                   91                      1

1             B             XXX            68             10                   T400                  81                  79                       2

1             c              xxx             79              7                    R400                  92                   90                     2

2            A               XXX            82              10                R400                   53                    50                     3

2            B               XXX            80              4                   R400                   72                   70                    2

2            C              XXX             71             7                     R400                 71                    70                    1

1             A             YYY           79             2                    R400                  92                   91                      1

1             B             YYY            68             10                   T400                 81                  79                       2

1             c              YYY            79              7                    R400                  92                   90                     2

2            A               YYY            82              10                T400                  53                    50                     3

2            B               YYY            80              4                   R400                   72                   70                    2

2            C              YYY            71             7                     R400                 71                    70                    1

 

OUTPUT REPORT:

 

                                 STATISTICS                A                       B               C              TOTAL

 

PRODUCT

    T400                      n(%)                        xx(xx)                 xx(xx)        xx(xx)        xx(xx)

    R400                     n(%)                       xx(xx)                 xx(xx)        xx(xx)        xx(xx)

 

CODE:

  XXX                       N                             xx(xx)                 xx(xx)        xx(xx)        xx(xx) 

                           MEAN(SD)                  xx(xx)                 xx(xx)        xx(xx)        xx(xx) 

                            MEDIAN                    xx(xx)                 xx(xx)        xx(xx)        xx(xx)

                           Min, Max                   xx(xx)                 xx(xx)        xx(xx)        xx(xx) 

          

 YYY                       N                             xx(xx)                 xx(xx)        xx(xx)        xx(xx) 

                           MEAN(SD)                  xx(xx)                 xx(xx)        xx(xx)        xx(xx) 

                            MEDIAN                    xx(xx)                 xx(xx)        xx(xx)        xx(xx)

                           Min, Max                   xx(xx)                 xx(xx)        xx(xx)        xx(xx) 

          

 

 

Please Help me out..Thank in Advance.

1 REPLY 1
mkeintz
PROC Star

Look at the PROC MEANS documentation.  If there is more to your question than in the docs, let us know.

 

regards,

Mark

--------------------------
The hash OUTPUT method will overwrite a SAS data set, but not append. That can be costly. Consider voting for Add a HASH object method which would append a hash object to an existing SAS data set

Would enabling PROC SORT to simultaneously output multiple datasets be useful? Then vote for
Allow PROC SORT to output multiple datasets

--------------------------

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

Discussion stats
  • 1 reply
  • 1099 views
  • 0 likes
  • 2 in conversation