will give you a table with the 3 quartiles, the mean+/-sd
latex(sumstat)
(will give you a beautiful tex version)
Read the help info of "summary.formula" to customize the table to your needs
Christos
> From: dwinsem...@comcast.net
> To: deeeperso...@googlemail.com
> Date: Sat,
On Apr 23, 2010, at 3:48 PM, Maxim wrote:
I have a very simple question, but I'm obviously not able to solve the
problem on my own.
I have a data.frame like
sample(c("A","B","C"),size=20,replace = T)->type
rnorm(20)->value
data.frame(ty=type,val=value)->test
There must be some built in fun
You can use fBasics package
sample(c("A","B","C"),size=20,replace = T) -> type
rnorm(20) -> value
data.frame(ty=type,val=value) -> test
require(fBasics)
nam <- rownames(basicStats(test$val))
result <- do.call("cbind", with(test, tapply(val, ty, basicStats)))
rownames(result) <- nam
result
Best
On 04/24/2010 05:48 AM, Maxim wrote:
Hi,
I have a very simple question, but I'm obviously not able to solve the
problem on my own.
I have a data.frame like
sample(c("A","B","C"),size=20,replace = T)->type
rnorm(20)->value
data.frame(ty=type,val=value)->test
There must be some built in f
There might be some package.
But you can also do something like:
results<-tapply(test$val,test$ty,function(x){
out1<-as.data.frame(length(x))
out2<-as.data.frame(mean(x))
out3<-as.data.frame(median(x))
out4<-as.data.frame(sd(x))
out<-cbind(out1,out2,out3,out
Hi,
I have a very simple question, but I'm obviously not able to solve the
problem on my own.
I have a data.frame like
sample(c("A","B","C"),size=20,replace = T)->type
rnorm(20)->value
data.frame(ty=type,val=value)->test
There must be some built in functions, that will do some descriptive
6 matches
Mail list logo