Learn R Programming

simcausal (version 0.5.7)

eval.target: Evaluate the True Value of the Causal Target Parameter

Description

This function estimates the true value of the previously set target parameter (set.targetE or set.targetMSM) using the DAG object and either 1) data: list of action-specific simulated data.frames; or 2) actions; or 3) when data and actions are missing, using all distinct actions previously defined on the DAG object.

Usage

eval.target(
  DAG,
  n,
  data,
  actions,
  rndseed = NULL,
  verbose = getOption("simcausal.verbose")
)

Value

For targetE returns a vector of counterfactual means, ATE or ATR; for targetMSM returns a named list with the MSM model fit ("msm"), MSM model coefficients ("coef"), the mapping of the MSM summary terms S() to the actual variable names used in the data, ("S.msm.map"), and the long format full data that was used for fitting this MSM "df_long".

Arguments

DAG

DAG object with target parameter set via set.targetE or set.targetMSM functions

n

Number of observations to simulate (if simulating full data), this is overwritten by the number of observations in each data

data

List of action-specific data.frames generated with sim or simfull

actions

Character vector of action names which play the role of the data generating mechanism for simulated data when argument data is missing. Alternatively, actions can be a list of action DAGs pre-selected with A(DAG) function. When this argument is missing, full data is automatically sampled from all available actions in the DAG argument.

rndseed

Seed for the random number generator.

verbose

Set to TRUE to print messages on status and information to the console. Turn this off by default using options(simcausal.verbose=FALSE).

Details

For examples and additional details see documentation for set.targetE or set.targetMSM