Re: [R] for loop in nls function

From: Yuelin Li <liy12_at_mskcc.org>
Date: Tue, 29 Apr 2008 20:09:29 -0400

> results[i]<- nls(Tw ~ mu + ((alpha - mu)/(1 + exp(gamma*(B -
> Mean_Air)))),
> data = dem16,
> start = list(mu = 0.0001, alpha = 21.8, gamma = 0.22, B = 12.8))
> }

If you have a variable that codes "site" then you can try something like this to get the parameters over sites. Pinheiro and Bates (2000) has several examples.

nlsList(Tw ~ mu + ((alpha - mu)/(1 + exp(gamma*(B - Mean_Air)))) | site)

Yuelin.  


     
     Please note that this e-mail and any files transmitted with it may be 
     privileged, confidential, and protected from disclosure under 
     applicable law. If the reader of this message is not the intended 
     recipient, or an employee or agent responsible for delivering this 
     message to the intended recipient, you are hereby notified that any 
     reading, dissemination, distribution, copying, or other use of this 
     communication or any of its attachments is strictly prohibited.  If 
     you have received this communication in error, please notify the 
     sender immediately by replying to this message and deleting this 
     message, any attachments, and all copies and backups from your 
     computer.

______________________________________________
R-help_at_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. Received on Wed 30 Apr 2008 - 01:08:30 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 30 Apr 2008 - 01:30:33 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive