turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- SAS Programming
- /
- Base SAS Programming
- /
- Percentile using mean

Topic Options

- RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

a month ago

Hi,

I have values (1 to 300) in a column i want to find the mean and std of 33.33rd percentile for that values.

How do i solve that. please help me!...

Accepted Solutions

Solution

a month ago

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Sathish_jammy

a month ago

Hi @Sathish_jammy,

Now you've started a second thread for essentially the same question -- not ideal.

I would probably let PROC RANK identify the percentiles (i.e. tertiles) and then use PROC SUMMARY to calculate the descriptive statistics for each of the three groups. Using your data from the other thread as dataset HAVE:

```
proc rank data=have out=want groups=3;
var weight;
ranks tertile;
run;
proc summary data=want nway;
class tertile;
var weight follw1_weight;
output out=stats mean= std= / autoname;
run;
```

All Replies

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Sathish_jammy

a month ago

Result 1 on google search seems to have the answer:

https://blogs.sas.com/content/iml/2013/10/23/percentiles-in-a-tabular-format.html

For non-standard percentiles use stdzise.

Solution

a month ago

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Sathish_jammy

a month ago

Hi @Sathish_jammy,

Now you've started a second thread for essentially the same question -- not ideal.

I would probably let PROC RANK identify the percentiles (i.e. tertiles) and then use PROC SUMMARY to calculate the descriptive statistics for each of the three groups. Using your data from the other thread as dataset HAVE:

```
proc rank data=have out=want groups=3;
var weight;
ranks tertile;
run;
proc summary data=want nway;
class tertile;
var weight follw1_weight;
output out=stats mean= std= / autoname;
run;
```

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to FreelanceReinhard

a month ago - last edited a month ago

Thank u so much! it works well...

But how do i get the mean difference & STD difference ,as well p-value for each 3 tertiles.

Could u please help me again.

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Sathish_jammy

a month ago - last edited a month ago

Well, a p-value is always associated with a statistical hypothesis test. So, you'd have to specify this test. As a start, let's assume that you want what is probably the most common choice in the situation you described in the other thread: the two-sided t-test for paired samples. But you should double-check your requirements.

The corresponding SAS procedure, PROC TTEST (with the PAIRED statement), does not only compute "the" p-values, but also the requested summary statistics. Continuing with dataset WANT from my first reply in this thread:

```
proc sort data=want;
by tertile;
run;
ods select none;
ods output ttests=ttest
statistics=tstats;
proc ttest data=want;
by tertile;
paired weight*follw1_weight;
run;
ods select all;
data want2;
merge tstats(keep=tertile mean stddev)
ttest(keep=tertile probt rename=(probt=p_value));
by tertile;
run;
```

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to FreelanceReinhard

a month ago