Create a table from the analysis_key and results object
create_analysis_key_table.Rd
Helper function to turn a analysis_key to a table. It will return a dataframe with analysis_var_x, analysis_var_value_x, group_var_x, group_var_value_x, nb_analysis_var, nb_group_var:
Where YY_var_x are the variable names for the dependent and independent variables.
Where YY_var_value_x are the values for the dependent and independent variables.
Where x is the number of the variable by order of grouping.
nb_xx is the number of variable used in the grouping.
Value
a dataframe with the analysis key and analysis_var_x, analysis_var_value_x, group_var_x, group_var_value_x, nb_analysis_var and nb_group_var
Examples
create_analysis_key_table(analysistools_MSNA_template_with_ratio_results_table$results_table)
#> # A tibble: 147 × 10
#> analysis_key analysis_type analysis_var_1 analysis_var_value_1 analysis_var_2
#> <chr> <chr> <chr> <chr> <chr>
#> 1 prop_select… prop_select_… admin1 admin1a NA
#> 2 prop_select… prop_select_… admin1 admin1b NA
#> 3 prop_select… prop_select_… admin1 admin1c NA
#> 4 mean @/@ in… mean income_v1_sal… NA NA
#> 5 median @/@ … median income_v1_sal… NA NA
#> 6 mean @/@ ex… mean expenditure_d… NA NA
#> 7 median @/@ … median expenditure_d… NA NA
#> 8 ratio @/@ i… ratio income_v1_sal… NA expenditure_d…
#> 9 prop_select… prop_select_… wash_drinking… borehole_tubewell NA
#> 10 prop_select… prop_select_… wash_drinking… bottled_water NA
#> # ℹ 137 more rows
#> # ℹ 5 more variables: analysis_var_value_2 <chr>, group_var_1 <chr>,
#> # group_var_value_1 <chr>, nb_analysis_var <dbl>, nb_group_var <dbl>