easystats / effectsize

:dragon: Compute and work with indices of effect size and standardized parameters
https://easystats.github.io/effectsize/
Other
337 stars 23 forks source link

Follow-up on `Error: cannot use 'paired = TRUE' in formula method` #646

Closed rempsyc closed 3 months ago

rempsyc commented 3 months ago

Follow-up to #610 and #615 regarding the Error: cannot use 'paired = TRUE' in formula method:

This is expected, and is consistent with the upcoming changes in R>=4.4.0

A user pointed out that from 0.8.6, effectize will throw this error even on R < 4.4.0.

Would it make sense for effectsize to conditionally support the paired = TRUE argument based on R version since effectsize officially supports R ≥ 3.6 and not ≥ 4.4.0?


R.Version()$version.string
#> [1] "R version 4.3.1 (2023-06-16 ucrt)"
packageVersion("effectsize")
#> [1] '0.8.8'

effectsize::cohens_d(len ~ supp, data = ToothGrowth, paired = TRUE)
#> Error: cannot use 'paired = TRUE' in formula method.

Created on 2024-06-18 with reprex v2.1.0

mattansb commented 3 months ago

No, I don't think so. The new error in R addressed a years old flagged issue - the formula interface does not contain any information about the actual pairing of the data, and only worked properly if the paired order was present in the data. I agree that not allowing this behavior is in the best interest of the users, and isn't just a comparability issue with R.

Note that rm_d(len ~ sup | id, method = "z") will always work properly and can and should be used instead of the previous behavior (won't work in this specific case, because that data set isn't actually paired).

strengejacke commented 3 months ago

rempsyc commented 3 hours ago

R.Version()$version.string

> [1] "R version 4.3.1 (2023-06-16 ucrt)"

👀

time to update your R version!

rempsyc commented 3 months ago

The new error in R addressed a years old flagged issue

Good points and great answer, thank you, I am closing this issue and will share this answer with the user.

time to update your R version!

I had to downgrade for the reprex 😅