Skip to contents

Start here

SurveyStudio opens an instrument and takes it through every stage below, by point and click. ?surveyframe is the map of the package, and sframe_demo(“first_survey”) is a whole survey to start from.

surveyframe surveyframe-package
surveyframe: Design, Plan, Seal and Report Questionnaire Studies
launch_studio()
Launch the SurveyStudio interface

Design

Make the instrument: its questions, choice sets, scales, branching and attention checks, saved as a portable .sframe file. In SurveyBuilder: the Build mode. In code: sframe_instrument() and the makers listed here, then write_sframe().

launch_builder()
Launch the surveyframe visual survey builder
sframe_instrument()
Create a survey instrument object
sframe_get_study()
The study an instrument serves
sframe_sampling_methods()
Sampling methods a study can declare
sframe_item()
Define a survey item
sframe_choice_set()
Define a reusable choice set
sframe_scale()
Define a scored scale
sframe_branch()
Define a branching rule
sframe_attention_check()
Define a design-time survey check
sframe_conjoint_design()
Declare a choice-experiment (conjoint) design
write_sframe()
Write an instrument to a .sframe file
read_sframe()
Read an instrument from a .sframe file
validate_sframe()
Validate an instrument object
sframe_validation
Report on a validation result
as_sframe()
Coerce to an instrument

Plan

Declare the analysis before the data arrive, so the report shows what was planned and what was run. In SurveyBuilder: the Plan mode. In SurveyStudio: Plan, or the Analyse screen. In code: sframe_plan(x) <- plan.

sframe_plan()
Get the pre-declared analysis plan
`sframe_plan<-`()
Set the pre-declared analysis plan
sframe_sample_size_plan()
Sample-size and power planning helper

Preview

See the survey as a respondent meets it, with nothing collected. In SurveyStudio: the Preview screen. In code: preview_survey().

preview_survey()
Preview a survey as a respondent sees it
run_survey()
Render a survey from an instrument object

Collect

Send the survey out: a standalone HTML page, optionally saving answers to a Google Sheet, or a Shiny module inside your own app. In SurveyBuilder: Export survey, with the Google Sheets settings. In code: export_survey().

export_survey()
Export a self-contained static HTML survey
export_google_sheet()
Export a survey instrument to Google Sheets collection format
sframe_survey_ui()
Shiny module UI for an embedded survey
sframe_survey_server()
Shiny module server for an embedded survey

Responses

Read the answers back against the instrument, check their quality, and export them with labels for other software. In SurveyStudio: the Responses and Quality screens. In code: read_responses().

read_responses()
Read and validate survey responses
read_sheet_responses()
Read survey responses from a Google Sheet
export_responses()
Write responses to SPSS or Stata with the labels attached
sframe_quality_results()
Generate a data quality report for survey responses
sframe_missing_data_results()
Missing-data report
sframe_outlier_results()
Flag univariate and multivariate outliers

Analyse

Score the scales and run the plan, block by block. In SurveyStudio: the Explore, Reliability and Analyse screens. In code: run_analysis_plan().

run_analysis_plan()
Run a pre-planned analysis from an instrument's analysis plan
score_scales()
Score defined scales from survey responses
sframe_descriptives_results()
Descriptive statistics report
sframe_reliability_results()
Estimate scale reliability from item responses
sframe_item_results()
Generate item-level diagnostics
sframe_efa_readiness_results()
Prepare a survey instrument for exploratory factor analysis
sframe_efa_solution()
Estimate an exploratory factor solution
sframe_validity_results()
Validity report for construct models
sframe_assumption_results()
Assumption-check report
sframe_posthoc_results()
Post-hoc and pairwise comparison report

Report

Write up what was run: an HTML, PDF, Word or OpenDocument report or its Quarto source, a codebook, the figures, and the R code behind each result, and sframe_show() to open a written file. In SurveyStudio: the Report screen. In code: render_report().

render_report()
Render a reproducible survey report
sframe_report_source()
Recompute and check a report source folder
render_results()
Render analysis results to a formatted HTML report
sframe_reports
Choosing a report
sframe_format_result()
Render one analysis result as the report does
sframe_codebook()
Generate a survey codebook from an instrument object
sframe_save_figures()
Save the charts from an analysis plan as files
sframe_analysis_qmd()
Write a Quarto analysis notebook for any instrument
sframe_show()
Show a file surveyframe wrote

References

Cite the works an instrument draws on. The references travel in the .sframe file and the report lists each one once, at the end. In SurveyStudio: the References screen. In code: sframe_add_references().

sframe_reference()
Create a reference
read_bibtex()
Read references from BibTeX
sframe_add_references()
Add references to an instrument
sframe_get_references()
List an instrument's references
sframe_bibliography()
Write a bibliography as CSL-JSON

Amendments

Change an instrument mid-study, on the record: each amendment is logged with its reason and the hash it replaced. In SurveyStudio: the Amendments screen. In code: amend_sframe().

amend_sframe()
Record a disclosed amendment to an instrument
sframe_get_amendments()
Read an instrument's amendment log
sframe_drop_items()
Drop items from scales or models
sframe_item_flags()
Items past the usual cut-offs in a measurement result
sframe_link_git_commit()
Link an instrument to its current Git commit

Inspect

Read parts of an instrument, a validation result or a report without reaching into the object, at any stage. Each accessor and as.data.frame method states the classes it accepts and what it returns.

sframe_accessors sf_accessors
Explore a surveyframe object
sframe_apa()
Extract APA-formatted result summaries
sframe_get_branches()
Get branching rules
sframe_get_attention_checks()
Get response-quality checks
sframe_get_choice_sets()
Get choice sets
sf_component_list
A list of instrument components
sframe_flagged()
Get rows flagged by response-quality checks
sframe_id()
Get an instrument component ID
sframe_identity sf_identity
The ID and label of an instrument component
sframe_is_valid()
Test whether validation passed
sframe_get_items()
Get survey items
sframe_label()
Get an instrument component label
sframe_meta()
Get survey metadata
sframe_missing_columns()
Columns the instrument declares that the responses left out
sframe_get_models()
Get model specifications
sframe_object()
Recover the validated object
sframe_problems()
Get validation problems
sframe_notes()
Notes from a validation
sframe_report_accessors sf_report_accessors
Read the reportable parts of an analysis or quality result
sframe_get_scales()
Get survey scales
sframe_validation_accessors sf_validation_accessors
Read a validation diagnostic
sframe_as_data_frame
Coerce a surveyframe object to a data frame
sframe_subset
Subset a surveyframe report
as.data.frame(<sf_choices>)
Coerce a choice set to a data frame
as.data.frame(<sframe>)
Coerce an instrument to its item summary
as.data.frame(<sframe_analysis_results>)
Summarise analysis-plan results as a data frame
as.data.frame(<sframe_assumption_report>)
Coerce an assumption report to a data frame
as.data.frame(<sframe_codebook>)
Extract the item table from a codebook report
as.data.frame(<sframe_descriptives_report>)
Extract the descriptives results table
as.data.frame(<sframe_efa_report>)
Coerce an EFA readiness report to a data frame
as.data.frame(<sframe_efa_solution>)
Extract the loading table from an EFA solution
as.data.frame(<sframe_item_report>)
Coerce an item report to a data frame
as.data.frame(<sframe_missing_data_report>)
Extract item missingness results
as.data.frame(<sframe_quality_report>)
Coerce a response-quality report to a data frame
as.data.frame(<sframe_reliability_report>)
Coerce a reliability report to a data frame
as.data.frame(<sframe_sample_size_plan>)
Coerce a sample-size plan to a data frame
as.data.frame(<sframe_sensitivity>)
Extract a sensitivity-analysis results table
as.data.frame(<sframe_validation>)
Coerce validation problems to a data frame
as.data.frame(<sframe_validity_report>)
Extract reliability evidence from a validity report

Models and syntax

Declare constructs, paths and covariances, and generate lavaan, seminr and psych syntax from the instrument.

sframe_model_spec()
Create a surveyframe model specification
sframe_construct()
Define a latent or composite construct
sframe_path()
Define a structural path between constructs
sframe_covariance()
Define a covariance between constructs
sframe_indirect_effect()
Define an indirect effect path
sframe_add_model()
Add a model specification to an instrument
sframe_validate_model()
Validate a surveyframe model specification
sframe_model_json()
Serialise a model specification to JSON
sframe_model_outline()
Create a model reporting template
sframe_syntax_cfa()
Generate lavaan CFA syntax from an instrument or a declared model
sframe_syntax_efa()
Generate EFA planning syntax
sframe_syntax_sem()
Generate lavaan CB-SEM syntax
sframe_syntax_pls()
Generate seminr PLS-SEM syntax
sframe_syntax_result()
The R code behind an analysis result

Charts

Opt-in ggplot2 charts for analysis results, and the package theme.

sframe_plots
Choosing a plot
theme_surveyframe()
surveyframe brand theme for ggplot2
plot(<sframe_analysis_results>)
Plot analysis-plan results
sframe_plot_correlation_matrix()
Correlation matrix heatmap
sframe_plot_decision_ranking()
Ranked-score bar chart for a decision-family result
sframe_plot_dematel_influence()
Prominence-relation scatter for a DEMATEL result
sframe_plot_descriptives()
Distribution shape by variable, standardised
sframe_plot_efa_loadings()
Loadings heatmap from a fitted EFA solution
sframe_plot_efa_scree()
Scree plot from an EFA readiness report
sframe_plot_group_comparison()
Group-comparison boxplot
sframe_plot_likert_matrix()
Grouped diverging chart for a Likert matrix question
sframe_plot_likert_scale()
Grouped diverging chart for a scale's Likert items
sframe_plot_missingness()
Missing-data report plot: missingness rate by item
sframe_plot_paired_comparison()
Paired-comparison slope plot
sframe_plot_quality()
Quality report plot: straight-lining flag rate by scale
sframe_plot_regression_diagnostics()
Regression diagnostic plots for a regression_linear result
sframe_plot_reliability()
Reliability plot: alpha and omega by scale
sframe_plot_validity()
Validity report plot: composite reliability and AVE by construct
sframe_plot_variable_distribution()
Raw-variable distribution panels: histogram, boxplot, and Q-Q
sframe_plot_term_frequency()
Term-frequency plot: horizontal bar or word cloud
sframe_plot_ngram_frequency()
N-gram-frequency plot: horizontal bar
sframe_plot_cooccurrence()
Term co-occurrence heatmap
sframe_plot_cooccurrence_network()
Term co-occurrence network plot
sframe_plot_sentiment()
Sentiment plot: diverging bar, or a positive/negative comparison cloud
sframe_plot_topics()
Topic-model top-terms plot: faceted bars, one facet per topic

Decision analysis

Multi-criteria decision analysis. The 10 methods run through the analysis plan like any other, so the functions here assemble their input and test how stable a ranking is.

sframe_sensitivity_analysis()
Test how far a decision ranking moves when the weights are perturbed
sframe_assemble_pairwise()
Assemble per-respondent comparison matrices
sframe_aggregate_judgements()
Aggregate individual judgement matrices
sframe_collected_weights()
Criterion weights collected from respondents
sframe_rated_matrix()
Build a performance matrix from rated matrix items
sframe_decision_options()
Normalise the decision options of an analysis-plan block
sframe_dematel_compute()
The DEMATEL total-relation classification

Text analysis

Open-ended answers: term and n-gram frequency, keyword in context, and quote extraction.

sframe_clean_text()
Clean open-ended text responses for analysis
sframe_term_frequency()
Term frequency for open-ended text
sframe_ngram_frequency()
N-gram frequency for open-ended text
sframe_term_context()
Keyword-in-context concordance for open-ended text
sframe_extract_quotes()
Extract representative quotes for each STM topic

Confidence intervals

Base-R bootstrap and effect-size confidence intervals, reused across the inferential runners.

sframe_bootstrap_ci()
Percentile bootstrap confidence interval for a statistic
sframe_cohens_d_ci()
Bootstrap confidence interval for Cohen's d
sframe_cramers_v_ci()
Confidence interval for Cramer's V
sframe_eta_sq_ci()
Confidence interval for eta squared

Demos

25 small teaching demos, each doing one job, and 2 larger reference datasets. Each comes with an instrument and response data, and the teaching demos with a codebook and the results surveyframe produced. See the “Learn by example” article.

sframe_list_demos()
List the bundled demos
sframe_demo()
Load one bundled demo
sframe_demo_qmd()
Copy a demo's Quarto notebook so you can run and change it

Methods

Print, format and summary methods, so every component prints and summarises cleanly at the console and inside reports.

print(<sframe>)
Print an sframe instrument object
format(<sframe>)
Format an sframe instrument object as a string
summary(<sframe>)
Summarise an sframe instrument object
print(<sf_choices>)
Print an sf_choices object
format(<sf_choices>)
Format an sf_choices object as a string
summary(<sf_choices>)
Summarise an sf_choices object
print(<sf_item>)
Print an sf_item object
format(<sf_item>)
Format an sf_item object as a string
summary(<sf_item>)
Summarise an sf_item object
print(<sf_scale>)
Print an sf_scale object
format(<sf_scale>)
Format an sf_scale object as a string
summary(<sf_scale>)
Summarise an sf_scale object
print(<sf_branch>)
Print an sf_branch object
format(<sf_branch>)
Format an sf_branch object as a string
summary(<sf_branch>)
Summarise an sf_branch object
print(<sf_check>)
Print an sf_check object
format(<sf_check>)
Format an sf_check object as a string
summary(<sf_check>)
Summarise an sf_check object
print(<sf_model>)
Print an sf_model object
format(<sf_model>)
Format an sf_model object as a string
summary(<sf_model>)
Summarise an sf_model object

For the report template

The APA cell formatter the Quarto report template calls. Exported because Quarto renders against the installed package.

sframe_apa_cells() sframe_apa_col_labels()
Format a result table's cells as an APA 7 report prints them

Old names (superseded)

Every name changed in 0.4.3, each still working, and what replaced it.