[R] Creating Tabel for Mean, Deviance
Edwin Sendjaja
edwin7 at web.de
Wed Dec 3 14:27:02 CET 2008
Hi,
Can someone help me how to create a table for Min, Max, Mean, Deviance.
I have input data like this:
Person Age Child
1 5 17 2
2 5 17 0
3 5 17 1
4 5 20 2
5 5 20 3
6 7 10 1
7 7 21 4
8 7 21 5
9 7 21 1
Now i want to create a table for the Min, Max, Deviance, and Mean. from the
Child Value.
It should look like this:
Person Age Min Max Mean Deviance
1 5 17 0 1 0.61 0.62
2 5 18 1 2 1.61 1.62
3 5 19 1 4 1.61 2.62
4 5 20 2 4 2.63 1.42
5 5 21 1 5 2.61 0.22
6 7 17 0 1 0.61 0.52
7 7 18 1 2 1.61 0.72
8 7 19 1 4 1.61 0.82
9 7 20 1 4 2.63 0.12
-----------------------------------------------------------------
what i can do is only manually:
data<- read.table("test.data")
Min(data$Child), Max(data$Child), Mean(data$Child), Deviance(data$Child)
I only know how to calculate. But i dont know how to buiild the tabell like
this.
I would appreciate if someone can help me. Thanks in advance.
More information about the R-help
mailing list