kkholst / mets

Analysis of Multivariate Event Times https://kkholst.github.io/mets/
15 stars 3 forks source link

Error in mlogit #8

Closed wt-tw-bio closed 4 months ago

wt-tw-bio commented 4 months ago

Hi,

I encountered an error while following the "Mediation Analysis for survival data" tutorial, specifically in the Multinomial regression section. Here are the steps and the error details: data(tTRACE) dcut(tTRACE) <- ~. weightmodel <- fit <- mlogit(wmicat.4 ~ agecat.4 + vf + chf, data = tTRACE, family = binomial) Error in cluster.default(id) : only implemented for resamples objects To further diagnose the issue, I tried running the example code from the mlogit help documentation, but encountered the same error: data(bmt) dfactor(bmt) <- cause1f ~ cause drelevel(bmt, ref = 3) <- cause3f ~ cause dlevels(bmt) mreg <- mlogit(cause1f ~ tcell + platelet, bmt) Error in cluster.default(id) : only implemented for resamples objects Could you please help me understand where the issue might be?

wt-tw-bio commented 4 months ago

The problem is solved. Caret::cluster conflicts with survival::cluster.