Displaying 1 result from an estimated 1 matches for "depth500m".
2006 Feb 16
1
cv.glm function error message in a loop
...e/absence data (=response), then 10 columns of predictor
variables.
Code that doesn't work:
for (i in 1:length(datafish)) #this is 227 columns within "data"
{
#run glm & step of fish.[i] with all parameters no interactions
modelfish<-glm(data[,i]~ECO.NAME+ISLAND+DISTANCE.EST+DEPTH500M,
binomial)
stepmodfi<-step(modelfish,trace=1,scope=list(lower= ~1,
upper=~ECO.NAME+ISLAND+DISTANCE.EST+DEPTH500M) ,direction="both")
#run cross-validation
fish.vali<-cv.glm(data,stepmodfi)
}
Code for one fish that works:
modelfish.355<-glm(fi355~ECO.NAME+ISLAND+DISTANCE.EST+DEPT...