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

Hi all,

 

I'm hoping to get descriptive statistics (n mean stddev min max median 95% CLM) on the sample data below. So, VISIT on the vertical pane going down and TIB_GROUP across on the top.

 

Visit Patient TIB_GROUP SCORE
1 1 1 85.29
2 1 1 61.76
3 4 1 59.35
1 2 0 44.12
2 2 0 58.82
1 3 2 80.88
2 3 2 86.76
1 4 1 42.89
2 4 1 23.53
3 4 1 69.12
1 5 0 79.41
2 5 0 66.18
3 5 0 92.65
1 6 0 69.12
2 6 0 76.47
1 7 2 97.06
2 7 2 97.06
1 8 1 72.06
2 8 1 73.53

How can I use proc means or proc tabulate for this? I'm having trouble getting all the descriptive stats I need

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

This should work:

proc tabulate data=have;
  class visit tib_group;
  var score;
  table visit,
        tib_group*score*(n mean stddev min max median lCLM uclm)
  ;
run;

Tabulate and Means both calculate the lower and upper confidence limits requested not an "interval". There are a number of tricks that can make something appear like an interval if that is a serious issue.

You may want to suppress the appearance of the variable Score or its default label, if any, by using

Score=' '*(<statistics list here>)

 

If this doesn't match you requirement then I suggest manually building an example such as using a word processor or similar and showing what you expect.

 


@Etoo12121 wrote:

Hi all,

 

I'm hoping to get descriptive statistics (n mean stddev min max median 95% CLM) on the sample data below. So, VISIT on the vertical pane going down and TIB_GROUP across on the top.

 

Visit Patient TIB_GROUP SCORE
1 1 1 85.29
2 1 1 61.76
3 4 1 59.35
1 2 0 44.12
2 2 0 58.82
1 3 2 80.88
2 3 2 86.76
1 4 1 42.89
2 4 1 23.53
3 4 1 69.12
1 5 0 79.41
2 5 0 66.18
3 5 0 92.65
1 6 0 69.12
2 6 0 76.47
1 7 2 97.06
2 7 2 97.06
1 8 1 72.06
2 8 1 73.53

How can I use proc means or proc tabulate for this? I'm having trouble getting all the descriptive stats I need


 

View solution in original post

4 REPLIES 4
Reeza
Super User

How do you want the stats displayed? As columns or row headers?

Can you show an example?

 

Does either one of these get you closer to what you want:

title 'Version 1';
proc tabulate data=have;
class visit tib_group;
var score;
table visit, tib_group * score*(N Mean MIN MAX MEDIAN);
run;

title 'Version 2';
proc tabulate data=have;
class visit tib_group;
var score;
table visit * score*(N Mean MIN MAX MEDIAN), tib_group ;
run;

@Etoo12121 wrote:

Hi all,

 

I'm hoping to get descriptive statistics (n mean stddev min max median 95% CLM) on the sample data below. So, VISIT on the vertical pane going down and TIB_GROUP across on the top.

 

Visit Patient TIB_GROUP SCORE
1 1 1 85.29
2 1 1 61.76
3 4 1 59.35
1 2 0 44.12
2 2 0 58.82
1 3 2 80.88
2 3 2 86.76
1 4 1 42.89
2 4 1 23.53
3 4 1 69.12
1 5 0 79.41
2 5 0 66.18
3 5 0 92.65
1 6 0 69.12
2 6 0 76.47
1 7 2 97.06
2 7 2 97.06
1 8 1 72.06
2 8 1 73.53

How can I use proc means or proc tabulate for this? I'm having trouble getting all the descriptive stats I need


 

Etoo12121
Obsidian | Level 7
Version 2 is perfect but how can I add the 95% Confidence Interval and standard deviation? That's what I've been struggling with
ballardw
Super User

This should work:

proc tabulate data=have;
  class visit tib_group;
  var score;
  table visit,
        tib_group*score*(n mean stddev min max median lCLM uclm)
  ;
run;

Tabulate and Means both calculate the lower and upper confidence limits requested not an "interval". There are a number of tricks that can make something appear like an interval if that is a serious issue.

You may want to suppress the appearance of the variable Score or its default label, if any, by using

Score=' '*(<statistics list here>)

 

If this doesn't match you requirement then I suggest manually building an example such as using a word processor or similar and showing what you expect.

 


@Etoo12121 wrote:

Hi all,

 

I'm hoping to get descriptive statistics (n mean stddev min max median 95% CLM) on the sample data below. So, VISIT on the vertical pane going down and TIB_GROUP across on the top.

 

Visit Patient TIB_GROUP SCORE
1 1 1 85.29
2 1 1 61.76
3 4 1 59.35
1 2 0 44.12
2 2 0 58.82
1 3 2 80.88
2 3 2 86.76
1 4 1 42.89
2 4 1 23.53
3 4 1 69.12
1 5 0 79.41
2 5 0 66.18
3 5 0 92.65
1 6 0 69.12
2 6 0 76.47
1 7 2 97.06
2 7 2 97.06
1 8 1 72.06
2 8 1 73.53

How can I use proc means or proc tabulate for this? I'm having trouble getting all the descriptive stats I need


 

Etoo12121
Obsidian | Level 7
exactly what I needed. Thank you @Reeza and @ballardw

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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