You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi!
I'm trying to make a series of designs with cbc_design to pick ones with small DB-error.
But when keep_db_error = TRUE, the function returns the error as below:
Error in `[.data.frame`(as.data.frame(design), , c(metaNames, varNames)) :
undefined columns selected
Does anyone know how to deal with this?
set.seed(123)
prof_3233 <- cbc_profiles(
A = c("A1", "A2", "A3"),
B = c("B1", "B2"),
C = c("C1", "C2", "C3"),
D = c(3000, 3500, 4000)
)
cea_des <- cbc_design(
profiles = prof_3233,
n_resp = 100,
n_alts = 2,
n_q = 10,
method = "CEA",
priors = list(A = c(0, 0), B = 0, C = c(0, 0), D = 0),
parallel = TRUE,
keep_db_error = TRUE
)
Thanks in advance!
The text was updated successfully, but these errors were encountered:
I think I know why this is happening, but the line that may raise that error seems to be left out of the script here. I think you may be trying to read/print the DB-error without identifying the proper location to look for the value. To access the DB-error value, try the following: DBerr <- as.numeric(cea_des$db_err)
This will store the error value in DBerr which you can then print, round, etc. For simplicity, I would also recommend rounding the error: RoundedDBerror <- round(Dberr, 2)
I'm using version 0.4.0 of cbcTools, which at the time I designed my DCE was the most recent version. If you are using a different version, your results may vary. That said, when I ran the script you provided here, no errors were raised and everything worked as expected.
I'm using ver. 0.5.2 . The returned object from cbc_design is a data.frame, not a list, regardless of the value for keep_db_error.
I tried running the same code as above with v 0.4.0, as you said, it worked.
In addition, the object is indeed a list.
Although I've not scrutinized the source code here,
it seems the lines 871-873 don't function.
Hi!
I'm trying to make a series of designs with
cbc_design
to pick ones with small DB-error.But when
keep_db_error = TRUE
, the function returns the error as below:Does anyone know how to deal with this?
Thanks in advance!
The text was updated successfully, but these errors were encountered: