Re: Quantile Regression/(package (quantreg))

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Re: Quantile Regression/(package (quantreg))

Frank Harrell
Mike,

Do something like:

require(rms)
dd <- datadist(mydatarame); options(datadist='dd')
f <- Rq(y ~ rcs(age,4)*sex, tau=.5)  # use rq function in quantreg
summary(f)  # inter-quartile-range differences in medians of y (b/c tau=.5)
plot(Predict(f, age, sex))   # show age effect on median as a continuous
variable

For more help type ?summary.rms and ?Predict

Frank

------------

When performing quantile regression (r package I used quantreg), the
value of the quantile refers to the quantile value of the dependent
variable.
Typically when trying to predict, since the information we have are the
independent variables, I am interested in trying to estimate the
coefficients based on the quantile values of the independent variables'
distribution. So that I can get an understanding, for certain ranges of
the predictor/independent variable values, the (target/dependent
variable) has (a certain level of exposure to the
predictors)/(coefficients).
Is there any way I can achieve that?

Just in case, if I am incorrect about my understanding on the way
quantiles are interpreted when using the package quantreg, please let me
know.

Thanks
Mike
--
Frank E Harrell Jr Professor and Chairman      School of Medicine
                    Department of Biostatistics Vanderbilt University

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Frank Harrell
Department of Biostatistics, Vanderbilt University