[R] [Newbie] Is there any support for work with grouped frequencies?

Christian Schulz ozric at web.de
Wed Nov 13 19:16:32 CET 2002


try this

tapply(variable,group,summary)

...instead of "summary" you can use other functions like mean.

help(tapply)   (..use the online help!)

regards,christian

----- Original Message -----
From: "Matej Cepl" <matej at ceplovi.cz>
To: <r-help at stat.math.ethz.ch>
Sent: Wednesday, November 13, 2002 4:04 PM
Subject: [R] [Newbie] Is there any support for work with grouped
frequencies?


> Hi,
>
> I have this table (BTW, published by FBI and representing age
> distribution of the WTC tragedy victims):
>
> "LABEL" "FREQ" "MIDPOINT"
> "1" "Infant (under 1)"   0
> "2" "1 to 4"   5
> "3" "5 to 8"   1
> "4" "9 to 12"   3
> "5" "13 to 16"   0
> "6" "17 to 19"   3
> "7" "20 to 24" 117
> "8" "25 to 29" 341
> "9" "30 to 34" 503
> "10" "35 to 39" 578
> "11" "40 to 44" 510
> "12" "45 to 49" 369
> "13" "50 to 54" 272
> "14" "55 to 59" 177
> "15" "60 to 64"  79
> "16" "65 to 69"  29
> "17" "70 to 74"  15
> "18" "75 and over"  11
> "19" "Unknown" NA
>
> Are there any tools to work with grouped frequencies (i.e.,
> median, mean, chi-square test of normality of distribution) or do
> I have to calculate them ``by hand''?
>
> Thanks for any answer,
>
> Matej
>
> --
> Matej Cepl, matej at ceplovi.cz,
> Finger: 89EF 4BC6 288A BF43 1BAB  25C3 E09F EF25 D964 84AC
> 138 Highland Ave. #10, Somerville, Ma 02143, (617) 623-1488
>
> The ratio of literacy to illiteracy is a constant, but nowadays
> the illiterates can read.
>     -- Alberto Moravia
>
> -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.
-.-.-
> r-help mailing list -- Read
http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
> Send "info", "help", or "[un]subscribe"
> (in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
>
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._.
_._

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list