Learn R Programming

fastStat (version 1.4)

table_one: Get Summary Table

Description

Get the first summary table when study.

Usage

table_one(
  data,
  group,
  mean_sd,
  median_q4,
  median_range,
  count_percent,
  mean,
  median,
  max,
  min,
  sd,
  q25,
  q75,
  count,
  percent,
  round = 2,
  count.percent.direction = "v",
  t.test,
  anova,
  wilcox.test,
  kruskal.test,
  chisq.test,
  fisher.test,
  weighted,
  statistics = FALSE
)

Arguments

data

data that will be summarized

group

one or more group variable names

mean_sd

variable names for mand and standard deviation. in the results represents plus and minus

median_q4

variable names for median and 25 and 75 quantiles

median_range

variable names for median and range

count_percent

variable names for count and percentage

mean

variable names for mean

median

variable names for median

max

variable names for max

min

variable names for min

sd

variable names for standard deviation

q25

variable names for 25 quantile

q75

variable names for 75 quantile

count

variable names for count

percent

variable names for percentage

round

digital round. 2 is defaulted

count.percent.direction

calculate of direction for count, percent and count_percent arguments, which should be one of g, group, v or var, v as defaulted

t.test

two-side t test

anova

two-side anova

wilcox.test

two-side wilcox test

kruskal.test

two-side kruskal test

chisq.test

two-side chisq test

fisher.test

two-side fisher test

weighted

weight for data

statistics

a logical object. TRUE to display the statistic information. Default is FALSE

Value

a summary matrix

Examples

Run this code
# NOT RUN {
table_one(data = mtcars,group='vs',
          mean_sd = 'wt',
          count_percent  = c('gear','am')
)

table_one(data = mtcars,
group='vs',

mean_sd = 'wt',
t.test = 'wt',

count_percent  = c('gear','am','cyl'),
chisq.test = c('am','gear'),
fisher.test = c('cyl'),

round = 3
)
# }

Run the code above in your browser using DataLab