### NLSY97 variable "id" is linked to the descriptive label in the header of the STATA formated data file.dtc" ###
pathSourceLabels <- paste0(myExtract,".dct")
SourceLabels<-read.csv(pathSourceLabels,header=TRUE, skip=0,nrow=17, sep="")
SourceLabels$X.<-NULL # remove extra column
SourceLabels
infile dictionary
1 R0000100 PUBID - YTH ID CODE 1997
2 R0536300 KEY!SEX (SYMBOL) 1997
3 R0536401 KEY!BDATE M/Y (SYMBOL) 1997
4 R0536402 KEY!BDATE M/Y (SYMBOL) 1997
5 R1482600 KEY!RACE_ETHNICITY (SYMBOL) 1997
6 R4893400 HOW OFTEN R ATTEND WORSHIP SERV 2000
7 R6520100 HOW OFTEN R ATTEND WORSHIP SERV 2001
8 S0919300 HOW OFTEN R ATTEND WORSHIP SERV 2002
9 S2987800 HOW OFTEN R ATTEND WORSHIP SERV 2003
10 S4681700 HOW OFTEN R ATTEND WORSHIP SERV 2004
11 S6316700 HOW OFTEN R ATTEND WORSHIP SERV 2005
12 S8331500 HOW OFTEN R ATTEND WORSHIP SERV 2006
13 T0739400 HOW OFTEN R ATTEND WORSHIP SERV 2007
14 T2781700 HOW OFTEN R ATTEND WORSHIP SERV 2008
15 T4495000 HOW OFTEN R ATTEND WORSHIP SERV 2009
16 T6143400 HOW OFTEN R ATTEND WORSHIP SERV 2010
17 T7637300 HOW OFTEN R ATTEND WORSHIP SERV 2011
# rename columns to match NLS Web Investigator format
SourceLabels<-plyr::rename(SourceLabels,
replace=c("infile"="RNUM","dictionary"="VARIABLE_TITLE")
)
# sort for visual inspection
SourceLabels<-SourceLabels[ with(SourceLabels, order(RNUM)), ]
SourceLabels
RNUM VARIABLE_TITLE
1 R0000100 PUBID - YTH ID CODE 1997
2 R0536300 KEY!SEX (SYMBOL) 1997
3 R0536401 KEY!BDATE M/Y (SYMBOL) 1997
4 R0536402 KEY!BDATE M/Y (SYMBOL) 1997
5 R1482600 KEY!RACE_ETHNICITY (SYMBOL) 1997
6 R4893400 HOW OFTEN R ATTEND WORSHIP SERV 2000
7 R6520100 HOW OFTEN R ATTEND WORSHIP SERV 2001
8 S0919300 HOW OFTEN R ATTEND WORSHIP SERV 2002
9 S2987800 HOW OFTEN R ATTEND WORSHIP SERV 2003
10 S4681700 HOW OFTEN R ATTEND WORSHIP SERV 2004
11 S6316700 HOW OFTEN R ATTEND WORSHIP SERV 2005
12 S8331500 HOW OFTEN R ATTEND WORSHIP SERV 2006
13 T0739400 HOW OFTEN R ATTEND WORSHIP SERV 2007
14 T2781700 HOW OFTEN R ATTEND WORSHIP SERV 2008
15 T4495000 HOW OFTEN R ATTEND WORSHIP SERV 2009
16 T6143400 HOW OFTEN R ATTEND WORSHIP SERV 2010
17 T7637300 HOW OFTEN R ATTEND WORSHIP SERV 2011