[Rd] read.ftable, write.ftable -- move to base?
This is just to suggest that the functions read.ftable and write.ftable be moved from the stats package to the base package. As I understand it, this would allow ftable format to be used (more easily than at present) for datasets placed in the "data" subdirectory of packages. And that would be a good thing? (It would also make the advice given in Writing R Extensions, Currently, data files can have one of three types as indicated by their extension: plain R code (.R or .r), tables (.tab, .txt, or .csv)... clearer in the sense that "table" could be read to mean the same thing as it does in other parts of R.) David Professor David Firth Dept of Statistics University of Warwick Coventry CV4 7AL United Kingdom Voice: +44 (0)247 657 2581 Fax: +44 (0)247 652 4532 Web: http://www.warwick.ac.uk/go/dfirth __ R-devel@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
[Rd] Re: [R-SIG-Mac] NaN and linear algebra
I am sorry that I wasn't clear. All that I meant was that *this* problem can result in different behaviour in "ordinary" statistical applications. For example, if the objective function in a call to optim() involves calling one of these linear algebra routines, the result may be NaN (on systems other than Mac OS X) --- which optim will typically handle sensibly --- or something else (an error, or perhaps some consequence of getting 0 for the determinant) under Mac OS X . Probably this was obvious to you. Apologies if I misled you into thinking that there was some other problem I knew about. Best regards, David On 20 Mar, 2005, at 15:08, stefano iacus wrote: No, blas/veclib is tested, so aprt this extreme case you should report some other more commonly used cases in which something fails on OS X. This will help us to work it out. As said, I'll try some tests without using veclib and let you know. I've fowarded this mail to r-devel, which seems to be the right place, so for future msg on the subject please use r-devel. stefano On 19/mar/05, at 17:44, David Firth wrote: Dear Don, Bill and Stefano Many thanks for your helpful replies on this. I do think this is pretty serious: the example I gave is an extreme one, but in real problems (e.g., calls to optim()) this sort of thing can and does result in different behaviour on the Mac than on other systems. And that has to be a Bad Thing. I'm unsure whether it is better to press Apple to improve vecLib, or to test R with an alternative BLAS (and if successful, recommend using that BLAS in place of vecLib). Or both. Unfortunately I don't know enough about these routines and the relevant standards to pursue either route myself. Best regards, David At 11:57 AM + 3/16/05, David Firth wrote: I don't know whether this is a bug, or a problem with the way I built R 2.0.1 (under Mac OS 10.3 on a G5), or something else. Can anyone else confirm (or otherwise) that this happens in their R 2.0.1 on Mac OS X? > d<-matrix(NaN,3,3) d [,1] [,2] [,3] [1,] NaN NaN NaN [2,] NaN NaN NaN [3,] NaN NaN NaN solve(d) Error in solve.default(d) : Lapack routine dgesv: system is exactly singular chol(d) Error in chol(d) : the leading minor of order 1 is not positive definite det(d) [1] 0 Doing the same thing on a Windows setup gave a different (and more useful, I think) result d<-matrix(NaN,3,3) d [,1] [,2] [,3] [1,] NaN NaN NaN [2,] NaN NaN NaN [3,] NaN NaN NaN solve(d) [,1] [,2] [,3] [1,] NaN NaN NaN [2,] NaN NaN NaN [3,] NaN NaN NaN chol(d) [,1] [,2] [,3] [1,] NaN NaN NaN [2,]0 NaN NaN [3,]00 NaN det(d) [1] NaN Any thoughts? David Professor David Firth Dept of Statistics University of Warwick Coventry CV4 7AL United Kingdom Voice: +44 (0)247 657 2581 Fax: +44 (0)247 652 4532 Web: http://www.warwick.ac.uk/go/dfirth ___ R-SIG-Mac mailing list [EMAIL PROTECTED] https://stat.ethz.ch/mailman/listinfo/r-sig-mac -- -- Don MacQueen Environmental Protection Department Lawrence Livermore National Laboratory Livermore, CA, USA -- ___ R-SIG-Mac mailing list [EMAIL PROTECTED] https://stat.ethz.ch/mailman/listinfo/r-sig-mac __ R-devel@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Enhanced version of plot.lm()
On 23 Apr 2005, at 12:30, John Maindonald wrote: I propose the following enhancements and changes to plot.lm(), the most important of which is the addition of a Residuals vs Leverage plot. (1) A residual versus leverage plot has been added, available by specifying which = 5, and not included as one of the default plots. Contours of Cook's distance are included, by default at values of 0.5 and 1.0. The labeled points, if any, are those with the largest Cook's distances. The parameter cook.levels can be changed as required, to control what contours appear. (2) Remove the word "plot" from the captions for which=2, 3, 4. It is redundant. (3) Now that the pos argument to text() is vectorized, use that in preference to an offset. (4) For which!=4 or 5, by default use pos=4 on the left half of the panel, and pos=2 on the right half of the panel. This prevents labels from appearing outside the plot area, where they can overlap other graphical features. The parameter label.pos allows users to change this default. The modified code that I propose is below. This, a modified .Rd file, and files from diff used with the April 20 development version, are in my directory http://wwwmaths.anu.edu.au/~johnm/r/plot-lm/ I believe the Residual-Leverage plot is given in Krause & Olsen, whether with Cook's distance contours I do not recall. I do not have access to a copy of this book. Martin Maechler drew my attention to it in 2003, as superior to the Cook's distance plot. Agreed. Alternatively Cook's distance versus leverage/(1-leverage), as on p74 of this book: Statistical Theory and Modelling, In honour of Sir David Cox, FRS. Eds D V Hinkley, N Reid and E J Snell. Chapman and Hall, 1991. In that graph the contours of residual^2 are straight lines through the origin. A small disadvantage is that the sign of the residual is lost. David I have finally got around to coding it up! John Maindonald. ... __ R-devel@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-devel
Re: [Rd] Enhanced version of plot.lm()
On 24 Apr 2005, at 05:37, John Maindonald wrote: I'd not like to lose the signs of the residuals. Also, as plots 1-3 focus on residuals, there is less of a mental leap in moving to residuals vs leverage; residuals vs leverage/(1-leverage) would also be in the same spirit. Yes, I know what you mean. Mental leaps are a matter of taste...pitfalls, etc, come to mind. Maybe, one way or another, both plots (residuals vs a function of leverage, and the plot from Hinkley et al) should go in. The easiest way to do this is to add a further which=6. I will do this if the consensus is that this is the right way to go. In any case, I'll add the Hinkley et al reference (author of the contribution that includes p.74?) to the draft help page. Sorry, I should have given the full reference, which (in BibTeX format from CIS) is @inproceedings{Firt:gene:1991, author = {Firth, D.}, title = {Generalized Linear Models}, year = {1991}, booktitle = {Statistical Theory and Modelling. In Honour of Sir David Cox, FRS}, editor = {Hinkley, D. V. and Reid, N. and Snell, E. J.}, publisher = {Chapman \& Hall Ltd}, pages = {55--82}, keywords = {Analysis of deviance; Likelihood} } David John Maindonald. On 24 Apr 2005, at 1:09 AM, David Firth wrote: On 23 Apr 2005, at 12:30, John Maindonald wrote: I propose the following enhancements and changes to plot.lm(), the most important of which is the addition of a Residuals vs Leverage plot. (1) A residual versus leverage plot has been added, available by specifying which = 5, and not included as one of the default plots. Contours of Cook's distance are included, by default at values of 0.5 and 1.0. The labeled points, if any, are those with the largest Cook's distances. The parameter cook.levels can be changed as required, to control what contours appear. (2) Remove the word "plot" from the captions for which=2, 3, 4. It is redundant. (3) Now that the pos argument to text() is vectorized, use that in preference to an offset. (4) For which!=4 or 5, by default use pos=4 on the left half of the panel, and pos=2 on the right half of the panel. This prevents labels from appearing outside the plot area, where they can overlap other graphical features. The parameter label.pos allows users to change this default. The modified code that I propose is below. This, a modified .Rd file, and files from diff used with the April 20 development version, are in my directory http://wwwmaths.anu.edu.au/~johnm/r/plot-lm/ I believe the Residual-Leverage plot is given in Krause & Olsen, whether with Cook's distance contours I do not recall. I do not have access to a copy of this book. Martin Maechler drew my attention to it in 2003, as superior to the Cook's distance plot. Agreed. Alternatively Cook's distance versus leverage/(1-leverage), as on p74 of this book: Statistical Theory and Modelling, In honour of Sir David Cox, FRS. Eds D V Hinkley, N Reid and E J Snell. Chapman and Hall, 1991. In that graph the contours of residual^2 are straight lines through the origin. A small disadvantage is that the sign of the residual is lost. David I have finally got around to coding it up! John Maindonald. ... John Maindonald email: [EMAIL PROTECTED] phone : +61 2 (6125)3473fax : +61 2(6125)5549 Centre for Bioinformation Science, Room 1194, John Dedman Mathematical Sciences Building (Building 27) Australian National University, Canberra ACT 0200. __ R-devel@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-devel