Skip to content

Pulling data into a model

2 messages · Crosby, Jacy R, Luc Villandre

#
Hi Jacy,

I'll take my chances answering your question.

I'd suggest using the paste() function and then transforming the string 
into a formula object:


my.formula = 
as.formula(paste("y~x1+x2+",paste(colnames(REG)[2:num],collapse="+"), 
sep= "")) ;

aov(my.formula,data=REG) ;


The first line creates a string that then becomes your formula statement.

Is this what you're looking for?

Cheers,

Luc
Crosby, Jacy R wrote: