calculate_regr_coeffs: Slopes based on random variables

calculate_regr_coeffsR Documentation

Slopes based on random variables

Description

Calculate slopes of the linear regression of proportion of ants on time. The proportion for each time point and colony is sampled from the distribution returned by the get_prob_mass function.

Usage

calculate_regr_coeffs(
  time_series_results,
  colony_stats,
  randomize = FALSE,
  sample_size = 10000
)

Arguments

colony_stats

A dataset containing numeric parameters describing colony state and experiment preparation;retrieved by data("colony_stats", package = "overwintering").

randomize

A logical indicating whether slopes should be calculated using permuted data, see below.

sample_size

A numeric indicating the number of samples taken from the distribution of the possible proportion of ants from the upper part of the nest among all ants being active outside the nest, see below.

time_series_result

A dataset with the results of the ant removal experiment; retrieved by data("time_series_result", package = "overwintering").

Details

This function uses get_prob_mass function on experiment data provided in the time_series_results and colony_stats datasets to calculate the probability distribution of the proportion of ants captured outside the nest which come from the upper part of the nest. The inference is based on the numbers of marked ants among all captured individuals with marking label indicating the nest segment (upper or lower). The probability distributions, obtained separately for each colony and time point, is sampled many times, producing multiple data vectors for linear regression. These vectors can additionally be permuted to have the null distribution of regression slopes.


TomVuod/overwintering documentation built on Nov. 22, 2023, 10:24 a.m.