Skip to contents

describe() gives you a complete summary of numeric variables - like age, income, or satisfaction scores. It's your first step in any analysis, helping you understand what's typical, what's unusual, and how spread out your data is.

Think of it as a health check for your data that reveals:

  • What's the average value?

  • What's the middle value?

  • How spread out are the responses?

  • Are there unusual patterns or outliers?

Usage

describe(
  data,
  ...,
  weights = NULL,
  show = "short",
  probs = c(0.25, 0.5, 0.75),
  na.rm = TRUE,
  excess = TRUE
)

Arguments

data

Your survey data (a data frame or tibble)

...

The numeric variables you want to summarize. List them separated by commas, or use helpers like starts_with("trust")

weights

Optional survey weights for population-representative results. Without weights, you describe your sample. With weights, you describe the population. Give a column name (unquoted or as a string), an expression such as sampling_weight * 2, or a numeric vector with one weight per row.

show

Which statistics to display:

  • "short" (default): Essential stats (mean, median, SD, range, IQR, skewness)

  • "all": Everything including min/max, variance, kurtosis, mode, quantiles

  • Custom list: Choose specific stats like c("mean", "sd", "range") from "mean", "median", "sd", "se", "var", "min", "max" (SPSS DESCRIPTIVES' Minimum/Maximum), "range", "iqr", "skew", "kurtosis", "mode", "quantiles". Unknown names are an error.

probs

For quantiles, which percentiles to show (default: 25th, 50th, 75th). The 50th percentile is the median; when the median is shown it is not printed a second time (the result keeps both columns).

na.rm

Remove missing values before calculating? (Default: TRUE). With FALSE, the result for a variable that contains missing values is NA (as in base R).

excess

For kurtosis, show excess kurtosis? (Default: TRUE, easier to interpret)

Value

A summary table with descriptive statistics for each variable

Details

Understanding the Results

Key statistics and what they tell you:

  • n: How many valid responses (watch for too many missing)

  • Mean: The average value

  • Median: The middle value (half above, half below)

  • SD: Standard deviation - how spread out values are

  • Range: The minimum and maximum values

  • IQR: Interquartile range - the middle 50% of values

  • Skewness: Whether data leans left (negative) or right (positive)

  • Kurtosis: Whether you have unusual outliers

  • N / Missing: Valid and missing cases. With weights, both are sums of weights (displayed rounded), as in SPSS FREQUENCIES with WEIGHT BY. Kish's effective sample size is kept in the result (<variable>_Effective_N) but not printed.

When to Use This

Always start here! Use describe() to:

  • Check data quality (impossible values?)

  • Understand distributions before testing

  • Spot outliers that might affect analyses

  • Compare groups side by side

Interpreting Patterns

  • Mean close to Median: Data is roughly symmetric

  • Mean > Median: Right-skewed (tail extends right)

  • Mean < Median: Left-skewed (tail extends left)

  • Large SD: Responses vary widely

  • Small SD: Responses are similar

See also

summary for base R summary statistics.

frequency for categorical variable summaries.

w_mean, w_sd, w_median for individual weighted statistics.

t_test and oneway_anova for group comparisons.

Other descriptive: crosstab(), frequency(), multiple_response(), normality_test()

Examples

# Load required packages and data
library(dplyr)
data(survey_data)

# Basic unweighted analysis
survey_data %>% describe(age)
#> 
#> Descriptive Statistics
#> ----------------------
#> 
#>   -------------------------------------------------------------------------
#>   Variable    Mean  Median      SD   Range     IQR  Skewness     N  Missing
#>   -------------------------------------------------------------------------
#>   age       50.550  50.000  16.976  77.000  24.000     0.172  2500        0
#>   -------------------------------------------------------------------------

# Weighted analysis
survey_data %>% describe(age, weights = sampling_weight)
#> 
#> Weighted Descriptive Statistics
#> -------------------------------
#> 
#>   -------------------------------------------------------------------------
#>   Variable    Mean  Median      SD   Range     IQR  Skewness     N  Missing
#>   -------------------------------------------------------------------------
#>   age       50.514  50.000  17.084  77.000  25.000     0.159  2516        0
#>   -------------------------------------------------------------------------

# Multiple variables with custom statistics
survey_data %>% describe(age, income, life_satisfaction,
                        weights = sampling_weight,
                        show = c("mean", "sd", "skew"))
#> 
#> Weighted Descriptive Statistics
#> -------------------------------
#> 
#>   --------------------------------------------------------------
#>   Variable               Mean        SD  Skewness     N  Missing
#>   --------------------------------------------------------------
#>   age                  50.514    17.084     0.159  2516        0
#>   income             3743.099  1423.966     0.725  2201      315
#>   life_satisfaction     3.625     1.152    -0.499  2437       79
#>   --------------------------------------------------------------

# Grouped analysis
survey_data %>%
  group_by(region) %>%
  describe(age, weights = sampling_weight)
#> 
#> Weighted Descriptive Statistics
#> -------------------------------
#> 
#> Group: region = East
#> --------------------
#> 
#>   ------------------------------------------------------------------------
#>   Variable    Mean  Median      SD   Range     IQR  Skewness    N  Missing
#>   ------------------------------------------------------------------------
#>   age       52.278  53.000  17.595  77.000  24.000     0.098  509        0
#>   ------------------------------------------------------------------------
#> 
#> Group: region = West
#> --------------------
#> 
#>   -------------------------------------------------------------------------
#>   Variable    Mean  Median      SD   Range     IQR  Skewness     N  Missing
#>   -------------------------------------------------------------------------
#>   age       50.067  49.000  16.927  77.000  24.000     0.170  2007        0
#>   -------------------------------------------------------------------------