makeRandomDataT: makeRandomData

Description Usage Arguments Details Value

Description

Simulate a random data generating distribution. See Details to see how it's done.

Usage

 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
makeRandomDataT(n, maxD = 2, D = NULL, minObsA = 30,
  func.distW = c("uniformW", "normalW", "bernoulliW", "binomialW", "gammaW",
  "normalWCor", "bernoulliWCor", "uniformWCor", "gammaPointMassW",
  "binomialFracW", "normalPointMassW"), funcG0.uni = c("linUni", "polyUni",
  "sinUni", "jumpUni", "pLogisUni", "dNormUni", "qGammaUni", "dNormMixUni",
  "cubicSplineUni", "linSplineUni"), funcG0.biv = c("linBiv", "polyBiv",
  "sinBiv", "jumpBiv", "dNormAddBiv", "dNormMultBiv", "polyJumpBiv",
  "sinJumpBiv", "dNormMultJumpBiv", "linSplineBiv"), funcG0.tri = c("linTri",
  "polyTri", "sinTri", "jumpTri", "linJump2Tri", "linJump1Tri", "polyJump2Tri",
  "polyJump1Tri", "sinJump2Tri", "sinJump1Tri", "dNormAddTri", "dNormMultTri",
  "dNormMultJump2Tri", "dNormMultJump1Tri", "pLogisAddTri"),
  funcG0.quad = c("linQuad", "polyQuad", "sinQuad", "jumpQuad",
  "linJump2Quad", "linJump1Quad", "polyJump2Quad", "polyJump1Quad",
  "sinJump2Quad", "sinJump1Quad", "dNormAddQuad", "dNormMultQuad",
  "dNormMultJump2Quad", "dNormMultJump1Quad", "pLogisAddQuad"),
  funcQ0.uni = c("linUni", "polyUni", "sinUni", "jumpUni", "pLogisUni",
  "dNormUni", "qGammaUni", "dNormMixUni", "cubicSplineUni", "linSplineUni"),
  funcQ0.biv = c("linBiv", "polyBiv", "sinBiv", "jumpBiv", "dNormAddBiv",
  "dNormMultBiv", "polyJumpBiv", "sinJumpBiv", "dNormMultJumpBiv",
  "linSplineBiv"), funcQ0.tri = c("linTri", "polyTri", "sinTri", "jumpTri",
  "linJump2Tri", "linJump1Tri", "polyJump2Tri", "polyJump1Tri", "sinJump2Tri",
  "sinJump1Tri", "dNormAddTri", "dNormMultTri", "dNormMultJump2Tri",
  "dNormMultJump1Tri", "pLogisAddTri"), funcQ0.quad = c("linQuad", "polyQuad",
  "sinQuad", "jumpQuad", "linJump2Quad", "linJump1Quad", "polyJump2Quad",
  "polyJump1Quad", "sinJump2Quad", "sinJump1Quad", "dNormAddQuad",
  "dNormMultQuad", "dNormMultJump2Quad", "dNormMultJump1Quad", "pLogisAddQuad"),
  errY = c("normalErr", "uniformErr", "gammaErr", "normalErrAW",
  "uniformErrAW"), minG0 = 0.001, minR2 = 0.01, maxR2 = 0.99,
  pos = 0.005, skewing = c(-1, 1), ...)

Arguments

n

A numeric sample size

maxD

A numeric indicating maximum number of covariates

funcG0.uni

A vector of characters that are functions in the global environment that are used to generate main terms for logit of the propensity score.

funcG0.biv

Ditto above, but for bivariate functions.

funcG0.tri

Ditto above, but for trivariate functions.

funcQ0.uni

Ditto funcG0.uni, but for the outcome regression

funcQ0.biv

Ditto

funcQ0.tri

Ditto

errY

A vector of characters that are functions in the global environment that are used to generate error terms for the outcome regression.

minG0

The minimum value for the propensity score (default 0.01).

pos

(1-2*pos)100% of pscores fall withing minG0 and 1- minG0, default is .005

distW.uncor

A vector of characters that are functions in the global environment that generate covariates. These functions should have an associated parameter function with "Parm" added to the end of their name. See the format of the functions provided to understand their structure.

distW.cor

Same as above, but generates a correlated covariate

skewage

default is c(-1,1). random add a skewing constant to the logit(pscores)

Details

Draw random data generating distribution. The code simulates as follows:
Simulate W

Simulating A

Simulating Y

Value

An object of class "makeRandomData" with the following entries

W

A matrix of covariates

A

A vector of binary treatments

Y

A vector of continuously valued outcome

distW

A list containing relevant information needed to reproduce data sets

fnG0

A list of lists containing relevant information needed to reproduce data sets

fnQ0

A list of lists containing relevant information needed to reproduce data sets

distErrY

A list containing relevant information needed to reproduce data sets

divideLogitG0

A numeric of the scaling factor for the propensity


benkeser/haltmle.sim documentation built on May 12, 2019, noon