BookmarkSubscribeRSS Feed
mcook
Quartz | Level 8

I have a table with variables:

 

Item   N   Mean   n_A  n_B  n_C  n_D  n_0  n_1  n_2  n_3  n_4  PVal  pBis 

 

I want to get it to the form with variables:

 

Item  Stats   N   Value

 

Where Stats is broken up into 4 different rows.  N, pBis, PVal, Mean.  and Value gives the value of those stats.  

 

such as...

 

Item   Stats    Nd    Value

A1        N      100     100

A1      pBis    100      0.4

A1     PVal     100     0.28

A1      Mean   100    0.56

B1       N         150    150

B1      pBis     150    0.31

B1     PVal      150    0.46

B1     Mean    150    0.46

C1   ............

 

etc.  

2 REPLIES 2
mcook
Quartz | Level 8
I have reason to believe that a data step with 4 output statements could be used.
ballardw
Super User

I can "guess" that perhaps n_A is supposed to be an n associated with something like A but what are n_0 n_1 and so on?

 

And if there is an A1 I tend to suspect there may be an A2, A3 or such lurking somewhere.

 

You might consider providing a data step that actually gives us some values to work with.

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

How to Concatenate Values

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 2 replies
  • 852 views
  • 0 likes
  • 2 in conversation