Re: [R] summary statistics

From: Jorge Iván Vélez <jorgeivanvelez_at_gmail.com>
Date: Tue, 12 Feb 2008 12:27:00 -0500

Hi Stephen,

Try

tapply(DATA$mgl,DATA$RM,summary) # DATA is a data.frame

I hope this helps.

Jorge

On 2/12/08, stephen sefick <ssefick_at_gmail.com> wrote:
>
> below is my data frame. I would like to compute summary statistics
> for mgl for each river mile (mean, median, mode). My apologies in
> advance- I would like to get something like the SAS print out of PROC
> Univariate. I have performed an ANOVA and a tukey LSD and I would
> just like the summary statistics.
> thanks
>
> stephen
>
> RM mgl
> 1 215 0.9285714
> 2 215 0.7352941
> 3 215 1.6455696
> 4 215 0.6000000
> 5 sc 1.8333333
> 6 sc 0.8333333
> 7 sc 2.5438596
> 8 sc 0.2500000
> 9 202 NA
> 10 202 0.5500000
> 11 202 0.8148148
> 12 202 1.6666667
> 13 198 0.5038760
> 14 198 0.3823529
> 15 198 0.7600000
> 16 198 0.4800000
> 17 hc 3.1818182
> 18 hc 3.7254902
> 19 hc 4.3750000
> 20 hc 2.6415094
> 21 190 0.3500000
> 22 190 0.4400000
> 23 190 0.6500000
> 24 190 0.5000000
> 25 bc 9.0000000
> 26 bc 5.0000000
> 27 bc 4.0000000
> 28 bc 3.2000000
> 29 185 0.7386364
> 30 185 0.5000000
> 31 185 1.1538462
> 32 185 0.6000000
> 33 179 1.8181818
> 34 179 1.1980000
> 35 179 2.5000000
> 36 179 2.0000000
> 37 148 2.0833333
> 38 148 2.3333333
> 39 148 3.1000000
> 40 148 2.2142857
> 41 119 2.4444444
> 42 119 2.3275862
> 43 119 4.7142857
> 44 119 1.7692308
> 45 61 2.8888889
> 46 61 3.2500000
> 47 61 4.7500000
> 48 61 2.6337449
>
>
> --
> Let's not spend our time and resources thinking about things that are
> so little or so large that all they really do for us is puff us up and
> make us feel like gods. We are mammals, and have not exhausted the
> annoying little problems of being mammals.
>
> -K. Mullis
>
> ______________________________________________
> R-help_at_r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

        [[alternative HTML version deleted]]



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Tue 12 Feb 2008 - 17:30:45 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 12 Feb 2008 - 18:30:14 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive