I am trying to estimate a nonparametic regression using -npregress-. I first tried to estimate the following:

I get an error saying that there are insignificant observations to compute the bootstrapped standard errors. So I tried adding the -nodrop- option and estimated the following:

I get results for this:

After this, I want to get the marginal effects, so I run this line of code:

and I get the following error:

unfortunately, I cannot share the data because I am working with a restricted data set, but I am hoping someone has some insight as to the problem. I am running the regression and margins command at the same time, so I am not changing the data or anything at all inbetween npregress and margins.

Thanks for any help!

Tim

Code:

npregress kernel sin_totHomeExp age_female if P == 1 & age_female >= 50, vce(bootstrap, seed(1234))

Code:

npregress kernel sin_totHomeExp age_female if P == 1 & age_female >= 50, vce(bootstrap, seed(1234) nodrop)

Code:

Observed Estimate Bootstrapped Std. Err. z P>|z|Meansin_totHomeExp 5.837566 0.411449 141.88 0.000Effectage_female -0.0603533 0.0048706 -12.39 0.000

Code:

margins, at(age_female=(50(2)85))

Code:

data have changed since estimation.Marginsandpredictafternpregresswill not work if your covariates, your dependent variable, or the predictions fromnpregresshave changed since estimation. r(198)

Thanks for any help!

Tim

## Comment