Implement predict when newdata is given.