# Modified t test

### Description

Performs a modified version of the *t* test to assess the
correlation between two spatial processes.

### Usage

1 | ```
modified.ttest(x, y, coords, nclass = 13)
``` |

### Arguments

`x` |
an n-dimensional vector of data values. |

`y` |
an n-dimensional vector of data values. |

`coords` |
an n x 2 matrix containing coordinates of the n data locations in each row. |

`nclass` |
a single number giving the number of cells for Moran's index. The default is 13. If this argument is NULL Sturges' formula us used. |

### Details

The methodology implemented is a modified *t* test of spatial association
based on the work of Clifford and Richardson (1989). The test is based on
corrections of the sample correlation coefficient between the two spatially
correlated sequences and required the estimation of an effective sample size.
This factor takes into account the spatial association of both processes.

### Value

A list with class `"mod.ttest"`

containing the following components:

`corr` |
the sample correlation coefficient. |

`Fstat` |
the value of the F-statistic. |

`dof` |
the estimated degrees of freedom for the F-statistic. |

`p.value` |
the p-value for the test. |

`upper.bounds` |
upper bounds of the intervals constructed to compute Moran's I. |

`card` |
number of elements in each interval generated to compute Moran's I. |

`imoran` |
a matrix containing Moran's index for each interval associated to both variables. |

The generic functions `print`

and `summary`

are used to obtain
and print additional details about the modified *t* test.

### References

Clifford, P., Richardson, S., Hemon, D. (1989),
Assessing the significance of the correlation between two spatial processes.
*Biometrics* **45**, 123–134.

Dutilleul, P. (1993),
Modifying the *t* test for assessing the correlation between two spatial processes.
*Biometrics* **49**, 305–314.

### Examples

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | ```
## This example uses the camg data set, available in the geoR Package
## (Ribeiro and Diggle, 2001).
## required to loading the camg data set from geoR package
library(geoR)
data(camg)
## defining the variables elevation and ca020 from the camg data set
x <- camg$elevation
y <- camg$ca020
## extracting the coordinates from the camg data set
coords <- camg[,1:2]
## computing the modified t-test of spatial association
z <- modified.ttest(x, y, coords)
z
## display the upper bounds, cardinality and the computed Moran's index
summary(z)
``` |

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker. Vote for new features on Trello.