[R] Transformation of nls() to nlme()

From: Dong-hyun Oh <oh.dongh_at_gmail.com>
Date: Mon, 01 Sep 2008 16:53:47 +0200


Dear useRs,

I would like to transform nls() to nlme().

The script for my estimation with nls() is the following:



R> sapply(demeaned, class)
        id        yr        cl        ck        gp       sic      
kospi       est

  "factor" "factor" "numeric" "numeric" "numeric" "factor"
"numeric" "factor"
       def       dt1       dt2       dt3       dt4       dt5        
dt6       dt7

"numeric" "numeric" "numeric" "numeric" "numeric" "numeric" "numeric"
"numeric"
       dt8       dt9      dt10      dt11      dt12      dt13       
dt14      dt15

"numeric" "numeric" "numeric" "numeric" "numeric" "numeric" "numeric"
"numeric"
      dt16      dt17      dt18      dt19      dt20       di1        
di2       di3

"numeric" "numeric" "numeric" "numeric" "numeric" "numeric" "numeric"
"numeric"
       di4       di5       di6       di7       di8       di9        
age       ind

"numeric" "numeric" "numeric" "numeric" "numeric" "numeric" "numeric"
"factor"
      l.l1      k.l1     t1.l1     del.l     del.k        Sl         
Sk         y

"numeric" "numeric" "numeric" "numeric" "numeric" "numeric" "numeric"
"numeric"
         l         k        ll        lk        kk        t1         
tt        lt

"numeric" "numeric" "numeric" "numeric" "numeric" "numeric" "numeric"
"numeric"
        kt      dt1l      dt2l      dt3l      dt4l      dt5l       
dt6l      dt7l

"numeric" "numeric" "numeric" "numeric" "numeric" "numeric" "numeric"
"numeric"
      dt8l      dt9l     dt10l     dt11l     dt12l     dt13l      
dt14l     dt15l

"numeric" "numeric" "numeric" "numeric" "numeric" "numeric" "numeric"
"numeric"
     dt16l     dt17l     dt18l     dt19l     dt20l      dt1k       
dt2k      dt3k

"numeric" "numeric" "numeric" "numeric" "numeric" "numeric" "numeric"
"numeric"
      dt4k      dt5k      dt6k      dt7k      dt8k      dt9k      
dt10k     dt11k

"numeric" "numeric" "numeric" "numeric" "numeric" "numeric" "numeric"
"numeric"
     dt12k     dt13k     dt14k     dt15k     dt16k     dt17k      
dt18k     dt19k

"numeric" "numeric" "numeric" "numeric" "numeric" "numeric" "numeric"
"numeric"
     dt20k      di1l      di2l      di3l      di4l      di5l       
di6l      di7l

"numeric" "numeric" "numeric" "numeric" "numeric" "numeric" "numeric"
"numeric"
      di8l      di9l      di1k      di2k      di3k      di4k       
di5k      di6k

"numeric" "numeric" "numeric" "numeric" "numeric" "numeric" "numeric"
"numeric"

      di7k di8k di9k
"numeric" "numeric" "numeric"

R> model.egi.tr <- y ~ al*l + ak*k + all*ll + alk*lk + akk*kk + (b1*dt1 + b2*dt2 + b3*dt3 + b4*dt4 + b5*dt5 + b6*dt6 + b7*dt7 + b8*dt8 + b9*dt9 + b10*dt10 + b11*dt11+ b12*dt12+ b13*dt13+ b14*dt14+ b15*dt15+ b16*dt16+ b17*dt17+ b18*dt18+ b19*dt19+ b20*dt20) * (1*di1 + e2*di2 + e3*di3 + e4*di4 + e5*di5 + e6*di6 + e7*di7 + e8*di8 + e9*di9)

R> fit.fixed.egi.tr <- nls(model.egi.tr, data = demeaned, start = list(al = 0.3, ak = -0.05, all = 0.2, alk = -0.03, akk = 0.004, b1 = 0.001, b2 = 0, b3 = 0, b4 = 0, b5 = 0, b6 = 0, b7 = 0, b8 = 0, b9 = 0, b10 = 0, b11 = 0, b12 = 0, b13 = 0, b14 = 0, b15 = 0, b16 = 0, b17 = 0, b18 = 0, b19 = 0, b20 = 0, e2 = 0, e3 = 0, e4 = 0, e5 = 0, e6 = 0, e7 = 0, e8 = 0, e9 = 0), trace = T)


Looking forward to the solution.

Regards,



Dong-hyun Oh
Center of Excellence for Science and Innovation Studies Royal Institute or Technology, Sweden
e-mail: oh.dongh_at_gmail.com
cel: +46 73 563 45 22

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 Mon 01 Sep 2008 - 16:29:55 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 Mon 01 Sep 2008 - 16:34:06 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