social_differentiation: Estimation of social differentiation

View source: R/social_differentiation.R

social_differentiationR Documentation

Estimation of social differentiation

Description

Estimates the coefficient of variation of the underlying association probabilities using maximum likelihood, assuming underlying association probabilities follow a beta distribution.

Usage

social_differentiation(Num, Den, initial.params = c(0.1, 0.1), nsim = 1e+05)

Arguments

Num

Numeric vector, numerator of the association indices

Den

Numeric vector, denominator of association indices

initial.params

Initial parameters for model fitting

nsim

Number of parametric bootstraps to draw for error estimation. See details.

Details

Social differentiation is commonly defined as the coefficient of variation of the true, underlying association probabilities. This estimation procedure assumes that the underlying probabilities follow a beta distribution, and estimates the parameters of this distribution given the observed association indices. The estimation of social differentiation serves as both a helpful descriptor of social structure, and a useful measure for determining the power and precision of social analyses. The estimated correlation between true and observed association indices can be derived by dividing the estimated social differentiation by the observed CV of association indices. In some edge cases, where social differentiation is very high, a correlation greater than 1 can be estimated. In these cases we recommend primarily interpreting the lower bound of the confidence interval.

This function uses the likelihood of the beta-binomial distribution to estimate social differentiation. The original method for social differentiation (and the one used by SOCPROG) uses a slightly different method involving integrating over possible probability values. The beta-binomial method is faster and more precise, but cannot be used when the denominators of the association indices are not integers (e.g. because the HWI was calculated). In these cases, the function will default to the integration method, with a warning.

This function will return estimated standard errors and confidence intervals. This is estimated by drawing simulated values using the estimated parameters and their variance-covariance matrix. A more robust estimate of confidence can be achieved throu a bootstrap of the raw data. To save computation time, we recommend setting nsim < 1 in these cases.

Value

A matrix containing the estimated social differentiation, the CV of the observed associations, and the estimated correlation between true and observed association indices, along with standard errors and confidence intervals.

Examples

X <- get_numerator(srkw_sightings, return = "vector", data_format = "GBI")
D <- get_denominator(srkw_sightings, return = "vector", data_format = "GBI")
social_differentiation(X, D)


MNWeiss/aninet documentation built on Jan. 31, 2023, 3:55 a.m.