我的数据:
dependent <- c(1,0,1)
Salutation <- c("MR","MR","MR")
Gender <- c("MALE","MALE","MALE")
Profession <- c("BUSINESS","OTHER","BUSINESS")
Region <- c("South","West","Midwest")
CUST_RES_CITY <- c("MUMBAI","BANGALORE","BANGALORE")
Vertical_New <- c("AGENCY 1","AGENCY 1","AGENCY 2")
VehicleMake <-c ("SUZUKI","HONDA","VOLKS")
model<- c("SWIFT","MOBILIO","POLO")
Segment <- c("5 to 10 Lacs","10 to 30 Lacs","5 to 10 Lacs")
factor.cs <- data.frame(dependent, Salutation ,Gender ,Profession ,Region, CUST_RES_CITY,Vertical_New,VehicleMake ,model,Segment)
以前我有这件作品会进行卡方测试并会从中返回统计数据。
corr.factor <- factor.cs %>%
summarise_each(funs(chisq.test(.,
factor.cs[,dependent])$statistic), -one_of(dependent))
现在,由于summarise_each已更改为summarise_at,_all等。我试图修改代码
corr.factor <- factor.cs %>%
summarise_all(funs(chisq.test(., factor.cs$dependent)$statistic))
%>% select(-c("dependent"))
我收到此错误:
Error in summarise_impl(.data, dots) :
Evaluation error: 'x' and 'y' must have at least 2 levels