getOptVar: Computes the Optimal Variance Given a Parametric Model When...

Description Usage Arguments Value Author(s) See Also Examples

Description

Computes the optimal variance when targeting the Average Treatment Effect (ATE). The optimal variance is defined as the variance associated with the optimal treatment mechanism within a given parametric model of treatment mechanisms. The computation is based on Monte Carlo simulation.

Usage

1
2
3
getOptVar(tm.model = formula(A ~ 1), Gmin = 0.01, piV = c(1/2, 
    1/3, 1/6), family = c("beta", "gamma"), Qbar = Qbar1, Vbar = Vbar1, 
    n = 1000, tm.control = glm.control(maxit = 500), verbose = FALSE)

Arguments

tm.model

A parametric model {\cal G} of treatment mechanisms. The procedure targets the optimal treatment mechanism within this model. Defaults to formula(A~1).

Gmin

A small positive numeric, the minimum value of elements of the parametric model {\cal G} of treatment mechanisms (see argument tm.model). The maximum value is 1-Gmin.

piV

Marginal distribution of V. Defaults to c(1/2, 1/3, 1/6).

family

A character, either "beta" (default) or "gamma", the nature of the law of outcome.

Qbar

A function, the conditional expectation of Y given (A,W). Defaults to Qbar1.

Vbar

A function, the conditional variance of Y given (A,W). Defaults to Vbar1.

n

An integer, the common sample size of the two simulated data sets used to compute the optimal treatment mechanism and associated optimal variance.

tm.control

A list of options to pass to glm for the targeting of the treatment mechanism within the model defined by argument 'tm.model'. Defaults to glm.control(maxit=500).

verbose

A logical or an integer indicating the level of verbosity (defaults to 'FALSE').

Value

Returns the optimal variance associated with the parametric model {\cal G} when targeting the Average Treatment Effect (ATE).

Author(s)

Antoine Chambaz [aut, cre]

See Also

getSample, getOptTm

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
##
## testing if the optimal variance is non-negative
##

library("R.utils")
library("tsml.cara.rct")

psi.sd <- getOptVar(n=1e3,
                    tm.model=formula(A~1),
                    piV=c(1/2, 1/3, 1/6),
                    family="gamma",
                    Qbar=Qbar1,
                    Vbar=Vbar1)

if (psi.sd<0) {
  throw("Numeric 'psi.sd' should be non-negative.\n")
}

achambaz/tsml.cara.rct documentation built on May 10, 2019, 5:10 a.m.