genGammaSplines {ivmte}R Documentation

Generate Gamma moments for splines

Description

The user can declare that the unobservable enters into the MTRs in the form of splines. This function generates the gamma moments for the splines. The specifications for the spline must be passed as an element generated by removeSplines. This function accounts for the interaction between covariates and splines.

Usage

genGammaSplines(
  splinesobj,
  data,
  lb,
  ub,
  multiplier = 1,
  subset,
  d = NULL,
  means = TRUE,
  late.rows = NULL
)

Arguments

splinesobj

a list generated by removeSplines applied to either the m0 and m1 argument.

data

a data.frame object containing all the variables that interact with the spline components.

lb

vector of lower bounds for the interval of integration. Each element corresponds to an observation.

ub

vector of upper bounds for the interval of integration. Each element corresponds to an observation.

multiplier

a vector of the weights that enter into the integral. Each element corresponds to an observation.

subset

Subset condition used to select observations with which to estimate gamma.

d

either 0 or 1, indicating the treatment status.

means

boolean, default set to TRUE. Set to TRUE if estimates of the gamma moments should be returned. Set to FALSE if the gamma estimates for each observation should be returned.

late.rows

Boolean vector indicating which observations to include when conditioning on covariates X.

Value

a matrix, corresponding to the splines being integrated over the region specified by lb and ub, accounting for the interaction terms. The number of rows is equal to the number of rows in data. The number of columns depends on the specifications of the spline. The name of each column takes the following form: "u[d]S[j].[b]", where "u" and "S" are fixed and stand for "unobservable" and "Splines" respectively. "[d]" will be either 0 or 1, depending on the treatment status. "[j]" will be an integer indicating which element of the list splines the column pertains to. "[b]" will be an integer reflect which component of the basis the column pertains to.


[Package ivmte version 1.4.0 Index]