简体   繁体   中英

Coxph, invalid 'envir' argument of type 'character'

I'm using the Survival package to do a cox regression (coxph) and I can't work out what I'm doing wrong.

My code is

prentice.fit <- coxph(Surv(age_ent, outage, diabetes) ~ a_menopause + cluster(id), data="mydata.cc", ties="breslow")
summary(prentice.fit)

But I keep getting an error: Error in eval(predvars, data, env) : invalid 'envir' argument of type 'character'

I have checked the class of all my variables. age_ent and outage are numeric and a_menopause and diabetes are integers.

Would greatly appreciate any help with this!

Thanks!

Value passed to data argument should not be quoted. You are referring to a variable in your environment, not a string.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM