surveyframe

surveyframe is an R package on CRAN for end-to-end survey research: instrument design, static HTML export, response quality checking, psychometric diagnostics, and reproducible reporting.
Live on CRAN v0.4.1

surveyframe

surveyframe is an R package covering the full survey research pipeline: instrument design, static HTML export, a Shiny module, response quality checking, psychometric diagnostics, and reproducible HTML reporting.

Instrument to reportDesign, field, and analyse a survey without leaving R
Static HTML exportA dependency-free survey respondents can complete in a browser
Reproducible reportingDeclared analysis plans and HTML reports from the same package

Why It Exists

Survey research workflows are usually stitched together from 4 disconnected tools: one for the instrument, another for hosting responses, another for cleaning, another for analysis. surveyframe keeps the whole sequence, instrument design through reproducible reporting, in one R package, which is documented on the blog and this site’s field-type series.

What You Can Do

  • Design survey instruments with sf_item() and export a static, dependency-free HTML survey respondents can complete in a browser
  • Run response quality checks and psychometric diagnostics (reliability, item diagnostics) on collected data
  • Declare an analysis plan before data collection and run it with run_analysis_plan() for a reproducible HTML report
  • Use the optional ggplot2 layer, including a diverging bar chart for Likert-type results

New In 0.4

Version 0.4.0 was a major release, and 0.4.1 followed it on CRAN.

Multi-criteria decision analysis. 10 methods, AHP, ANP, DEMATEL, VIKOR, MOORA, SMART, WASPAS, PROMETHEE, ELECTRE, and TOPSIS, each carrying a literature citation. 2 new item types collect the judgement data inside the instrument itself, a pairwise comparison on Saaty’s 1-to-9 scale and a constant-sum criteria weighting. AHP judgements are screened for consistency against Saaty’s random-index table, and sensitivity_analysis() reports how far a ranking moves when the weights are perturbed.

Text analysis for open-ended responses. 9 methods, from term and n-gram frequency through keyword-in-context concordance, co-occurrence, sentiment, and LDA or structural topic modelling. They run through the same analysis plan and reporting pipeline as every other method family.

Small-sample corrections. The Hodges-Lehmann shift estimator, the paired Wilcoxon pseudomedian interval, the exact odds-ratio interval on Fisher’s test, and Firth’s bias-reduced logistic regression for data prone to separation. An advisory on assumption_report() flags when a study is small enough for these to matter.

Disclosed amendments and a provenance trail. amend_sframe() appends a timestamped entry to an ordered log, recording why an instrument changed and which fields moved, and never overwrites earlier entries. Changes touching the analysis plan or a model require a deviation report, and the sign-off field records a reviewer’s name or the literal none, so an unreviewed change stays visible. link_git_commit() ties the file’s SHA-256 hash to a specific Git commit. An edit that bypasses amend_sframe() still fails the integrity check exactly as before.

Teaching and export, added in 0.4.1. A library of 22 demos, each showing one thing, reachable with sframe_demos() and openable as an editable Quarto notebook. sframe_export_labelled() writes SPSS .sav or Stata .dta with the question wording and response options attached, so variables arrive labelled rather than as bare codes.

Access And Limitations

surveyframe is free and open source, installed with install.packages("surveyframe"). It is an R package, not a browser tool, so it requires a local R installation to use.

Install