codebook.syn {synthpop}R Documentation

Makes a codebook from a data frame

Description

Describes features of variables in a data frame relevant for synthesis.

Usage

codebook.syn(data, maxlevs = 3)

Arguments

data

a data frame with a data set to be synthesised.

maxlevs

the number of factor levels above which separate tables with all labels are returned as part of labs component.

Value

A list with two components.

tab - a data frame with the following information about each variable:

name

variable name

class

class of variable

nmiss

number of missing values (NA)

perctmiss

percentage of missing values

ndistinct

number of distinct values (excluding missing values)

details

range for numeric variables, maximum length for character variables, labels for factors with <= maxlevs levels

labs - a list of extra tables with labels for each factor with number of levels greater than maxlevs.

Examples

codebook.syn(SD2011)

[Package synthpop version 1.8-0 Index]