----------------------------------------------------------------------------------------------------------- name: log: D:\stovring\SDCA\EpiSpace_EpiStats\EffMod\effmod_analysis.log log type: text opened on: 8 Jun 2023, 14:23:29 . clear . . use partic_data_dist . . . ** Analysis with logistic regression . . * Effect in full cohort . logit nonpartic b0.distance, or Iteration 0: log likelihood = -63571.998 Iteration 1: log likelihood = -63473.224 Iteration 2: log likelihood = -63472.677 Iteration 3: log likelihood = -63472.677 Logistic regression Number of obs = 131,370 LR chi2(2) = 198.64 Prob > chi2 = 0.0000 Log likelihood = -63472.677 Pseudo R2 = 0.0016 ------------------------------------------------------------------------------ nonpartic | Odds ratio Std. err. z P>|z| [95% conf. interval] -------------+---------------------------------------------------------------- distance | 30-59km | 1.091648 .0176887 5.41 0.000 1.057524 1.126874 >60km | 1.37778 .0312103 14.15 0.000 1.317947 1.440329 | _cons | .2189893 .0019826 -167.75 0.000 .2151377 .2229098 ------------------------------------------------------------------------------ Note: _cons estimates baseline odds. . . * Stratified analyses . bysort access: logit nonpartic b0.distance, or ----------------------------------------------------------------------------------------------------------- -> access = Yes Iteration 0: log likelihood = -40442.386 Iteration 1: log likelihood = -40405.791 Iteration 2: log likelihood = -40405.614 Iteration 3: log likelihood = -40405.614 Logistic regression Number of obs = 85,784 LR chi2(2) = 73.54 Prob > chi2 = 0.0000 Log likelihood = -40405.614 Pseudo R2 = 0.0009 ------------------------------------------------------------------------------ nonpartic | Odds ratio Std. err. z P>|z| [95% conf. interval] -------------+---------------------------------------------------------------- distance | 30-59km | 1.019441 .021262 0.92 0.356 .9786084 1.061977 >60km | 1.287862 .0374798 8.69 0.000 1.216459 1.363457 | _cons | .2128982 .0023727 -138.80 0.000 .2082981 .2175998 ------------------------------------------------------------------------------ Note: _cons estimates baseline odds. ----------------------------------------------------------------------------------------------------------- -> access = No Iteration 0: log likelihood = -23073.367 Iteration 1: log likelihood = -23001.945 Iteration 2: log likelihood = -23001.528 Iteration 3: log likelihood = -23001.528 Logistic regression Number of obs = 45,586 LR chi2(2) = 143.68 Prob > chi2 = 0.0000 Log likelihood = -23001.528 Pseudo R2 = 0.0031 ------------------------------------------------------------------------------ nonpartic | Odds ratio Std. err. z P>|z| [95% conf. interval] -------------+---------------------------------------------------------------- distance | 30-59km | 1.192874 .0309818 6.79 0.000 1.13367 1.255169 >60km | 1.51613 .0550209 11.47 0.000 1.412037 1.627897 | _cons | .2316625 .0035976 -94.17 0.000 .2247175 .2388222 ------------------------------------------------------------------------------ Note: _cons estimates baseline odds. . . * Model with interaction . logit nonpartic b0.distance##b0.access, or Iteration 0: log likelihood = -63571.998 Iteration 1: log likelihood = -63408.673 Iteration 2: log likelihood = -63407.142 Iteration 3: log likelihood = -63407.141 Logistic regression Number of obs = 131,370 LR chi2(5) = 329.71 Prob > chi2 = 0.0000 Log likelihood = -63407.141 Pseudo R2 = 0.0026 --------------------------------------------------------------------------------- nonpartic | Odds ratio Std. err. z P>|z| [95% conf. interval] ----------------+---------------------------------------------------------------- distance | 30-59km | 1.019441 .021262 0.92 0.356 .9786084 1.061977 >60km | 1.287862 .0374798 8.69 0.000 1.216459 1.363457 | access | No | 1.088138 .0207997 4.42 0.000 1.048125 1.129678 | distance#access | 30-59km#No | 1.170126 .038977 4.72 0.000 1.096173 1.249068 >60km#No | 1.177245 .0547633 3.51 0.000 1.074659 1.289625 | _cons | .2128982 .0023727 -138.80 0.000 .2082981 .2175998 --------------------------------------------------------------------------------- Note: _cons estimates baseline odds. . estimates store model1 . . qui logit nonpartic b0.distance b0.access, or . * Test for interaction . lrtest model1 Likelihood-ratio test Assumption: . nested within model1 LR chi2(2) = 28.33 Prob > chi2 = 0.0000 . . . ** Same analysis but with risk ratio instead of odds ratio . . * Effect in full cohort . binreg nonpartic b0.distance, rr Iteration 1: deviance = 174411.4 Iteration 2: deviance = 130712.1 Iteration 3: deviance = 127014.5 Iteration 4: deviance = 126945.4 Iteration 5: deviance = 126945.4 Iteration 6: deviance = 126945.4 Generalized linear models Number of obs = 131,370 Optimization : MQL Fisher scoring Residual df = 131,367 (IRLS EIM) Scale parameter = 1 Deviance = 126945.3532 (1/df) Deviance = .9663413 Pearson = 131369.9361 (1/df) Pearson = 1.000022 Variance function: V(u) = u*(1-u) [Bernoulli] Link function : g(u) = ln(u) [Log] BIC = -1421316 ------------------------------------------------------------------------------ | EIM nonpartic | Risk ratio std. err. z P>|z| [95% conf. interval] -------------+---------------------------------------------------------------- distance | 30-59km | 1.073966 .0141173 5.43 0.000 1.04665 1.101995 >60km | 1.290216 .0227027 14.48 0.000 1.246478 1.335489 | _cons | .1796482 .0013343 -231.15 0.000 .1770521 .1822825 ------------------------------------------------------------------------------ Note: _cons estimates baseline risk. . . * Stratified analyses . bysort access: binreg nonpartic b0.distance, rr ----------------------------------------------------------------------------------------------------------- -> access = Yes Iteration 1: deviance = 111024.1 Iteration 2: deviance = 83282.22 Iteration 3: deviance = 80858.84 Iteration 4: deviance = 80811.26 Iteration 5: deviance = 80811.23 Iteration 6: deviance = 80811.23 Generalized linear models Number of obs = 85,784 Optimization : MQL Fisher scoring Residual df = 85,781 (IRLS EIM) Scale parameter = 1 Deviance = 80811.22737 (1/df) Deviance = .9420644 Pearson = 85783.94892 (1/df) Pearson = 1.000034 Variance function: V(u) = u*(1-u) [Bernoulli] Link function : g(u) = ln(u) [Log] BIC = -893625.6 ------------------------------------------------------------------------------ | EIM nonpartic | Risk ratio std. err. z P>|z| [95% conf. interval] -------------+---------------------------------------------------------------- distance | 30-59km | 1.015974 .0174279 0.92 0.356 .9823838 1.050713 >60km | 1.225919 .0282119 8.85 0.000 1.171853 1.282479 | _cons | .1755285 .0016129 -189.36 0.000 .1723956 .1787183 ------------------------------------------------------------------------------ Note: _cons estimates baseline risk. ----------------------------------------------------------------------------------------------------------- -> access = No Iteration 1: deviance = 63215.62 Iteration 2: deviance = 47293.78 Iteration 3: deviance = 46024.76 Iteration 4: deviance = 46003.07 Iteration 5: deviance = 46003.06 Iteration 6: deviance = 46003.06 Generalized linear models Number of obs = 45,586 Optimization : MQL Fisher scoring Residual df = 45,583 (IRLS EIM) Scale parameter = 1 Deviance = 46003.05543 (1/df) Deviance = 1.009215 Pearson = 45585.98443 (1/df) Pearson = 1.000065 Variance function: V(u) = u*(1-u) [Bernoulli] Link function : g(u) = ln(u) [Log] BIC = -442982 ------------------------------------------------------------------------------ | EIM nonpartic | Risk ratio std. err. z P>|z| [95% conf. interval] -------------+---------------------------------------------------------------- distance | 30-59km | 1.151114 .0237314 6.83 0.000 1.105529 1.19858 >60km | 1.38197 .0378015 11.83 0.000 1.309832 1.458082 | _cons | .1880893 .0023716 -132.51 0.000 .1834981 .1927954 ------------------------------------------------------------------------------ Note: _cons estimates baseline risk. . . * Model with interaction (note that we need to use ML estimation to use . * lrtest (likelihood ratio test)) . binreg nonpartic b0.distance##b0.access, rr ml Iteration 0: log likelihood = -87119.839 Iteration 1: log likelihood = -63930.639 Iteration 2: log likelihood = -63420.95 Iteration 3: log likelihood = -63407.149 Iteration 4: log likelihood = -63407.141 Iteration 5: log likelihood = -63407.141 Generalized linear models Number of obs = 131,370 Optimization : ML Residual df = 131,364 Scale parameter = 1 Deviance = 126814.2828 (1/df) Deviance = .9653656 Pearson = 131370 (1/df) Pearson = 1.000046 Variance function: V(u) = u*(1-u) [Bernoulli] Link function : g(u) = ln(u) [Log] AIC = .9654128 Log likelihood = -63407.1414 BIC = -1421412 --------------------------------------------------------------------------------- | OIM nonpartic | Risk ratio std. err. z P>|z| [95% conf. interval] ----------------+---------------------------------------------------------------- distance | 30-59km | 1.015974 .0174279 0.92 0.356 .9823837 1.050713 >60km | 1.225919 .0282119 8.85 0.000 1.171853 1.282479 | access | No | 1.07156 .0167181 4.43 0.000 1.039289 1.104833 | distance#access | 30-59km#No | 1.133016 .0303867 4.66 0.000 1.074997 1.194166 >60km#No | 1.127293 .0402965 3.35 0.001 1.051017 1.209105 | _cons | .1755285 .0016129 -189.36 0.000 .1723956 .1787183 --------------------------------------------------------------------------------- Note: _cons estimates baseline risk. . estimates store model2 . . qui binreg nonpartic b0.distance b0.access, rr ml . * Test for interaction . lrtest model2 Likelihood-ratio test Assumption: . nested within model2 LR chi2(2) = 26.71 Prob > chi2 = 0.0000 . . log close name: log: D:\stovring\SDCA\EpiSpace_EpiStats\EffMod\effmod_analysis.log log type: text closed on: 8 Jun 2023, 14:23:46 -----------------------------------------------------------------------------------------------------------