genWeight: Generating list of target weight functions

Description Usage Arguments Value

View source: R/wweights.R

Description

This function takes in the user-defined target weight functions and the data set, and generates the weight functions for each observation.

Usage

1
genWeight(fun, fun.name, uname, data)

Arguments

fun

custom weight function defined by the user. Arguments of the weight function must only be names of variables entering into the function, and can include the unobserved variable.

fun.name

string, name of function.

uname

the name assigned to the unobserved variable entering into the MTR.

data

a named vector containing the values of the variables defining the 'fun', excluding the value of the unobservable (generated from applying split() to a data.frame).

Value

The weight function 'fun', where all arguments other than that of the unobserved variable are fixed according to the vector 'data'.


ivmte documentation built on Sept. 17, 2021, 5:06 p.m.