Your example is not actually a regression, and not reproducible. Here is
one that is both:
> fm1 <- lm(weight ~ ns(height, df = 5), data = women)
> predict(fm1, newdata=women[1,], se=TRUE)
Error: variable 'ns(height, df = 5)' was fitted with class "nmatrix.5" but
class "nmatrix.1" was supplied
I am fittling a spline to a variable in a regression model, I am then using
the predict.glm funtion to make some predictions. When I use bs to fit the
spline I don't have any problems using the predict.glm function however when
I use ns I get the following error:
Error in model.frame(formula, row