Get `chisq.test()$p.value` for several groups using `dplyr::group_by()`
问题 I'm trying to conduct a chi square test on several groups within the dplyr frame . The problem is, group_by() %>% summarise() doesn't seem to do trick. Simulated data (same structure as problematic data, but random, so p.values should be high) set.seed(1) data.frame(partido=sample(c("PRI", "PAN"), 100, 0.6), genero=sample(c("H", "M"), 100, 0.7), GM=sample(c("Bajo", "Muy bajo"), 100, 0.8)) -> foo I want to compare several groups defined by GM to see if there are changes in the p.values for the