Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Plotting Quantile Regression Lines

In Stata, is it possible to plot quantile regression lines? I know a standard OLS regression line can be added to a scatter plot but it isn't clear to me how to add other types of regression lines.

If that is not possible is, it possible to plot a line that I specify in the mx+b format? Then I could just take the slope and intercept terms from the quantile regression output and plot them manually.

Thanks for the help!

like image 939
user1892600 Avatar asked Dec 10 '12 19:12

user1892600


People also ask

How do you fit a quantile regression?

Quantile Regression data considerationsA single numeric dependent variable is required. The target variable needs to be a continuous variable. The predictors can be continuous variables or dummy variables for categorical predictors. Either the intercept term or at least one predictor is required to run an analysis.

How do you interpret quantile regression?

The quantile regression coefficient tells us that for every one unit change in socst that the predicted value of write will increase by . 6333333. We can show this by listing the predictor with the associated predicted values for two adjacent values.

How do you do quantile regression on Excel?

Setting up a Quantile RegressionAfter opening XLSTAT, select the XLSTAT / Modeling data / Quantile Regression command (see below). Once you've clicked on the button, the Quantile Regression dialog box appears. Select the data on the Excel sheet. The Dependent variable (or variable to model) is here the Weight.

Can I use quantile regression with panel data?

Panel data quantile regression allows the estimation of effects that are heterogeneous throughout the conditional distribution of the response variable, while controlling for individual and time spe- cific confounders.


1 Answers

Yes. Specifically, you can save the fitted values after model fitting, after which you plot those predicted values as an extra variable. Generally, twoway function allows plotting lines and curves given their formulas. I'll not illustrate the second method given the first.


. sysuse auto
(1978 Automobile Data)

. gen gpm = 1/mpg

. qreg gpm weight

 

. predict predicted
(option xb assumed; fitted values)

. scatter gpm weight || line predicted weight, sort ytitle("1 / `: var label mpg'") legend(off)

like image 148
Nick Cox Avatar answered Nov 27 '22 06:11

Nick Cox