Hi
Is there a difference between GSEM and GLM family/link syntax? I want to estimate a set of fractional response models. Separately, GLM can estimate each equation, so I assumed that GSEM would fit the same model if the same family-link notation was used. However, results are completely different as shown in the example below.
Any though on how to write this fractional logit under GSEM notation would be highly appreciated.
All the best,
Paul
-------------
Example:
use http://www.ats.ucla.edu/stat/stata/faq/proportion, clear
gsem (meals <- yr_rnd parented api99, link(logit) family(binomial) ), vce(robust) nolog
predict v1
glm meals yr_rnd parented api99, link(logit) family(binomial) vce(robust) nolog
predict v2
gen dif=v1-v2
sum dif
--------------
The output is...
. gsem (meals <- yr_rnd parented api99, family(binomial) link(logit) ), vce(robust) nolog
Generalized structural equation model Number of obs = 4257
Log pseudolikelihood = -144.80954
------------------------------------------------------------------------------
| Robust
| Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
meals <- |
yr_rnd | -.806549 1.043966 -0.77 0.440 -2.852684 1.239586
parented | -2.741766 .5014297 -5.47 0.000 -3.72455 -1.758981
api99 | -.0140403 .0051991 -2.70 0.007 -.0242304 -.0038501
_cons | 26.72637 4.044309 6.61 0.000 18.79967 34.65307
------------------------------------------------------------------------------
.
. glm meals yr_rnd parented api99, link(logit) family(binomial) vce(robust) nolog
note: meals has noninteger values
Generalized linear models No. of obs = 4257
Optimization : ML Residual df = 4253
Scale parameter = 1
Deviance = 395.8141242 (1/df) Deviance = .093067
Pearson = 374.7025759 (1/df) Pearson = .0881031
Variance function: V(u) = u*(1-u/1) [Binomial]
Link function : g(u) = ln(u/(1-u)) [Logit]
AIC = .7220973
Log pseudolikelihood = -1532.984106 BIC = -35143.61
------------------------------------------------------------------------------
| Robust
meals | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
yr_rnd | .0482527 .0321714 1.50 0.134 -.0148021 .1113074
parented | -.7662598 .0390715 -19.61 0.000 -.8428386 -.6896811
api99 | -.0073046 .0002156 -33.89 0.000 -.0077271 -.0068821
_cons | 6.75343 .0896767 75.31 0.000 6.577667 6.929193
------------------------------------------------------------------------------
. sum dif
Variable | Obs Mean Std. Dev. Min Max
-------------+--------------------------------------------------------
dif | 4257 .4718934 .2702031 .0229145 .8948619
Is there a difference between GSEM and GLM family/link syntax? I want to estimate a set of fractional response models. Separately, GLM can estimate each equation, so I assumed that GSEM would fit the same model if the same family-link notation was used. However, results are completely different as shown in the example below.
Any though on how to write this fractional logit under GSEM notation would be highly appreciated.
All the best,
Paul
-------------
Example:
use http://www.ats.ucla.edu/stat/stata/faq/proportion, clear
gsem (meals <- yr_rnd parented api99, link(logit) family(binomial) ), vce(robust) nolog
predict v1
glm meals yr_rnd parented api99, link(logit) family(binomial) vce(robust) nolog
predict v2
gen dif=v1-v2
sum dif
--------------
The output is...
. gsem (meals <- yr_rnd parented api99, family(binomial) link(logit) ), vce(robust) nolog
Generalized structural equation model Number of obs = 4257
Log pseudolikelihood = -144.80954
------------------------------------------------------------------------------
| Robust
| Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
meals <- |
yr_rnd | -.806549 1.043966 -0.77 0.440 -2.852684 1.239586
parented | -2.741766 .5014297 -5.47 0.000 -3.72455 -1.758981
api99 | -.0140403 .0051991 -2.70 0.007 -.0242304 -.0038501
_cons | 26.72637 4.044309 6.61 0.000 18.79967 34.65307
------------------------------------------------------------------------------
.
. glm meals yr_rnd parented api99, link(logit) family(binomial) vce(robust) nolog
note: meals has noninteger values
Generalized linear models No. of obs = 4257
Optimization : ML Residual df = 4253
Scale parameter = 1
Deviance = 395.8141242 (1/df) Deviance = .093067
Pearson = 374.7025759 (1/df) Pearson = .0881031
Variance function: V(u) = u*(1-u/1) [Binomial]
Link function : g(u) = ln(u/(1-u)) [Logit]
AIC = .7220973
Log pseudolikelihood = -1532.984106 BIC = -35143.61
------------------------------------------------------------------------------
| Robust
meals | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
yr_rnd | .0482527 .0321714 1.50 0.134 -.0148021 .1113074
parented | -.7662598 .0390715 -19.61 0.000 -.8428386 -.6896811
api99 | -.0073046 .0002156 -33.89 0.000 -.0077271 -.0068821
_cons | 6.75343 .0896767 75.31 0.000 6.577667 6.929193
------------------------------------------------------------------------------
. sum dif
Variable | Obs Mean Std. Dev. Min Max
-------------+--------------------------------------------------------
dif | 4257 .4718934 .2702031 .0229145 .8948619