[R] Nonlinear weighted least squares estimation

Jesus Frias Jesus.Frias at dit.ie
Mon Nov 8 16:21:12 CET 2004


Hi Robert

	You can try gnls() in the nlme package or if that is not suitable, try to
follow the example in the nls() help page for weighted regression that has
an example of weighted regression from MASS.

from the nls help page:


     ## weighted nonlinear regression
     Treated <- Puromycin[Puromycin$state == "treated", ]
     weighted.MM <- function(resp, conc, Vm, K)
     {
         ## Purpose: exactly as white book p.451 -- RHS for nls()
         ##  Weighted version of Michaelis-Menten model
         ## ------------------------------------------------------------
         ## Arguments: 'y', 'x' and the two parameters (see book)
         ## ------------------------------------------------------------
         ## Author: Martin Maechler, Date: 23 Mar 2001, 18:48

         pred <- (Vm * conc)/(K + conc)
         (resp - pred) / sqrt(pred)
     }

     Pur.wt <- nls( ~ weighted.MM(rate, conc, Vm, K), data = Treated,
                   start = list(Vm = 200, K = 0.1),
                   trace = TRUE)



regards,

Jesus

--------------------------------------------------------------
Jesús María Frías Celayeta
School of Food Sci. and Env. Health.
Faculty of Tourism and Food
Dublin Institute of Technology
Cathal Brugha St., Dublin 1. Ireland
t +353 1 4024459 f +353 1 4024495
w www.dit.ie/DIT/tourismfood/science/staff/frias.html
--------------------------------------------------------------

> -----Original Message-----
> From: r-help-bounces at stat.math.ethz.ch
> [mailto:r-help-bounces at stat.math.ethz.ch]On Behalf Of Robert Brown FM
> CEFAS
> Sent: 08 November 2004 15:03
> To: r-help at stat.math.ethz.ch
> Subject: [R] Nonlinear weighted least squares estimation
>
>
> Hi there,
>
> I'm trying to fit a growth curve to some data and need to use a
> weighted least squares estimator to account for
> heteroscedasticity in the data.  A weights argument is available
> in nls that would appear to be appropriate for this purpose, but
> it is listed as 'not yet implemented'. Is there another package
> which could implement this procedure?
>
> Regards,
>
> Robert Brown
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
> http://www.R-project.org/posting-guide.html
>
> --
> This message has been scanned for content and
> viruses by the DIT Information Services MailScanner
> Service, and is believed to be clean.
> http://www.dit.ie
>



-- 
This message has been scanned for content and 
viruses by the DIT Information Services MailScanner 
Service, and is believed to be clean.
http://www.dit.ie




More information about the R-help mailing list