Amelia (version 1.7.4)

write.amelia: Write Amelia imputations to file


Writes the imptuted datasets to file from a run of amelia.


write.amelia(obj, separate = TRUE, file.stem,
                         extension = NULL, format = "csv",
                         impvar = "imp", = TRUE,  …)



an object of class "amelia"; typically output from the function amelia.


logical variable. If TRUE (default), the imputed datasets will be written to separate files, whose names come from the file.stem and extension arguments. If FALSE, the imputations are stacked and written as a single file.


the leading part of the filename to save to output The imputation number and extension will be added to complete the filename. This can include a directory path.


the extension of the filename. This is simply what follows file.stem and the imputation number.


one of the following output formats: csv, dta or table. See details.


the name of imputation number variable written to the stacked dataset when separate is FALSE.

logical variable indicating whether the original, unimputed dataset should be included in the stacked dataset when separate is FALSE.

further arguments for the write functions.


write.amelia writes the imputed datasets to a file or a set of files using one of the following functions: write.csv, write.dta, or write.table. You can pass arguments to these functions from write.amelia.

When separate is TRUE, each imputed dataset is written to its own file. If you were to set file.stem to "outdata" and the extension to ".csv" , then the resulting filename of the written files will be


and so on.

When separate is FALSE, the function adds a variable called impvar to each dataset which indicates the imputed dataset to which the row belongs. Then, each of the datasets are stacked together to create one dataset. If is TRUE, then the original, unimputed dataset is included at the top of the stack, with its imputation number set to 0.

See Also

write.csv, write.table, write.dta