[R] identical values not so identical? newbie help please!

Nordlund, Dan (DSHS/RDA) NordlDJ at dshs.wa.gov
Thu Mar 10 19:02:27 CET 2011


> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-
> project.org] On Behalf Of maiya
> Sent: Thursday, March 10, 2011 7:19 AM
> To: r-help at r-project.org
> Subject: [R] identical values not so identical? newbie help please!
> 
> Hi there!
> I'm not sure I can create a minimal example of my problem, so I'm
> linking to
> a minimal .RData file that has only two objects: obs and exp, each is a
> 6x9
> matrix.  http://dl.dropbox.com/u/10364753/test.RData link to dropbox
> file
> (I hope this is acceptable mailing list etiquette!)
> 
> Here's what happens:
> > obs[1, 1]
> [1] 118
> > exp[1, 1]
> [1] 118
> > obs[1, 1]-exp[1, 1]
> [1] 2.842171e-14
> 
> Problem is, both obs and exp should be identical. They are the result
> of a
> saturated loglinear model, and I've run the same code across about 400
> tables, all of which result in sum(obs-exp)=0, except for this one. I
> can't
> figure it out?
> 
> Anyway, I need help understanding why 118 and 118 are not really the
> same. I
> appreciate some may be wary of downloading my .Rdata file (I'm on
> ubuntu if
> that's any consolation), but I don't know how else to ask this
> quesiton!
> 
> Thanks!
> 
> Maja Z.
> 

See the R FAQ 7.31

Dan

Daniel J. Nordlund
Washington State Department of Social and Health Services
Planning, Performance, and Accountability
Research and Data Analysis Division
Olympia, WA 98504-5204




More information about the R-help mailing list