[R] Help on how to use predict

Eduardo M. A. M.Mendes emammendes at gmail.com
Mon Aug 15 20:21:16 CEST 2011


Hi there

Many thanks.   I will try to follow what you two said.  

Meanwhile I use the dirty solution that I have just come across.

Cheers

Ed


-----Original Message-----
From: Duncan Murdoch [mailto:murdoch.duncan at gmail.com] 
Sent: Monday, August 15, 2011 1:36 PM
To: David Winsemius
Cc: Eduardo M. A. M.Mendes; r-help at r-project.org
Subject: Re: [R] Help on how to use predict

On 11-08-15 12:21 PM, David Winsemius wrote:
> Eduardo;
>
> I think you would be more successful if you put your data in a 
> dataframe, offered it to lm with column names only in the formula, and 
> then used the newdata argument with predict with the column names 
> matching the column names in the original data.
>

I agree.  You can use the "subset" argument to lm to choose your local
window.

Duncan Murdoch



More information about the R-help mailing list