I am trying to fit a GAM model as follows:
model <- gam(`output` ~ s(`var 1`) + s(`var 2`), data = mydata)
Where mydata
is a data.frame
containing the data I need with columns: output
, var 1
and var 2
.
When I run the command I get this warning:
Warning message:
In model.matrix.default(mt, mf, contrasts) :
non-list contrasts argument ignored
Which I have no idea what it means. However I can see that the model is fit as summary(model)
returns stuff.
Now I would like to plot the fitting curves for:
output
againstvar 1
output
againstvar 2
How?
Attempt I
I have tried to:
plot(model)
But I get this error:
Error in parse(text = evars) : <text>:1:8: unexpected symbol
1: var 1