Description Usage Arguments Value Examples
The input is the path to the file with variable information, which must be a .csv file with the following seven named columns:
Column Name Description Variable The variable name Type The type of variable (x, ordinal, continuous, or other) Categories A category specification (see [parse_cat_spec] for each ordinal variable Missing_Value Value that represents missing data for that variable. Multiple values are separated by commas. Ex: -1,99 Left_Right_Side The side (prefix/affix) on which the label is appended to distinguish left/right variables Left_Label The label that marks left variables Right_Label The label that marks right variables Left_Right_Approach The approach to use for merging left/right variables.
The first four columns are required, whereas the final four columns are optional (since they need only be used if there exist left/right variables that should be merged). Further details on each column are provided next.
Details on Variable: The variable names must be unique. An error is thrown if they are not. Each variable must match a column name in the corresponding data file (see [load_cp_data]).
Details on Type: There should be exactly one variable specified as type x (for age estimation, x is age). Response variables (which comprise the matrix Y) must be either ordinal or continuous. Additional variables that should be kept in the returned data frame should be marked as other (likely, these are covariates). Variables that are not specified in the variable information file but are in the data file are ignored in [load_cp_data].
Details on Categories: Each ordinal variable must explicitly define the allowable categories and their order in the format expected by [parse_cat_spec].
Details on Left_Right_Side, Left_Label, Right_Label, and Left_Right_Approach: Optionally, variables may be specified as left/right variables with the approach described in [merge_lr_var]. For such variables, the variable name given in the Variable column is the base variable, and the remaining columns specify the side, left label, right label, and merging approach.
1 | load_var_info(var_info_file)
|
var_info_file |
The file with variable information |
A data frame containing the cumulative probit data
1 2 3 4 5 6 7 8 9 | # Call load_var_info to read in variable specifications
# This example uses raw data included with the package 'yada'
var_info_file <- syanalysis_name.file("extdata","US_var_info.csv",package="yada")
print(var_info_file)
var_info <- load_var_info(var_info_file) # load file using file path
head(var_info)
# The following column names MUST be present in var_info_file:
# Variable, Type, Categories, Missing_Value
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.