I'm trying to estimate a semi-parametric regression model with (1) a continuous and a categorical variable interacting in the basis function and (2) a continuous parametric regressor. I then want to plot predicted probabilities using margins. However, when specifying covariate values at which to estimate predicted probabilities, margins does not recognize the continuous regressor specified in the asis() option as a covariate:
Code:
sysuse auto, clear
npregress series price mpg i.foreign, asis(weight)
margins, over(foreign) at(mpg = (15 (5) 40) weight = 3000)
Code:
gen group = mod(_n, 2) == 0
npregress series price mpg i.foreign, asis(weight i.group)
margins, over(foreign) at(mpg = (15 (5) 40) group = 1)
Code:
npregress series price mpg, asis(weight i.foreign) margins, over(foreign) at(mpg = (15 (5) 40) weight = 3000 foreign = 1)
0 Response to Margins for semiparametric regression
Post a Comment