Skip to content
Prev 206737 / 398503 Next

Predict polynomial problem

On Mon, 18 Jan 2010, Barry Rowlingson 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 = environment( formula( mmn[[3]] ) ) )
 	get("i",env=environment(formula(mmn[[3]])))
 	sapply(mmn,function(x) environment( formula( x ) ) )


to see what gives.

HTH,

Chuck
Charles C. Berry                            (858) 534-2098
                                             Dept of Family/Preventive Medicine
E mailto:cberry at tajo.ucsd.edu	            UC San Diego
http://famprevmed.ucsd.edu/faculty/cberry/  La Jolla, San Diego 92093-0901