diff --git a/DESCRIPTION b/DESCRIPTION index 596946f..b5a177c 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,18 +1,18 @@ Package: easyPSID Title: Reading, Formatting, and Organizing the Panel Study of Income Dynamics (PSID) -Version: 0.1.1 +Version: 0.1.2 Authors@R: person("Brian", "Aronson",email = "bdaronson@gmail.com", role = c("aut", "cre")) Description: Provides various functions for reading and preparing the Panel Study of Income Dynamics (PSID) for longitudinal analysis, including functions that read the PSID's fixed width format files directly into R, rename all of the PSID's longitudinal variables so that recurring variables have consistent names across years, simplify assembling longitudinal datasets from cross sections of the PSID Family Files, and export the resulting PSID files into file formats common among other statistical programming languages ('SAS', 'STATA', and 'SPSS'). Depends: R (>= 3.0.1), stringr (>= 1.0.0), LaF (>= 0.6.0), foreign (>= 0.8-67) License: MIT + file LICENSE Encoding: UTF-8 -LazyData: true -RoxygenNote: 7.0.2 +LazyData: false +RoxygenNote: 6.1.0 NeedsCompilation: no -Packaged: 2020-02-16 21:30:00 UTC; admin +Packaged: 2021-10-03 14:44:33 UTC; bda13 Author: Brian Aronson [aut, cre] Maintainer: Brian Aronson Repository: CRAN -Date/Publication: 2020-02-16 21:40:02 UTC +Date/Publication: 2021-10-03 15:00:02 UTC diff --git a/LICENSE b/LICENSE index 01330a3..d12caa7 100644 --- a/LICENSE +++ b/LICENSE @@ -1,2 +1,2 @@ -YEAR: 2019 +YEAR: 2021 COPYRIGHT HOLDER: Brian Aronson diff --git a/MD5 b/MD5 index b0380d7..34c4979 100644 --- a/MD5 +++ b/MD5 @@ -1,7 +1,7 @@ -62a7f29caf97d44cb56dff420cc20229 *DESCRIPTION -02d1618577bd2d0466aa03f413aca193 *LICENSE -69627f5a26c562b6becb8fa84ad16468 *NAMESPACE -c1de29bd3be85bcb8ed3f5843d6a2916 *NEWS.md +90415693d449123c4ab45d1de1a51e58 *DESCRIPTION +8effe555a748c8ef043339c2427d17ae *LICENSE +9506bff0123601879225c2af3647593c *NAMESPACE +5f6ebebd4f6a4407a05a788631875939 *NEWS.md 504c78d1143d2eabbd7353bebcc55ee2 *R/10find_desc.R 7203ff66e6fa5ea692020f55683ef9cc *R/1unzip_all_files.R 062d276c9308d1224c420382ee0aaf2a *R/2convert_to_rds.R @@ -13,22 +13,22 @@ d1b5d0e6a1acb4cc5341eef4f0745346 *R/7convert_from_rdata.R 6c1013c14d817547ce674d85fbd2f7ed *R/8find_name.R 220925bea5f68f355e628352b4e141db *R/9find_years.R 00ee728a84bf1ccda82983f101a23f94 *R/PSID_Package.Documentation_function.R -b2e1a61ff7266782d6ae8eb717413698 *R/sysdata.rda -2fc3d460a956393562e0b46eadd1cce7 *README.md +40774678dc10e0cf9a8e6d2e5259f987 *R/sysdata.rda +f6c6aba7f7561381e0646286d9694f5a *README.md a3ec50e70b44fb699009d06d6d1c402e *inst/extdata/rds_dir/FAM1968.rds a24bf4365b653a291af90f9d9fb457d7 *inst/extdata/rds_dir/FAM1969.rds -211376a165be5b245e5cf09346412ab9 *inst/extdata/rds_dir/IND2017.rds +d7cd1cdcf062ed1cc1ab772e9835927c *inst/extdata/rds_dir/IND2019.rds d9542fbbf2513e8559a8be7317c492be *inst/extdata/unzip_dir/FAM1984.do 6b31772af4073883c76d77aae74499cb *inst/extdata/unzip_dir/FAM1984.txt 903436bd03d13eee3bdaf84bcaa2456a *inst/extdata/zip_dir/fam1968.zip -b26037db93eaf350df86e52f2e92ee6b *man/convert_from_rds.Rd -638d11037496c60489b05a6af2ab683b *man/convert_to_rds.Rd -3ef982a9e69452a737f9f767f7048b26 *man/create_custom_panel.Rd -1d5a8e5053d0d780f2a5832756a9502d *man/create_extract.Rd -43694510596de6780a9050c0c9e203ad *man/easyPSID-package.Rd -6772871517946994232c2907bcfaeba5 *man/find_description.Rd -755f810c229ef7d63237e3131c191adb *man/find_name.Rd -39170b51d8820493575f6a58b4dccc26 *man/find_years.Rd -d125e371031dfb7b4c5c597dd695a6d1 *man/rename_fam_vars.Rd -f967609ad5341477406a117a1702c8d7 *man/rename_ind_vars.Rd -36e6772d307e01275470a574e0b38634 *man/unzip_all_files.Rd +afe3f0e80913ceebd730903077fb25b4 *man/convert_from_rds.Rd +dc0873bd81886c48b5df83555ea6e522 *man/convert_to_rds.Rd +8b87c53e7689dd30607c94331317fe78 *man/create_custom_panel.Rd +005e57ff5f826054a68df190e089465b *man/create_extract.Rd +8cca39d80dea448b4043ea520ede9e66 *man/easyPSID-package.Rd +a5fe95482fbcd9ed1354d3a884a7aef3 *man/find_description.Rd +a55e08b7c1a1c1a6e2f714c55e567c71 *man/find_name.Rd +81bae55cab97ac5a020621077ad19eba *man/find_years.Rd +3b7b2ddefacf1506ffd638a87f43f5b7 *man/rename_fam_vars.Rd +e4fb51302e862a2a7c6135eecfd9a30b *man/rename_ind_vars.Rd +6fd3f35620ec7606502ed16910d03cac *man/unzip_all_files.Rd diff --git a/NAMESPACE b/NAMESPACE index dd7f1bf..31fcc1e 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -1,4 +1,4 @@ -# Generated by roxygen2: do not edit by hand +# Generated by roxygen2: do not edit by hand export(convert_from_rds) export(convert_to_rds) diff --git a/NEWS.md b/NEWS.md index f3027a1..52e28cc 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,2 @@ -# easyPSID 0.1.1 -- Added support for 2017 Family and Individual Files -- Lost support for 2015 Individual File \ No newline at end of file +# easyPSID 0.1.2 +- Added support for 2019 Family Files and 2019 Individual cross-sectional file. Please note that support for the 2017 version of the Individual cross-sectional is no longer supported in this version of the package. \ No newline at end of file diff --git a/R/sysdata.rda b/R/sysdata.rda index 674e3a8..a42970e 100644 Binary files a/R/sysdata.rda and b/R/sysdata.rda differ diff --git a/README.md b/README.md index 5f4cf45..b2962ad 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,14 @@ -# easyPSID +# easyPSID README.md ## Overview -[CRAN package](https://CRAN.R-project.org/package=easyPSID) designed to simplify the task of reading the Panel Study of Income Dynamics (PSID) into R and preparing the data for analysis. Although the PSID is one of the most comprehensive longitudinal datasets for examining health and life course patterns among American families, preparing the PSID for analysis can be a difficult task. The PSID comes with no scripts for being read into R, and every wave of each PSID longitudinal variable has a unique name. For example, variables in the 1968 PSID Family File are named `V1-V440` whereas variables within the 1969 PSID Family File are named `V441-V1017`, even though most variables in the 1969 Family Files match those in the 1968 Family File. These aspects of the PSID pose difficulties for R users who want to conduct longitudinal analyses in the PSID. easyPSID simplifies these tasks and several others. +The easyPSID package is designed to simplify the task of reading the Panel Study of Income Dynamics (PSID) into R and preparing the data for analysis. + +Although the PSID is one of the most comprehensive longitudinal datasets for examining health and life course patterns among American families, preparing the PSID for analysis can be a difficult task. The PSID comes with no scripts for being read into R, and every wave of each PSID longitudinal variable has a unique name. For example, variables in the 1968 PSID Family File are named “V1” through “V440” whereas variables within the 1969 PSID Family File are named “V441” through “V1017,” even though of the 1969 Family File variables match those in the 1968 Family File. These aspects of the PSID can pose difficulties for R users who want to conduct longitudinal analyses in the PSID. Fortunately, the easyPSID package is designed to make working with the PSID as easy as possible. ## Example -After downloading multiple waves of the PSID Packaged Data Family Files from https://simba.isr.umich.edu/, a common use of easyPSID is to unzip each wave of the family files, convert them to .rds format, rename all longitudinal variables to consistent names across years, and save the resulting renamed datasets to .rds format. This can be done as follows (assuming the PSID files were saved into `C:/PSID/Zip Files`): +After users have downloaded several waves of the PSID Packaged Data Family Files from https://simba.isr.umich.edu/, a common first use of the easyPSID package is to unzip each wave of the family files, convert them to .rds format, rename all longitudinal variables to consistent names across years, and save these resulting renamed datasets to .rds format with the following code (after amending for directory names). For example: library(easyPSID) unzip_all_files( @@ -24,31 +26,25 @@ After downloading multiple waves of the PSID Packaged Data Family Files from htt ## Installation -This package can be directly installed via CRAN with `install.packages("easyPSID")`. Alternatively, newest versions of this package can be installed with `devtools::install_github("BrianAronson/easyPSID")` - -Prior to working with the easyPSID package, users will need to download packaged PSID data for the family files and cross-sectional individual file from https://simba.isr.umich.edu/. - -## Function Overview - -Below is a brief outline of each function in this package: - -- **unzip\_all\_files** - - Unzips all files in the supplied directory. -- **convert\_to\_rds** - - Read PSID fixed width files into R and saves output in .rds format. -- **rename\_fam\_vars** - - Renames all variables in longitudinal family files to their names when they were first available in the dataset. -- **rename\_ind\_vars** - - Renames all variables in longitudinal family files to their names when they were first available in the dataset. -- **create\_custom\_panel** - - Creates a longitudinal dataset with provided family files consisting of a custom set of variables selected by the user. -- **create\_extract** - - Creates a longitudinal dataset with provided family files consisting of the dataset's N most commonly reoccurring variables. -- **convert\_from\_rdata** - - Converts PSID .rds files to files compatible with STAT, SAS, or SPSS. -- **find\_name** - - Returns the new name (via the rename\_fam\_vars and rename\_ind\_vars functions) of a specified variable. -- **find\_years** - - Returns each year that a given variable is available in the PSID, and its names during those years. -- **find\_description** - - Returns the description of a given variable in the PSID with the variable labels provided by the PSID. \ No newline at end of file +This package can be directly installed via CRAN with: + install.packages("easyPSID") + +Alternatively, newest versions of this package can be installed with: + devtools::install_github("BrianAronson/easyPSID") + +However, prior to working with the easyPSID package, users will need to have already downloaded packaged PSID data for the years that they wish to work with from https://simba.isr.umich.edu/. PSID's packaged data can only be accessed by loading this URL and navigating through the following tabs: Data=> Packaged Data=> Main and Supplemental Studies. The current functions only work with the PSID's family files and cross-sectional individual file. For reference, once downloaded, the family files typically have a naming structure like "fam1968.zip", "fam1969.zip", etc. and the individual cross section will be named something like "ind2015er.zip". + +##Function Overview + +More detailed vignettes for this package are in development, but below is a brief outline of each function in this package: + +- **unzip\_all\_files**: Unzips all files in the supplie directory. +- **convert\_to\_rds**: Read PSID fixed width files into R and saves output in .rds format. +- **rename\_fam\_vars**: Renames all variables in longitudinal family files to their names when they were first available in the dataset. +- **rename\_ind\_vars**: Renames all variables in longitudinal family files to their names when they were first available in the dataset. +- **create\_custom\_panel**: Creates a longitudinal dataset with provided family files consisting of a custom set of variables selected by the user. +- **create\_extract**: Creates a longitudinal dataset with provided family files consisting of the dataset's N most commonly reoccurring variables. +- **convert\_from\_rdata**: Converts PSID .rds files to files compatible with STAT, SAS, or SPSS. +- **find\_name**: Returns the new name (via the rename\_fam\_vars and rename\_ind\_vars functions) of a specified variable. +- **find\_years**: Returns each year that a given variable is available in the PSID, and its names during those years. +- **find\_description**: Returns the description of a given variable in the PSID with the variable labels provided by the PSID. diff --git a/inst/extdata/rds_dir/IND2017.rds b/inst/extdata/rds_dir/IND2017.rds deleted file mode 100644 index 9a4838b..0000000 Binary files a/inst/extdata/rds_dir/IND2017.rds and /dev/null differ diff --git a/inst/extdata/rds_dir/IND2019.rds b/inst/extdata/rds_dir/IND2019.rds new file mode 100644 index 0000000..e0c4d7e Binary files /dev/null and b/inst/extdata/rds_dir/IND2019.rds differ diff --git a/man/convert_from_rds.Rd b/man/convert_from_rds.Rd index d06834e..ffd9657 100644 --- a/man/convert_from_rds.Rd +++ b/man/convert_from_rds.Rd @@ -1,26 +1,26 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/7convert_from_rdata.R -\name{convert_from_rds} -\alias{convert_from_rds} -\title{Export PSID files to another statistical language} -\usage{ -convert_from_rds(language, in_direc, out_direc) -} -\arguments{ -\item{language}{Language to export PSID .rds files into (options include SPSS, SAS, and STATA)} - -\item{in_direc}{Directory of PSID .rds files to export. Note that large files can take a long time to export.} - -\item{out_direc}{Directory for exported files to be placed} -} -\description{ -Exports all .rds files in the chosen directory into a common file format used by one of three other statistical programming languages (SPSS, SAS, and STATA). Unlike most alternatives, this function retains all variable labels provided by the PSID. -} -\examples{ -convert_from_rds( - language="STATA", - in_direc=system.file("extdata","rds_dir", package = "easyPSID"), - out_direc=tempdir() -) -} +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/7convert_from_rdata.R +\name{convert_from_rds} +\alias{convert_from_rds} +\title{Export PSID files to another statistical language} +\usage{ +convert_from_rds(language, in_direc, out_direc) +} +\arguments{ +\item{language}{Language to export PSID .rds files into (options include SPSS, SAS, and STATA)} + +\item{in_direc}{Directory of PSID .rds files to export. Note that large files can take a long time to export.} + +\item{out_direc}{Directory for exported files to be placed} +} +\description{ +Exports all .rds files in the chosen directory into a common file format used by one of three other statistical programming languages (SPSS, SAS, and STATA). Unlike most alternatives, this function retains all variable labels provided by the PSID. +} +\examples{ +convert_from_rds( + language="STATA", + in_direc=system.file("extdata","rds_dir", package = "easyPSID"), + out_direc=tempdir() +) +} \keyword{PSID} diff --git a/man/convert_to_rds.Rd b/man/convert_to_rds.Rd index 55daaff..5ca9c42 100644 --- a/man/convert_to_rds.Rd +++ b/man/convert_to_rds.Rd @@ -1,23 +1,23 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/2convert_to_rds.R -\name{convert_to_rds} -\alias{convert_to_rds} -\title{Convert all PSID files from .txt format to .rds format} -\usage{ -convert_to_rds(in_direc, out_direc) -} -\arguments{ -\item{in_direc}{Directory containing unzipped PSID .txt and .do files} - -\item{out_direc}{Directory to place PSID .rds files into} -} -\description{ -Converts all PSID fixed width format .txt files in a selected directory into .rds format. Importantly, this function assumes that all files contained in the original PSID .zip files (especially those ending in .do) are present in the same directory as the PSID .txt files, and that all files within that directory have the same names as when first unzipped. -} -\examples{ -convert_to_rds( - in_direc=system.file("extdata","unzip_dir", package = "easyPSID"), - out_direc=tempdir() -) -} +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/2convert_to_rds.R +\name{convert_to_rds} +\alias{convert_to_rds} +\title{Convert all PSID files from .txt format to .rds format} +\usage{ +convert_to_rds(in_direc, out_direc) +} +\arguments{ +\item{in_direc}{Directory containing unzipped PSID .txt and .do files} + +\item{out_direc}{Directory to place PSID .rds files into} +} +\description{ +Converts all PSID fixed width format .txt files in a selected directory into .rds format. Importantly, this function assumes that all files contained in the original PSID .zip files (especially those ending in .do) are present in the same directory as the PSID .txt files, and that all files within that directory have the same names as when first unzipped. +} +\examples{ +convert_to_rds( + in_direc=system.file("extdata","unzip_dir", package = "easyPSID"), + out_direc=tempdir() +) +} \keyword{PSID} diff --git a/man/create_custom_panel.Rd b/man/create_custom_panel.Rd index 345e713..7dc7f59 100644 --- a/man/create_custom_panel.Rd +++ b/man/create_custom_panel.Rd @@ -1,30 +1,30 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/5create_custom_panel.R -\name{create_custom_panel} -\alias{create_custom_panel} -\title{Create custom longitudinal (panel) dataset with PSID Family Files} -\usage{ -create_custom_panel(var_names, in_direc, out_direc) -} -\arguments{ -\item{var_names}{Variable names to include in custom longitudinal dataset (as vector of strings)} - -\item{in_direc}{Directory of PSID .rds to use for custom longitudinal dataset} - -\item{out_direc}{Directory to place resulting longitudinal dataset into} -} -\description{ -Uses the longitudinal PSID Family Files to create a custom longitudinal dataset in long format based on all PSID .rds Family files in a selected directory. - -This function can work with data that has been renamed via the rename_fam_vars function or data just converted to .rds format via the convert_to_rds function. It will creates NAs for years when a given variable was not available, and creates a new variable ("Year") to specify the panel of data included in the custom dataset. If a provided variable exists in other waves of the family files under a different name, all waves of that variable will be included in the resulting dataset. - -To create a longitudinal family file of the PSID with all variables in the PSID Family Files, it is recommended that one uses the create_extract function instead. However, such a file can be very large when using many waves of the PSID. Users with more than five waves of the PSID Family Files are highly recommended to avoid creating a longitudinal dataset with all unique Family File variables. -} -\examples{ -create_custom_panel( - var_names = c("V534", "V442", "V398"), - in_direc=system.file("extdata","rds_dir", package = "easyPSID"), - out_direc=tempdir() -) -} +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/5create_custom_panel.R +\name{create_custom_panel} +\alias{create_custom_panel} +\title{Create custom longitudinal (panel) dataset with PSID Family Files} +\usage{ +create_custom_panel(var_names, in_direc, out_direc) +} +\arguments{ +\item{var_names}{Variable names to include in custom longitudinal dataset (as vector of strings)} + +\item{in_direc}{Directory of PSID .rds to use for custom longitudinal dataset} + +\item{out_direc}{Directory to place resulting longitudinal dataset into} +} +\description{ +Uses the longitudinal PSID Family Files to create a custom longitudinal dataset in long format based on all PSID .rds Family files in a selected directory. + +This function can work with data that has been renamed via the rename_fam_vars function or data just converted to .rds format via the convert_to_rds function. It will creates NAs for years when a given variable was not available, and creates a new variable ("Year") to specify the panel of data included in the custom dataset. If a provided variable exists in other waves of the family files under a different name, all waves of that variable will be included in the resulting dataset. + +To create a longitudinal family file of the PSID with all variables in the PSID Family Files, it is recommended that one uses the create_extract function instead. However, such a file can be very large when using many waves of the PSID. Users with more than five waves of the PSID Family Files are highly recommended to avoid creating a longitudinal dataset with all unique Family File variables. +} +\examples{ +create_custom_panel( + var_names = c("V534", "V442", "V398"), + in_direc=system.file("extdata","rds_dir", package = "easyPSID"), + out_direc=tempdir() +) +} \keyword{PSID} diff --git a/man/create_extract.Rd b/man/create_extract.Rd index 0d4b083..cf7dd0d 100644 --- a/man/create_extract.Rd +++ b/man/create_extract.Rd @@ -1,28 +1,28 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/6create_extract.R -\name{create_extract} -\alias{create_extract} -\title{Create subset of common family file variables in long format} -\usage{ -create_extract(in_direc, out_direc, num_vars = 500, all_years = F) -} -\arguments{ -\item{in_direc}{Directory containing waves of the Family Files in .rds format} - -\item{out_direc}{Directory to place export file into} - -\item{num_vars}{Number of variables to include in export dataset (default = 500). High variable counts with many waves of data require a significant amount of RAM, and may cause this function to throw errors if a computer's RAM is insufficient} - -\item{all_years}{Select most common variables based on all years of the PSID rather than based in the data actually supplied} -} -\description{ -Creates an extract dataset in long format consisting of the 500 most frequently reoccurring PSID Family Variables across all supplied waves of the PSID. -} -\examples{ -create_extract( - in_direc=system.file("extdata","rds_dir", package = "easyPSID"), - out_direc=tempdir(), - num_vars=25, -) -} +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/6create_extract.R +\name{create_extract} +\alias{create_extract} +\title{Create subset of common family file variables in long format} +\usage{ +create_extract(in_direc, out_direc, num_vars = 500, all_years = F) +} +\arguments{ +\item{in_direc}{Directory containing waves of the Family Files in .rds format} + +\item{out_direc}{Directory to place export file into} + +\item{num_vars}{Number of variables to include in export dataset (default = 500). High variable counts with many waves of data require a significant amount of RAM, and may cause this function to throw errors if a computer's RAM is insufficient} + +\item{all_years}{Select most common variables based on all years of the PSID rather than based in the data actually supplied} +} +\description{ +Creates an extract dataset in long format consisting of the 500 most frequently reoccurring PSID Family Variables across all supplied waves of the PSID. +} +\examples{ +create_extract( + in_direc=system.file("extdata","rds_dir", package = "easyPSID"), + out_direc=tempdir(), + num_vars=25, +) +} \keyword{PSID} diff --git a/man/easyPSID-package.Rd b/man/easyPSID-package.Rd index f383555..23ac76d 100644 --- a/man/easyPSID-package.Rd +++ b/man/easyPSID-package.Rd @@ -1,17 +1,17 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/PSID_Package.Documentation_function.R -\docType{package} -\name{easyPSID-package} -\alias{easyPSID} -\alias{easyPSID-package} -\title{easyPSID: Reading, Formatting, and Organizing the Panel Study of Income Dynamics (PSID)} -\description{ -Provides various functions for reading and preparing the Panel Study of Income Dynamics (PSID) for longitudinal analysis, including functions that read the PSID's fixed width format files directly into R, rename all of the PSID's longitudinal variables so that recurring variables have consistent names across years, simplify assembling longitudinal datasets from cross sections of the PSID Family Files, and export the resulting PSID files into file formats common among other statistical programming languages ('SAS', 'STATA', and 'SPSS'). -} -\details{ -This package is designed for use with the PSID's packaged data Family Files, available at https://simba.isr.umich.edu/. See easyPSID's readme at https://github.com/BrianAronson/easyPSID/blob/master/README.md for a more detailed overview and guide for using this package. -} -\author{ -\strong{Maintainer}: Brian Aronson \email{bdaronson@gmail.com} - +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/PSID_Package.Documentation_function.R +\docType{package} +\name{easyPSID-package} +\alias{easyPSID} +\alias{easyPSID-package} +\title{easyPSID: Reading, Formatting, and Organizing the Panel Study of Income Dynamics (PSID)} +\description{ +Provides various functions for reading and preparing the Panel Study of Income Dynamics (PSID) for longitudinal analysis, including functions that read the PSID's fixed width format files directly into R, rename all of the PSID's longitudinal variables so that recurring variables have consistent names across years, simplify assembling longitudinal datasets from cross sections of the PSID Family Files, and export the resulting PSID files into file formats common among other statistical programming languages ('SAS', 'STATA', and 'SPSS'). +} +\details{ +This package is designed for use with the PSID's packaged data Family Files, available at https://simba.isr.umich.edu/. See easyPSID's readme at https://github.com/BrianAronson/easyPSID/blob/master/README.md for a more detailed overview and guide for using this package. +} +\author{ +\strong{Maintainer}: Brian Aronson \email{bdaronson@gmail.com} + } diff --git a/man/find_description.Rd b/man/find_description.Rd index 9966cda..a2a6e93 100644 --- a/man/find_description.Rd +++ b/man/find_description.Rd @@ -1,18 +1,18 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/10find_desc.R -\name{find_description} -\alias{find_description} -\title{Find description of PSID variable} -\usage{ -find_description(variables) -} -\arguments{ -\item{variables}{Variable names to look up (as individual string or vector of strings)} -} -\description{ -Finds the descriptions of selected PSID variables. -} -\examples{ -find_description(variables=c("V2","V30")) -} +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/10find_desc.R +\name{find_description} +\alias{find_description} +\title{Find description of PSID variable} +\usage{ +find_description(variables) +} +\arguments{ +\item{variables}{Variable names to look up (as individual string or vector of strings)} +} +\description{ +Finds the descriptions of selected PSID variables. +} +\examples{ +find_description(variables=c("V2","V30")) +} \keyword{PSID} diff --git a/man/find_name.Rd b/man/find_name.Rd index 19bac84..2e1013f 100644 --- a/man/find_name.Rd +++ b/man/find_name.Rd @@ -1,20 +1,20 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/8find_name.R -\name{find_name} -\alias{find_name} -\title{Lookup new longitudinal variables names} -\usage{ -find_name(variable, var_year = TRUE) -} -\arguments{ -\item{variable}{Variable to look up} - -\item{var_year}{Report year when renamed variable first entered the PSID dataset (default=TRUE)} -} -\description{ -Finds the new name of any longitudinal variable in the PSID Family Files or Individual files following implementation of the rename_fam_vars and rename_ind_vars functions. -} -\examples{ -find_name(variable="V1244",var_year=FALSE) -} +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/8find_name.R +\name{find_name} +\alias{find_name} +\title{Lookup new longitudinal variables names} +\usage{ +find_name(variable, var_year = TRUE) +} +\arguments{ +\item{variable}{Variable to look up} + +\item{var_year}{Report year when renamed variable first entered the PSID dataset (default=TRUE)} +} +\description{ +Finds the new name of any longitudinal variable in the PSID Family Files or Individual files following implementation of the rename_fam_vars and rename_ind_vars functions. +} +\examples{ +find_name(variable="V1244",var_year=FALSE) +} \keyword{PSID} diff --git a/man/find_years.Rd b/man/find_years.Rd index 60f3e47..03acf3f 100644 --- a/man/find_years.Rd +++ b/man/find_years.Rd @@ -1,20 +1,20 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/9find_years.R -\name{find_years} -\alias{find_years} -\title{Find years of PSID variable} -\usage{ -find_years(variable, var_names = TRUE) -} -\arguments{ -\item{variable}{Variable name to look up} - -\item{var_names}{Report names for longitudinal PSID variable across years (default=TRUE)} -} -\description{ -Finds the years and corresponding variable names for any longitudinal PSID variable in the PSID Family Files and Individual file. -} -\examples{ -find_years(variable="V3",var_names=FALSE) -} +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/9find_years.R +\name{find_years} +\alias{find_years} +\title{Find years of PSID variable} +\usage{ +find_years(variable, var_names = TRUE) +} +\arguments{ +\item{variable}{Variable name to look up} + +\item{var_names}{Report names for longitudinal PSID variable across years (default=TRUE)} +} +\description{ +Finds the years and corresponding variable names for any longitudinal PSID variable in the PSID Family Files and Individual file. +} +\examples{ +find_years(variable="V3",var_names=FALSE) +} \keyword{PSID} diff --git a/man/rename_fam_vars.Rd b/man/rename_fam_vars.Rd index 4ce40b3..8d5cfa8 100644 --- a/man/rename_fam_vars.Rd +++ b/man/rename_fam_vars.Rd @@ -1,23 +1,23 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/3rename_fam_vars.R -\name{rename_fam_vars} -\alias{rename_fam_vars} -\title{Rename longitudinal Family File variables} -\usage{ -rename_fam_vars(in_direc, out_direc) -} -\arguments{ -\item{in_direc}{Directory of PSID .rds files to rename} - -\item{out_direc}{Directory for renamed PSID .rds files to be saves to. Warning: If no directory specified, this function will overwrite the Family Files in the current directory.} -} -\description{ -Renames all longitudinal variables in every PSID Family File of a given directory, such that variables are labeled with the variable name used when the variable was first made available in the PSID. For example, the "Release Number" variable was first recorded in the PSID dataset in 1968 as variable "V1" but its name in the 1969 family file is "V441". This program changes the "Release Number" variable name to "V1" in 1968 and all subsequent waves. -} -\examples{ -rename_fam_vars( - in_direc=system.file("extdata","rds_dir", package = "easyPSID"), - out_direc=tempdir() -) -} +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/3rename_fam_vars.R +\name{rename_fam_vars} +\alias{rename_fam_vars} +\title{Rename longitudinal Family File variables} +\usage{ +rename_fam_vars(in_direc, out_direc) +} +\arguments{ +\item{in_direc}{Directory of PSID .rds files to rename} + +\item{out_direc}{Directory for renamed PSID .rds files to be saves to. Warning: If no directory specified, this function will overwrite the Family Files in the current directory.} +} +\description{ +Renames all longitudinal variables in every PSID Family File of a given directory, such that variables are labeled with the variable name used when the variable was first made available in the PSID. For example, the "Release Number" variable was first recorded in the PSID dataset in 1968 as variable "V1" but its name in the 1969 family file is "V441". This program changes the "Release Number" variable name to "V1" in 1968 and all subsequent waves. +} +\examples{ +rename_fam_vars( + in_direc=system.file("extdata","rds_dir", package = "easyPSID"), + out_direc=tempdir() +) +} \keyword{PSID} diff --git a/man/rename_ind_vars.Rd b/man/rename_ind_vars.Rd index bc34e04..63f5dd2 100644 --- a/man/rename_ind_vars.Rd +++ b/man/rename_ind_vars.Rd @@ -1,30 +1,31 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/4rename_ind_vars.R -\name{rename_ind_vars} -\alias{rename_ind_vars} -\title{Renames longitudinal Cross-year Individual variables and saves in long format} -\usage{ -rename_ind_vars(in_direc, out_direc, only_long_vars = F, cust_vars = NULL) -} -\arguments{ -\item{in_direc}{Directory of PSID Cross-year Individual file .rds file} - -\item{out_direc}{Directory for renamed and transformed PSID Cross-year Individual file to be saved to} - -\item{only_long_vars}{Keep only longitudinal variables in dataset} - -\item{cust_vars}{Custom variables to keep in dataset (as character vector). Output will always include "ER30001", "fam_id_68", and "Year"} -} -\description{ -Renames all repeated variables in the Cross-year Individual file so that matching variables across waves have the same name, and transforms the resulting dataset into long format. The longitudinal file does not include rows for respondents who were missing in a given wave, and cross-sectional variables are marked as NA during waves when they were not asked. In addition, the resulting file adds two variables for ease of use: "Year" and "fam_id_68". - -This function may require up to 8gb of RAM, and will likely throw "cannot allocate memory" errors to users with less RAM on their computer. Users with memory issues should implement the "only_long_vars" or "cust_vars" options. -} -\examples{ -rename_ind_vars( - only_long_vars=TRUE, - in_direc=system.file("extdata","rds_dir", package = "easyPSID"), - out_direc=tempdir() -) -} +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/4rename_ind_vars.R +\name{rename_ind_vars} +\alias{rename_ind_vars} +\title{Renames longitudinal Cross-year Individual variables and saves in long format} +\usage{ +rename_ind_vars(in_direc, out_direc, only_long_vars = F, + cust_vars = NULL) +} +\arguments{ +\item{in_direc}{Directory of PSID Cross-year Individual file .rds file} + +\item{out_direc}{Directory for renamed and transformed PSID Cross-year Individual file to be saved to} + +\item{only_long_vars}{Keep only longitudinal variables in dataset} + +\item{cust_vars}{Custom variables to keep in dataset (as character vector). Output will always include "ER30001", "fam_id_68", and "Year"} +} +\description{ +Renames all repeated variables in the Cross-year Individual file so that matching variables across waves have the same name, and transforms the resulting dataset into long format. The longitudinal file does not include rows for respondents who were missing in a given wave, and cross-sectional variables are marked as NA during waves when they were not asked. In addition, the resulting file adds two variables for ease of use: "Year" and "fam_id_68". + +This function may require up to 8gb of RAM, and will likely throw "cannot allocate memory" errors to users with less RAM on their computer. Users with memory issues should implement the "only_long_vars" or "cust_vars" options. +} +\examples{ +rename_ind_vars( + only_long_vars=TRUE, + in_direc=system.file("extdata","rds_dir", package = "easyPSID"), + out_direc=tempdir() +) +} \keyword{PSID} diff --git a/man/unzip_all_files.Rd b/man/unzip_all_files.Rd index c1270d7..7feda9d 100644 --- a/man/unzip_all_files.Rd +++ b/man/unzip_all_files.Rd @@ -1,23 +1,23 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/1unzip_all_files.R -\name{unzip_all_files} -\alias{unzip_all_files} -\title{Unzip all PSID files} -\usage{ -unzip_all_files(in_direc, out_direc) -} -\arguments{ -\item{in_direc}{Directory of .zip files to be unzipped} - -\item{out_direc}{Directory for unzipped PSID files to be placed} -} -\description{ -Unzips all .zip_files files in the specified directory. -} -\examples{ -unzip_all_files( - in_direc=system.file("extdata", "zip_dir", package = "easyPSID"), - out_direc=tempdir() -) -} +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/1unzip_all_files.R +\name{unzip_all_files} +\alias{unzip_all_files} +\title{Unzip all PSID files} +\usage{ +unzip_all_files(in_direc, out_direc) +} +\arguments{ +\item{in_direc}{Directory of .zip files to be unzipped} + +\item{out_direc}{Directory for unzipped PSID files to be placed} +} +\description{ +Unzips all .zip_files files in the specified directory. +} +\examples{ +unzip_all_files( + in_direc=system.file("extdata", "zip_dir", package = "easyPSID"), + out_direc=tempdir() +) +} \keyword{PSID}