Skip to content

Biserial and point-biserial correlations should check and probably coerce input #180

Open
@strengejacke

Description

@strengejacke

This may be related to #79. When dichotomous variables are a factor, and this leads to an error, coerce to numeric before processing:

mtcars$am <- as.factor(mtcars$am)
correlation::correlation(mtcars[c("am", "hp")], method = "biserial")
#> Warning: It seems like there is not enough continuous variables in your data.
#> Maybe you want to include the factors? We're setting `include_factors=TRUE` for
#> you.
#> Error in .cor_test_biserial(data, x, y, ci = ci, method = method, ...): Biserial and point-biserial correlations can only be applied for one dichotomous and one continuous variables.

Created on 2021-04-28 by the reprex package (v2.0.0)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug 🐛Something isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions