Quantile Regression
When the data presents outliers, high skewness, and conditions leading to heteroscedasticity, we employ quantile regression for modelling. Also, one key question quantile regression answers, which linear regression cannot, is "Does DEWP, TEMP, and Iws influence PM2.5 levels differently for high PM2.5 than for average PM2.5?"
Quantile regression is quite similar to linear regression; however, the quantile regression parameter estimates the change in a certain quantile of the response variable produced by a unit change in the input predictor variable. In order to fully understand this statement, let's fit our Beijing data using quantile regression (without using the interaction terms).
We need to install the quantreg package to fit the quantile regression into the data. The package offers the method, rq() to fit the data using the argument tau, which is the model parameter specifying the value of quantile to be used for fitting the model into the data. Observe that the other...