Learn R Programming

geostan (version 0.8.1)

prep_sar_data2: Prepare data for SAR model: raster analysis

Description

Prepares a list of data required for using the SAR model; this is for working with (large) raster data files. For non-raster analysis, see prep_sar_data.

Usage

prep_sar_data2(row, col, quiet = FALSE)

Value

A list containing all of the data elements required by the SAR model in stan_sar.

Arguments

row

Number of rows in the raster

col

Number of columns in the raster

quiet

Controls printing behavior. By default, quiet = FALSE and the range of permissible values for the spatial dependence parameter is printed to the console.

Details

Prepare data for the SAR model when your raw dataset consists of observations on a regular tessellation, such as a raster layer or remotely sensed imagery. The rook criteria is used to determine adjacency. This function uses Equation 5 from Griffith (2000) to calculate the eigenvalues for a row-standardized spatial weights matrix of a P-by-Q dimension regular tessellation.

This function can accommodate very large numbers of observations for use with stan_sar; for large N data, it is also recommended to use slim = TRUE or the drop argument. For details, see: vignette("raster-regression", package = "geostan").

See Also

prep_car_data2, prep_sar_data, stan_sar.

Examples

Run this code

row = 100
col = 120
sar_dl <- prep_sar_data2(row = row, col = col)

Run the code above in your browser using DataLab