BookmarkSubscribeRSS Feed
thirupathireddy
Calcite | Level 5

I applied the Quantile regression technique to 10000 samples, and for the selected quantiles(5,10,50,75,90) estimated the coefficients, but I want to know the sample size for each quantile.

my question is 

at 5% what is the sample size

at 10% what is the sample size

.

.

at 90% what is the sample size

3 REPLIES 3
PGStats
Opal | Level 21

Do you want something like this ?

 

proc quantreg data=sashelp.heart;
where sex = "Male";
model weight = height / quantile=0.1 0.5 0.9;
output out=q residual=r / columnwise;
run;

proc sql;
select 
    quantile,
    sum(r>0) as n_greater,
    sum(r<0) as n_lower
from q
where sex = "Male"
group by quantile;
quit;

PGStats_0-1622481921113.png

 

PG
thirupathireddy
Calcite | Level 5

For the Sashelp. hearts after applying the quantile regression the total sample size is 2336

 

in that total sample size how many samples are belong to the First 0.1, 0.5, and 0.9 quantiles.

 

below output is showing 

The FREQ Procedure

Capture.JPG

 

But I want output like below

Capture1.JPG

 

 

PGStats
Opal | Level 21

Maybe you simply need:

 

proc reg data=sashelp.heart;
where sex = "Male";
model weight = height;
output out=q residual=r;
run;

proc rank data=q out=qr groups=10;
var r;
ranks quantile;
run;

proc freq data=qr;
table quantile;
run;

PGStats_0-1622517060965.png

 

PG

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 479 views
  • 0 likes
  • 2 in conversation