Compute Summary Statistics for All Variables

Description

Calculates mean, standard deviation, sample size, and standard error of the mean for every column in a data frame. All numeric values stored unrounded.

Usage

univariate_stats_answers(data)

compute_summary_stats(...)

Arguments

data A data frame. All columns will be summarised.
Arguments passed to univariate_stats_answers().

Value

A tibble with columns variable, mean, sd, n, and sem. All values are unrounded.

Examples

library("psych350lab")

data(superman, package = "psych350data")
library(dplyr)

my_data <- superman |>
  select(year, clark_height_in, height_diff) |>
  filter(!is.na(height_diff))

univariate_stats_answers(my_data)
# A tibble: 3 × 5
  variable           mean    sd     n   sem
  <chr>             <dbl> <dbl> <int> <dbl>
1 year            1993.   28.4      9 9.47 
2 clark_height_in   73.7   1.73     9 0.577
3 height_diff        8.40  2.32     9 0.774