Dear Stata users,
I have generated restricted cubic splines (4 knots) for variable A, and then fit the median regression model. Now I would like to calculate and plot 95% CI for median regression line, but do not know how to do this on Stata. I would really appreciate if anyone may help me with this.
Codes:
Thank you so much.
Best wishes.
I have generated restricted cubic splines (4 knots) for variable A, and then fit the median regression model. Now I would like to calculate and plot 95% CI for median regression line, but do not know how to do this on Stata. I would really appreciate if anyone may help me with this.
Codes:
PHP Code:
mkspline A_ = A nknots(4) cubic
lqreg B A_1 A_2 A_3, quantiles(50) nodots seed(123)
lqregpred adjs, for(A_1 A_2 A_3) plotvs(A)
Best wishes.