write.mitmlSAV: Write 'mitml' objects to native SPSS format

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/write.mitmlSAV.R

Description

Saves objects of class mitml in the .sav format used by the statistical software SPSS (IBM Corp., 2013). The function serves as a front-end for write_sav from the haven package.

Usage

1
write.mitmlSAV(x, filename)

Arguments

x

An object of class mitml or mitml.list as produced by panImpute, jomoImpute, mitmlComplete, or similar).

filename

Name of the destination file. The file extension (.sav) is appended if needed.

Details

This function exports multiply imputed data sets to a single .sav file, in which an Imputation_ variable separates the original data and the various imputed data sets. This allows exporting imputed data directly to the native SPSS format.

Alternatively, write.mitmlSPSS may be used for creating separate text and SPSS syntax files, which offers more control over the data format.

Value

None (invisible NULL).

Author(s)

Simon Grund

References

IBM Corp. (2013). IBM SPSS Statistics for Windows, Version 22.0. Armonk, NY: IBM Corp

See Also

panImpute, jomoImpute, mitmlComplete, write.mitmlSPSS

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 
data(studentratings)

fml <- ReadDis + SES ~ ReadAchiev + (1|ID)
imp <- panImpute(studentratings, formula = fml, n.burn = 1000, n.iter = 100, m = 5)

# write data file and SPSS syntax
write.mitmlSAV(imp, filename = "imputation")

## End(Not run)

mitml documentation built on Oct. 5, 2021, 5:07 p.m.