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

Do something like:

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

For more help type ?summary.rms and ?Predict



When performing quantile regression (r package I used quantreg), the
value of the quantile refers to the quantile value of the dependent
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
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

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

[hidden email] mailing list
PLEASE do read the posting guide
and provide commented, minimal, self-contained, reproducible code.
Frank Harrell
Department of Biostatistics, Vanderbilt University