# Which one of these two packages to use (coxph vs svycoxph)for cox proportional hazard model using NHANES database?

This is the problem that I am running into. To choose the best way of doing cox proportion.

There are two functions available in R - one is coxph and the other is svycoxph which is for survey objects. I am more inclined to using the svycoxph as we are able to specify weights, id, and cluster information of the nhanes survey.

With this I tried to make models for cancer mortality (mortstat_logical == 2 is cancer here) for bicarbonate levels. I adjusted for demographic parameters. I checked for violation of cox proportional hazard assumption and found that it is not being violated (using function cox.zph).

*Here I am using bicarbonate as a continuous variable because I wasnt getting much signal when I had split them into categories. To ensure that I am in the right direction, I modelled using the continuous variable which should ideal give the right direction and a p value <0.05 (based on earlier publications).

When I made this model using coxph I found that higher bicarbonate levels lead to lesser mortality by cancer (p = 0.006) as suggested by previous publications as well. But coxph was done without strata, id and weights. So I tried the svycoxph. But I found that here bicarbonate was no longer significant.

coxph(Surv(time_after_exm, mortstat_logical==2)~bicarbonate+age+sex+race+poor+insurance+education, data = nhanes_data_noNA) Image

svycoxph(Surv(time_after_exm, mortstat_logical==2)~bicarbonate+age+sex+race+poor+insurance+education, data = nhanes_data_noNA, design = nhanes_svydesign)

I

Dealing with NHANES, you shall use svycoxph to account of psu strata and weights, with the subset option to refer to the dataset without NA. If you don't, you have biased results as the not weighted population is oversampling different subpopulations. I'd say that passing a filtered data frame as data in the svycoxph is also origin of bias, but I am not 100% sure about how this is implemented in the source code. Would use the most safe subset option as given by the examples of svycoxph.