codebook.syn: Makes a codebook from a data frame

View source: R/codebook.syn.r

codebook.synR 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)

bnowok/synthpop documentation built on Sept. 1, 2022, 2:41 p.m.