how to calculate summary statistics for each factor

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

how to calculate summary statistics for each factor

karena
I have a dataset like the following:

subject   class     value
123        1            10
124        1             12
125        1            12
223        2            23
224       2             18
225         2            19
323        3             21
324       3              10
325       3               19
326       3               20

how to calculate the summary value for each factor?
thanks

karena
Reply | Threaded
Open this post in threaded view
|

Re: how to calculate summary statistics for each factor

Erik Iverson-3
?tapply is one way.

karena wrote:

> I have a dataset like the following:
>
> subject   class     value
> 123        1            10
> 124        1             12
> 125        1            12
> 223        2            23
> 224       2             18
> 225         2            19
> 323        3             21
> 324       3              10
> 325       3               19
> 326       3               20
>
> how to calculate the summary value for each factor?
> thanks
>
> karena

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: how to calculate summary statistics for each factor

Andrew Miles-3
In reply to this post by karena
You could try Summarize in the NCStats package, or aggregate in the  
epicalc package.

Andrew Miles
Department of Sociology
Duke University

On Jul 6, 2010, at 11:53 AM, karena wrote:

>
> I have a dataset like the following:
>
> subject   class     value
> 123        1            10
> 124        1             12
> 125        1            12
> 223        2            23
> 224       2             18
> 225         2            19
> 323        3             21
> 324       3              10
> 325       3               19
> 326       3               20
>
> how to calculate the summary value for each factor?
> thanks
>
> karena
> --
> View this message in context: http://r.789695.n4.nabble.com/how-to-calculate-summary-statistics-for-each-factor-tp2279777p2279777.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> [hidden email] 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.

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|

Re: how to calculate summary statistics for each factor

karena
yeah, both work. Thank you, guys...