[R] Frequencies, proportions & cumulative proportions

Muenchen, Robert A (Bob) muenchen at utk.edu
Sat Oct 17 00:37:37 CEST 2009


Ted,

I know how to do that. It's just such a standard display in SAS, SPSS
and Stata that I figured someone had done it and I had just overlooked
it.

Thanks!
Bob



I don't think there is a ready-made one, but it is very little
effort to make your own:

mkMyTable <- function(X){
  Table <- data.frame( table(X) )
  Table$Prop <- prop.table( Table$Freq )
  Table$CumProp <-  cumsum( Table$Prop )
  Table
}

myTable <- mkMyTable(Score)

Hoping this helps!
Ted.

--------------------------------------------------------------------
E-Mail: (Ted Harding) <Ted.Harding at manchester.ac.uk>
Fax-to-email: +44 (0)870 094 0861
Date: 16-Oct-09                                       Time: 22:48:06
------------------------------ XFMail ------------------------------




More information about the R-help mailing list