Learn R Programming

synthpop (version 1.9-0)

codebook.syn: 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)

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.

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.

Examples

Run this code
codebook.syn(SD2011)

Run the code above in your browser using DataLab