Skip to content
Prev 78154 / 398502 Next

Descriptive statistics for tables

I do not totally understand your question as well. You seem to want a
descriptive statistic about a unitary number. What is the sd of a number?
or any other descriptive statictic. Maybe you mean for the columns or rows
or it could be that these are t-stats or z-stats that you need to get
p_values for them. In any case what I would do assuming that these tables
are in your env is the following

sapply(ls(), function(x){
  nam <- paste(x,"_summary", sep="")
  tt <- colMeans(get(x))
  assign(nam, tt, pos=1)})

The function above will output a number of tables with their original name
an extension _summary which contains the column means of the tables.

If you have the tables in different files on your box you need to add a
read.table line above. and the function becomes

sapply(dir(), function(x){

  nam <- paste(x,"_summary", sep="")
  assign(x, read.table(x))
	tt <- colMeans(x)
  assign(nam, tt, pos=1)})


HTH
On Fri, 30 Sep 2005, DAVID CAMACHO wrote: