RosterToLongDf: Conversion of Roster Variables to Long Format

Description Usage Arguments Examples

Description

The NLS has roster variables, variable dimension arrays which hold items like jobs that a person may have had over a year. RosterToLongDf turns a set of roster variables in a wide data frame into a long data frame convenient for analysis.

Usage

1
RosterToLongDf(data, roster.base, id = "PUBID.1997")

Arguments

data

a data frame

roster.base

the stable character prefix of the roster variable

id

character name representing the unit identifier

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
library(NLSdata)

## Not run: 
codebook <- system.file("Investigator", "Occupations.cdb", package = "NLSdata")
csv.extract <- system.file("Investigator", "Occupations.csv", package = "NLSdata")

nls.obj <- CreateNLSdata(codebook, csv.extract)
occ.df <- RosterToLongDf(nls.obj$data, "YEMP_OCCODE_2002")

occ.df$math.cs <- (occ.df$YEMP_OCCODE_2002 >= 1000 &
                   occ.df$YEMP_OCCODE_2002 <= 1240)

## End(Not run)

google/NLSdata documentation built on May 17, 2019, 7:43 a.m.