Skip to contents

A plain CSV carries codes. dm_1 arrives in SPSS as a column of integers with no variable label and no value labels, and the reader has to reconstruct all of it from the questionnaire. This attaches both from the instrument: the variable label is the item's label, and the value labels come from the item's choice set, which stores its values and labels side by side.

Usage

sframe_export_labelled(data, instrument, path)

Arguments

data

A response data frame, as returned by read_responses().

instrument

The sframe the responses were collected with.

path

Output file. An .sav is written for SPSS, a .dta for Stata, chosen from the extension.

Value

The path, invisibly.

Examples

# \donttest{
demo <- sframe_demo("two_group")
out <- file.path(tempdir(), "two_group.sav")
if (requireNamespace("haven", quietly = TRUE)) {
  sframe_export_labelled(demo$responses, demo$instrument, out)
}
# }