M. Samir
M. Samir

Reputation: 11

Error message when running the "OptimalCutpoints"

I have a dataset with 20 patients, one measured variable (miR-21), a condition (condition) with 0 representing healthy and 1 representing diseased. I do not have any covariate. The data looks like attachedDatabase. run this code to get the optimal cutpoint for the "miR-21", which is a diagnostic maker for the condition that I am testing:

optimal.cutpoint.Youden<-optimal.cutpoints(X = "miR-21", status = "Condition", tag.healthy = 0, methods = "Youden", data = ATB_Copy, pop.prev = NULL, categorical.cov = NULL, control = control.cutpoints(generalized.Youden = FALSE), ci.fit = TRUE, conf.level = 0.95, trace = FALSE)

I keep getting the Error: Can't subset columns that don't exist. x Locations 4, 5, 2, 3, 9, etc. don't exist. i There are only 1 column.

Any help ?

Upvotes: 1

Views: 178

Answers (1)

ale_ish
ale_ish

Reputation: 159

Not sure why, but I had to convert data (in your example ATB_copy) into data.frame and it worked, even though it was already a data frame.

is.data.frame(ATB_Copy)
[1] TRUE

ATB_copy_df <- as.data.frame(ATB_Copy)

Once I did this, it worked.

Upvotes: 0

Related Questions