ACCLAB / dabestr

Data Analysis with Bootstrap Estimation in R
https://acclab.github.io/dabestr
Apache License 2.0
214 stars 34 forks source link

Effectsize measurement with unbalaced data #166

Open Merlin31415 opened 9 months ago

Merlin31415 commented 9 months ago

Hello,

I tried to run a script i have written last year and found that i am no longer able to calculate effectsize with dabestR with unbalanced data. I used to be able to get results regardless of the sampe size in each group.

Here an example with the data provided from dabest but removing one data point.

data(non_proportional_data)
test <- non_proportional_data
test <- test %>%
  slice(-5)

dabest_obj <- load(test,
                   x = Group, y = Measurement,
                   idx = c("Control 1", "Test 1")
)
dabest_obj.mean_diff <- mean_diff(dabest_obj)

This leads to Error in PermutationTest(ctrl_measurement, test_measurement, effect_size = effect_size_type, : The two arrays do not have the same length.

Is it possible that that this is no longer supported or am I missing something?

Best, Merlin

sunroofgod commented 8 months ago

Hi @Merlin31415, sorry for the late reply!

This issue has been addressed previously and resolved in the latest version that is available on the development branch.

You may update your version of dabestr to the development version via:

devtools::install_github(repo = "ACCLAB/dabestr", ref = "dev")

You may also see the issue thread regarding the same issue here: https://github.com/ACCLAB/dabestr/issues/154.

Hope this helps :)

Jacobluke- commented 4 months ago

Issue closed with no response for a long time

mz555 commented 3 months ago

This issue persists. If i try the mean_diff() or the cliff_delta() I get an error:

Error in `vec_slice()`:
! Can't subset elements past the end.
ℹ Locations 38 and 38 don't exist.
ℹ There are only 37 elements.
Lucas1213WZY commented 3 months ago

Hi @mz555 ,

May I ask which version of dabestr you are using? If you are using version 2023.9.12, the issue might persist. We have addressed this problem in the latest version which is on our development branch.

If this is the case, please update your version of dabestr to the development version by running:

devtools::install_github(repo = "ACCLAB/dabestr", ref = "dev")

After updating, reload the library with:

library(dabestr)

and rerun your code.

If you are already using the development version and still encountering issues, could you provide us with your code snippet, the dataset, or a more detailed error message if one exists after running your code? This will help us reproduce the error and determine which part is causing the problem.

Thank you!

Jacobluke- commented 3 months ago

Hi @mz555 ,

We've checked that this error has been resolved in the dev branch.

According to your description, it's vec_slice() function that is generating errors, and it's closely related to slice() method in dplyr from this part of the code:

test <- test %>%
  slice(-5)

Can you try updating both dplyr and it's dependencies to see if such problem persists?

mz555 commented 3 months ago

Hello,

Yes, the plot now works! Another small bug, on the website the cliffs delta for the "anova" doesn't work and crashes the site. I @ your team on twitter about it as I didn't know if the same team handles that side.

Again, thank you for the quick fix!

Best, Mircea

On Aug 5, 2024 08:07, Lucas Wang Zhuoyu @.***> wrote:

⚠ Caution: External sender

Hi @mz555https://github.com/mz555 ,

May I ask which version of dabestr you are using? If you are using version 2023.9.12, the issue might persist. We have addressed this problem in the latest version which is on our development branch.

If this is the case, please update your version of dabestr to the development version by running:

devtools::install_github(repo = "ACCLAB/dabestr", ref = "dev")

After updating, reload the library with:

library(dabestr)

and rerun your code.

If you are already using the development version and still encountering issues, could you provide us with your code snippet, the dataset, or a more detailed error message if one exists after running your code? This will help us reproduce the error and determine which part is causing the problem.

Thank you!

— Reply to this email directly, view it on GitHubhttps://github.com/ACCLAB/dabestr/issues/166#issuecomment-2268329297, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AGCZQIOVA4KUL4U3VIVABQ3ZP4QBJAVCNFSM6AAAAABDPSJWPSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENRYGMZDSMRZG4. You are receiving this because you were mentioned.Message ID: @.***>

Lucas1213WZY commented 3 months ago

Hi @mz555 Mircea,

Thank you for the feedback! May I know how the website crash occurred or a more detailed explanation of how the data looks like and what the experimental design is? For example, when using the cliffs delta's anova functionality, was it 2x2 or some other experimental design, as of now we can only carry out 2x2 experimental designs (2x3 or more complex designs are not supported).

mz555 commented 3 months ago

Hi,

I just ran the default dataset on the website for the multiple two-groups, and when you click cliff delta it tries to compute then gives an error.

The error just says "oops, something went wrong". I tried it now to check again. Same issue.

This works in the package btw. It's just the website that throws this error.

On Aug 10, 2024 14:16, Lucas Wang Zhuoyu @.***> wrote:

⚠ Caution: External sender

Hi @mz555https://github.com/mz555 Mircea,

Thank you for the feedback! May I know how the website crash occurred or a more detailed situation? For example, when using the cliffs delta's anova functionality, was it 2x2 or some other experimental design, as of now we can only carry out 2x2 experimental designs (2x3 or more complex designs are not supported).

— Reply to this email directly, view it on GitHubhttps://github.com/ACCLAB/dabestr/issues/166#issuecomment-2281708989, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AGCZQIKT5U5YIJDTDF3TM7DZQYHD7AVCNFSM6AAAAABDPSJWPSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEOBRG4YDQOJYHE. You are receiving this because you were mentioned.Message ID: @.***>

Lucas1213WZY commented 3 months ago

Hi @mz555 Mircea,

Thank you for providing us with the details regarding the issue on the website, I'll report to my team and my colleague in charge of the web application. I hope this issue can be resolved as soon as possible.

Best, Lucas