[R] Predicting Smooths of Vectors in MGCV
njacobson at psu.edu
Wed Jan 21 17:42:42 CET 2015
I am trying to obtain predictions from a smooth of vectors. I have
successfully modeled the smooth vectors, using the following:
Both matb and mat are matrices, each containing 7 columns.
I am unsure of how to set up the prediction data frame given there are two
I have tried creating two separate matrices (matpdat and matpdat2)
containing the names of original columns in mat and matb and linking them
However, I receive the following error:
Error in model.frame.default(ff, data = newdata, na.action = na.act) :
invalid type (list) for variable 'matb'
I have also tried combining the two matrices into a data frame, but I
receive the same error using the following code:
I know that predictions are possible, given that if I do not specify the
prediction values, the GAM. I'm not sure how the data matrix is supposed to
be set up. I searched the MGCV documentation and I also searched the forums
and google, but I was unable to find an example of someone making
predictions from smooths of vectors.
I would appreciate any help!
Nicholas C. Jacobson
Doctoral Student in Clinical Psychology
378 Moore Building
The Pennsylvania State University
University Park, PA 16802-3103
Email: njacobson at psu.edu
[[alternative HTML version deleted]]
More information about the R-help