On Thu, Sep 2, 2010 at 11:09 AM, Ivan Allaman <ivanala...@yahoo.com.br> wrote: > > Good morning gentlemen! > > How using a weighted model in nls2? Values with the nls are logical since > values with nls2 are not. I believe that this discrepancy is due to I did > not include the weights argument in nls2. >
Just to follow up, nls2 was ignoring the weights argument. This is now fixed in the development version of nls2. The weights and no weights versions below give different residual sum of squares showing that weights is not ignored: library(nls2) # grab development version source("http://nls2.googlecode.com/svn/trunk/R/nls2.R") BOD2 <- cbind(BOD, w = 1:6) nls2(demand ~ a + b*Time, data = BOD2, start = c(a = 1, b = 1), weights = w, alg = "brute") # compare against nls2(demand ~ a + b*Time, data = BOD2, start = c(a = 1, b = 1), alg = "brute") -- 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.