On Wed, Oct 6, 2010 at 10:16 AM, lord12 <trexi...@yahoo.com> wrote: > > Thanks a lot! I have one other question,however. If I want to have two > garchFits, garchFit(~aparch(1,1), data = sunspot.year) and > garchFit(~arma(2,1)+apaarch(1,1), data = sunspot.year), how do I automate > the creation of these models? > > for(k in 1:2) > { > garchFit~...,data = sunspot.year), > } > > I am not sure what to put in the ...
Set up a character vector of terms, Terms, such as Terms <- c("x1", "x2", "x3", "x4") and then replace the fo<- line in my second solution with: fo <- as.formula(paste("y1", paste(Terms[1:k], collapse = "+"), sep = "~")) -- Statistics & Software Consulting GKX Group, GKX Associates Inc. tel: 1-877-GKX-GROUP email: ggrothendieck at gmail.com ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.