sim.questionnaire: Simulate item-level questionnaire data with specified total...

View source: R/sim.questionnaire.R

sim.questionnaireR Documentation

Simulate item-level questionnaire data with specified total score distribution

Description

Simulate item-level questionnaire data with specified total score distribution

Usage

sim.questionnaire(
  N = 100,
  n_items = 10,
  likert = 1:5,
  total_mean = 39,
  total_sd = 5,
  total_min = 10,
  total_max = 50
)

Arguments

N

Number of participants

n_items

Number of items in the questionnaire

likert

Vector of possible Likert scale values (e.g., 1:5)

total_mean

Mean of the desired total score distribution

total_sd

Standard deviation of the desired total score distribution

total_min

Minimum possible total score

total_max

Maximum possible total score

Value

Data frame with item-level responses and total scores

Examples

set.seed(123)
simdat <- sim.questionnaire(N = 100, n_items = 10, likert = 1:5, total_mean = 39, total_sd = 5, total_min = 10, total_max = 50)
summary(simdat$total)
head(simdat)

ccamp83/mu documentation built on July 4, 2025, 6:20 p.m.