Skip to content

Complete cases in chaid_table #43

@FedericoTrifoglio

Description

@FedericoTrifoglio

Hi, chaid_table.R has been really helpful, but when creating node_table, only filtering complete cases may result in 0 frequencies for the outcome levels (if each case has at least one missing value across the independent variables). Those 0 frequencies will later cause the chisq.test to raise an error because x must be positive.
I've removed both filter(complete.cases(.)) %>% and it works just fine to me.
Also noticed that you did tidyr::pivot_wider in row 76 but not in row 87.

Metadata

Metadata

Assignees

Labels

questionFurther information is requested

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions