## Installing package into '/storage01/users/izf381/R/x86_64-redhat-linux-gnu-library/3.6'
## (as 'lib' is unspecified)
## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
## Loading required package: carData
## 
## Attaching package: 'car'
## The following object is masked from 'package:dplyr':
## 
##     recode
## 
## Attaching package: 'zoo'
## The following objects are masked from 'package:base':
## 
##     as.Date, as.Date.numeric

Definitions

1) Define your event variable - The event variable is the transition of employement in Wave 3 to unemployment (fired, layed off, let go) in Wave 4

2) Define a duration or time variable - If the age at unemployment is censored, then the age at the date of interview is the censored age at unemployment, or if not censored, the actual age at umeployment.

3) Define a censoring indicator - If someone has experienced the event the are assigned a “0”, if they experience an event they are assigned a “1”.

Descriptive estimates

## Loading required package: ggplot2
## Registered S3 methods overwritten by 'ggplot2':
##   method         from 
##   [.quosures     rlang
##   c.quosures     rlang
##   print.quosures rlang
## Loading required package: ggpubr
## Loading required package: magrittr

4) Estimate the following functions of survival time for that variable and plot them:

a. Survival

## Call: survfit(formula = Surv(time = job.loss.age, event = job_transition) ~ 
##     1, data = addhealth)
## 
##  time n.risk n.event survival std.err lower 95% CI upper 95% CI
##    19   7101     114    0.984 0.00149        0.981        0.987
##    20   6987     338    0.936 0.00290        0.931        0.942
##    21   6649     344    0.888 0.00374        0.881        0.895
##    22   6305     469    0.822 0.00454        0.813        0.831
##    23   5836     400    0.766 0.00503        0.756        0.775
##    24   5436     333    0.719 0.00534        0.708        0.729
##    25   5102      84    0.707 0.00540        0.696        0.717
##    26   4981      27    0.703 0.00542        0.692        0.714

b. Hazard

## $time
## [1] 19.5 20.5 21.5 22.5 23.5 24.5 25.5
## 
## $haz
## [1] 0.049584812 0.053123498 0.077297339 0.071002134 0.063216305 0.016656801
## [7] 0.005818767
## 
## $var
## [1] 7.275614e-06 8.205726e-06 1.274596e-05 1.260855e-05 1.200492e-05
## [6] 3.303130e-06 1.256180e-06

##   time         haz          var
## 1 19.5 0.049584812 7.275614e-06
## 2 20.5 0.053123498 8.205726e-06
## 3 21.5 0.077297339 1.274596e-05
## 4 22.5 0.071002134 1.260855e-05
## 5 23.5 0.063216305 1.200492e-05
## 6 24.5 0.016656801 3.303130e-06
## 7 25.5 0.005818767 1.256180e-06

c. Cumulative Hazard

### 5) Carry out the following analysis #### a. Kaplan-Meier survival analysis of the outcome

## Call: survfit(formula = Surv(job.loss.age, job_transition) ~ 1, data = addhealth)
## 
##  time n.risk n.event survival std.err lower 95% CI upper 95% CI
##    19   7101     114    0.984 0.00149        0.981        0.987
##    20   6987     338    0.936 0.00290        0.931        0.942
##    21   6649     344    0.888 0.00374        0.881        0.895
##    22   6305     469    0.822 0.00454        0.813        0.831
##    23   5836     400    0.766 0.00503        0.756        0.775
##    24   5436     333    0.719 0.00534        0.708        0.729
##    25   5102      84    0.707 0.00540        0.696        0.717
##    26   4981      27    0.703 0.00542        0.692        0.714

b. Define a grouping variable, this can be dichotomous or categorical.

The grouping variabe is sexual orientation

c. Do you have a research hypothesis about the survival patterns for the levels of the categorical variable? State it. LGB individuals experience a higher rate of job loss due to social stigma then heterosexual individuals.

d. Comparison of Kaplan-Meier survival across grouping variable in your data. Interpret your results. It would appear across all groups that the age at highest risk is around 22-23 years old.

Job transition based on sexual orienation

## Call: survfit(formula = Surv(job.loss.age, job_transition) ~ sexorient, 
##     data = addhealth)
## 
##                 sexorient=a_straight 
##  time n.risk n.event survival std.err lower 95% CI upper 95% CI
##    19   6866     111    0.984 0.00152        0.981        0.987
##    20   6755     320    0.937 0.00293        0.932        0.943
##    21   6435     330    0.889 0.00379        0.882        0.897
##    22   6105     450    0.824 0.00460        0.815        0.833
##    23   5655     386    0.767 0.00510        0.757        0.777
##    24   5269     318    0.721 0.00541        0.711        0.732
##    25   4950      79    0.710 0.00548        0.699        0.720
##    26   4835      26    0.706 0.00550        0.695        0.717
## 
##                 sexorient=b_bisexual 
##  time n.risk n.event survival std.err lower 95% CI upper 95% CI
##    19    122       3    0.975  0.0140        0.948        1.000
##    20    119       9    0.902  0.0270        0.850        0.956
##    21    110      10    0.820  0.0348        0.754        0.891
##    22    100      15    0.697  0.0416        0.620        0.783
##    23     85       2    0.680  0.0422        0.602        0.768
##    24     83       6    0.631  0.0437        0.551        0.723
##    25     77       3    0.607  0.0442        0.526        0.700
##    26     74       1    0.598  0.0444        0.517        0.692
## 
##                 sexorient=c_LGB 
##  time n.risk n.event survival std.err lower 95% CI upper 95% CI
##    20    113       9    0.920  0.0255        0.872        0.972
##    21    104       4    0.885  0.0300        0.828        0.946
##    22    100       4    0.850  0.0336        0.786        0.918
##    23     96      12    0.743  0.0411        0.667        0.828
##    24     84       9    0.664  0.0444        0.582        0.757
##    25     75       2    0.646  0.0450        0.564        0.740

##            observed   expected        o-e
## a_straight     2020 2042.75755 -22.757546
## b_bisexual       49   33.01654  15.983458
## c_LGB            40   33.22591   6.774089
## Call: survfit(formula = Surv(time = job.loss.age, event = job_transition) ~ 
##     sexorient + sex, data = addhealth)
## 
##                 sexorient=a_straight, sex=a_male   
##  time n.risk n.event survival std.err lower 95% CI upper 95% CI
##    19   3245      63    0.981 0.00242        0.976        0.985
##    20   3182     160    0.931 0.00444        0.923        0.940
##    21   3022     173    0.878 0.00575        0.867        0.889
##    22   2849     251    0.801 0.00701        0.787        0.814
##    23   2598     213    0.735 0.00775        0.720        0.750
##    24   2385     189    0.677 0.00821        0.661        0.693
##    25   2196      47    0.662 0.00830        0.646        0.679
##    26   2140      21    0.656 0.00834        0.640        0.672
## 
##                 sexorient=a_straight, sex=b_female 
##  time n.risk n.event survival std.err lower 95% CI upper 95% CI
##    19   3621      48    0.987 0.00190        0.983        0.990
##    20   3573     160    0.943 0.00387        0.935        0.950
##    21   3413     157    0.899 0.00500        0.889        0.909
##    22   3256     199    0.844 0.00603        0.833        0.856
##    23   3057     173    0.796 0.00669        0.783        0.810
##    24   2884     129    0.761 0.00709        0.747        0.775
##    25   2754      32    0.752 0.00718        0.738        0.766
##    26   2695       5    0.751 0.00719        0.737        0.765
## 
##                 sexorient=b_bisexual, sex=a_male   
##  time n.risk n.event survival std.err lower 95% CI upper 95% CI
##    19     19       1    0.947  0.0512        0.852        1.000
##    20     18       1    0.895  0.0704        0.767        1.000
##    21     17       1    0.842  0.0837        0.693        1.000
##    24     16       2    0.737  0.1010        0.563        0.964
## 
##                 sexorient=b_bisexual, sex=b_female 
##  time n.risk n.event survival std.err lower 95% CI upper 95% CI
##    19    103       2    0.981  0.0136        0.954        1.000
##    20    101       8    0.903  0.0292        0.848        0.962
##    21     93       9    0.816  0.0382        0.744        0.894
##    22     84      15    0.670  0.0463        0.585        0.767
##    23     69       2    0.650  0.0470        0.565        0.749
##    24     67       4    0.612  0.0480        0.524        0.713
##    25     63       3    0.583  0.0486        0.495        0.686
##    26     60       1    0.573  0.0487        0.485        0.677
## 
##                 sexorient=c_LGB, sex=a_male   
##  time n.risk n.event survival std.err lower 95% CI upper 95% CI
##    20     71       4    0.944  0.0274        0.892        0.999
##    21     67       1    0.930  0.0304        0.872        0.991
##    22     66       4    0.873  0.0395        0.799        0.954
##    23     62       8    0.761  0.0506        0.668        0.867
##    24     54       6    0.676  0.0555        0.576        0.794
##    25     48       2    0.648  0.0567        0.546        0.769
## 
##                 sexorient=c_LGB, sex=b_female 
##  time n.risk n.event survival std.err lower 95% CI upper 95% CI
##    20     42       5    0.881  0.0500        0.788        0.985
##    21     37       3    0.810  0.0606        0.699        0.937
##    23     34       4    0.714  0.0697        0.590        0.865
##    24     30       3    0.643  0.0739        0.513        0.805

e. Plot the hazard function for the analysis for each level of the group variable (continued assignment from part d)

#Part B #Parametric models ### 1) Carry out the following analysis: Define your outcome as in part A. Also consider what covariates are hypothesized to affect the outcome variable. Define these and construct a parametric model for your outcome.
####The outcome variable is the transition of employement in Wave 3 to unemployment (fired, layed off, let go) in Wave 4 ####The predictior variables are chosen based on previous literature and what may effect lossing a job for LGB individuals. The variables are education, depression, insurance status, getting beaten up, alcohol consumption, general health, race/ethnicity, sex, how a job was lost, sexual orientation, unable to pay utilities, and job satisfaction

Fit the parametric model of your choosing to the data.

a. Did you choose an AFT or PH model and why?

I chose a Cox Proportional Hazard Model to analyzing the effect of several covariates after looking at the results of exponential, Weibull, and piecewise exponential models. The Weibull had the lowest AIC score and fit somewhat, but the Cox model proved to be better.

b. Justify what parametric distribution you choose

c. Carry out model fit diagnostics for the model

d. Include all main effects in the model

e. Test for an interaction between at least two of the predictors

f. Interpret your results and write them up

## Loading required package: grid
## Loading required package: Matrix
## 
## Attaching package: 'survey'
## The following object is masked from 'package:graphics':
## 
##     dotchart
## Stratified 1 - level Cluster Sampling design (with replacement)
## With (130) clusters.
## svydesign(ids = ~psuscid, strata = ~region, weights = ~GSWGT4, 
##     data = addhealth, nest = T)
## Call:
## svycoxph(formula = Surv(time = job.loss.age, event = job_transition) ~ 
##     sex + sexorient, design = des2)
## 
##   n= 7101, number of events= 2109 
## 
##                         coef exp(coef) se(coef)      z Pr(>|z|)    
## sexb_female         -0.40943   0.66403  0.05377 -7.615 2.64e-14 ***
## sexorientb_bisexual  0.55580   1.74333  0.17214  3.229  0.00124 ** 
## sexorientc_LGB       0.10467   1.11034  0.21069  0.497  0.61934    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##                     exp(coef) exp(-coef) lower .95 upper .95
## sexb_female             0.664     1.5060    0.5976    0.7378
## sexorientb_bisexual     1.743     0.5736    1.2441    2.4429
## sexorientc_LGB          1.110     0.9006    0.7347    1.6780
## 
## Concordance= 0.555  (se = 0.007 )
## Likelihood ratio test= NA  on 3 df,   p=NA
## Wald test            = 69.8  on 3 df,   p=5e-15
## Score (logrank) test = NA  on 3 df,   p=NA

###Cox model with outcome and predictor variables.

## Stratified 1 - level Cluster Sampling design (with replacement)
## With (130) clusters.
## svydesign(ids = ~psuscid, strata = ~region, weights = ~GSWGT4, 
##     data = addhealth, nest = T)
## Call:
## svycoxph(formula = Surv(time = job.loss.age, event = job_transition) ~ 
##     sex + racethnic + sexorient + educ + unable_pay_utilities + 
##         insurance_statusW4 + general_health + depressionW4 + 
##         alcohol_day_permonthW4 + leave_job + job_satisfaction + 
##         beaten_upW4, design = des2)
## 
##   n= 7101, number of events= 2109 
## 
##                                            coef exp(coef)  se(coef)      z
## sexb_female                           -0.335328  0.715103  0.060652 -5.529
## racethnicb-nhblack                     0.252315  1.287002  0.088078  2.865
## racethnicc-hispanic                   -0.001349  0.998652  0.120087 -0.011
## racethnicd-asian                      -0.281351  0.754763  0.143848 -1.956
## racethnice-native_american             0.392680  1.480944  0.333665  1.177
## racethnicf-other                       0.356611  1.428481  0.332484  1.073
## sexorientb_bisexual                    0.324764  1.383704  0.175884  1.846
## sexorientc_LGB                         0.149616  1.161388  0.200128  0.748
## educb_highschool_grad                 -0.135556  0.873230  0.102126 -1.327
## educc_college_bach                    -0.604396  0.546404  0.147919 -4.086
## educd_college+                        -1.165803  0.311672  0.157958 -7.380
## unable_pay_utilitiesb_yes              0.322562  1.380661  0.068373  4.718
## insurance_statusW4b_yes_insurance     -0.425704  0.653309  0.062529 -6.808
## general_healthb_poor/bad               0.150772  1.162731  0.097135  1.552
## depressionW4b_yes                      0.174849  1.191066  0.082055  2.131
## alcohol_day_permonthW4b_1or2days/week -0.003821  0.996186  0.072122 -0.053
## alcohol_day_permonthW4c_3to5days/week -0.005482  0.994533  0.094637 -0.058
## alcohol_day_permonthW4d_daily          0.235969  1.266135  0.137049  1.722
## leave_jobb_health                     -1.179450  0.307448  0.218042 -5.409
## leave_jobc_other                      -0.928580  0.395114  0.135977 -6.829
## leave_jobd_skip                       -0.805064  0.447059  0.103178 -7.803
## job_satisfactionb_neutral              0.111726  1.118206  0.080248  1.392
## job_satisfactionc_dissatisfied         0.199357  1.220618  0.094520  2.109
## beaten_upW4b_yes                       0.019293  1.019480  0.099590  0.194
##                                       Pr(>|z|)    
## sexb_female                           3.22e-08 ***
## racethnicb-nhblack                     0.00417 ** 
## racethnicc-hispanic                    0.99103    
## racethnicd-asian                       0.05048 .  
## racethnice-native_american             0.23925    
## racethnicf-other                       0.28346    
## sexorientb_bisexual                    0.06483 .  
## sexorientc_LGB                         0.45470    
## educb_highschool_grad                  0.18440    
## educc_college_bach                    4.39e-05 ***
## educd_college+                        1.58e-13 ***
## unable_pay_utilitiesb_yes             2.39e-06 ***
## insurance_statusW4b_yes_insurance     9.89e-12 ***
## general_healthb_poor/bad               0.12062    
## depressionW4b_yes                      0.03310 *  
## alcohol_day_permonthW4b_1or2days/week  0.95775    
## alcohol_day_permonthW4c_3to5days/week  0.95380    
## alcohol_day_permonthW4d_daily          0.08511 .  
## leave_jobb_health                     6.33e-08 ***
## leave_jobc_other                      8.55e-12 ***
## leave_jobd_skip                       6.06e-15 ***
## job_satisfactionb_neutral              0.16384    
## job_satisfactionc_dissatisfied         0.03493 *  
## beaten_upW4b_yes                       0.84639    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##                                       exp(coef) exp(-coef) lower .95
## sexb_female                              0.7151     1.3984    0.6350
## racethnicb-nhblack                       1.2870     0.7770    1.0829
## racethnicc-hispanic                      0.9987     1.0014    0.7892
## racethnicd-asian                         0.7548     1.3249    0.5693
## racethnice-native_american               1.4809     0.6752    0.7701
## racethnicf-other                         1.4285     0.7000    0.7445
## sexorientb_bisexual                      1.3837     0.7227    0.9802
## sexorientc_LGB                           1.1614     0.8610    0.7846
## educb_highschool_grad                    0.8732     1.1452    0.7148
## educc_college_bach                       0.5464     1.8301    0.4089
## educd_college+                           0.3117     3.2085    0.2287
## unable_pay_utilitiesb_yes                1.3807     0.7243    1.2075
## insurance_statusW4b_yes_insurance        0.6533     1.5307    0.5780
## general_healthb_poor/bad                 1.1627     0.8600    0.9612
## depressionW4b_yes                        1.1911     0.8396    1.0141
## alcohol_day_permonthW4b_1or2days/week    0.9962     1.0038    0.8649
## alcohol_day_permonthW4c_3to5days/week    0.9945     1.0055    0.8262
## alcohol_day_permonthW4d_daily            1.2661     0.7898    0.9679
## leave_jobb_health                        0.3074     3.2526    0.2005
## leave_jobc_other                         0.3951     2.5309    0.3027
## leave_jobd_skip                          0.4471     2.2368    0.3652
## job_satisfactionb_neutral                1.1182     0.8943    0.9555
## job_satisfactionc_dissatisfied           1.2206     0.8193    1.0142
## beaten_upW4b_yes                         1.0195     0.9809    0.8387
##                                       upper .95
## sexb_female                              0.8054
## racethnicb-nhblack                       1.5295
## racethnicc-hispanic                      1.2637
## racethnicd-asian                         1.0006
## racethnice-native_american               2.8481
## racethnicf-other                         2.7408
## sexorientb_bisexual                      1.9532
## sexorientc_LGB                           1.7192
## educb_highschool_grad                    1.0667
## educc_college_bach                       0.7302
## educd_college+                           0.4248
## unable_pay_utilitiesb_yes                1.5787
## insurance_statusW4b_yes_insurance        0.7385
## general_healthb_poor/bad                 1.4066
## depressionW4b_yes                        1.3989
## alcohol_day_permonthW4b_1or2days/week    1.1474
## alcohol_day_permonthW4c_3to5days/week    1.1972
## alcohol_day_permonthW4d_daily            1.6563
## leave_jobb_health                        0.4714
## leave_jobc_other                         0.5158
## leave_jobd_skip                          0.5473
## job_satisfactionb_neutral                1.3087
## job_satisfactionc_dissatisfied           1.4690
## beaten_upW4b_yes                         1.2392
## 
## Concordance= 0.671  (se = 0.008 )
## Likelihood ratio test= NA  on 24 df,   p=NA
## Wald test            = 576  on 24 df,   p=<2e-16
## Score (logrank) test = NA  on 24 df,   p=NA

schoenfeld residuals

## Response sexb_female :
## 
## Call:
## lm(formula = sexb_female ~ des2$variables$job.loss.age[des2$variables$job_transition == 
##     1])
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -0.4797 -0.4563 -0.4427  0.5445  0.5634 
## 
## Coefficients:
##                                                                   Estimate
## (Intercept)                                                      0.0703658
## des2$variables$job.loss.age[des2$variables$job_transition == 1] -0.0008703
##                                                                 Std. Error
## (Intercept)                                                      0.1467977
## des2$variables$job.loss.age[des2$variables$job_transition == 1]  0.0066452
##                                                                 t value
## (Intercept)                                                       0.479
## des2$variables$job.loss.age[des2$variables$job_transition == 1]  -0.131
##                                                                 Pr(>|t|)
## (Intercept)                                                        0.632
## des2$variables$job.loss.age[des2$variables$job_transition == 1]    0.896
## 
## Residual standard error: 0.4991 on 2107 degrees of freedom
## Multiple R-squared:  8.14e-06,   Adjusted R-squared:  -0.0004665 
## F-statistic: 0.01715 on 1 and 2107 DF,  p-value: 0.8958
## 
## 
## Response racethnicb-nhblack :
## 
## Call:
## lm(formula = `racethnicb-nhblack` ~ des2$variables$job.loss.age[des2$variables$job_transition == 
##     1])
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -0.2788 -0.2346 -0.2152 -0.1860  0.8233 
## 
## Coefficients:
##                                                                  Estimate
## (Intercept)                                                     -0.172513
## des2$variables$job.loss.age[des2$variables$job_transition == 1]  0.010885
##                                                                 Std. Error
## (Intercept)                                                       0.122445
## des2$variables$job.loss.age[des2$variables$job_transition == 1]   0.005543
##                                                                 t value
## (Intercept)                                                      -1.409
## des2$variables$job.loss.age[des2$variables$job_transition == 1]   1.964
##                                                                 Pr(>|t|)  
## (Intercept)                                                       0.1590  
## des2$variables$job.loss.age[des2$variables$job_transition == 1]   0.0497 *
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.4163 on 2107 degrees of freedom
## Multiple R-squared:  0.001827,   Adjusted R-squared:  0.001353 
## F-statistic: 3.856 on 1 and 2107 DF,  p-value: 0.04969
## 
## 
## Response racethnicc-hispanic :
## 
## Call:
## lm(formula = `racethnicc-hispanic` ~ des2$variables$job.loss.age[des2$variables$job_transition == 
##     1])
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -0.07292 -0.06937 -0.06764 -0.06555  0.93857 
## 
## Coefficients:
##                                                                  Estimate
## (Intercept)                                                      0.041320
## des2$variables$job.loss.age[des2$variables$job_transition == 1] -0.001475
##                                                                 Std. Error
## (Intercept)                                                       0.073982
## des2$variables$job.loss.age[des2$variables$job_transition == 1]   0.003349
##                                                                 t value
## (Intercept)                                                       0.559
## des2$variables$job.loss.age[des2$variables$job_transition == 1]  -0.440
##                                                                 Pr(>|t|)
## (Intercept)                                                        0.577
## des2$variables$job.loss.age[des2$variables$job_transition == 1]    0.660
## 
## Residual standard error: 0.2515 on 2107 degrees of freedom
## Multiple R-squared:  9.201e-05,  Adjusted R-squared:  -0.0003826 
## F-statistic: 0.1939 on 1 and 2107 DF,  p-value: 0.6597
## 
## 
## Response racethnicd-asian :
## 
## Call:
## lm(formula = `racethnicd-asian` ~ des2$variables$job.loss.age[des2$variables$job_transition == 
##     1])
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -0.05253 -0.04634 -0.04225 -0.03812  0.96746 
## 
## Coefficients:
##                                                                  Estimate
## (Intercept)                                                      0.081687
## des2$variables$job.loss.age[des2$variables$job_transition == 1] -0.002760
##                                                                 Std. Error
## (Intercept)                                                       0.059440
## des2$variables$job.loss.age[des2$variables$job_transition == 1]   0.002691
##                                                                 t value
## (Intercept)                                                       1.374
## des2$variables$job.loss.age[des2$variables$job_transition == 1]  -1.026
##                                                                 Pr(>|t|)
## (Intercept)                                                        0.169
## des2$variables$job.loss.age[des2$variables$job_transition == 1]    0.305
## 
## Residual standard error: 0.2021 on 2107 degrees of freedom
## Multiple R-squared:  0.0004991,  Adjusted R-squared:  2.472e-05 
## F-statistic: 1.052 on 1 and 2107 DF,  p-value: 0.3051
## 
## 
## Response racethnice-native_american :
## 
## Call:
## lm(formula = `racethnice-native_american` ~ des2$variables$job.loss.age[des2$variables$job_transition == 
##     1])
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -0.01323 -0.00879 -0.00754 -0.00610  0.99618 
## 
## Coefficients:
##                                                                  Estimate
## (Intercept)                                                     -0.025103
## des2$variables$job.loss.age[des2$variables$job_transition == 1]  0.001138
##                                                                 Std. Error
## (Intercept)                                                       0.025534
## des2$variables$job.loss.age[des2$variables$job_transition == 1]   0.001156
##                                                                 t value
## (Intercept)                                                      -0.983
## des2$variables$job.loss.age[des2$variables$job_transition == 1]   0.985
##                                                                 Pr(>|t|)
## (Intercept)                                                        0.326
## des2$variables$job.loss.age[des2$variables$job_transition == 1]    0.325
## 
## Residual standard error: 0.0868 on 2107 degrees of freedom
## Multiple R-squared:  0.0004601,  Adjusted R-squared:  -1.426e-05 
## F-statistic: 0.9699 on 1 and 2107 DF,  p-value: 0.3248
## 
## 
## Response racethnicf-other :
## 
## Call:
## lm(formula = `racethnicf-other` ~ des2$variables$job.loss.age[des2$variables$job_transition == 
##     1])
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -0.01087 -0.00923 -0.00837 -0.00787  0.99250 
## 
## Coefficients:
##                                                                   Estimate
## (Intercept)                                                     -0.0062256
## des2$variables$job.loss.age[des2$variables$job_transition == 1]  0.0002495
##                                                                 Std. Error
## (Intercept)                                                      0.0270698
## des2$variables$job.loss.age[des2$variables$job_transition == 1]  0.0012254
##                                                                 t value
## (Intercept)                                                      -0.230
## des2$variables$job.loss.age[des2$variables$job_transition == 1]   0.204
##                                                                 Pr(>|t|)
## (Intercept)                                                        0.818
## des2$variables$job.loss.age[des2$variables$job_transition == 1]    0.839
## 
## Residual standard error: 0.09203 on 2107 degrees of freedom
## Multiple R-squared:  1.967e-05,  Adjusted R-squared:  -0.0004549 
## F-statistic: 0.04144 on 1 and 2107 DF,  p-value: 0.8387
## 
## 
## Response sexorientb_bisexual :
## 
## Call:
## lm(formula = sexorientb_bisexual ~ des2$variables$job.loss.age[des2$variables$job_transition == 
##     1])
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -0.04795 -0.02975 -0.02294 -0.01626  0.98966 
## 
## Coefficients:
##                                                                  Estimate
## (Intercept)                                                     -0.131377
## des2$variables$job.loss.age[des2$variables$job_transition == 1]  0.005920
##                                                                 Std. Error
## (Intercept)                                                       0.044236
## des2$variables$job.loss.age[des2$variables$job_transition == 1]   0.002002
##                                                                 t value
## (Intercept)                                                      -2.970
## des2$variables$job.loss.age[des2$variables$job_transition == 1]   2.956
##                                                                 Pr(>|t|)
## (Intercept)                                                      0.00301
## des2$variables$job.loss.age[des2$variables$job_transition == 1]  0.00315
##                                                                   
## (Intercept)                                                     **
## des2$variables$job.loss.age[des2$variables$job_transition == 1] **
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.1504 on 2107 degrees of freedom
## Multiple R-squared:  0.00413,    Adjusted R-squared:  0.003658 
## F-statistic: 8.739 on 1 and 2107 DF,  p-value: 0.00315
## 
## 
## Response sexorientc_LGB :
## 
## Call:
## lm(formula = sexorientc_LGB ~ des2$variables$job.loss.age[des2$variables$job_transition == 
##     1])
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -0.02143 -0.01972 -0.01911 -0.01813  0.98432 
## 
## Coefficients:
##                                                                  Estimate
## (Intercept)                                                      0.012146
## des2$variables$job.loss.age[des2$variables$job_transition == 1] -0.000571
##                                                                 Std. Error
## (Intercept)                                                       0.040148
## des2$variables$job.loss.age[des2$variables$job_transition == 1]   0.001817
##                                                                 t value
## (Intercept)                                                       0.303
## des2$variables$job.loss.age[des2$variables$job_transition == 1]  -0.314
##                                                                 Pr(>|t|)
## (Intercept)                                                        0.762
## des2$variables$job.loss.age[des2$variables$job_transition == 1]    0.753
## 
## Residual standard error: 0.1365 on 2107 degrees of freedom
## Multiple R-squared:  4.685e-05,  Adjusted R-squared:  -0.0004277 
## F-statistic: 0.09871 on 1 and 2107 DF,  p-value: 0.7534
## 
## 
## Response educb_highschool_grad :
## 
## Call:
## lm(formula = educb_highschool_grad ~ des2$variables$job.loss.age[des2$variables$job_transition == 
##     1])
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -0.7332 -0.6565  0.3101  0.3323  0.3723 
## 
## Coefficients:
##                                                                  Estimate
## (Intercept)                                                     -0.259099
## des2$variables$job.loss.age[des2$variables$job_transition == 1]  0.011126
##                                                                 Std. Error
## (Intercept)                                                       0.137804
## des2$variables$job.loss.age[des2$variables$job_transition == 1]   0.006238
##                                                                 t value
## (Intercept)                                                      -1.880
## des2$variables$job.loss.age[des2$variables$job_transition == 1]   1.784
##                                                                 Pr(>|t|)  
## (Intercept)                                                       0.0602 .
## des2$variables$job.loss.age[des2$variables$job_transition == 1]   0.0746 .
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.4685 on 2107 degrees of freedom
## Multiple R-squared:  0.001507,   Adjusted R-squared:  0.001034 
## F-statistic: 3.181 on 1 and 2107 DF,  p-value: 0.07464
## 
## 
## Response educc_college_bach :
## 
## Call:
## lm(formula = educc_college_bach ~ des2$variables$job.loss.age[des2$variables$job_transition == 
##     1])
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -0.2092 -0.1758 -0.1633 -0.1491  0.8709 
## 
## Coefficients:
##                                                                  Estimate
## (Intercept)                                                      0.157660
## des2$variables$job.loss.age[des2$variables$job_transition == 1] -0.006446
##                                                                 Std. Error
## (Intercept)                                                       0.110409
## des2$variables$job.loss.age[des2$variables$job_transition == 1]   0.004998
##                                                                 t value
## (Intercept)                                                       1.428
## des2$variables$job.loss.age[des2$variables$job_transition == 1]  -1.290
##                                                                 Pr(>|t|)
## (Intercept)                                                        0.153
## des2$variables$job.loss.age[des2$variables$job_transition == 1]    0.197
## 
## Residual standard error: 0.3753 on 2107 degrees of freedom
## Multiple R-squared:  0.0007889,  Adjusted R-squared:  0.0003147 
## F-statistic: 1.664 on 1 and 2107 DF,  p-value: 0.1973
## 
## 
## Response educd_college+ :
## 
## Call:
## lm(formula = `educd_college+` ~ des2$variables$job.loss.age[des2$variables$job_transition == 
##     1])
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -0.08448 -0.06766 -0.06264 -0.05482  0.96022 
## 
## Coefficients:
##                                                                  Estimate
## (Intercept)                                                      0.103726
## des2$variables$job.loss.age[des2$variables$job_transition == 1] -0.004142
##                                                                 Std. Error
## (Intercept)                                                       0.071460
## des2$variables$job.loss.age[des2$variables$job_transition == 1]   0.003235
##                                                                 t value
## (Intercept)                                                       1.452
## des2$variables$job.loss.age[des2$variables$job_transition == 1]  -1.280
##                                                                 Pr(>|t|)
## (Intercept)                                                        0.147
## des2$variables$job.loss.age[des2$variables$job_transition == 1]    0.201
## 
## Residual standard error: 0.2429 on 2107 degrees of freedom
## Multiple R-squared:  0.0007775,  Adjusted R-squared:  0.0003033 
## F-statistic:  1.64 on 1 and 2107 DF,  p-value: 0.2005
## 
## 
## Response unable_pay_utilitiesb_yes :
## 
## Call:
## lm(formula = unable_pay_utilitiesb_yes ~ des2$variables$job.loss.age[des2$variables$job_transition == 
##     1])
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -0.2395 -0.2209 -0.2062 -0.1819  0.8330 
## 
## Coefficients:
##                                                                  Estimate
## (Intercept)                                                     -0.068553
## des2$variables$job.loss.age[des2$variables$job_transition == 1]  0.002930
##                                                                 Std. Error
## (Intercept)                                                       0.120101
## des2$variables$job.loss.age[des2$variables$job_transition == 1]   0.005437
##                                                                 t value
## (Intercept)                                                      -0.571
## des2$variables$job.loss.age[des2$variables$job_transition == 1]   0.539
##                                                                 Pr(>|t|)
## (Intercept)                                                        0.568
## des2$variables$job.loss.age[des2$variables$job_transition == 1]    0.590
## 
## Residual standard error: 0.4083 on 2107 degrees of freedom
## Multiple R-squared:  0.0001378,  Adjusted R-squared:  -0.0003368 
## F-statistic: 0.2904 on 1 and 2107 DF,  p-value: 0.59
## 
## 
## Response insurance_statusW4b_yes_insurance :
## 
## Call:
## lm(formula = insurance_statusW4b_yes_insurance ~ des2$variables$job.loss.age[des2$variables$job_transition == 
##     1])
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -0.7311 -0.6576  0.2964  0.3254  0.3577 
## 
## Coefficients:
##                                                                  Estimate
## (Intercept)                                                     -0.020331
## des2$variables$job.loss.age[des2$variables$job_transition == 1]  0.001812
##                                                                 Std. Error
## (Intercept)                                                       0.136479
## des2$variables$job.loss.age[des2$variables$job_transition == 1]   0.006178
##                                                                 t value
## (Intercept)                                                      -0.149
## des2$variables$job.loss.age[des2$variables$job_transition == 1]   0.293
##                                                                 Pr(>|t|)
## (Intercept)                                                        0.882
## des2$variables$job.loss.age[des2$variables$job_transition == 1]    0.769
## 
## Residual standard error: 0.464 on 2107 degrees of freedom
## Multiple R-squared:  4.081e-05,  Adjusted R-squared:  -0.0004338 
## F-statistic: 0.086 on 1 and 2107 DF,  p-value: 0.7694
## 
## 
## Response general_healthb_poor/bad :
## 
## Call:
## lm(formula = `general_healthb_poor/bad` ~ des2$variables$job.loss.age[des2$variables$job_transition == 
##     1])
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -0.15369 -0.12821 -0.11494 -0.09932  0.91917 
## 
## Coefficients:
##                                                                  Estimate
## (Intercept)                                                      0.213729
## des2$variables$job.loss.age[des2$variables$job_transition == 1] -0.009629
##                                                                 Std. Error
## (Intercept)                                                       0.094725
## des2$variables$job.loss.age[des2$variables$job_transition == 1]   0.004288
##                                                                 t value
## (Intercept)                                                       2.256
## des2$variables$job.loss.age[des2$variables$job_transition == 1]  -2.246
##                                                                 Pr(>|t|)  
## (Intercept)                                                       0.0242 *
## des2$variables$job.loss.age[des2$variables$job_transition == 1]   0.0248 *
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.322 on 2107 degrees of freedom
## Multiple R-squared:  0.002388,   Adjusted R-squared:  0.001914 
## F-statistic: 5.043 on 1 and 2107 DF,  p-value: 0.02483
## 
## 
## Response depressionW4b_yes :
## 
## Call:
## lm(formula = depressionW4b_yes ~ des2$variables$job.loss.age[des2$variables$job_transition == 
##     1])
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -0.2111 -0.1925 -0.1856 -0.1739  0.8414 
## 
## Coefficients:
##                                                                  Estimate
## (Intercept)                                                      0.128573
## des2$variables$job.loss.age[des2$variables$job_transition == 1] -0.006133
##                                                                 Std. Error
## (Intercept)                                                       0.114995
## des2$variables$job.loss.age[des2$variables$job_transition == 1]   0.005206
##                                                                 t value
## (Intercept)                                                       1.118
## des2$variables$job.loss.age[des2$variables$job_transition == 1]  -1.178
##                                                                 Pr(>|t|)
## (Intercept)                                                        0.264
## des2$variables$job.loss.age[des2$variables$job_transition == 1]    0.239
## 
## Residual standard error: 0.3909 on 2107 degrees of freedom
## Multiple R-squared:  0.0006584,  Adjusted R-squared:  0.0001841 
## F-statistic: 1.388 on 1 and 2107 DF,  p-value: 0.2389
## 
## 
## Response alcohol_day_permonthW4b_1or2days/week :
## 
## Call:
## lm(formula = `alcohol_day_permonthW4b_1or2days/week` ~ des2$variables$job.loss.age[des2$variables$job_transition == 
##     1])
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -0.2466 -0.2329 -0.2295 -0.2243  0.7790 
## 
## Coefficients:
##                                                                  Estimate
## (Intercept)                                                      0.031494
## des2$variables$job.loss.age[des2$variables$job_transition == 1] -0.001655
##                                                                 Std. Error
## (Intercept)                                                       0.124150
## des2$variables$job.loss.age[des2$variables$job_transition == 1]   0.005620
##                                                                 t value
## (Intercept)                                                       0.254
## des2$variables$job.loss.age[des2$variables$job_transition == 1]  -0.294
##                                                                 Pr(>|t|)
## (Intercept)                                                        0.800
## des2$variables$job.loss.age[des2$variables$job_transition == 1]    0.768
## 
## Residual standard error: 0.4221 on 2107 degrees of freedom
## Multiple R-squared:  4.116e-05,  Adjusted R-squared:  -0.0004334 
## F-statistic: 0.08672 on 1 and 2107 DF,  p-value: 0.7684
## 
## 
## Response alcohol_day_permonthW4c_3to5days/week :
## 
## Call:
## lm(formula = `alcohol_day_permonthW4c_3to5days/week` ~ des2$variables$job.loss.age[des2$variables$job_transition == 
##     1])
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -0.1189 -0.1139 -0.1119 -0.1099  0.8936 
## 
## Coefficients:
##                                                                   Estimate
## (Intercept)                                                     -0.0248842
## des2$variables$job.loss.age[des2$variables$job_transition == 1]  0.0009922
##                                                                 Std. Error
## (Intercept)                                                      0.0929568
## des2$variables$job.loss.age[des2$variables$job_transition == 1]  0.0042079
##                                                                 t value
## (Intercept)                                                      -0.268
## des2$variables$job.loss.age[des2$variables$job_transition == 1]   0.236
##                                                                 Pr(>|t|)
## (Intercept)                                                        0.789
## des2$variables$job.loss.age[des2$variables$job_transition == 1]    0.814
## 
## Residual standard error: 0.316 on 2107 degrees of freedom
## Multiple R-squared:  2.639e-05,  Adjusted R-squared:  -0.0004482 
## F-statistic: 0.0556 on 1 and 2107 DF,  p-value: 0.8136
## 
## 
## Response alcohol_day_permonthW4d_daily :
## 
## Call:
## lm(formula = alcohol_day_permonthW4d_daily ~ des2$variables$job.loss.age[des2$variables$job_transition == 
##     1])
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -0.04873 -0.04342 -0.04117 -0.03828  0.96741 
## 
## Coefficients:
##                                                                  Estimate
## (Intercept)                                                     -0.028426
## des2$variables$job.loss.age[des2$variables$job_transition == 1]  0.001054
##                                                                 Std. Error
## (Intercept)                                                       0.058230
## des2$variables$job.loss.age[des2$variables$job_transition == 1]   0.002636
##                                                                 t value
## (Intercept)                                                      -0.488
## des2$variables$job.loss.age[des2$variables$job_transition == 1]   0.400
##                                                                 Pr(>|t|)
## (Intercept)                                                        0.625
## des2$variables$job.loss.age[des2$variables$job_transition == 1]    0.689
## 
## Residual standard error: 0.198 on 2107 degrees of freedom
## Multiple R-squared:  7.584e-05,  Adjusted R-squared:  -0.0003987 
## F-statistic: 0.1598 on 1 and 2107 DF,  p-value: 0.6894
## 
## 
## Response leave_jobb_health :
## 
## Call:
## lm(formula = leave_jobb_health ~ des2$variables$job.loss.age[des2$variables$job_transition == 
##     1])
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -0.04496 -0.03363 -0.02928 -0.02440  0.98007 
## 
## Coefficients:
##                                                                  Estimate
## (Intercept)                                                     -0.072432
## des2$variables$job.loss.age[des2$variables$job_transition == 1]  0.003427
##                                                                 Std. Error
## (Intercept)                                                       0.049684
## des2$variables$job.loss.age[des2$variables$job_transition == 1]   0.002249
##                                                                 t value
## (Intercept)                                                      -1.458
## des2$variables$job.loss.age[des2$variables$job_transition == 1]   1.524
##                                                                 Pr(>|t|)
## (Intercept)                                                        0.145
## des2$variables$job.loss.age[des2$variables$job_transition == 1]    0.128
## 
## Residual standard error: 0.1689 on 2107 degrees of freedom
## Multiple R-squared:  0.001101,   Adjusted R-squared:  0.0006266 
## F-statistic: 2.322 on 1 and 2107 DF,  p-value: 0.1277
## 
## 
## Response leave_jobc_other :
## 
## Call:
## lm(formula = leave_jobc_other ~ des2$variables$job.loss.age[des2$variables$job_transition == 
##     1])
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -0.06299 -0.05847 -0.05672 -0.05493  0.94709 
## 
## Coefficients:
##                                                                   Estimate
## (Intercept)                                                     -0.0246842
## des2$variables$job.loss.age[des2$variables$job_transition == 1]  0.0009373
##                                                                 Std. Error
## (Intercept)                                                      0.0681578
## des2$variables$job.loss.age[des2$variables$job_transition == 1]  0.0030853
##                                                                 t value
## (Intercept)                                                      -0.362
## des2$variables$job.loss.age[des2$variables$job_transition == 1]   0.304
##                                                                 Pr(>|t|)
## (Intercept)                                                        0.717
## des2$variables$job.loss.age[des2$variables$job_transition == 1]    0.761
## 
## Residual standard error: 0.2317 on 2107 degrees of freedom
## Multiple R-squared:  4.38e-05,   Adjusted R-squared:  -0.0004308 
## F-statistic: 0.09228 on 1 and 2107 DF,  p-value: 0.7613
## 
## 
## Response leave_jobd_skip :
## 
## Call:
## lm(formula = leave_jobd_skip ~ des2$variables$job.loss.age[des2$variables$job_transition == 
##     1])
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -0.8888  0.1343  0.1567  0.1743  0.2172 
## 
## Coefficients:
##                                                                  Estimate
## (Intercept)                                                      0.182390
## des2$variables$job.loss.age[des2$variables$job_transition == 1] -0.008485
##                                                                 Std. Error
## (Intercept)                                                       0.108554
## des2$variables$job.loss.age[des2$variables$job_transition == 1]   0.004914
##                                                                 t value
## (Intercept)                                                       1.680
## des2$variables$job.loss.age[des2$variables$job_transition == 1]  -1.727
##                                                                 Pr(>|t|)  
## (Intercept)                                                       0.0931 .
## des2$variables$job.loss.age[des2$variables$job_transition == 1]   0.0844 .
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.369 on 2107 degrees of freedom
## Multiple R-squared:  0.001413,   Adjusted R-squared:  0.0009392 
## F-statistic: 2.982 on 1 and 2107 DF,  p-value: 0.08436
## 
## 
## Response job_satisfactionb_neutral :
## 
## Call:
## lm(formula = job_satisfactionb_neutral ~ des2$variables$job.loss.age[des2$variables$job_transition == 
##     1])
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -0.2337 -0.2108 -0.2004 -0.1868  0.8213 
## 
## Coefficients:
##                                                                  Estimate
## (Intercept)                                                      0.164508
## des2$variables$job.loss.age[des2$variables$job_transition == 1] -0.006806
##                                                                 Std. Error
## (Intercept)                                                       0.118590
## des2$variables$job.loss.age[des2$variables$job_transition == 1]   0.005368
##                                                                 t value
## (Intercept)                                                       1.387
## des2$variables$job.loss.age[des2$variables$job_transition == 1]  -1.268
##                                                                 Pr(>|t|)
## (Intercept)                                                        0.166
## des2$variables$job.loss.age[des2$variables$job_transition == 1]    0.205
## 
## Residual standard error: 0.4032 on 2107 degrees of freedom
## Multiple R-squared:  0.0007622,  Adjusted R-squared:  0.0002879 
## F-statistic: 1.607 on 1 and 2107 DF,  p-value: 0.205
## 
## 
## Response job_satisfactionc_dissatisfied :
## 
## Call:
## lm(formula = job_satisfactionc_dissatisfied ~ des2$variables$job.loss.age[des2$variables$job_transition == 
##     1])
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -0.1502 -0.1290 -0.1217 -0.1129  0.8983 
## 
## Coefficients:
##                                                                  Estimate
## (Intercept)                                                     -0.103593
## des2$variables$job.loss.age[des2$variables$job_transition == 1]  0.005005
##                                                                 Std. Error
## (Intercept)                                                       0.096733
## des2$variables$job.loss.age[des2$variables$job_transition == 1]   0.004379
##                                                                 t value
## (Intercept)                                                      -1.071
## des2$variables$job.loss.age[des2$variables$job_transition == 1]   1.143
##                                                                 Pr(>|t|)
## (Intercept)                                                        0.284
## des2$variables$job.loss.age[des2$variables$job_transition == 1]    0.253
## 
## Residual standard error: 0.3289 on 2107 degrees of freedom
## Multiple R-squared:  0.0006198,  Adjusted R-squared:  0.0001455 
## F-statistic: 1.307 on 1 and 2107 DF,  p-value: 0.2531
## 
## 
## Response beaten_upW4b_yes :
## 
## Call:
## lm(formula = beaten_upW4b_yes ~ des2$variables$job.loss.age[des2$variables$job_transition == 
##     1])
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -0.1378 -0.1242 -0.1138 -0.1071  0.9072 
## 
## Coefficients:
##                                                                  Estimate
## (Intercept)                                                      0.136825
## des2$variables$job.loss.age[des2$variables$job_transition == 1] -0.005987
##                                                                 Std. Error
## (Intercept)                                                       0.094637
## des2$variables$job.loss.age[des2$variables$job_transition == 1]   0.004284
##                                                                 t value
## (Intercept)                                                       1.446
## des2$variables$job.loss.age[des2$variables$job_transition == 1]  -1.398
##                                                                 Pr(>|t|)
## (Intercept)                                                        0.148
## des2$variables$job.loss.age[des2$variables$job_transition == 1]    0.162
## 
## Residual standard error: 0.3217 on 2107 degrees of freedom
## Multiple R-squared:  0.0009262,  Adjusted R-squared:  0.000452 
## F-statistic: 1.953 on 1 and 2107 DF,  p-value: 0.1624

Grambsch and Therneau test

##                                            rho    chisq        p
## sexb_female                           -0.07999 2.97e+01 5.05e-08
## racethnicb-nhblack                    -0.01150 9.95e-01 3.18e-01
## racethnicc-hispanic                    0.00549 1.48e-01 7.00e-01
## racethnicd-asian                       0.05507 1.28e+01 3.42e-04
## racethnice-native_american             0.02766 4.38e+00 3.63e-02
## racethnicf-other                      -0.01340 9.56e-01 3.28e-01
## sexorientb_bisexual                   -0.01834 1.42e+00 2.34e-01
## sexorientc_LGB                         0.01011 4.22e-01 5.16e-01
## educb_highschool_grad                 -0.06168 2.32e+01 1.45e-06
## educc_college_bach                    -0.07794 4.45e+01 2.50e-11
## educd_college+                        -0.00112 6.66e-03 9.35e-01
## unable_pay_utilitiesb_yes              0.00919 3.75e-01 5.40e-01
## insurance_statusW4b_yes_insurance      0.03721 7.13e+00 7.57e-03
## general_healthb_poor/bad               0.01619 1.53e+00 2.17e-01
## depressionW4b_yes                     -0.00618 2.01e-01 6.54e-01
## alcohol_day_permonthW4b_1or2days/week -0.02137 2.15e+00 1.42e-01
## alcohol_day_permonthW4c_3to5days/week  0.02604 3.37e+00 6.64e-02
## alcohol_day_permonthW4d_daily         -0.00814 3.21e-01 5.71e-01
## leave_jobb_health                     -0.04079 1.06e+01 1.15e-03
## leave_jobc_other                      -0.06359 1.65e+01 4.85e-05
## leave_jobd_skip                       -0.06195 1.77e+01 2.61e-05
## job_satisfactionb_neutral             -0.07405 2.97e+01 5.03e-08
## job_satisfactionc_dissatisfied         0.03306 5.71e+00 1.68e-02
## beaten_upW4b_yes                       0.03510 6.90e+00 8.63e-03
## GLOBAL                                      NA 1.69e+02 9.33e-24

Plot of residuals

###Martingale residuals

## Warning in simpleLoess(y, x, w, span, degree = degree, parametric =
## FALSE, : pseudoinverse used at 0.99
## Warning in simpleLoess(y, x, w, span, degree = degree, parametric =
## FALSE, : neighborhood radius 2.01
## Warning in simpleLoess(y, x, w, span, degree = degree, parametric =
## FALSE, : reciprocal condition number 4.0323e-16
## Warning in simpleLoess(y, x, w, span, degree = degree, parametric =
## FALSE, : There are other near singularities as well. 4.0401
## Warning in simpleLoess(y, x, w, span, degree = degree, parametric =
## FALSE, : pseudoinverse used at 0.99
## Warning in simpleLoess(y, x, w, span, degree = degree, parametric =
## FALSE, : neighborhood radius 2.01
## Warning in simpleLoess(y, x, w, span, degree = degree, parametric =
## FALSE, : reciprocal condition number 0
## Warning in simpleLoess(y, x, w, span, degree = degree, parametric =
## FALSE, : There are other near singularities as well. 4.0401
## Warning in simpleLoess(y, x, w, span, degree = degree, parametric =
## FALSE, : pseudoinverse used at 0.99
## Warning in simpleLoess(y, x, w, span, degree = degree, parametric =
## FALSE, : neighborhood radius 2.01
## Warning in simpleLoess(y, x, w, span, degree = degree, parametric =
## FALSE, : reciprocal condition number 0
## Warning in simpleLoess(y, x, w, span, degree = degree, parametric =
## FALSE, : There are other near singularities as well. 4.0401
## Warning in simpleLoess(y, x, w, span, degree = degree, parametric =
## FALSE, : pseudoinverse used at 0.99
## Warning in simpleLoess(y, x, w, span, degree = degree, parametric =
## FALSE, : neighborhood radius 2.01
## Warning in simpleLoess(y, x, w, span, degree = degree, parametric =
## FALSE, : reciprocal condition number 0
## Warning in simpleLoess(y, x, w, span, degree = degree, parametric =
## FALSE, : There are other near singularities as well. 4.0401
## Warning in simpleLoess(y, x, w, span, degree = degree, parametric =
## FALSE, : pseudoinverse used at 0.99
## Warning in simpleLoess(y, x, w, span, degree = degree, parametric =
## FALSE, : neighborhood radius 2.01
## Warning in simpleLoess(y, x, w, span, degree = degree, parametric =
## FALSE, : reciprocal condition number 4.0323e-16
## Warning in simpleLoess(y, x, w, span, degree = degree, parametric =
## FALSE, : There are other near singularities as well. 4.0401

###Stratification by sexual orientation

## Stratified 1 - level Cluster Sampling design (with replacement)
## With (130) clusters.
## svydesign(ids = ~psuscid, strata = ~region, weights = ~GSWGT4, 
##     data = addhealth, nest = T)
## Call:
## svycoxph(formula = Surv(time = job.loss.age, event = job_transition) ~ 
##     strata(sexorient) + sex + racethnic + educ + unable_pay_utilities + 
##         insurance_statusW4 + general_health + depressionW4 + 
##         alcohol_day_permonthW4 + leave_job + job_satisfaction + 
##         beaten_upW4, design = des2)
## 
##   n= 7101, number of events= 2109 
## 
##                                            coef exp(coef)  se(coef)      z
## sexb_female                           -0.335703  0.714836  0.060583 -5.541
## racethnicb-nhblack                     0.253031  1.287923  0.087930  2.878
## racethnicc-hispanic                   -0.001235  0.998766  0.120151 -0.010
## racethnicd-asian                      -0.279472  0.756183  0.143855 -1.943
## racethnice-native_american             0.392777  1.481088  0.332964  1.180
## racethnicf-other                       0.356074  1.427714  0.332230  1.072
## educb_highschool_grad                 -0.135344  0.873416  0.101981 -1.327
## educc_college_bach                    -0.603440  0.546927  0.147813 -4.082
## educd_college+                        -1.166681  0.311399  0.157663 -7.400
## unable_pay_utilitiesb_yes              0.321484  1.379173  0.068445  4.697
## insurance_statusW4b_yes_insurance     -0.426206  0.652982  0.062538 -6.815
## general_healthb_poor/bad               0.149968  1.161797  0.097086  1.545
## depressionW4b_yes                      0.175581  1.191939  0.082208  2.136
## alcohol_day_permonthW4b_1or2days/week -0.004832  0.995179  0.072246 -0.067
## alcohol_day_permonthW4c_3to5days/week -0.005481  0.994534  0.094793 -0.058
## alcohol_day_permonthW4d_daily          0.235276  1.265258  0.136874  1.719
## leave_jobb_health                     -1.179429  0.307454  0.218010 -5.410
## leave_jobc_other                      -0.929322  0.394821  0.136137 -6.826
## leave_jobd_skip                       -0.805227  0.446986  0.103213 -7.802
## job_satisfactionb_neutral              0.112813  1.119422  0.080290  1.405
## job_satisfactionc_dissatisfied         0.200945  1.222557  0.094657  2.123
## beaten_upW4b_yes                       0.018515  1.018687  0.099776  0.186
##                                       Pr(>|z|)    
## sexb_female                           3.00e-08 ***
## racethnicb-nhblack                     0.00401 ** 
## racethnicc-hispanic                    0.99180    
## racethnicd-asian                       0.05205 .  
## racethnice-native_american             0.23814    
## racethnicf-other                       0.28382    
## educb_highschool_grad                  0.18446    
## educc_college_bach                    4.46e-05 ***
## educd_college+                        1.36e-13 ***
## unable_pay_utilitiesb_yes             2.64e-06 ***
## insurance_statusW4b_yes_insurance     9.41e-12 ***
## general_healthb_poor/bad               0.12242    
## depressionW4b_yes                      0.03269 *  
## alcohol_day_permonthW4b_1or2days/week  0.94667    
## alcohol_day_permonthW4c_3to5days/week  0.95389    
## alcohol_day_permonthW4d_daily          0.08563 .  
## leave_jobb_health                     6.30e-08 ***
## leave_jobc_other                      8.71e-12 ***
## leave_jobd_skip                       6.11e-15 ***
## job_satisfactionb_neutral              0.16000    
## job_satisfactionc_dissatisfied         0.03376 *  
## beaten_upW4b_yes                       0.85279    
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##                                       exp(coef) exp(-coef) lower .95
## sexb_female                              0.7148     1.3989    0.6348
## racethnicb-nhblack                       1.2879     0.7764    1.0840
## racethnicc-hispanic                      0.9988     1.0012    0.7892
## racethnicd-asian                         0.7562     1.3224    0.5704
## racethnice-native_american               1.4811     0.6752    0.7712
## racethnicf-other                         1.4277     0.7004    0.7445
## educb_highschool_grad                    0.8734     1.1449    0.7152
## educc_college_bach                       0.5469     1.8284    0.4094
## educd_college+                           0.3114     3.2113    0.2286
## unable_pay_utilitiesb_yes                1.3792     0.7251    1.2060
## insurance_statusW4b_yes_insurance        0.6530     1.5314    0.5777
## general_healthb_poor/bad                 1.1618     0.8607    0.9605
## depressionW4b_yes                        1.1919     0.8390    1.0146
## alcohol_day_permonthW4b_1or2days/week    0.9952     1.0048    0.8638
## alcohol_day_permonthW4c_3to5days/week    0.9945     1.0055    0.8259
## alcohol_day_permonthW4d_daily            1.2653     0.7904    0.9675
## leave_jobb_health                        0.3075     3.2525    0.2005
## leave_jobc_other                         0.3948     2.5328    0.3024
## leave_jobd_skip                          0.4470     2.2372    0.3651
## job_satisfactionb_neutral                1.1194     0.8933    0.9564
## job_satisfactionc_dissatisfied           1.2226     0.8180    1.0155
## beaten_upW4b_yes                         1.0187     0.9817    0.8377
##                                       upper .95
## sexb_female                              0.8050
## racethnicb-nhblack                       1.5302
## racethnicc-hispanic                      1.2640
## racethnicd-asian                         1.0025
## racethnice-native_american               2.8445
## racethnicf-other                         2.7380
## educb_highschool_grad                    1.0667
## educc_college_bach                       0.7307
## educd_college+                           0.4242
## unable_pay_utilitiesb_yes                1.5772
## insurance_statusW4b_yes_insurance        0.7381
## general_healthb_poor/bad                 1.4053
## depressionW4b_yes                        1.4003
## alcohol_day_permonthW4b_1or2days/week    1.1466
## alcohol_day_permonthW4c_3to5days/week    1.1976
## alcohol_day_permonthW4d_daily            1.6546
## leave_jobb_health                        0.4714
## leave_jobc_other                         0.5156
## leave_jobd_skip                          0.5472
## job_satisfactionb_neutral                1.3102
## job_satisfactionc_dissatisfied           1.4718
## beaten_upW4b_yes                         1.2387
## 
## Concordance= 0.672  (se = 0.008 )
## Likelihood ratio test= NA  on 22 df,   p=NA
## Wald test            = 550.3  on 22 df,   p=<2e-16
## Score (logrank) test = NA  on 22 df,   p=NA

Part C

Write Up: (10 points, 1-3 pages on how you set up the analysis, and interpreted the results of your analysis). This should follow the format of a journal aritlce’s methods, data and results sections.

a. Descriptive write up consisting of:

i. Tables of discriptive statistics (please see above)

ii. Graphs of the necessary funtions (please see above)

iii. Results of statistical tests (please see above)

iv. Interpretation of the results

For this analysis the National Longitudinal Study of Adolescent to Adult Health (ADD Health) was used to determine if LGB individuals experience a higher rate of job loss due to social stigma then heterosexual individuals. ADD Health is a nationally representative longitudinal study of adolescents in the United States who are between 7 and 12 years old. The survey was conducted in 1994 with follow up surveys in 1996, 2008, and 2016. A Cox Proportional Hazards Model was utilized to analyze the data.
The results from the analysis shows that females are at a lower risk then males for losing a job.
Non-Hispanic blacks are at a higher risk of losing a job than non-Hispanic whites.
People with a bachelor’s degree and higher (Masters, PhD) are at a lower risk of losing a job than people with less then an high school education
People who are at a higher risk of not being able to pay utility bills then those who can pay utility bills
People who have health insurance are at a lower risk of losing a job then those who do not have insurance
People who are depressed are at a higher risk of losing a job then people who are not depressed.
People who leave a job for health reasons are at a lower risk of losing a job then people who are fired from a job.
People who are dissatisfied with a job are at a higher risk of losing a job then people who are satisfied with a job.
From this analysis it would appear that LGB individuals do not experience a higher rate of job loss due to social stigma then heterosexual individuals.