Learn R Programming

spatialAtomizeR (version 0.2.4)

run_both_methods: Run Both Methods and Compare

Description

Runs both ABRM and dasymetric mapping methods and compares results

Usage

run_both_methods(
  sim_data,
  sim_metadata,
  model_code,
  nimble_params,
  output_dir,
  norm_idx_x,
  pois_idx_x,
  binom_idx_x,
  norm_idx_y,
  pois_idx_y,
  binom_idx_y,
  dist_y,
  outcome_type
)

Value

List with combined comparison, ABRM results, and dasymetric results

Arguments

sim_data

List of data elements to be used in the ABRM, structured like the output from the simulate_misaligned_data() function. The first element of this list is the Y-grid sf dataframe (named 'gridy'), containing a numeric area ID variable named 'ID_y', covariates named 'covariate_y_1','covariate_y_2',...., and an outcome named 'y'. The second element of this list is the X-grid sf dataframe (named 'gridx'), containing a numeric area ID variable named 'ID_x' and covariates named 'covariate_x_1','covariate_x_2',... The third element of the list is the atom sf dataframe (named 'atoms'), which should contain variables named 'ID_x' and 'ID_y' holding the X-grid and Y-grid cell IDs for each atom, as well as an atom-level population count named 'population'.

sim_metadata

Simulation metadata

model_code

NIMBLE model code

nimble_params

List of NIMBLE parameters (niter, nburnin, thin, nchains)

output_dir

Output directory

norm_idx_x

Indices of normal X covariates

pois_idx_x

Indices of Poisson X covariates

binom_idx_x

Indices of binomial X covariates

norm_idx_y

Indices of normal Y covariates

pois_idx_y

Indices of Poisson Y covariates

binom_idx_y

Indices of binomial Y covariates

dist_y

Distribution type for outcome (1=normal, 2=poisson, 3=binomial)

outcome_type

Outcome distribution name