R-beta: sum of squares and NAs

Peter Dalgaard BSA p.dalgaard at biostat.ku.dk
Sat Jul 4 00:11:03 CEST 1998


Bill Simpson <wsimpson at uwinnipeg.ca> writes:

> 
> This surprised me.  Is it the way it is supposed to be?
> > x<-c(1,2,3,4,5)
> > y<-c(1.2,1.3,1.4,1.5,NA)
> > x-y
> [1] -0.2  0.7  1.6  2.5   NA
> > (x-y)^2
> [1] 0.04 0.49 2.56 6.25  NaN
> >>>so NA^2 = NaN? Why not still NA?
> 
> > sum((x-y)^2)
> [1] NaN
> >>>yes that is reasonable
> 
> So if you ever have a data set with missing observations (NAs), you can't
> do any nlm() least squares fitting? That doesn't seem right.

Bug, disappeared in current intermediate patch version.


-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)             FAX: (+45) 35327907
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list