log type: text
opened on: 14 Nov 2005, 11:02:19
. use "C:\AAA Miker Files\newer web pages\soc_388_notes\clogg and eliason data.dta", clear
. drop _x_*
. table color labor, contents (sum uwcount sum wncount mean weight) by (sex)
----------------------------------------------
sex and | labor
color | unemployed part-time other
----------+-----------------------------------
male |
white | 3511 4227 31467
| 3530 4183 31131
| 1431 1408 1408
|
black | 604 356 2245
| 815 462 2783
| 1921 1849 1764
|
other | 165 157 924
| 119 124 797
| 1029 1124 1228
----------+-----------------------------------
female |
white | 2281 7833 18945
| 2234 7559 18704
| 1394 1373 1405
|
black | 545 563 2132
| 653 644 2498
| 1705 1627 1668
|
other | 89 216 725
| 64 162 574
| 1029 1070 1127
----------------------------------------------
. *This is the data table from Clogg and Eliason, with unweighted counts, weighted normalized counts, and mean cell weights.
. set linesize 79
. desmat: poisson uwcount labor*sex=dev(3)*dev(2) labor*color=dev(3)*dev(3) sex*color=dev(2)*dev(3)
-------------------------------------------------------------------------------
Poisson regression
-------------------------------------------------------------------------------
Dependent variable uwcount
Optimization: ml
Number of observations: 18
Initial log likelihood: -81627.074
Log likelihood: -123.390
LR chi square: 163007.367
Model degrees of freedom: 13
Pseudo R-squared: 0.998
Prob: 0.000
-------------------------------------------------------------------------------
nr Effect Coeff s.e.
-------------------------------------------------------------------------------
uwcount
labor
1 unemployed -0.677** 0.018
2 part-time -0.433** 0.017
sex
3 male -0.018* 0.009
labor.sex
4 unemployed.male 0.161** 0.009
5 part-time.male -0.347** 0.007
color
6 white 1.852** 0.011
7 black -0.364** 0.014
labor.color
8 unemployed.white -0.282** 0.018
9 unemployed.black 0.340** 0.022
10 part-time.white 0.193** 0.017
11 part-time.black -0.229** 0.022
sex.color
12 male.white 0.080** 0.009
13 male.black -0.097** 0.011
14 _cons 7.053** 0.011
-------------------------------------------------------------------------------
* p < .05
** p < .01
. poisgof
Goodness-of-fit chi2 = 86.53056
Prob > chi2(4) = 0.0000
. poisgof,pearson
Goodness-of-fit chi2 = 89.79915
Prob > chi2(4) = 0.0000
. *This is Clogg and Eliason's model 1
. desmat: poisson wrongcount labor*sex=dev(3)*dev(2) labor*color=dev(3)*dev(3) sex*color=dev(2)*dev(3)
-------------------------------------------------------------------------------
Poisson regression
-------------------------------------------------------------------------------
Dependent variable wrongcount
Optimization: ml
Number of observations: 18
Initial log likelihood: -1.137e+08
Log likelihood: -71806.645
LR chi square: 2.273e+08
Model degrees of freedom: 13
Pseudo R-squared: 0.999
Prob: 0.000
-------------------------------------------------------------------------------
nr Effect Coeff s.e.
-------------------------------------------------------------------------------
wrongcount
labor
1 unemployed -0.689** 0.001
2 part-time -0.435** 0.000
sex
3 male 0.013** 0.000
labor.sex
4 unemployed.male 0.165** 0.000
5 part-time.male -0.340** 0.000
color
6 white 1.858** 0.000
7 black -0.133** 0.000
labor.color
8 unemployed.white -0.263** 0.001
9 unemployed.black 0.383** 0.001
10 part-time.white 0.186** 0.000
11 part-time.black -0.231** 0.001
sex.color
12 male.white 0.059** 0.000
13 male.black -0.083** 0.000
14 _cons 14.294** 0.000
-------------------------------------------------------------------------------
* p < .05
** p < .01
. poisgof
Goodness-of-fit chi2 = 143357.3
Prob > chi2(4) = 0.0000
. poisgof, pearson
Goodness-of-fit chi2 = 148750.5
Prob > chi2(4) = 0.0000
. *Standard errors are tiny, fit statistics are huge, coefficients differ a little bit from what we had before.
. *This second model is sort of a travesty, which is why clogg and eliason don't mention.
. desmat: poisson wncount labor*sex=dev(3)*dev(2) labor*color=dev(3)*dev(3) sex*color=dev(2)*dev(3)
-------------------------------------------------------------------------------
Poisson regression
-------------------------------------------------------------------------------
Dependent variable wncount
Optimization: ml
Number of observations: 18
Initial log likelihood: -79982.751
Log likelihood: -130.057
LR chi square: 159705.387
Model degrees of freedom: 13
Pseudo R-squared: 0.998
Prob: 0.000
-------------------------------------------------------------------------------
nr Effect Coeff s.e.
-------------------------------------------------------------------------------
wncount
labor
1 unemployed -0.690** 0.020
2 part-time -0.435** 0.018
sex
3 male 0.013 0.010
labor.sex
4 unemployed.male 0.165** 0.009
5 part-time.male -0.340** 0.007
color
6 white 1.858** 0.012
7 black -0.133** 0.015
labor.color
8 unemployed.white -0.263** 0.020
9 unemployed.black 0.384** 0.023
10 part-time.white 0.186** 0.018
11 part-time.black -0.232** 0.022
sex.color
12 male.white 0.059** 0.009
13 male.black -0.083** 0.011
14 _cons 7.033** 0.012
-------------------------------------------------------------------------------
* p < .05
** p < .01
. poisgof
Goodness-of-fit chi2 = 100.2395
Prob > chi2(4) = 0.0000
. poisgof, pearson
Goodness-of-fit chi2 = 104.0537
Prob > chi2(4) = 0.0000
. *These coefficients correspond exactly to clogg and eliason's second model. This is C+E's second model
. *The correct solution, in Clogg and Eliason's view, uses the weights to generate unbiased coefficients, but then uses the actual data to generate the SE of the coefficients
. *In stata, it requires using the 'exposure' option in poisson regression.
. *In stata, the exposure is the inverse of the sampling probability, which in this case is the inverse of the weights.
. gen inverse_weight=1/weight
. desmat: poisson uwcount labor*sex=dev(3)*dev(2) labor*color=dev(3)*dev(3) sex*color=dev(2)*dev(3), exposure(inverse_weight)
-------------------------------------------------------------------------------
Poisson regression
-------------------------------------------------------------------------------
Dependent variable uwcount
Optimization: ml
Number of observations: 18
Initial log likelihood: -84619.027
Log likelihood: -124.919
LR chi square: 168988.216
Model degrees of freedom: 13
Pseudo R-squared: 0.999
Prob: 0.000
-------------------------------------------------------------------------------
nr Effect Coeff s.e.
-------------------------------------------------------------------------------
uwcount
labor
1 unemployed -0.688** 0.018
2 part-time -0.440** 0.017
sex
3 male 0.013 0.009
labor.sex
4 unemployed.male 0.166** 0.009
5 part-time.male -0.343** 0.007
color
6 white 1.860** 0.011
7 black -0.136** 0.014
labor.color
8 unemployed.white -0.265** 0.018
9 unemployed.black 0.386** 0.022
10 part-time.white 0.191** 0.017
11 part-time.black -0.238** 0.022
sex.color
12 male.white 0.058** 0.009
13 male.black -0.085** 0.011
14 _cons 14.292** 0.011
ln(inverse_weight) (offset)
-------------------------------------------------------------------------------
* p < .05
** p < .01
. poisgof
Goodness-of-fit chi2 = 89.58815
Prob > chi2(4) = 0.0000
. poisgof, pearson
Goodness-of-fit chi2 = 93.54537
Prob > chi2(4) = 0.0000
. *That's clogg and eliason model 3, my model 4
. exit, clear