[R] predict.lm point forecasts with factors

2007-02-14 Thread sj
hello, I am trying to use predict.lm to make point forecasts based on a model with continuous and categorical independent variables I have no problems fitting the model using lm, but when I try to use predict to make point predictions. it reverts back to the original dataframe and gives me the

Re: [R] predict.lm point forecasts with factors

2007-02-14 Thread Marc Schwartz
On Wed, 2007-02-14 at 13:54 -0700, sj wrote: hello, I am trying to use predict.lm to make point forecasts based on a model with continuous and categorical independent variables I have no problems fitting the model using lm, but when I try to use predict to make point predictions. it reverts

[R] predict.lm variables found question

2006-11-09 Thread Larry White
hello, I'm trying to predict some values based on a linear regression model. I've created the model using one dataframe, and have the prediction values in a second data frame (call it newdata). There are 56 rows in the dataframe used to create the model and 15 in newdata. I ran predict(model1,

Re: [R] predict.lm variables found question

2006-11-09 Thread Peter Dalgaard
Larry White [EMAIL PROTECTED] writes: hello, I'm trying to predict some values based on a linear regression model. I've created the model using one dataframe, and have the prediction values in a second data frame (call it newdata). There are 56 rows in the dataframe used to create the

[R] predict.lm within a function

2006-08-31 Thread Pamela McCaskie
Hi I'm trying to wrap predict.lm within a function, but I'm having problems passing arguments into it in this way. Basically I want to create a lm object, then pass it into the predict.lm function and be able to tell predict.lm which variable I want to predict for, by passing the variable name

[R] predict.lm

2006-05-02 Thread Bill Szkotnicki
I have a model with a few correlated explanatory variables. i.e. m1=lm(y~x1+x2+x3+x4,protdata) and I have used predict as follows: x=data.frame(x=1:36) yp=predict(m1,x,se.fit=T) tprot=sum(yp$fit) # add up the predictions tprot tprot is the sum of the 36 predicted values and I would

Re: [R] predict.lm

2006-05-02 Thread Christos Hatzis
this. -Christos -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Bill Szkotnicki Sent: Tuesday, May 02, 2006 2:59 PM To: 'R-Help help' Subject: [R] predict.lm I have a model with a few correlated explanatory variables. i.e. m1=lm(y~x1+x2+x3+x4,protdata

Re: [R] predict.lm

2006-05-02 Thread Prof Brian Ripley
: Tuesday, May 02, 2006 2:59 PM To: 'R-Help help' Subject: [R] predict.lm I have a model with a few correlated explanatory variables. i.e. m1=lm(y~x1+x2+x3+x4,protdata) and I have used predict as follows: x=data.frame(x=1:36) yp=predict(m1,x,se.fit=T) How can this work? You fitted

Re: [R] predict.lm

2006-05-02 Thread Bill Szkotnicki
way? Bill -Original Message- From: Prof Brian Ripley [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 02, 2006 2:54 PM To: Christos Hatzis Cc: 'Bill Szkotnicki'; 'R-Help help' Subject: Re: [R] predict.lm On Tue, 2 May 2006, Christos Hatzis wrote: I think you got it right. The mean

[R] predict.lm - standard error of predicted means?

2005-07-20 Thread kehler
Simple question. For a simple linear regression, I obtained the standard error of predicted means, for both a confidence and prediction interval: x-1:15 y-x + rnorm(n=15) model-lm(y~x) predict.lm(model,newdata=data.frame(x=c(10,20)),se.fit=T,interval=confidence)$se.fit 1 2

Re: [R] predict.lm - standard error of predicted means?

2005-07-20 Thread Peter Dalgaard
[EMAIL PROTECTED] writes: Simple question. For a simple linear regression, I obtained the standard error of predicted means, for both a confidence and prediction interval: x-1:15 y-x + rnorm(n=15) model-lm(y~x)

Re: [R] predict.lm - standard error of predicted means?

2005-07-20 Thread mark salsburg
Can someone please refer me to a function or method that resolves this structuring issue: I have two matrices with identical colnames (89), but varying number of observations: matrix Amatrix B 217 x 89 16063 x 89 I want to creat one

Re: [R] predict.lm - standard error of predicted means?

2005-07-20 Thread Peter Dalgaard
mark salsburg [EMAIL PROTECTED] writes: Can someone please refer me to a function or method that resolves this structuring issue: I have two matrices with identical colnames (89), but varying number of observations: matrix Amatrix B 217 x 89

Re: [R] predict.lm - standard error of predicted means?

2005-07-20 Thread Prof Brian Ripley
On Wed, 20 Jul 2005, Peter Dalgaard wrote: mark salsburg [EMAIL PROTECTED] writes: Can someone please refer me to a function or method that resolves this structuring issue: I have two matrices with identical colnames (89), but varying number of observations: matrix A

[R] predict.lm with (logical) NA vector

2003-11-10 Thread Edzer J. Pebesma
I was surprised by the following (R 1.8.0): R lm.fit = lm(y~x, data.frame(x=1:10, y=1:10)) R predict(lm.fit, data.frame(x = rep(NA, 10))) 1 2 3 4 5 -1.060998e-314 -1.060998e-314 -1.060998e-314 -1.060998e-314 -1.060998e-314

Re: [R] predict.lm with (logical) NA vector

2003-11-10 Thread Prof Brian Ripley
On Mon, 10 Nov 2003, Edzer J. Pebesma wrote: I was surprised by the following (R 1.8.0): R lm.fit = lm(y~x, data.frame(x=1:10, y=1:10)) R predict(lm.fit, data.frame(x = rep(NA, 10))) 1 2 3 4 5 -1.060998e-314 -1.060998e-314