I'm trying to estimate a fractionnal regression model with unobserved heterogenity.
I choose the method developped by papke and Wooldrige (2009) "Panel data methods for fractional response variables with an application to test pass rates".
Before applying the code to my data, I tried to replicate their results using the code provided on papke's website: http://econ.msu.edu/faculty/papke/Pa...statafiles.zip
The code I'm interresting in is the panel case with exogoneity of covariates ("math4_boot_exog_gee.do").
Here is a copy of the code from the website:
I had a few issues with it, first, the normden function has been depreciated so I replaced it with normalden.
Then I got this error message:
So I added an "xtset, clear" statement before the bootstrap statement, and "xtset distid year" before the estimations of the fractional regression model.
Here is my full code at this point:
But I'm still having an error message:
I tried adding the "nodrop" option in the boostrap statement but it did not change anything.
Any idea what could cause this issue please?
I choose the method developped by papke and Wooldrige (2009) "Panel data methods for fractional response variables with an application to test pass rates".
Before applying the code to my data, I tried to replicate their results using the code provided on papke's website: http://econ.msu.edu/faculty/papke/Pa...statafiles.zip
The code I'm interresting in is the panel case with exogoneity of covariates ("math4_boot_exog_gee.do").
Here is a copy of the code from the website:
Code:
capture program drop math4_boot program math4_boot, rclass glm math4 lavgrexp alavgrexp lunch alunch lenroll alenroll y96-y01 if year>1994, fa(bin) link(probit) cluster(distid) mat b = e(b) xtgee math4 lavgrexp lunch lenroll alavgrexp alunch alenroll y96-y01, fa(bi) link(probit) corr(exch) robust from(b,skip) return scalar b1 = _b[lavgrexp] return scalar b2 = _b[lunch] return scalar b3 = _b[lenroll] predict x1b1hat, xb gen scale=normden(x1b1hat) gen pe1=scale*_b[lavgrexp] summarize pe1 return scalar ape1=r(mean) gen pe2=scale*_b[lunch] summarize pe2 return scalar ape2=r(mean) gen pe3=scale*_b[lenroll] summarize pe3 return scalar ape3=r(mean) drop x1b1hat scale pe1 pe2 pe3 end *Bootstrapped SE within districts bootstrap r(b1) r(b2) r(b3) r(ape1) r(ape2) r(ape3), reps(20) seed(123) cluster(distid) idcluster(newid): math4_boot program drop math4_boot
Then I got this error message:
Code:
Bootstrap replications (20) ----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5 repeated time values within panel the most likely cause for this error is misspecifying the cluster(), idcluster(), or group() option r(451);
Here is my full code at this point:
Code:
capture program drop math4_boot program math4_boot, rclass xtset distid year glm math4 lavgrexp alavgrexp lunch alunch lenroll alenroll y96-y01 if year>1994, fa(bin) link(probit) cluster(distid) mat b = e(b) xtgee math4 lavgrexp lunch lenroll alavgrexp alunch alenroll y96-y01, fa(bi) link(probit) corr(exch) robust from(b,skip) return scalar b1 = _b[lavgrexp] return scalar b2 = _b[lunch] return scalar b3 = _b[lenroll] predict x1b1hat, xb gen scale=normalden(x1b1hat) gen pe1=scale*_b[lavgrexp] summarize pe1 return scalar ape1=r(mean) gen pe2=scale*_b[lunch] summarize pe2 return scalar ape2=r(mean) gen pe3=scale*_b[lenroll] summarize pe3 return scalar ape3=r(mean) drop x1b1hat scale pe1 pe2 pe3 end *Bootstrapped SE within districts xtset, clear bootstrap r(b1) r(b2) r(b3) r(ape1) r(ape2) r(ape3), reps(20) seed(123) cluster(distid) idcluster(newid): math4_boot program drop math4_boot
Code:
Bootstrap replications (20) ----+--- 1 ---+--- 2 ---+--- 3 ---+--- 4 ---+--- 5 xxxxxxxxxxxxxxxxxxxx insufficient observations to compute bootstrap standard errors no results will be saved
Any idea what could cause this issue please?
Comment