------------------------------------------------------------------------------------------- name: log: C:\Users\zgn603\Dropbox\Forskning\CoronaProject\High-Risk Paper\Stata_logFile. > log log type: text opened on: 27 Jan 2022, 10:33:32 . . *create stable data selection . drop if highrisk == . (0 observations deleted) . drop if proximity == . (1 observation deleted) . . *average observation time . sum difftime Variable | Obs Mean Std. Dev. Min Max -------------+--------------------------------------------------------- difftime | 7,813 27.05952 15.02504 4 120 . . *high-risk and normal social dist freq . fre highrisk highrisk ----------------------------------------------------------- | Freq. Percent Valid Cum. --------------+-------------------------------------------- Valid 0 | 7793 99.74 99.74 99.74 1 | 20 0.26 0.26 100.00 Total | 7813 100.00 100.00 ----------------------------------------------------------- . mean highrisk Mean estimation Number of obs = 7,813 -------------------------------------------------------------- | Mean Std. Err. [95% Conf. Interval] -------------+------------------------------------------------ highrisk | .0025598 .0005717 .0014392 .0036805 -------------------------------------------------------------- . mean proximity Mean estimation Number of obs = 7,813 -------------------------------------------------------------- | Mean Std. Err. [95% Conf. Interval] -------------+------------------------------------------------ proximity | .781774 .0046732 .7726133 .7909347 -------------------------------------------------------------- . codebook proximity ------------------------------------------------------------------------------------------- proximity (unlabeled) ------------------------------------------------------------------------------------------- type: numeric (byte) label: labels15 range: [0,1] units: 1 unique values: 2 missing .: 0/7,813 tabulation: Freq. Numeric Label 1,705 0 No 6,108 1 Yes . codebook highrisk if proximity == 1 ------------------------------------------------------------------------------------------- highrisk (unlabeled) ------------------------------------------------------------------------------------------- type: numeric (float) range: [0,1] units: 1 unique values: 2 missing .: 0/6,108 tabulation: Freq. Value 6,088 0 20 1 . . *create ordinale violation outcome . gen ordinal_outcome = . (7,813 missing values generated) . replace ordinal_outcome = 0 if proximity == 0 (1,705 real changes made) . replace ordinal_outcome = 1 if proximity == 1 (6,108 real changes made) . replace ordinal_outcome = 2 if proximity == 1 & highrisk == 1 (20 real changes made) . codebook ordinal_outcome ------------------------------------------------------------------------------------------- ordinal_outcome (unlabeled) ------------------------------------------------------------------------------------------- type: numeric (float) range: [0,2] units: 1 unique values: 3 missing .: 0/7,813 tabulation: Freq. Value 1,705 0 6,088 1 20 2 . . *violations regressed on secounds of observation . ologit ordinal_outcome difftime, robust or Iteration 0: log pseudolikelihood = -4233.5177 Iteration 1: log pseudolikelihood = -4098.1246 Iteration 2: log pseudolikelihood = -4089.4663 Iteration 3: log pseudolikelihood = -4089.402 Iteration 4: log pseudolikelihood = -4089.402 Ordered logistic regression Number of obs = 7,813 Wald chi2(1) = 145.45 Prob > chi2 = 0.0000 Log pseudolikelihood = -4089.402 Pseudo R2 = 0.0340 --------------------------------------------------------------------------------- | Robust ordinal_outcome | Odds Ratio Std. Err. z P>|z| [95% Conf. Interval] ----------------+---------------------------------------------------------------- difftime | 1.045959 .003897 12.06 0.000 1.038349 1.053625 ----------------+---------------------------------------------------------------- /cut1 | -.157401 .0911961 -.336142 .02134 /cut2 | 7.761658 .3428544 7.089676 8.43364 --------------------------------------------------------------------------------- Note: Estimates are transformed only in the first equation. . margins, at(difftime = (10(10)90)) predict(outcome(1)) predict(outcome(2)) Adjusted predictions Number of obs = 7,813 Model VCE : Robust 1._predict : Pr(ordinal_outcome==1), predict(outcome(1)) 2._predict : Pr(ordinal_outcome==2), predict(outcome(2)) 1._at : difftime = 10 2._at : difftime = 20 3._at : difftime = 30 4._at : difftime = 40 5._at : difftime = 50 6._at : difftime = 60 7._at : difftime = 70 8._at : difftime = 80 9._at : difftime = 90 ------------------------------------------------------------------------------ | Delta-method | Margin Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- _predict#_at | 1 1 | .6465312 .0128469 50.33 0.000 .6213518 .6717106 1 2 | .7408978 .0057227 129.47 0.000 .7296815 .7521142 1 3 | .8167471 .0056894 143.56 0.000 .8055962 .8278981 1 4 | .8734044 .007652 114.14 0.000 .8584067 .8884021 1 5 | .9131311 .0081492 112.05 0.000 .897159 .9291031 1 6 | .939227 .0075063 125.13 0.000 .924515 .953939 1 7 | .9547321 .0063618 150.07 0.000 .9422633 .967201 1 8 | .9618074 .0053713 179.07 0.000 .9512799 .9723349 1 9 | .9615308 .0056036 171.59 0.000 .9505479 .9725136 2 1 | .0006668 .0002107 3.16 0.002 .0002539 .0010798 2 2 | .0010447 .0003046 3.43 0.001 .0004478 .0016416 2 3 | .0016364 .0004418 3.70 0.000 .0007705 .0025023 2 4 | .0025623 .000646 3.97 0.000 .0012963 .0038284 2 5 | .00401 .0009569 4.19 0.000 .0021345 .0058856 2 6 | .0062706 .001444 4.34 0.000 .0034403 .0091009 2 7 | .009793 .0022278 4.40 0.000 .0054266 .0141594 2 8 | .0152636 .0035132 4.34 0.000 .0083778 .0221494 2 9 | .023717 .0056367 4.21 0.000 .0126693 .0347647 ------------------------------------------------------------------------------ . marginsplot, graphregion(color(white)) scheme(s2mono) Variables that uniquely identify margins: difftime . . end of do-file