stone.stat {DCluster} | R Documentation |
Compute Stone's Statistic
Description
Calculate Stone's statistic. See stone manual page for details.
stone.stat computes the test statistic and the test using a hi-square distribution whilst stone.test performs a bootstrap test.
Usage
stone.stat(data, region, sorted=FALSE, lambda)
stone.test(formula, data, model, R, ...)
Arguments
formula |
Formula that specifies the underlying model. The observed cases are the response and the expected number of cases must be specified as an offset in the log scale (see example below). Note that now it is not necessary to use Observed and Expected and that any other names can be used to specify the observed and expected cases. |
model |
Parametric model to be used in the bootstrap test. One of "param", "multinom", "poisson" or "negbin". See the DCluster manpage for details. |
... |
The remaining arguments in 'stone.stat' not included in 'stone.test'. This is done so because stone.test calls stone.stat in order to perform the test. |
R |
Number of replicates used in the test to compute the significance of the observed value of the test statistic. |
data |
A dataframe containing the data, as specified in the DCluster manpage. |
region |
Region where around which we want to test for a cluster. It must a row number of data. |
sorted |
Whether the data are already sorted by distance to region. |
lambda |
Value of the null hypotheses. It may NULL (i. e., not known) or a number. |
Value
A vector of two elements with the value of the statistic and the region (counting from the centre) where it was achieved.
References
Stone, R. A. (1988). Investigating of excess environmental risks around putative sources: Statistical problems and a proposed test. Statistics in Medicine 7,649-660.
See Also
DCluster
Examples
library(spdep)
data(nc.sids)
sids<-data.frame(Observed=nc.sids$SID74)
sids<-cbind(sids, Expected=nc.sids$BIR74*sum(nc.sids$SID74)/sum(nc.sids$BIR74))
sids<-cbind(sids, x=nc.sids$x, y=nc.sids$y)
#Compute Stone's statistic around Anson county
region<-which(row.names(nc.sids)=="Robeson")
stone.stat(sids, region=region, lambda=1)
stone.test(Observed~offset(log(Expected)), sids, model="poisson", R=99,
region=region, lambda=1)