[R] extracting F, df and r squared using "sapply"?

Dieter Menne dieter.menne at menne-biomed.de
Sat Feb 19 12:33:37 CET 2005


> 
> If you look at tmp, all the F statistics, r-squared values, etc. are there, 
> but is there an easy way to get at them reported in a tabulated form?
> 

Try:

tb=by(warpbreaks, tension,
  function(x) {
    sumlm=summary(lm(breaks ~ wool, data=x))
    c(sumlm$df,F=sumlm$fstatistic)
  }
  )
do.call("rbind",tb)

and don't forget to give the df columns a name.

> and no smart-alec comments about bonferonni corrections :)

Use package (or library ???... just kidding) multcomp.

No smart-alec comments about packages and libraries, please.


Dieter




More information about the R-help mailing list