<font face="trebuchet ms,sans-serif">É possível sim. Use apply(), para jogar uma coluna por vez para a nls(), </font><font face="trebuchet ms,sans-serif">ou talvez melhor, deixe as y em uma lista de vetores e use lapply()</font><font face="trebuchet ms,sans-serif">. Se o mesmo modelo o chutes podem ser usados, isso não será complicado. Na situação em que os chutes podem mudar é mais indicado criar uma função selfStart para se livrar da tarefa de atribuir chutes.<br>
<br><span style="font-family: courier new,monospace;">x <- 1:10</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">y <- list()</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">y$y1 <- 10*x/(2+x)+rnorm(x,0,0.1)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">y$y2 <- 10*x/(2+x)+rnorm(x,0,0.1)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">y$y3 <- 10*x/(2+x)+rnorm(x,0,0.1)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">matplot(x, do.call(cbind, y))</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">nls.l <- lapply(y,</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> function(yi){</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> n0 <- nls(yi~A*x/(B+x), start=c(A=10, B=3))</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> n0</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> })</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">lapply(nls.l, coef)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">lapply(nls.l, summary)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">lapply(nls.l, fitted)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">lapply(nls.l, residuals)</span><br style="font-family: courier new,monospace;"><br>À disposição.<br>Walmes.<br><br clear="all"></font><span style="font-family:trebuchet ms,sans-serif">==========================================================================</span><br style="font-family:trebuchet ms,sans-serif">
<span style="font-family:trebuchet ms,sans-serif">Walmes Marques Zeviani</span><br style="font-family:trebuchet ms,sans-serif"><span style="font-family:trebuchet ms,sans-serif">LEG (Laboratório de Estatística e Geoinformação, 25.450418 S, 49.231759 W)</span><br style="font-family:trebuchet ms,sans-serif">
<span style="font-family:trebuchet ms,sans-serif">Departamento de Estatística - Universidade Federal do Paraná</span><br style="font-family:trebuchet ms,sans-serif"><span style="font-family:trebuchet ms,sans-serif">fone: (+55) 41 3361 3573</span><br style="font-family:trebuchet ms,sans-serif">
<span style="font-family:trebuchet ms,sans-serif">VoIP: (3361 3600) 1053 1173</span><br style="font-family:trebuchet ms,sans-serif"><span style="font-family:trebuchet ms,sans-serif">e-mail: <a href="mailto:walmes@ufpr.br" target="_blank">walmes@ufpr.br</a></span><br style="font-family:trebuchet ms,sans-serif">
<span style="font-family:trebuchet ms,sans-serif">twitter: @walmeszeviani</span><br style="font-family:trebuchet ms,sans-serif"><span style="font-family:trebuchet ms,sans-serif">homepage: <a href="http://www.leg.ufpr.br/%7Ewalmes" target="_blank">http://www.leg.ufpr.br/~walmes</a></span><br style="font-family:trebuchet ms,sans-serif">
<span style="font-family:trebuchet ms,sans-serif">linux user number: 531218</span><br style="font-family:trebuchet ms,sans-serif"><span style="font-family:trebuchet ms,sans-serif">==========================================================================</span><br>