Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support for a quantile regression #925

Open
yuryzablotski opened this issue Dec 27, 2023 · 0 comments
Open

support for a quantile regression #925

yuryzablotski opened this issue Dec 27, 2023 · 0 comments

Comments

@yuryzablotski
Copy link

Describe the solution you'd like
I would like to be able to plot predictions of quantile regression similarly, like it's currently possible for OLS / GLM. A single quantile would be great, all quantiles at once would be terrific!

It works with only plot_model(model), but doesn't work with plot_model(model, type = "eff", terms = "predictor")

By the way, the emmeans guys (almost, some bugs are still there) made it work with quantile regression and I can use the emmip for plotting. But I prefer your package.

How could we do it?
Should be very similar to OLS with the use of "tau" argument, where tau is the quantile. A list of taus is of couarse a much better choice, a compared to a single tau.

Code example

library(ISLR)
library(quantreg)

lr <- lm(wage ~ jobclass + age, Wage)
qr10 <- rq(wage ~ jobclass + age, Wage, tau = 0.1)
qr50 <- rq(wage ~ jobclass + age, Wage, tau = 0.5)
qr90 <- rq(wage ~ jobclass + age, Wage, tau = 0.9)

qr_all <- rq(wage ~ jobclass + age, Wage,
tau = seq(.05, .95, by = 0.05))

summary(qr_all) %>% plot()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant