Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in xtfrm.data.frame(x) : cannot xtfrm data frames when using ggadjustedcurves #628

Open
hhchang0210 opened this issue Jun 18, 2023 · 0 comments

Comments

@hhchang0210
Copy link

Steps to reproduce the problem

I have a dataset. The independent variable, statin, is a factor variable.
str(t1$statin)
Factor w/ 2 levels "1","2": 2 1 1 1 2 1 2 1 1 1

fit2 <- coxph( Surv(death_365days_duration,death_365days) ~ statin, data = t1 )
ggadjustedcurves(fit2, data = t1, method = "average", variable = "statin")

->Error in xtfrm.data.frame(x) : cannot xtfrm data frames

Or

fit2 <- coxph( Surv(death_365days_duration,death_365days) ~ strata(statin), data = t1 )
ggadjustedcurves(fit2, data = t1, method = "average", variable = "statin")

->Error in xtfrm.data.frame(x) : cannot xtfrm data frames

Could someone help me how to fix it?
Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant