2024-10-28Error in eval(family$initialize): y值必需满足0 <= y <= 1解决今天在使用R语言对Weekly进行交叉验证时,发生如下报错:错误于eval(family$initialize):y值必需满足0<=y<=1错误代码为:Weekly<-read.csv("Weekly.csv")set.seed(1)attach(Weekly)glm.fit1=glm(Direction~Lag1+Lag2,data=Weekly,family=binomial)summary(glm.fit1)