Description Usage Arguments Examples
View source: R/5create_custom_panel.R
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.
1 | create_custom_panel(var_names, in_direc, out_direc)
|
var_names |
Variable names to include in custom longitudinal dataset (as vector of strings) |
in_direc |
Directory of PSID .rds to use for custom longitudinal dataset |
out_direc |
Directory to place resulting longitudinal dataset into |
1 2 3 4 5 | create_custom_panel(
var_names = c("V534", "V442", "V398"),
in_direc=system.file("extdata","rds_dir", package = "easyPSID"),
out_direc=tempdir()
)
|
Loading required package: stringr\nLoading required package: LaF\nLoading required package: foreign\nFAM1968.rds Added to Panel\nFAM1969.rds Added to Panel\nWarning messages:\n1: In as.matrix(data$psid_all) : input string \'\xa0M12 TYPE ORGANIZATION DONATED TO\' cannot be translated to UTF-8, is it valid in \'ANSI_X3.4-1968\'?\n2: In as.matrix(data$psid_all) : input string \'\xa0M41 TYPE ORG HD VLNTEER LAST YR\' cannot be translated to UTF-8, is it valid in \'ANSI_X3.4-1968\'?\n3: In as.matrix(data$psid_all) : input string \'\xa0M52 TYPE ORGS FOR OTR PURPOSES\' cannot be translated to UTF-8, is it valid in \'ANSI_X3.4-1968\'?\nsh: 1: rm: Permission denied\n
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.