Binary Power Law Analysis for Spatial Disease Patterns
BPL.Rd
This function calculates the Binary Power Law (BPL) parameters for spatial disease patterns, fits a linear model, and performs a hypothesis test for the slope.
Arguments
- data
A data frame containing the following columns:
field
: The field identifier.n
: The number of observations in each quadrat.i
: The incidence count in each quadrat.
Value
A list containing the following elements:
summary
: A data frame summarizing the input data by field, including total observations (n_total
), mean incidence (incidence_mean
), observed variance (V
), and binomial variance (Vbin
).model_summary
: A summary of the linear model fitted to the log-transformed variances.hypothesis_test
: The result of the hypothesis test for the slope being equal to 1.ln_Ap
: The intercept of the linear model, representing the natural logarithm of the parameter \( A_p \).slope
: The slope of the linear model.
Details
The function performs the following steps:
Summarizes the data by field to calculate the total number of observations (
n_total
), mean incidence (incidence_mean
), observed variance (V
), and binomial variance (Vbin
).Log-transforms the variances.
Fits a linear model to the log-transformed variances.
Tests the hypothesis that the slope of the linear model is equal to 1.