Hi everyone.
I usually use the xblc command to plot estimation and confidence intervals after running a regression model with my variable of interest modeled as splines.
I'm using my usual code but this time I get an error message.
This is my code
preserve
replace x = ln(x)
replace x = round(x, 0.1)
mkspline index=x, cubic nknot(5)
regress y index*
levelsof x
xblc index*, covname(x) at(`r(levels)') generate(pa or lb ub) pr
#delimit;
twoway
(line or pa , lc(maroon) lp(solid) lw(medthick) lcolor(lime) sort )
(line lb pa , lw(medthick) lc(maroon) lp(shortdash) lcolor(lime) sort )
(line ub pa , lw(medthick) lc(maroon) lp(shortdash) lcolor(lime) sort )
(scatter y x, sort msize(*0.4) mcolor(midblue%40)),
legend(off)
scheme(s1color)
;
#delimit cr
restore
This is my STATA output

Can anyone help me?
Thanks you very much
I usually use the xblc command to plot estimation and confidence intervals after running a regression model with my variable of interest modeled as splines.
I'm using my usual code but this time I get an error message.
This is my code
preserve
replace x = ln(x)
replace x = round(x, 0.1)
mkspline index=x, cubic nknot(5)
regress y index*
levelsof x
xblc index*, covname(x) at(`r(levels)') generate(pa or lb ub) pr
#delimit;
twoway
(line or pa , lc(maroon) lp(solid) lw(medthick) lcolor(lime) sort )
(line lb pa , lw(medthick) lc(maroon) lp(shortdash) lcolor(lime) sort )
(line ub pa , lw(medthick) lc(maroon) lp(shortdash) lcolor(lime) sort )
(scatter y x, sort msize(*0.4) mcolor(midblue%40)),
legend(off)
scheme(s1color)
;
#delimit cr
restore
This is my STATA output
Can anyone help me?
Thanks you very much
