format_iar: Format IAR data for ssnet

View source: R/format_iar.R

format_iarR Documentation

Format IAR data for ssnet

Description

Given an adjacency matrix, formats data for using IAR priors to model spatial structure. Otherwise, assumes default structure where neighbors are defined as variables directly above or to the side of a specified variable location.

Usage

format_iar(
  adjmat = NULL,
  im.res = NULL,
  x = NULL,
  tau.prior = "none",
  tau.manual = NULL
)

Arguments

adjmat

A data.frame or matrix containing a "sparse" representation of the neighbor relationships. The first column should contain a numerical index for a given location. Each index will be repeated in this column for every neighbor it has. The indices for the location's neighbors are then specified in the second column. An optional third column specifies weights. If no third column is specified, then equal weights are assumed.

im.res

A 2-element vector where the first argument is the number of "rows" and the second argument is the number of "columns" in each subject's "image". Default is NULL.

x

Design, or input, matrix, of dimension nobs x nvars; each row is an observation vector. It is recommended that x have user-defined column names for ease of identifying variables.

tau.prior

One of c("none", "manual", "cauchy"). This argument determines the precision parameter in the Conditional Autoregressive model for the (logit of) prior inclusion probabilities. When "none", the precision is set to 1; when "manual", the precision is manually entered by the user; when "cauchy", the inverse precision is assumed to follow a Cauchy distribution with mean 0 and scale 2.5.

tau.manual

When tau.prior = "manual", use this argument to specify a common precision parameter.

Value

A list containing data formatted for using IAR priors.


jmleach-bst/ssnet documentation built on March 4, 2024, 5:04 p.m.