___ ____ ____ ____ ____ tm /__ / ____/ / ____/ ___/ / /___/ / /___/ 8.2 Copyright 1984-2004 Statistics/Data Analysis StataCorp 4905 Lakeway Drive Special Edition College Station, Texas 77845 USA 800-STATA-PC http://www.stata.com 979-696-4600 stata@stata.com 979-696-4601 (fax) 46-user Stata for Windows (network) perpetual license: Serial number: 8198044710 Licensed to: SRC - ISR University of Michigan Notes: 1. (/m# option or -set memory-) 97.66 MB allocated to data 2. (/v# option or -set maxvar-) 5000 maximum variables 3. Stata running in batch mode running C:\Program Files\stata8SE\profile.do ... . do W:\yuxie\web\files\assoc\clogg2.do . *log using clogg2.log, replace . . input f1-f4 f1 f2 f3 f4 1. 44 11 38 62 2. 59 41 147 293 3. 23 11 13 27 4. 27 8 16 27 5. 258 57 105 110 6. end . . input r1-r4 r1 r2 r3 r4 1. 1 1 1 1 2. 2 2 2 2 3. 3 3 3 3 4. 4 4 4 4 5. 5 5 5 5 . . input c1-c4 c1 c2 c3 c4 1. 1 2 3 4 2. 1 2 3 4 3. 1 2 3 4 4. 1 2 3 4 5. 1 2 3 4 . . stack f1 r1 c1 f2 r2 c2 f3 r3 c3 f4 r4 c4, into(freq row column) clear . . tab row column, sum(freq) nost nofreq Means of freq | column row | 1 2 3 4 | Total -----------+--------------------------------------------+---------- 1 | 44 11 38 62 | 38.75 2 | 59 41 147 293 | 135 3 | 23 11 13 27 | 18.5 4 | 27 8 16 27 | 19.5 5 | 258 57 105 110 | 132.5 -----------+--------------------------------------------+---------- Total | 82.2 25.6 63.8 103.8 | 68.85 . . gen u_i = row . gen v_j = column . . recode u_i (1=-0.0753) (2=-0.7763) (3=0.0983) (4=0.1550) (5=0.5983) (u_i: 20 changes made) . recode v_j (1=-0.7432) (2=-0.1265) (3=0.2713) (4=0.5984) (v_j: 20 changes made) . . gen inter=u_i*v_j . . xi:glm freq i.row i.column , family(poisson) i.row _Irow_1-5 (naturally coded; _Irow_1 omitted) i.column _Icolumn_1-4 (naturally coded; _Icolumn_1 omitted) Iteration 0: log likelihood = -191.97426 Iteration 1: log likelihood = -173.76424 Iteration 2: log likelihood = -173.70926 Iteration 3: log likelihood = -173.70926 Generalized linear models No. of obs = 20 Optimization : ML: Newton-Raphson Residual df = 12 Scale parameter = 1 Deviance = 236.3378892 (1/df) Deviance = 19.69482 Pearson = 222.6175106 (1/df) Pearson = 18.55146 Variance function: V(u) = u [Poisson] Link function : g(u) = ln(u) [Log] Standard errors : OIM Log likelihood = -173.7092614 AIC = 18.17093 BIC = 200.3891019 ------------------------------------------------------------------------------ freq | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- _Irow_2 | 1.248144 .0911233 13.70 0.000 1.069546 1.426743 _Irow_3 | -.73936 .141298 -5.23 0.000 -1.016299 -.462421 _Irow_4 | -.6867163 .1388241 -4.95 0.000 -.9588065 -.4146261 _Irow_5 | 1.229452 .0913149 13.46 0.000 1.050478 1.408426 _Icolumn_2 | -1.166563 .1012205 -11.52 0.000 -1.364951 -.9681744 _Icolumn_3 | -.2534021 .0746183 -3.40 0.001 -.3996512 -.107153 _Icolumn_4 | .2333107 .0660293 3.53 0.000 .1038956 .3627258 _cons | 3.834356 .0903243 42.45 0.000 3.657323 4.011388 ------------------------------------------------------------------------------ . . . xi:glm freq i.row i.column inter, family(poisson) i.row _Irow_1-5 (naturally coded; _Irow_1 omitted) i.column _Icolumn_1-4 (naturally coded; _Icolumn_1 omitted) Iteration 0: log likelihood = -73.732834 Iteration 1: log likelihood = -58.358235 Iteration 2: log likelihood = -58.319035 Iteration 3: log likelihood = -58.319034 Generalized linear models No. of obs = 20 Optimization : ML: Newton-Raphson Residual df = 11 Scale parameter = 1 Deviance = 5.557435033 (1/df) Deviance = .5052214 Pearson = 5.445678127 (1/df) Pearson = .4950616 Variance function: V(u) = u [Poisson] Link function : g(u) = ln(u) [Log] Standard errors : OIM Log likelihood = -58.31903427 AIC = 6.731903 BIC = -27.39561998 ------------------------------------------------------------------------------ freq | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- _Irow_2 | 1.059567 .0947076 11.19 0.000 .873944 1.245191 _Irow_3 | -.7276799 .1413508 -5.15 0.000 -1.004722 -.4506374 _Irow_4 | -.6747092 .1389152 -4.86 0.000 -.9469781 -.4024404 _Irow_5 | 1.182135 .092873 12.73 0.000 1.000107 1.364163 _Icolumn_2 | -1.039247 .1040451 -9.99 0.000 -1.243172 -.8353222 _Icolumn_3 | -.1592165 .0798742 -1.99 0.046 -.3157671 -.0026658 _Icolumn_4 | .2274527 .072154 3.15 0.002 .0860335 .3688719 inter | -1.308265 .0940538 -13.91 0.000 -1.492608 -1.123923 _cons | 3.794589 .0934024 40.63 0.000 3.611524 3.977655 ------------------------------------------------------------------------------ . . . . . end of do-file