Learn R Programming

SurveyStat (version 1.0.3)

describe_survey: Generate comprehensive survey description

Description

This function provides a comprehensive description of survey data including sample size, variable types, missing value patterns, and basic statistics. Can incorporate survey weights if provided.

Usage

describe_survey(data, weight_col = NULL)

Value

A list containing descriptive statistics

Arguments

data

A data.frame containing survey data

weight_col

Character string specifying column name containing weights (optional)

Examples

Run this code
data <- data.frame(
  age = c(25, 30, 35),
  gender = c("M", "F", "M"),
  weight = c(1.2, 0.8, 1.0)
)
desc <- describe_survey(data)
desc_weighted <- describe_survey(data, "weight")

Run the code above in your browser using DataLab