RE: [R] Precision in R

From: Liaw, Andy <>
Date: Wed 21 Jul 2004 - 03:01:13 EST

You can find the info in ?numeric, which says:


     _R has no single precision data type.  All real numbers are stored
     in double precision format_. ...

I suspect the most likely difference is in the actual algorithms used for the least squares computation. AFAIK SAS uses the sweep operator on the extended cross-product matrix, whereas lm() in R uses QR decomposition on the X matrix.

You can read Prof. Bates' article on least squares computations in R in the most recent issue of the R News, available on


> From:
> Greetings.
> I'm trying to recreate in R some regression models I've done in SAS,
> but I'm not getting the same results. My advisor suspects
> this may be
> due to differences in precision between R and SAS. Does anyone know

> where I can find specifications for R's type double? (It
> doesn't seem
> to be in the R Language Definition.) Thanks in advance for any help
> anyone can provide.
> Aaron
> -------------
> Aaron Solomon (ben Saul Joseph) Adelman
> E-mail:
> Web site:
> AOL Instant Messenger & Yahoo! Messenger: Hiergargo
> AIM chat-room (preferred): Adelmania
> ______________________________________________
> mailing list
> PLEASE do read the posting guide!
> mailing list PLEASE do read the posting guide! Received on Wed Jul 21 03:10:16 2004

This archive was generated by hypermail 2.1.8 : Wed 03 Nov 2004 - 22:55:07 EST