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

Hi everyone, I need help with this  for using proc summary....

I've got the next dataaset :
                          

                           Obs    VISit                  classy      pop    TREAT  

                              1    Baseline                Missing  1     Placebo    

                              2    Week 12 LOCF      I            1     Placebo    
                              3    Baseline                II           1     Placebo    
                              4    Baseline                II           1     Placebo    
                              5    Baseline                II           1     Placebo    
                              6    Baseline                II           1     Placebo   
                              7    Baseline                II           1     Placebo    
                              8    Baseline                II           1     Placebo    
                              9    Baseline                II           1     Placebo    
                             10    Baseline                II           1     Placebo    
                             11    Baseline                II           1     Placebo    
                             12    Baseline                II           1     Placebo    
                             13    Baseline                II           1     Placebo    

                             14    Baseline                II           1     Placebo    
                             15    Baseline                II           1     Placebo    
                             16    Baseline                II           1     Placebo    
                             17    Baseline                II           1     Placebo   
                             18    Baseline                II           1     Placebo    
                             19    Baseline                II           1     Placebo    
                             20    Baseline                II           1     Placebo    

                             21    Baseline                II           1     Placebo    
                             22    Baseline                II           1     Placebo    
                             23    Baseline                II           1     Placebo    
                             24    Baseline                II           1     Placebo    
                             25    Baseline                II           1     Placebo   

                             26    Baseline                II           1     Placebo    
                             27    Baseline                II           1     Placebo    
                             28    Baseline                II           1     Placebo   
                             29    Week 12 LOCF      II           1     Placebo  

I type:

  proc summary data=new nway;

     class treat classy visit;

     var pop;

     output out=newsum(drop=_:);

     run;

and I obtain:


                                  Obs    TREAt    class    VISit                  pop

                                    1    Placebo        I        Week 12 LOCF              1
                                    2    Placebo        I        Week 12 LOCF              1
                                    3    Placebo        I        Week 12 LOCF              1
                                    4    Placebo        I        Week 12 LOCF              1
                                    5    Placebo        I        Week 12 LOCF              .
                                    6    Placebo        II       Baseline                 26
                                    7    Placebo        II       Baseline                  1
                                    8    Placebo        II       Baseline                  1
                                    9    Placebo        II       Baseline                  1
                                   10    Placebo        II       Baseline                  0
                                   11    Placebo        II       Week 12 LOCF              1
                                   12    Placebo        II       Week 12 LOCF              1
                                   13    Placebo        II       Week 12 LOCF              1
                                   14    Placebo        II       Week 12 LOCF              1
                                   15    Placebo        II       Week 12 LOCF              .

I was expecting the real summary and as well the missing value, and it is not...what I am doing wrong here ?

Thanks in advance.

1 ACCEPTED SOLUTION

Accepted Solutions
michtka
Fluorite | Level 6

I got it Smiley Happy

proc summary data=new nway missing;

     class treattxt eff_rslt visder;

     var itt;

     output out=newsum(drop=_:) n=n;

     run;

View solution in original post

5 REPLIES 5
michtka
Fluorite | Level 6

I got it Smiley Happy

proc summary data=new nway missing;

     class treattxt eff_rslt visder;

     var itt;

     output out=newsum(drop=_:) n=n;

     run;

ballardw
Super User

If you want missing to be treated as a valid level of you class variable add the MISSING option to the class statement.

Class treat classy visit / missing;

You didn't request any summary functions for the variable. Request the statistics on the output statement.

output out=newsum(drop=_:) sum= ;  if you only want sum if you want more statistics you'll need to provide output variable names for each statistic, syntax is

statistic-keyword<(variable-list)>=<name(s)>

or use the auto name option

output out=newsum(drop=_:) sum std /autoname;


michtka
Fluorite | Level 6

I did it adding missing as an option of proc summary...I think will be the same.

Linlin
Lapis Lazuli | Level 10

try adding sum=

proc summary data=new nway;

     class treat classy visit;

     var pop;

     output out=newsum(drop=_:) sum=;

     run;

Linlin

michtka
Fluorite | Level 6

thnaks, I did with n

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
  • 5 replies
  • 17575 views
  • 0 likes
  • 3 in conversation