AICc_ens_metrics: AICc_ens_metrics

View source: R/AICc_ens_metrics.R

AICc_ens_metricsR Documentation

AICc_ens_metrics

Description

AICc_ens_metrics calculates the best fit model out of all possible linear combinations of metrics as explanatory variables and ENS as the response.

Usage

AICc_ens_metrics(ens, metrics)

Arguments

ens

a vector of integer values indicating the effective network size of each observed network, generated by iteratively running the enss function estimate_ens() or estimate_backtrans_ens() for each edgelist generated by the function import_emp().

metrics

a dataframe generated by the enss function calculate_metrics() containing metri The dataframe of metrics should pair with the vector of ens values, such that metrics[i, ] is equal to ens[i] and the number of rows in the metrics dataframe is equal to the length of the ens vector.

Value

either a single model of best fit, with coefficients for each variable included in the model or a list of models and their coefficients, if there was a tie among AICc values.

Examples

emp_el <- readRDS("./data/Effective_el_emp")
emp_el <- list(emp_el[[1]], emp_el[[3]], emp_el[[8]], emp_el[[9]], emp_el[[10]], emp_el[[12]], emp_el[[14]], emp_el[[16]], emp_el[[20]], emp_el[[21]], emp_el[[22]], emp_el[[23]], emp_el[[30]], emp_el[[26]], emp_el[[29]], emp_el[[13]], emp_el[[34]], emp_el[[38]], emp_el[[39]], emp_el[[41]])
unweighted_metrics <- calculate_metrics(emp_el)
ens_SI <- c(7, 36, 20, 9, 11, 43, 13, 16, 16, 31, 36, 20, 34, 25, 11, 10, 24, 10, 9, 15)
SI_AICc <- AICc_ens_metrics(ens_SI, unweighted_metrics)

collinmmccabe/enss documentation built on May 5, 2024, 6:23 a.m.