Skip to contents

Create counterfactual data of variables from INLA model

Usage

create_counterfactual_inla(
  cv_set,
  y_var,
  pred_vars,
  reff_var = NULL,
  id_vars,
  hyper_priors = list(prec.unstruct = c(1, 5e-04), prec.spatial = c(1, 5e-04),
    prec.timerw1 = c(1, 0.01)),
  W_orgUnit,
  var_scales,
  constant_org,
  constant_date
)

Arguments

cv_set

list object containing analysis and assessment data.frames

y_var

string name of column of observed values

pred_vars

vector string of predictor variables to use in model

reff_var

string or formula for random effects

id_vars

names of columns used as keys/ids in data.frames

hyper_priors

priors for spatial and temporal random effects

W_orgUnit

graph of orgUnit to use in spatial structure. If NULL (default), will not fit a spatial structure.

var_scales

data.frame of center and scale factors used in variable scaling

constant_org

orgUnit to use in counterfactual plots

constant_date

date to use in counterfactual plots

Value

list of dataframes of counter factual data. Each element corresponds to one predictor variable