The function produces a data.frame describing one metric variable METRIC with various statistics SPLIT is a group variable which may be left out. Tests may be preformed on Mean (t.test, oneway.test) or Median (wilcox.test,kruskal.test)

MetricBySplit(METRIC, SPLIT = NULL, VARNAME = T, LONGNAME = NULL,
  PVALUE = F, TEST = NULL, ALL = T, SEL = NULL, SHOW_N = T,
  DIGITS = 2)

Arguments

METRIC

is a numeric variable

SPLIT

=NULL split factor (group variable), if NULL an ungrouped description is returned

VARNAME

=T indicate the VARNAME name of METRICS in the first column

LONGNAME

=NULL optional long name for METRICS if NULL a LONGNAME is derived from the call

PVALUE

=F If TRUE, tests on mean and Median are performed and added as last column

TEST

=NULL Choose TEST from c("Mean","Median"). If not specified set to both i.e. c("Mean","Median")

ALL

=T If TRUE, also overall statistics

SEL

=NULL if specified select statistics from c("Mean", "Sd", "Median", "Mad", "Perc25", "Perc75", "Min", "Max")

SHOW_N

=T Show N=length(METRIC) top left

DIGITS

=2 Number of digits for statistics

Value

a data.frame OF CHARACTERS with statistics by the group variable SPLIT

Details

MetricBySplit

Examples

if (FALSE) { Metric<-c(rnorm(57),rnorm(43,2,2)) Split<-c(rep("Arm A",57),rep("Arm B",43)) # MetricBySplit(Metric,Split) MetricBySplit(Metric,Split,PVALUE=T,TEST=c("Mean","Median"), SEL=c("Mean","Median"),DIGITS=3) }