Skip to content

nls function does not use subset argument (PR#9290)

4 messages · tadakado at gmail.com, Brian Ripley, Peter Dalgaard +1 more

#
Full_Name: Tadashi Kadowaki
Version: 2.4.0
OS: Redhat Linux 9
Submission from: (NULL) (58.12.166.67)


Doesn't nls function support subset?  It seems not to work.
And, there are no information in the online help.
Has it sunk into oblivion?
#
This is not the place to ask a question: do read the FAQ.

?nls shows that nls does have a 'subset' argument, and it does work.
Compare
+     trace = TRUE)
1360.779 :  0.12345 0.54321
0.000778241 :  3.002946 1.999563
0.000778241 :  3.002946 1.999563
Nonlinear regression model
   model:  yeps ~ a + b * x
    data:  parent.frame()
        a        b
3.002946 1.999563
  residual sum-of-squares: 0.000778241
+     trace = TRUE, subset=1:9)
1056.760 :  0.12345 0.54321
0.0007055261 :  3.000838 2.000138
0.0007055261 :  3.000838 2.000138
Nonlinear regression model
   model:  yeps ~ a + b * x
    data:  parent.frame()
        a        b
3.000838 2.000138
  residual sum-of-squares: 0.0007055261

I find your comments baffling: please provide a reproducible example of 
your claims.
On Wed, 11 Oct 2006, tadakado at gmail.com wrote:

            

  
    
#
tadakado at gmail.com writes:
Whatever gave you those ideas?

Yes, nls supports subset.
Yes, it does seem to work.
Yes, it is documented in the online help.
No, it has not sunk into anything.
Nonlinear regression model
  model:  density ~ SSlogis(log(conc), Asym, xmid, scal)
   data:  DNase
    Asym     xmid     scal
2.345180 1.483090 1.041455
 residual sum-of-squares: 0.004789569
#
I am sorry, it was my program's bug.
Yes, subset works!
Yes, nls works correctly!

I didn't pay enough attention to NAs.
NA threw off start value estimation in my program.
So, I got different results when I filtered NAs beforehand
and filtered by subset.
I also confused because subset does not appear in the
code of the nls function.
Then, I reached a wrong conclusion.

Thank you very much for your time.

Tadashi Kadowaki

11 Oct 2006 11:55:56 +0200, Peter Dalgaard <p.dalgaard at biostat.ku.dk>: