Is it possible to run a Quantile REgression using multiple independent variables (x). Using Python I tried statsmodel
mod = smf.quantreg(y, X)
res = mod.fit(q=.5)
print(res.summary())
Where y and X are Pandas dataframes. This works for OLS, however for quantile regression I does not.
How would you go about performing this?
Another way to do quantreg with multiple columns (when you don’t want to write out each variable) is to do something like this:
Mod = smf.quantreg(f”y_var~ {' + '.join(df.columns[1:])}”)
Res = mod.fit(q=0.5)
print(res.summary())
Where my y variable (y_var) is the first column in my data frame.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With