Re: [R] for loop in nls function

2008-04-29 Thread Yuelin Li
> 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.

[R] for loop in nls function

2008-04-29 Thread Ingrid Tohver
Hello, I am trying to apply a least squares non-linear regression to my dataset, dem16. I can apply it to a subset based on a single site fine, but I want to apply it to each (of 197) sites. I am stumbling over a "for" loop. Site and Mean_Air are variables in my dataset and I would like to