[R] Formulae for R functions

Terry Therneau therneau at mayo.edu
Wed Feb 13 13:52:24 CET 2008


> Can someone direct me to a resource or resources that list the formulae used
> by R  functions (i.e. predict.lm ) to calculate the statistic reported.  I
> am not a programmer and studying the r code is extremely slow going.  I
> have searched  r-project.org and all the function help files without
> success. For example I have attempted to replicate by hand the se.fit
> calculation from a lm object calculated by a call to the predict function
> and have not been able to reproduce the results. 

  The information you want is not readily available for most functions in R.  
The standard documentation files are, by tradition, very short synopses of the 
arguments.  For a few of the larger packages such as linear mixed models (lme) 
and the survival code, the authors have written a book: when it exists this is 
your best bet for a comprensive methods description.  Many details can be found 
in the excellent Venables and Ripley text, which is often the first place I 
look.  For your question, the standard statistical formulae are quite well 
established, R will of course use them.  
  If you are reduced to reading source code, make sure you fetch it off of the R 
site, rather than printing out the R internal code, which has been stripped of 
all comments.  
  
  	Terry Therneau



More information about the R-help mailing list