declare_design: Declare a design

Description Usage Arguments Value Examples

Description

Declare a design

Usage

1
2
## S3 method for class 'dd'
lhs + rhs

Arguments

lhs

A step in a research design, beginning with a function that defines the model. Steps are evaluated sequentially. With the exception of the first step, all steps must be functions that take a data.frame as an argument and return a data.frame. Steps are declared using the declare_ functions, i.e., declare_model, declare_inquiry, declare_sampling, declare_assignment, declare_measurement, declare_estimator, and declare_test.

rhs

A second step in a research design

Value

a design

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
design <-
  declare_model(
    N = 500, 
    U = rnorm(N),
    potential_outcomes(Y ~ Z + U)
  ) +
  declare_inquiry(ATE = mean(Y_Z_1 - Y_Z_0)) +
  declare_sampling(S = complete_rs(N, n = 250), legacy = FALSE) +
  declare_assignment(Z = complete_ra(N, m = 25), legacy = FALSE) +
  declare_measurement(Y = reveal_outcomes(Y ~ Z)) +
  declare_estimator(Y ~ Z, inquiry = "ATE") 

dat <- draw_data(design)
head(dat)

run_design(design)

# You may wish to have a design with only one step:

design <- declare_model(N = 500, noise = rnorm(N)) + NULL

## Not run: 
diagnosis <- diagnose_design(design)

summary(diagnosis)

## End(Not run)

DeclareDesign documentation built on Feb. 15, 2021, 1:07 a.m.