View source: R/convenience-functions.R
n_eff | R Documentation |
An approximate calculation for the effective sample size for spatially autocorrelated data. Only valid for approximately normally distributed data.
n_eff(n, rho)
n |
Number of observations. |
rho |
Spatial autocorrelation parameter from a simultaneous autoregressive model. |
Implements Equation 3 from Griffith (2005).
Returns effective sample size n*, a numeric value.
Griffith, Daniel A. (2005). Effective geographic sample size in the presence of spatial autocorrelation. Annals of the Association of American Geographers. Vol. 95(4): 740-760.
sim_sar, aple
n_eff(100, 0)
n_eff(100, 0.5)
n_eff(100, 0.9)
n_eff(100, 1)
rho <- seq(0, 1, by = 0.01)
plot(rho, n_eff(100, rho),
type = 'l',
ylab = "Effective Sample Size")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.