Problems with the chisq_hat function

I am having a problem getting the chisq_hat function to work. I put in price and pieces, which are both numerical values and it always gives me an error. Here is the code chunk I used and the resulting error. Any ideas on how to get it to work?

Chisq_hat <- lego_population %>%
specify(formula = price ~ pieces) %>%
hypothesize(null = "independence") %>%
calculate(stat = "Chisq")
Chisq_hat

Error: A chi-square statistic is not well-defined for a numeric response variable (price) and a numeric explanatory variable (pieces).

chi-square assesses the independence of two categorical variables only. To assess the relationship between two numeric vectors look to cor, aov/lm etc.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.