[R] The naPattern agrument of gnls()

From: Ben Rich <richmcb_at_gmail.com>
Date: Wed 17 Aug 2005 - 00:21:57 EST

I was hoping someone could help me to better understand the naPattern argument in the function gnls(). Unfortunately, there's no example using this argument provided in the help file.

According to the gnls() help file, naPattern is "an expression or formula object, specifying which returned values are to be regarded as missing". As I understand it, the idea is that with some models (e.g. quinModel) some of the rows that are needed to compute the predicted values aren't observations of the response variable and need to be left out of the optimization.

The nlme() function has an argument with the same name and description. I've used naPattern successfully with the nlme() function, following an example in the book "Mixed-Effects Models in S and S-PLUS" by Pinheiro and Bates, but a similar attempt with gnls() fails with the error message:

  Error in data.frame(data, getParsGnls(plist, pmap, beta, N)) :

        arguments imply differing number of rows: 695, 287

Any help or explanation would be appreciated. I'm using R version 2.1.0 on linux.

R-help@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 Received on Wed Aug 17 00:28:51 2005

This archive was generated by hypermail 2.1.8 : Sun 23 Oct 2005 - 15:23:32 EST