How to use data for training and tests with glm?

ypredicted = predict(model, xtest)
# see how you did
norm(ytest - ypredicted) # from LinearAlgebra