Learn R Programming

spatialAtomizeR (version 0.2.4)

simulate_misaligned_data: Simulate Misaligned Spatial Data

Description

Simulate Misaligned Spatial Data

Usage

simulate_misaligned_data(
  seed = 2,
  dist_covariates_x = c("normal", "poisson", "binomial"),
  dist_covariates_y = c("normal", "poisson", "binomial"),
  dist_y = "poisson",
  x_intercepts = rep(0, 3),
  y_intercepts = rep(0, 3),
  rho_x = 0.6,
  rho_y = 0.6,
  x_correlation = 0.5,
  y_correlation = 0.5,
  beta0_y = NULL,
  beta_x = NULL,
  beta_y = NULL,
  diff_pops = TRUE,
  xy_cov_cor = FALSE
)

Value

List containing gridy, gridx, atoms, and true_params

Arguments

seed

Random seed (default = 2)

dist_covariates_x

Vector specifying distribution type for each synthetic X-grid covariate ('poisson', 'binomial', or 'normal')

dist_covariates_y

Vector specifying distribution type for each synthetic Y-grid covariate ('poisson', 'binomial', or 'normal')

dist_y

Distribution type for synthetic outcome variable (one of 'poisson', 'binomial', or 'normal')

x_intercepts

Intercepts for X covariates

y_intercepts

Intercepts for Y covariates

rho_x

Spatial correlation parameter for X-grid covariates (0 to 1 with higher values yielding more spatial correlation, default = 0.6)

rho_y

Spatial correlation parameter for Y-grid covariates and outcome (0 to 1 with higher values yielding more spatial correlation, default = 0.6)

x_correlation

Between-variable correlation for all pairs of X-grid covariates (default = 0.5)

y_correlation

Between-variable correlation for all pairs of Y-grid covariates (default = 0.5)

beta0_y

Intercept for outcome model

beta_x

Outcome model coefficients for X-grid covariates

beta_y

Outcome model coefficients for Y-grid covariates

diff_pops

Logical, indicating whether the atoms should be generated with different population sizes (diff_pops = TRUE) or a common population size (diff_pops = FALSE)

xy_cov_cor

Logical, indicating whether the atom-level spatial random effects for X-grid and Y-grid covariates should be correlated (xy_cov_cor = TRUE) or not. When set to TRUE, the x_correlation and rho_x parameters are used to generate all covariates (separate correlation parameters are not allowed for X-grid and Y-grid covariates).