[R] Predicting response from fitted linear model with incomplete new sample data

2013-12-18 Thread Chris Wilkinson
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

Re: [R] How to get the adjusted R squared from GLS() estimator

2014-03-14 Thread Chris Wilkinson
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

[R] Earth (MARS) package with categorical predictors

2013-11-07 Thread Chris Wilkinson
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

[R] Earth (MARS) package with categorical predictors

2013-11-10 Thread Chris Wilkinson
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 _

Re: [R] Earth (MARS) package with categorical predictors

2013-11-11 Thread Chris Wilkinson
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

[R] Principal Components in a Linear Model

2013-11-22 Thread Chris Wilkinson
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