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
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
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
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
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
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.