| BPL | R Documentation |
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.
BPL(data)
data |
A data frame containing the following columns:
|
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.
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.
Other Spatial analysis:
AFSD(),
count_subareas(),
count_subareas_random(),
fit_gradients(),
join_count(),
oruns_test(),
oruns_test_boustrophedon(),
oruns_test_byrowcol(),
plot_AFSD()
# Example usage with a sample data frame
result <- BPL(FHBWheat)
print(result$summary)
print(result$model_summary)
print(result$hypothesis_test)
print(paste("ln(Ap):", result$ln_Ap))
print(paste("Slope (b):", result$slope))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.