I am trying to train on part of my data and test on another part: > glm.model = glm(as.factor(h_finished) ~ . , family=binomial, data=form[1:150000,]) > pred = predict(glm.model, data=form[150001:200000,-1], type="response") > t = table(pred, form[150001:200000,1]) Error in table(pred, form[150001:2e+05, 1]) : all arguments must have the same length
but try as I might my pred has too many lines: > length(pred) [1] 150000 > length(form[150000:200000, 1]) [1] 50000 [150000:200000, 1] works in the table function and indeed immediately above. How can I make the [150000:200000, 1] work the predict function? ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.