Charles C. Berry wrote:
On Tue, 19 Jan 2010, Charles C. Berry wrote:
and the values in those places are different:
On Tue, 19 Jan 2010, Barry Rowlingson wrote:
On Tue, Jan 19, 2010 at 1:36 AM, Charles C. Berry
wrote:
> Its the environment thing.
> > I think you want something like t
Barry Rowlingson wrote:
On Tue, Jan 19, 2010 at 5:37 PM, Charles C. Berry wrote:
Note:
i <- 20
bquote(y ~ poly(x,.(i)))
y ~ poly(x, 20)
I see it now. bquote(y~poly(x,.(i))) gets it's 'i' there and then, sticks
it in the returned expression as the value '20', so any further evaluati
On Tue, 19 Jan 2010, Barry Rowlingson wrote:
On Tue, Jan 19, 2010 at 5:37 PM, Charles C. Berry wrote:
Note:
i <- 20
bquote(y ~ poly(x,.(i)))
y ~ poly(x, 20)
I see it now. bquote(y~poly(x,.(i))) gets it's 'i' there and then, sticks
it in the returned expression as the value '20', so
On Tue, Jan 19, 2010 at 5:37 PM, Charles C. Berry wrote:
>
>> Note:
>>
>> i <- 20
>>> bquote(y ~ poly(x,.(i)))
>>>
>> y ~ poly(x, 20)
>>
>>
I see it now. bquote(y~poly(x,.(i))) gets it's 'i' there and then, sticks
it in the returned expression as the value '20', so any further evaluations
get
and the values in those
places are different:
On Tue, 19 Jan 2010, Barry Rowlingson wrote:
On Tue, Jan 19, 2010 at 1:36 AM, Charles C. Berry wrote:
Its the environment thing.
I think you want something like this:
models[[i]]=lm( bquote( y ~ poly(x,.(i)) ), data=d)
Use
terms
On Tue, 19 Jan 2010, Charles C. Berry wrote:
and the values in those places are different:
On Tue, 19 Jan 2010, Barry Rowlingson wrote:
On Tue, Jan 19, 2010 at 1:36 AM, Charles C. Berry
wrote:
> Its the environment thing.
>
> I think you want something like this:
>
> ? ? ? ? ? ? ? ?mo
On Tue, 2010-01-19 at 08:27 +, Barry Rowlingson wrote:
> On Tue, Jan 19, 2010 at 1:36 AM, Charles C. Berry
> wrote:
>
> > Its the environment thing.
> >
> > I think you want something like this:
> >
> >models[[i]]=lm( bquote( y ~ poly(x,.(i)) ), data=d)
> >
> > Use
> >terms(
On Tue, Jan 19, 2010 at 1:36 AM, Charles C. Berry wrote:
> Its the environment thing.
>
> I think you want something like this:
>
> models[[i]]=lm( bquote( y ~ poly(x,.(i)) ), data=d)
>
> Use
> terms( mmn[[3]] )
>
> both with and without this change and
>
>
> ls( env = enviro
On Mon, 18 Jan 2010, Barry Rowlingson wrote:
I have a function that fits polynomial models for the orders in n:
lmn <- function(d,n){
models=list()
for(i in n){
models[[i]]=lm(y~poly(x,i),data=d)
}
return(models)
}
My data is:
> d=data.frame(x=1:10,y=runif(10))
So first just do it for
Subject: [R] Predict polynomial problem
I have a function that fits polynomial models for the orders in n:
lmn <- function(d,n){
models=list()
for(i in n){
models[[i]]=lm(y~poly(x,i),data=d)
}
return(models)
}
My data is:
> d=data.frame(x=1:10,y=runif(10))
So first just do
I have a function that fits polynomial models for the orders in n:
lmn <- function(d,n){
models=list()
for(i in n){
models[[i]]=lm(y~poly(x,i),data=d)
}
return(models)
}
My data is:
> d=data.frame(x=1:10,y=runif(10))
So first just do it for a cubic:
> mmn = lmn(d,3)
> predict
11 matches
Mail list logo