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
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;
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
But I want output like below
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;
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!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.