Loading required package: carData
Attaching package: 'car'
The following object is masked from 'package:dplyr':
recode
The following object is masked from 'package:purrr':
some
library(survey)
Loading required package: grid
Loading required package: Matrix
Attaching package: 'Matrix'
The following objects are masked from 'package:tidyr':
expand, pack, unpack
Attaching package: 'survey'
The following object is masked from 'package:graphics':
dotchart
Use of data from IPUMS NHIS is subject to conditions including that users
should cite the data appropriately. Use command `ipums_conditions()` for more
details.
Call:
svycoxph(formula = Surv(time = death_time, event = aev) ~ edu +
aev, design = des2)
n= 46046, number of events= 5727
coef exp(coef) se(coef) robust se z
edufive+ yrs of college -1.957e-02 9.806e-01 5.572e-02 7.847e-02 -0.249
edulths 1.013e-01 1.107e+00 3.669e-02 5.417e-02 1.871
edusomecollege 5.411e-02 1.056e+00 3.979e-02 5.599e-02 0.966
aev 2.140e+01 1.970e+09 1.512e+02 7.625e+05 0.000
Pr(>|z|)
edufive+ yrs of college 0.8031
edulths 0.0614 .
edusomecollege 0.3339
aev 1.0000
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
exp(coef) exp(-coef) lower .95 upper .95
edufive+ yrs of college 9.806e-01 1.020e+00 0.8408 1.144
edulths 1.107e+00 9.036e-01 0.9952 1.231
edusomecollege 1.056e+00 9.473e-01 0.9459 1.178
aev 1.970e+09 5.076e-10 0.0000 Inf
Concordance= 0.949 (se = 0.001 )
Likelihood ratio test= NA on 4 df, p=NA
Wald test = 6 on 4 df, p=0.2
Score (logrank) test = NA on 4 df, p=NA
(Note: the likelihood ratio and score tests assume independence of
observations within a cluster, the Wald and robust score tests do not).
Individuals with a less than high school education are more likely to experience the hazard compared to individuals with five years or more of college.
Evaluate the assumptions of the Cox model, including proportionality of hazards of covariates, and if you use a continuous variable, evaluate linearity of the effect using Martingale residuals
slope coef se(coef) z p
Intercept -1.35e-01 -3.54e-05 1.47e-06 -24.000 1.23e-127
edufive+ yrs of college 1.15e-03 4.71e-07 6.87e-07 0.686 4.93e-01
edulths 1.27e-02 1.87e-06 4.47e-07 4.170 3.04e-05
edusomecollege -9.36e-04 8.47e-08 4.88e-07 0.173 8.62e-01
aev 7.70e-03 1.21e-06 4.29e-07 2.820 4.85e-03
strata 3.89e-05 8.59e-09 2.58e-10 33.300 1.12e-242
Chisq=1165.72 on 5 df, p=<2e-16; test weights=aalen
library(ggfortify)autoplot(fita)
Warning: `gather_()` was deprecated in tidyr 1.2.0.
Please use `gather()` instead.
Plots show less than high school education to increase in hazard (ever been told they had asthma). some to higher education seems to decrease the hazard.