Quantile Regression with statsmodels
Quantile regression is a type of regression analysis used in statistics and econometrics. Whereas the method of least squares estimates the conditional mean of the response variable across values of the predictor variables, quantile regression estimates the conditional median (or other quantiles) of the response variable. Quantile regression is an extension of linear regression used when the conditions of linear regression are not met.
Github: github.com/markumreed/data_sc...
LinkedIn: / data-science-for-everyone
Пікірлер: 6
Thank you very much , you helped me a lot ! very useful .
@DataScienceforEveryone
2 жыл бұрын
Glad to hear that!
Thanks, that helped a lot :)
@DataScienceforEveryone
2 жыл бұрын
Glad it was helpful!
Doing data.plot.scatter(x="income", y="foodexp") early on would make it obvious that you need to take the log of both variables first. When you do log vs log, you'll get quantile estimates that *do* mostly fall within the OLS confidence band. I guess that's happening because you have a very heteroskedastic dataset, where e = kf(x) approximately: obviously the quantile slopes will vary!
can I just ask how the code of visualizing the results part would be if you had 2 or more independent variables? thank you in advance!