search for: dmi_obs

Displaying 1 result from an estimated 1 matches for "dmi_obs".

Did you mean: dma_ops
2008 Jun 09
1
Cross-validation in R
...ing purpose test.dmi <- data.dmi[-select.dmi,] #Selecting 10% (remaining) of the data for testing purpose glm1.dmi <- glm(DMI_kg~Sex+DOF+Avg_Nem+In_Wt, na.action=na.omit, data = train.dmi) #Create fitted values using test.dmi data dmi_pred <- predict.glm(glm1.dmi, test.dmi) dmi_obs<-test.dmi[,"DMI_kg"] # Get the prediction error = MSE perr2 <- t(dmi_obs - dmi_pred)%*%(dmi_obs - dmi_pred)/nrow(test.dmi) perr2.vect <- c(perr2.vect, perr2) } x11() hist(perr2.vect) mean(perr2.vect) sd(perr2.vect)