Skip to content

Commit

Permalink
Update 11-global-spatial-autocorrelation2.Rmd
Browse files Browse the repository at this point in the history
fixing two mistakes pointed out by Dr. Roth (thanks!):

# substitute "ncol(counties)" by
# n <- length(r_i)

"beta multiplied by P/n" --> "beta divided by P/n"
  • Loading branch information
jkoschinsky authored Oct 23, 2023
1 parent 8dfbf30 commit 069ff0c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions 11-global-spatial-autocorrelation2.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -560,10 +560,10 @@ moments (e.g., Marshall 1991), yielding the following expressions:

$$\beta=O/P$$

With O as the total event count $(\Sigma_iO_i)$, and P as he total population count
With O as the total event count $(\Sigma_iO_i)$, and P as the total population count
$(\Sigma_iP_i)$, and

$$\alpha = [\Sigma_iP_i(r_i - \beta)^2]/P - \beta(P/n)$$
$$\alpha = [\Sigma_iP_i(r_i - \beta)^2]/P - \beta/(P/n)$$

with n as the total number of observations (in other words, P/n is the average population)

Expand All @@ -587,7 +587,7 @@ by calculating the initial variables.
beta <- sum(counties$HC60) / sum(counties$PO60)
r_i <- counties$HC60 / counties$PO60
P_i <- counties$PO60
n <- ncol(counties)
n <- length(r_i)
P <- sum(counties$PO60)
```

Expand Down

0 comments on commit 069ff0c

Please sign in to comment.