summarySE: Summarizes data

Description Usage Arguments Value Examples

View source: R/summarySE.R

Description

Gives count, mean, standard deviation, standard error of the mean, and confidence interval (default 95

Usage

1
2
3
4
5
6
7
8
summarySE(
  data = NULL,
  measurevar,
  groupvars = NULL,
  na.rm = FALSE,
  conf.interval = 0.95,
  .drop = TRUE
)

Arguments

data

a data frame

measurevar

the name of a column that contains the variable to be summariezed

groupvars

a vector containing names of columns that contain grouping variables

na.rm

a boolean that indicates whether to ignore NA's

conf.interval

the percent range of the confidence interval (default is 95%)

.drop

should combinations of variables that do not appear in the input data be preserved (FALSE) or dropped (TRUE, default)

Value

the count, mean, standard deviation, standard error of the mean, and confidence interval of data

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
mean_values = c(0, 5)
sd_values = c(1, 5)

data <- data.frame(data.norm = c(rnorm(n = 50, mean = 0, sd = 1), rnorm(n = 50,
    mean = 5, sd = 1), rnorm(n = 50, mean = 0, sd = 5), rnorm(n = 50,
    mean = 5, sd = 5)), Mean_value = as.factor(rep(mean_values, each = 50)),
    Sd_value = as.factor(rep(sd_values, each = 100)))

data.norm.sum <- summarySE(data, measurevar = "data.norm", groupvars = c("Mean_value",
    "Sd_value"))

ShudongSun/Sample-Size-Determination documentation built on Feb. 10, 2022, 1:33 a.m.