0
다음은 선택 열을 기준으로 예측 실행하려고하지 예측이 : 는
다음은 이전 코드입니다 :model <- glm(Automatable1Y0N ~.,family=binomial(link='logit'),data=train)
data <- subset(training.data.raw,select=c(5,6,7,8,10,12,27))
train <- data[1:800,]
test <- data[801:957,]
model <- glm(Automatable1Y0N ~.,family=binomial(link='logit'),data=train)
anova(model, test="Chisq")
어떠한 문제를이 2 줄에. 그리고 나는이 예측 라인을 실행했을 때 :
fitted.results <- predict(model,newdata=subset(test,select=c(5,6,7,8,10,12)),type='response')
하지만이 오류 메시지가 표시됨 :
Error in `[.data.frame`(x, r, vars, drop = drop) : undefined columns selected
사람이 도와 주실 수 있습니까? 감사. 나는 오류가 와서 칼럼 (8)을 추가 할 때 다음
newdata <-subset(test,select=c(5,))
은 결과입니다 :
나는이 부분 집합 명령을 추출하려고
> newdata <-subset(test,select=c(5))
> newdata <-subset(test,select=c(5,6))
> newdata <-subset(test,select=c(5,6,7))
> newdata <-subset(test,select=c(5,6,7,8))
Error in `[.data.frame`(x, r, vars, drop = drop) :
undefined columns selected
아마도 '모델'과 'newdata'사이의 변수 이름이 일치하지 않습니다. 그러나 재현 할 수있는 예제가 없으면이를 확인하기가 어렵습니다. –
편집 해 주셔서 감사합니다.하지만 Google 시스템에서 문제를 재현하는 데 도움이됩니다. 예를 들어'train'과'test' 객체는 없습니다. 자세한 내용은 [here] (http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example)을 참조하십시오. –