--------------------------------------------------------------------------------------------------

      name:  <unnamed>

       log:  C:\Users\mexmi\Documents\newer web pages\Soc_382\logs\event_history_log1.log

  log type:  text

 opened on:  19 Feb 2019, 10:20:26

 

. use "C:\Users\mexmi\Documents\current class files\intro soc methods\Soc 382 stuff\Soc 382 event history\HCMST file for class, single observation per couple v2.dta", clear

( )

 

* This is a brief log for examining the single observation event history dataset. More commentary in the Excel file.

 

 

. tabulate ever_broke_up_w2345

 

    whether |

subject who |

        was |

followed up |

 ever broke |

  up or not |      Freq.     Percent        Cum.

------------+-----------------------------------

          0 |      2,167       81.16       81.16

          1 |        503       18.84      100.00

------------+-----------------------------------

      Total |      2,670      100.00

 

* 503 breakups out of 2670 total couples.

 

*Now I issue the stset command, which calls up the stset command that has already been applied to this dataset.

 

. stset

-> stset relationship_duration_at_end, failure(ever_broke_up_w2345==1)

                                       enter(time how_long_relationship_w1)

 

     failure event:  ever_broke_up_w2345 == 1

obs. time interval:  (0, relationship_duration_at_end]

 enter on or after:  time how_long_relationship_w1

 exit on or before:  failure

 

------------------------------------------------------------------------------

     2670  total observations

       33  event time missing (relationship_duration_at_end>=.) PROBABLE ERROR

------------------------------------------------------------------------------

     2637  observations remaining, representing

      494  failures in single-record/single-failure data

 8265.833  total analysis time at risk and under observation

                                              at risk from t =         0

                                   earliest observed entry t =         0

                                        last observed exit t =  73.33334

 

*Now a Kaplan-Meier graph, for survival of couples as intact couples, by whether they met online or not.

 

. sts graph if met_on_after_95==1 & same_sex_couple_v2==0 & _t<20,  by(met_online_augmented)

 

         failure _d:  ever_broke_up_w2345 == 1

   analysis time _t:  relationship_duration_at_end

  enter on or after:  time how_long_relationship_w1

 

 

* Now an stcox proportional hazards model predicting breakup. Note that there is no dependent variable (because the stset command already told Stata what the outcome of interest is) and there is no control for the time axis, relationship duration, because the Cox proportional hazard model controls for that automatically. Also note that as this is the single observation dataset, all covariates are fixed at time 1.

 

. stcox resp_col_dgre married coresident children_in_hh met_online_augmented ln_hhinc_2009dollars

 

         failure _d:  ever_broke_up_w2345 == 1

   analysis time _t:  relationship_duration_at_end

  enter on or after:  time how_long_relationship_w1

 

Iteration 0:   log likelihood = -2535.3568

Iteration 1:   log likelihood = -2423.3912

Iteration 2:   log likelihood = -2421.8666

Iteration 3:   log likelihood = -2421.8658

Refining estimates:

Iteration 0:   log likelihood = -2421.8658

 

Cox regression -- Breslow method for ties

 

No. of subjects =         2582                     Number of obs   =      2582

No. of failures =          478

Time at risk    =  8121.833358

                                                   LR chi2(6)      =    226.98

Log likelihood  =   -2421.8658                     Prob > chi2     =    0.0000

 

--------------------------------------------------------------------------------------

                  _t | Haz. Ratio   Std. Err.      z    P>|z|     [95% Conf. Interval]

---------------------+----------------------------------------------------------------

       resp_col_dgre |   .8267504   .0831387    -1.89   0.059     .6788549    1.006867

             married |   .3542358   .0529819    -6.94   0.000     .2642293     .474902

          coresident |   .3391017   .0436468    -8.40   0.000      .263493    .4364059

      children_in_hh |   1.112869   .0609199     1.95   0.051     .9996501     1.23891

met_online_augmented |   1.095103    .131106     0.76   0.448     .8660613    1.384717

ln_hhinc_2009dollars |   .9061744   .0515513    -1.73   0.083      .810565    1.013061

--------------------------------------------------------------------------------------

 

. regress relationship_duration_at_end resp_col_dgre married coresident children_in_hh met_online_

> augmented ln_hhinc_2009dollars  if ever_broke_up_w2345==1

 

      Source |       SS       df       MS              Number of obs =     478

-------------+------------------------------           F(  6,   471) =   20.55

       Model |  8558.76186     6  1426.46031           Prob > F      =  0.0000

    Residual |  32697.7652   471  69.4220068           R-squared     =  0.2075

-------------+------------------------------           Adj R-squared =  0.1974

       Total |   41256.527   477  86.4916709           Root MSE      =   8.332

 

--------------------------------------------------------------------------------------

relationship_durat~d |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]

---------------------+----------------------------------------------------------------

       resp_col_dgre |   1.187367   .8458316     1.40   0.161     -.474703    2.849438

             married |   8.886208   1.058656     8.39   0.000     6.805935    10.96648

          coresident |   .1817787   .8803307     0.21   0.836    -1.548083     1.91164

      children_in_hh |  -.9104321   .4433885    -2.05   0.041    -1.781696   -.0391679

met_online_augmented |  -4.684189   .9610017    -4.87   0.000     -6.57257   -2.795807

ln_hhinc_2009dollars |  -.9450353   .4867864    -1.94   0.053    -1.901577    .0115065

               _cons |   17.82119   5.167315     3.45   0.001     7.667347    27.97503

--------------------------------------------------------------------------------------

 

. *The regression on failure time for couples who broke up is bad in EVERY way. The badness of this is one reason we do Event History Analysis.

 

. clear all

 

. use "C:\Users\mexmi\Documents\current class files\intro soc methods\Soc 382 stuff\Soc 382 event

> history\wave1 to 5 combined for sharing with class stset v3 reduced vars.dta", clear

( )

 

. log close

      name:  <unnamed>

       log:  C:\Users\mexmi\Documents\newer web pages\Soc_382\logs\event_history_log1.log

  log type:  text

 closed on:  19 Feb 2019, 11:56:39

--------------------------------------------------------------------------------------------------