gbiqq_designer: Integrate gbiqq with DeclareDesign

Description Usage Arguments Examples

View source: R/gbiqq_designer.R

Description

Define a model, estimand, and answer strategy.

Usage

1
2
3
gbiqq_designer(model = make_model("X -> Y"), restrictions = NULL,
  priors = "uniform", parameters = NULL, inquiry = list(ATE =
  "Y[X=1] - Y[X=0]"), data_strat = NULL, answer_strat = NULL)

Arguments

model

A model object generated by make_model().

restrictions

A list of character vectors specifying nodal types to be kept or removed from the model. Use get_nodal_types to see syntax.

priors

A numeric vector. Dirichlet hyperparameters.

parameters

A numeric vector. True parameters.

inquiry

A named list of strings. Names are estimand labels and values are strings containing estimand definitions. See 'Examples' for correct format.

data_strat

should be of the form "list(n_obs = n_obs, vars = list("X", "Y"), probs = list(...), n = NULL, subsets = list(...))

answer_strat

priors used at the analysis stage, if different

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
require("DeclareDesign")
my_design <- gbiqq_designer(
  model = make_model("X -> Y"),
  parameters = c(.5, .5, .1, .7, .1, .1),  # Truth
  data_strat = list(n_obs = 5, vars = list(NULL), probs = list(NULL),
                    ns = NULL,
     subsets = list(NULL)),
  inquiry = list(ATE = "Y[X=1] - Y[X=0]"))

## Not run: draw_data(my_design)
## Not run: draw_estimands(my_design)
## Not run: draw_estimates(my_design)
## Not run: diagnose_design(my_design, sims = 2)

my_design <- gbiqq_designer(
model = make_model("X -> M -> Y"),
inquiry = list(ATE = "Y[X=1] - Y[X=0]"),
data_strat = list(n_obs = 5,
vars = list(c("X", "Y"), "M"),
probs = list(1, .5),
n = NULL,
subsets = list(NULL, "X==1 & Y==0")),
answer_strat  = NULL
)

df <- draw_data(my_design)
draw_estimands(my_design)
## Not run: 
get_estimates(my_design, df)

## End(Not run)

lilymedina/gbiqqtools documentation built on Nov. 4, 2019, 4:32 p.m.