equatiomatic
equatiomatic copied to clipboard
support for `quantreg::rq` objects
Hi there, great package! Just a suggestion to add support for quantreg::rq
objects.
library(equatiomatic)
library(quantreg)
# Fit a simple model
mod1 <- rq(mpg ~ cyl + disp, data = mtcars)
# Give the results to extract_eq
extract_eq(mod1)
# Error in UseMethod("extract_lhs", model) :
# no applicable method for 'extract_lhs' applied to an object of class "rq"
Hi, thanks for the suggestion! This is a great idea but, honestly, we're probably a ways away from being able to implement it (and I recognize this issue was opened nearly 11 months ago with no response). I'm hoping to build out a framework to make extensions like this easier, and then to build a vignette on how to implement new equations. That way, others in the community like yourself could help contribute to the package more directly. I'll tag this issue if/when I'm able to do that.
No worries, feel free to tag me with any updates!
Hi @fawda123, could you provide an example of what the equation from the model you showed above should look like? I'm not super familiar with quantile regression.
@datalorax the equation is the same as for OLS, i.e., response ~ intercept plus slope parameters.
library(quantreg)
mod1 <- rq(mpg ~ cyl + disp, data = mtcars)
summary(mod1)
# Call: rq(formula = mpg ~ cyl + disp, data = mtcars)
#
# tau: [1] 0.5
#
# Coefficients:
# coefficients lower bd upper bd
# (Intercept) 33.32282 27.32925 38.72945
# cyl -1.58246 -2.66538 -0.55182
# disp -0.01768 -0.03105 -0.00331
Ah... okay. Then yes! This should be pretty easy to implement.