georgheinze / coxphf

2 stars 0 forks source link

Formula argument #18

Open JoanneF1229 opened 10 months ago

JoanneF1229 commented 10 months ago

Hi, I'm using the function to perform univariate analysis. I got two very different beta estimations based on two different ways of specifying the covariate of the data.

In my example, my data=dats and the covariate of interest=age_dx_cat

First way, the covariate was specified using Surv()~dats[["age_dx_cat"]], data=dats, maxit=100. The result showed the significant association comparing age_dx_cat 15+ vs the reference group (see picture below) One

In the second way, the covariate was specified using a standard approach, Surv()~age_dx_cat,data=dats,maxit=100. The result showed completely different beta estimation and insignificant association. two

I have tried the two specifications of covariate using coxph() and the results were identical. coxph

Sincerely, Joanne