Skip to contents

This 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.

Usage

generate_collinearity_subset(ManyEcoEvo, collinearity_subset)

Arguments

ManyEcoEvo

a ManyEcoEvo dataframe containing formatted raw data, formatted diversity_data, the estimate_type, dataset, publishable_subset, and exclusion_set. See details.

collinearity_subset

a dataframe containing the column response_id containing 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