I would like to predict a new response from a fitted linear model where the
new data is a single case with a missing value. My reading of the help on
predict() is inconclusive on whether this is possible.
Leaving out the missing value or setting it to NA both fail but differently,
see example code
You could fit a linear model to original/predicted y values and get rsquared
from that.
Chris
On Mar 13, 2014 5:26 PM, Greg Snow <538...@gmail.com> wrote:
>
> Well if I had it and you asked nicely, then I would be happy to give
> it to you. Oh, you mean the gls function, not GLS as my initials
It appears to be legitimate to include multi-level categorical and continuous
variables in defining the model for earth (e.g. y ~ cat + cont1 + cont2) but is
it also then possible use categoricals in the predict method using the earth
result? I tried but it returns an error which is not very inf
It appears to be legitimate to include multi-level categorical and continuous
variables in defining the model for earth (e.g. y ~ cat + cont1 + cont2) but is
it also then possible use categoricals in the predict method using the earth
result?
Chris
_
you can provide a simple reproducible example. It's not clear
exactly what the issue is from your question. The following simple example
gives the correct response:
data(etitanic)
a <- earth(survived~., data=etitanic)
predict(a, newdata=etitanic[1,])
Regards,
Steve
Message: 42
Date
My data has correlations between predictors so I think it would be
advantageous to rotate the axes with prcomp().
> census <-
read.table(paste("http://www.stat.wisc.edu/~rich/JWMULT02dat","T8-5.DAT",sep
="/"),header=F)
> census
V1 V2V3 V4 V5
1 5.935 14.2 2.265 2.27 2.91
2 1.523 1
6 matches
Mail list logo