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
nhis <-read_stata("C:/Users/maman/OneDrive - University of Texas at San Antonio/Event History Analysis Data/nhis_00002.dta.gz")nhis <- haven::zap_labels(nhis)nhis <- nhis %>%filter(mortelig ==1)#Creating covariatesnhis$sex1 <-Recode(nhis$sex,recodes="1='male'; 2='female'; else=NA")nhis$cit <-Recode(nhis$citizen,recodes="1='no'; 2='yes'; else=NA")nhis$obese <-Recode(nhis$bmicat,recodes="1:3='no'; 4='yes'; else=NA")nhis$education <-Recode(nhis$educrec2,recodes="10:41='less than hs'; 42='hs grad'; 50:53= 'some college'; 54='college degree'; 60='more than college'; else=NA")nhis$pov <-Recode(nhis$pooryn,recodes="1='at or above'; 2='below'; else=NA")nhis$smokstat <-Recode(nhis$smokfreqnow,recodes="1='non-smoker'; 2='current smoker'; 3='evry day smoker'; else=NA")nhis$marstat1 <-Recode(nhis$marstat,recodes="10:13='married'; 20='widowed'; 30='divorced'; 40='separated'; 50='never married'; else=NA")nhis$white <-Recode(nhis$racenew,recodes="100=1; 997:999=NA; else=0")nhis$black <-Recode(nhis$racenew,recodes="200=1; 997:999=NA; else=0")nhis$othr <-Recode(nhis$racenew,recodes="300:542=1; 997:999=NA; else=0")nhis$hisp <-Recode(nhis$hispeth,recodes="10=0; 20:70=1; else=NA")nhis$hisp1 <-Recode(nhis$hispeth,recodes="10='no'; 20:70='yes'; else=NA")nhis$race_eth[nhis$hisp ==0& nhis$white==1]<-"NHWhite"
Warning: Unknown or uninitialised column: `race_eth`.
Define your outcome as in HW 1. Also consider what covariates are hypothesized to affect the outcome variable. Define these and construct a parametric model for your outcome.
The outcome of interest is mortality risk associated with obesity by race/ethnicity with a specific focus on the Latino population.
There are a few independent variables of interest. 1) Obesity status is the main consideration since this state is associated with poorer health outcomes. 2) Race/Ethnicity will be used to examine differences in mortality risk by subgroup. 3) Length of stay or number of years spent in the U.S will be used to compare the mortality risk between Latinos that have spent less time in the U.S. versus those who have lived in the U.S. for an extended period of time.
Relevant covariates:
Age
Sex
Education
Marital Status
Poverty
Self reported health
Health behaviors (smoking and alcohol consumption)
After fitting the Cox model, the results show that there were 1,469 events (deaths) total. Compared to those who are not obese, those that are had a 24% increased risk of experiencing the event.
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
Call:
svycoxph(formula = Surv(death_age, d.event) ~ obese, design = des)
n= 31306, number of events= 1469
coef exp(coef) se(coef) robust se z Pr(>|z|)
obeseyes 0.21551 1.24049 0.06465 0.07436 2.898 0.00375 **
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
exp(coef) exp(-coef) lower .95 upper .95
obeseyes 1.24 0.8061 1.072 1.435
Concordance= 0.53 (se = 0.013 )
Likelihood ratio test= NA on 1 df, p=NA
Wald test = 8.4 on 1 df, p=0.004
Score (logrank) test = NA on 1 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).
Hazard model with additional covariates
In addition to obesity status, this Cox model included race/ethnicity, sex, and educational attainment. The effect of obesity remained significant and the amount of increased risk remained about the same at 20%. Compared to Hispanics, non-Hispanic Blacks experience a 77% increased risk of experiencing the event, whereas for non-Hispanic Whites the risk is similar to Hispanics. The risk for college graduates and those with education past college is about the same. Compared to college graduates, those with lower levels of educational attainment have a greater risk of experiencing the event.
To test the proportionality assumption of the model Schoenfeld residuals will be extracted and tested. The formal test from Grambsch and Therneau suggest that the proportionality assumption is met.