
Generate Collinearity Data Subset
Source:R/generate_collinearity_subset.R
generate_collinearity_subset.RdThis function generates a subset of the data that is used to demonstrate the effects of collinearity on regression models. The data is generated by sampling from a multivariate normal distribution with a specified correlation matrix.
Arguments
- ManyEcoEvo
a ManyEcoEvo dataframe containing formatted raw
data, formatteddiversity_data, theestimate_type,dataset,publishable_subset, andexclusion_set. See details.- collinearity_subset
a dataframe containing the column
response_idcontaining response ID's to be included in the expert subset
Value
A ManyEcoEvo dataframe with added column expertise_subset with new subsets of data and diversity_data
Details
#'
Note that this function needs to be run on ManyEcoEvo after the following functions have been run (See examples):
generate_collinearity_subset() only creates expertise subsets based on the full dataset where exclusion_set == "complete" and publishable_subset == "All" and expertise_subset == "All".
Examples
ManyEcoEvo %>%
prepare_response_variables(estimate_type = "Zr") |>
generate_exclusion_subsets(estimate_type = "Zr") |>
generate_rating_subsets() |>
generate_expertise_subsets(ManyEcoEvo:::expert_subset) |>
generate_collinearity_subset(collinearity_subset = collinearity_subset)
#> Error in eval(expr, envir, enclos): object 'collinearity_subset' not found