Skip to content

Commit

Permalink
Add 2012 & 2014 variables for Gen2 relationships
Browse files Browse the repository at this point in the history
ref #3
  • Loading branch information
wibeasley committed Oct 14, 2018
1 parent b818396 commit d8fff38
Show file tree
Hide file tree
Showing 10 changed files with 435 additions and 155 deletions.
39 changes: 20 additions & 19 deletions Base79/ItemYears.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ namespace Nls.Base79 {
public static class ItemYears {
public const Int16 Gen1Roster = 1979;

public readonly static Int16[] Gen1AndGen2 = { 1979, 1980, 1981, 1982, 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1996, 1998, 2000, 2002, 2004, 2006, 2008, 2010, 2012 };
public readonly static Int16[] Gen1AndGen2 = { 1979, 1980, 1981, 1982, 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1996, 1998, 2000, 2002, 2004, 2006, 2008, 2010, 2012, 2014 };

public readonly static Int16[] Gen1ShareBioparent = { 2006, 2010 };

Expand All @@ -23,31 +23,32 @@ public static class ItemYears {
//public readonly static Int16[] Gen1BioparentBirthMonth = ItemYears.Gen1BioparentBirthYear;
public readonly static Int16[] Gen1BioparentAge = ItemYears.Gen1BioparentBirthYear;

public readonly static Int16[] Gen2ShareBiodad = { 2006, 2008, 2010, 2012 };
public readonly static Int16[] Gen2ShareBiodad = { 2006, 2008, 2010, 2012, 2014 };

public readonly static Int16[] FatherAsthmaGen2 = { 2004, 2006, 2008 };
//public readonly static Int16[] FatherDeadGen2 = { 2006, 2008, 2010, 2012, 2014 }; // Not incorporated yet. THrees items: (a) alive/dead, (b) month of death, (c) year of death. May not be biodad?
public readonly static Int16[] FatherAsthmaGen2 = { 2004, 2006, 2008, 2010, 2010, 2012, 2014 };

public readonly static Int16[] BabyDaddyItems = { 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1996, 1998, 2000, 2002, 2004, 2006, 2008, 2010 };
public readonly static Int16[] BabyDaddyInHH = { 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1996, 1998, 2000, 2002, 2004, 2006, 2008, 2010 };
public readonly static Int16[] BabyDaddyIsAlive = { 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1996, 1998, 2000, 2002, 2004, 2006, 2008, 2010 };
public readonly static Int16[] BabyDaddyInHHEver = { 1993, 1994, 1996, 1998, 2000, 2002, 2004, 2006, 2008, 2010 };
// Baby Daddy: Questions answered by the Gen1 Mother about the father of her Gen2 child (ie, the items are located in the NLSY Gen1 data source)
public readonly static Int16[] BabyDaddyItems = { 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1996, 1998, 2000, 2002, 2004, 2006, 2008, 2010, 2012, 2014 };
public readonly static Int16[] BabyDaddyInHH = { 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1996, 1998, 2000, 2002, 2004, 2006, 2008, 2010, 2012, 2014 };
public readonly static Int16[] BabyDaddyIsAlive = { 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1996, 1998, 2000, 2002, 2004, 2006, 2008, 2010, 2012, 2014 };
public readonly static Int16[] BabyDaddyInHHEver = { 1993, 1994, 1996, 1998, 2000, 2002, 2004, 2006, 2008, 2010, 2012, 2014 };
public readonly static Int16[] BabyDaddyLeftHHMonthOrNeverLivedInHH = { 1992 };
public readonly static Int16[] BabyDaddyLeftHHMonth = { 1993, 1994, 1996, 1998, 2000, 2002, 2004, 2006, 2008, 2010 };
public readonly static Int16[] BabyDaddyLeftHHMonth = { 1993, 1994, 1996, 1998, 2000, 2002, 2004, 2006, 2008, 2010, 2012, 2014 };
public readonly static Int16[] BabyDaddyLeftHHYearNeverAsked = { 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991 };
public readonly static Int16[] BabyDaddyLeftHHYearTwoDigit = { 1992, 1993 };
public readonly static Int16[] BabyDaddyLeftHHYearFourDigit = { 1994, 1996, 1998, 2000, 2002, 2004, 2006, 2008, 2010 };
public readonly static Int16[] BabyDaddyLeftHHYearFourDigit = { 1994, 1996, 1998, 2000, 2002, 2004, 2006, 2008, 2010, 2012, 2014 };
public readonly static Int16[] BabyDaddyLeftHHDate = { 1992, 1993, 1994, 1996, 1998, 2000, 2002, 2004, 2006, 2008, 2010 };

public readonly static Int16[] BabyDaddyDeathNeverAsked = { 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991 };
public readonly static Int16[] BabyDaddyDeathTwoDigitYear = { 1992, 1993 };
public readonly static Int16[] BabyDaddyDeathFourDigitYear = { 1994, 1996, 1998, 2000, 2002, 2004, 2006, 2008, 2010 };
public readonly static Int16[] BabyDaddyDeathDate = { 1992, 1993, 1994, 1996, 1998, 2000, 2002, 2004, 2006, 2008, 2010 };
public readonly static Int16[] BabyDaddyDistanceFromHHFuzzyCeiling = { 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1996, 1998, 2000, 2002, 2004, 2006, 2008, 2010 };
public readonly static Int16[] BabyDaddyAsthma = { 2004, 2006, 2008, 2010 };

public readonly static Int16[] Gen2CFatherItems = { 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1996, 1998, 2000, 2002, 2004, 2006, 2008, 2010 };
public readonly static Int16[] Gen2CFatherInHH = { 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1992, 1993, 1994, 1996, 1998, 2000, 2002, 2004, 2006, 2008, 2010 };//No 1991
public readonly static Int16[] Gen2CFatherAlive = { 1984, 1985, 1986, 1988, 1990, 1992, 1993, 1994, 1996, 1998, 2000, 2002, 2004, 2006, 2008, 2010 }; //No 1987, 1989, 1991 (but 1993 is present)
public readonly static Int16[] Gen2CFatherDistanceFromMotherFuzzyCeiling = { 1984, 1985, 1986, 1988, 1990, 1992, 1994, 1996, 1998, 2000, 2002, 2004, 2006, 2008, 2010 };//No odd years after 1985
public readonly static Int16[] BabyDaddyDeathFourDigitYear = { 1994, 1996, 1998, 2000, 2002, 2004, 2006, 2008, 2010, 2012, 2014 };
public readonly static Int16[] BabyDaddyDeathDate = { 1992, 1993, 1994, 1996, 1998, 2000, 2002, 2004, 2006, 2008, 2010, 2012, 2014 };
public readonly static Int16[] BabyDaddyDistanceFromHHFuzzyCeiling = { 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1996, 1998, 2000, 2002, 2004, 2006, 2008, 2010, 2012, 2014 };
public readonly static Int16[] BabyDaddyAsthma = { 2004, 2006, 2008, 2010, 2012, 2014 };

public readonly static Int16[] Gen2CFatherItems = { 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1996, 1998, 2000, 2002, 2004, 2006, 2008, 2010, 2012, 2014 };
public readonly static Int16[] Gen2CFatherInHH = { 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1992, 1993, 1994, 1996, 1998, 2000, 2002, 2004, 2006, 2008, 2010, 2012, 2014 };//No 1991
public readonly static Int16[] Gen2CFatherAlive = { 1984, 1985, 1986, 1988, 1990, 1992, 1993, 1994, 1996, 1998, 2000, 2002, 2004, 2006, 2008, 2010, 2012, 2014 }; //No 1987, 1989, 1991 (but 1993 is present)
public readonly static Int16[] Gen2CFatherDistanceFromMotherFuzzyCeiling = { 1984, 1985, 1986, 1988, 1990, 1992, 1994, 1996, 1998, 2000, 2002, 2004, 2006, 2008, 2010, 2012, 2014 };//No odd years after 1985
}
}
9 changes: 9 additions & 0 deletions dal/import-79-metadata.R
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,15 @@ purrr::pmap_int(
# a <- ds_file$entries[[15]]
# table(a$ID)

# RODBC::sqlSave(
# channel = channel_rodbc,
# dat = ds_file$entries[[16]][, ],
# tablename = "Metadata.tblVariable",
# safer = TRUE, # Don't keep the existing table.
# rownames = FALSE,
# append = TRUE
# )

# DBI::dbWriteTable(
# conn = channel,
# name = DBI::Id(catalog="NlsyLinks79", schema="Metadata", table="tblv"),
Expand Down
2 changes: 1 addition & 1 deletion dal/import-79-raw.R
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ for( i in seq_len(nrow(ds_extract)) ) { # i <- 1L
channel = channel_rodbc,
dat = d,
tablename = ds_extract$table_name_qualified[i],
safer = TRUE, # Don't keep the existing table.
safer = FALSE, # Don't keep the existing table.
rownames = FALSE,
append = TRUE
) %>%
Expand Down
2 changes: 1 addition & 1 deletion dal/import-97-raw.R
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ for( i in seq_len(nrow(ds_extract)) ) { # i <- 1L
channel = channel_rodbc,
dat = d,
tablename = ds_extract$table_name_qualified[i],
safer = TRUE, # Don't keep the existing table.
safer = FALSE, # Don't keep the existing table.
rownames = FALSE,
append = TRUE
) %>%
Expand Down
1 change: 1 addition & 0 deletions data-public/metadata/tables-79/ArchiveDescription.csv
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,4 @@
84,Adds Gen1 back,2013-11-06
85,"R excludes 0, .0625, .125 (as well as .375 & .75)",2013-11-20
86,Add 2012 variables,2018-01-04
89,Add 2014 variables for Gen2 relationships,2018-10-14
10 changes: 5 additions & 5 deletions data-public/metadata/tables-79/item.csv
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ ID,Label,MinValue,MinNonnegative,MaxValue,Active,Notes
40,FatherHasAsthmaGen2,-7,0,1,TRUE,
48,BioKidCountGen1,0,0,11,TRUE,
49,Gen1ChildsIDByBirthOrder,-4,1,11,TRUE,
50,HerTwinsTripsAreListed,-5,0,5,TRUE,
52,HerTwinsAreMz,-5,0,5,TRUE,
53,HerTripsAreMz,-5,0,5,TRUE,
54,HerTwinsMistakenForEachOther,-5,1,2,TRUE,
55,HerTripsMistakenForEachOther,-5,1,2,TRUE,
50,HerTwinsTripsAreListed,-5,0,5,TRUE,"Manually reviewed after 2010 wave, but not since"
52,HerTwinsAreMz,-5,0,5,TRUE,"Manually reviewed after 2010 wave, but not since"
53,HerTripsAreMz,-5,0,5,TRUE,"Manually reviewed after 2010 wave, but not since"
54,HerTwinsMistakenForEachOther,-5,1,2,TRUE,"Manually reviewed after 2010 wave, but not since"
55,HerTripsMistakenForEachOther,-5,1,2,TRUE,"Manually reviewed after 2010 wave, but not since"
60,BirthOrderInNlsGen2,-3,1,11,TRUE,
63,SiblingCountTotalFen1,-3,0,29,TRUE,
64,BioKidCountGen2,-7,0,11,TRUE,
Expand Down
Loading

0 comments on commit d8fff38

Please sign in to comment.