Description Usage Arguments Examples
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.
1 | RosterToLongDf(data, roster.base, id = "PUBID.1997")
|
data |
a data frame |
roster.base |
the stable character prefix of the roster variable |
id |
character name representing the unit identifier |
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.