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.
Fit the parametric model of your choosing to the data.
Did you choose an AFT or PH model and why?
Proportional Hazards Model (PH) because I want to see if the effect of the covariates increase or decrease the hazard by a proportionate amount of time.
Covariate Mean Coef Rel.Risk S.E. LR p
us 0.1786
nous 0.044 0 1 (reference)
yesus 0.956 0.126 1.134 0.095
home 0.2411
own 0.784 0 1 (reference)
rent 0.216 0.052 1.054 0.044
Events 2994
Total time at risk 100560
Max. log. likelihood -12763
LR test statistic 2.74
Degrees of freedom 2
Overall p-value 0.253488
Include all main effects in the model
plot(fit.wei)
Test for an interaction between at least two of the predictors
Results: In both the weibull and survdiff fits, the p. value is over .05 indicating there is no significant interactions between home ownership, citizenship status and mortality. There are no interactions between the predictor variables (home ownershp and citizenship) and the outcome (mortality)
Provide tabular and graphical output to support your conclusions
Covariate Mean Coef Rel.Risk S.E. LR p
us 0.1180
nous 0.044 0 1 (reference)
yesus 0.956 0.146 1.157 0.095
home 0.1516
own 0.784 0 1 (reference)
rent 0.216 0.064 1.066 0.044
Events 2994
Total time at risk 100530
Max. log. likelihood -13513
LR test statistic 3.87
Degrees of freedom 2
Overall p-value 0.144361