Skip to contents

Every surveyframe class returns its primary table, and each class has its own columns. Where an object holds more than one table, the others are reachable through the named accessors in sf_accessors, or, for a full tabular record of an instrument, through codebook_report().

Value

A data frame, with the columns listed above for the class given.

What each class gives

  • sframe: one row per item, with id, label, type, choice_set, scale_id, reverse and required.

  • sframe_codebook: one row per item, the codebook's item table.

  • sframe_validation: one row per problem, with check and problem.

  • sframe_analysis_results: one row per block, with block, research_question, method and apa.

  • sframe_reliability_report: one row per scale, with scale_id, label, n_items, n, alpha and omega.

  • sframe_item_report: one row per item, with scale_id and the item diagnostics.

  • sframe_quality_report: one row per check, the flattened quality checks.

  • sframe_efa_report: one row per measure, the readiness measures.

  • sframe_sensitivity: one row per perturbation, with criterion, direction, weight, rho, rank_changed and top_changed.

A summary, and where the full record is

These tables are a summary of the columns a reader scans first. The item table leaves out help text, placeholder, matrix rows, comparison items and scale, slider and rating settings, date bounds, section introduction and page; the scale table leaves out min_valid, the reverse key and the weights. Read the stored declaration in full through sf_items(), sf_scales() and the rest of sf_accessors, each of which returns the component objects themselves, or through write_sframe() for the interchange record.

A class holding one table returns it directly, so it keeps that table's own row names and row.names has no effect. Pass row.names to base::as.data.frame() on the returned frame where you need to set them. The coercion gives one view of an object. An instrument, for example, returns its items, and its choice sets and scales come from sf_choice_sets(), sf_scales() or codebook_report().

Examples

cs    <- sf_choices("ag5", 1:5,
           c("Strongly disagree", "Disagree", "Neutral",
             "Agree", "Strongly agree"))
item  <- sf_item("sat_1", "The service met my expectations.",
                 type = "likert", choice_set = "ag5", scale_id = "sat")
scale <- sf_scale("sat", "Satisfaction", items = "sat_1")
instr <- sf_instrument("Demo Survey", components = list(cs, item, scale))

as.data.frame(instr)
#>      id                            label   type choice_set scale_id reverse
#> 1 sat_1 The service met my expectations. likert        ag5      sat   FALSE
#>   required
#> 1    FALSE
as.data.frame(cs)
#>   value             label
#> 1     1 Strongly disagree
#> 2     2          Disagree
#> 3     3           Neutral
#> 4     4             Agree
#> 5     5    Strongly agree