Closed shigono closed 11 months ago
Hi Shigeru, thanks for noticing this. I've had issues with this in the past and thought I had them all resolved, but apparently not. I'll look into it. The issue is indeed in the joining. It should be preserving the row order when joining.
Okay I've patched this. I actually previously had a more manual check to ensure the row ordering would be preserved during the join, but then removed it because I thought setting sort = FALSE
in merge
would prevent it from changing the row ordering. I guess I was wrong! Best to just keep the manual check in there.
Try installing this version:
remotes::install_github("jhelvy/cbcTools")
Does that fix the issue?
Thank you for your quick response. I found the issue is fixed.
Please let me say thank you for making a nice package. I wrote an introduction to the package (sorry it is in Japanese ...) https://elsur.jpn.org/202308ConjointDoE/doe_for_dcm.html
Wow what a great post! This package is still relatively new and hasn't had too many users to test it, so thanks for taking the time to work through the different design methods. Using Google translate I could mostly understand your post, and it looks like you found some other bugs too.
As you can see from the code, the cbc_design()
function relies on many other packages for generating designs. My goal was not to re-create everyone else's work but instead make it easier to use them. The rest of the package provides a workflow to further evaluate designs by simulating choice data and examining statistical power to obtain an estimated sample size requirement, so the cbc_design()
part is only one piece of the puzzle.
I'm not 100% sure if the translation to English was correct, but here are some things that I think you pointed out - please let me know if I have them correct:
full
and orthogonal
methods, cbc_design()
returns missing experimental designs when the number of possible profiles is less than the number of trials. I agree with you - that should generate an error, and the user should be informed. Would you mind posting that specific issue as a separate issue? That will make fixing it easier to track.random
, I could very easily add a randomize = TRUE
argument that simply shuffles the order of the questions across all respondents. You could always set it to FALSE
, but it seems like a good idea to randomize the question order. random
method looks pretty bad...I think I could quite easily adjust the algorithm to swap out profiles to void full overlap of any one attribute within any one choice set. That's an easy fix and still maintains a randomized design. This could also be an argument to the function, e.g. avoid_full_overlap = TRUE
.orthogonal
method is important. I have had a difficult time with this method as it seems it's virtually impossible to obtain a truly "orthogonal" design. I don't know if anything else can be done to improve it though. In reality, no design will be truly orthogonal anyway as not every respondent is perfect. As soon as you have to drop poor respondents from your experiment, the resulting data will no longer be orthogonal. I'm very honored that you read my poor writing. Taking advantage of your kindness, I'll post three new issues (NA in full/orthogonal design, randomizing, minimizing overlap).
Yes I believe one of great values of your package is that it helps our workflow from making a design to evaluating it. I'd like to add some demonstration using cbc_choice() and cbc_power() to my post, after studying your JSS article on logitr.
Thank you for your comment on orthogonal method, which helps me much. Some researhers recommend traditional DoE approach based on orthogonal arrays, but I think, as you said, it is not necessary useful for current practice of CBC.
Hello, I think I found cbc_design() generates designs which contain errors. Please see the demo code below.
The output is:
profiles of altID = 2 and 3 are duplicated.
I guess this behavior comes from join_profiles() in design.R. At line 332 , it merges design with profiles. It doen't retain the row order of design.
just to be sure, my sessionInfo() is:
Thank you, Shigeru ONO