wunt: Data-driven Uniform transformer.

Description Usage Arguments Value Examples

View source: R/wunt.R

Description

This function constructs weights for each subject in the control group with a data-driven Uniform transformer, and estimates the average treatment effect on the treated group with the constructed weights.

Usage

1
2
wunt(x,z,y,type='constant',marginal=FALSE,extra=FALSE,xextra=NULL,
method='Kernel',h=NULL,kernel='gaussian',degree=2,interact=TRUE)

Arguments

x

A data matrix/vector

z

A vector of treamtment assignment, with 1 for treated and 0 for control.

y

A vector of observed outcomes, with length(y)=length(z).

type

Type of the smooth kernel function used to approximate the density of the covariates in the control group. type should be one of 'constant', 'linear' and 'quadratic'.

marginal

An indicator for whether the Uniform transformer is constructed based on the marginal distribution or joint distribution. By defaul, marginal is FALSE, i.e., the Uniform transformer is constructed based on the joint distribution of x.

extra

An indicator for whether there is extra unlabeled data to construct the Uniform transformer.

xextra

Extra unlabeled data to construct the Uniform transformer. xextra must be specified if extra=T

method

Method to estimate the density of the transformed data in the treated group. method should be 'Kernel' or 'Projection'

h

The bandwidth to be used for the Kernel method.

kernel

Type of kernel. kernel can be chosen from 'gaussian','gaussian4','gaussian6','gaussian8','gaussian10','epanechnikov','uniform','triangular','triweight','tricube','biweight',cosine','silverman'

degree

Degree of polynomials for the basis functions of the Projection method.

interact

An indicator for whether interactions would be included for the basis functions.

Value

est

Estimated average treatment effect on the treated group.

weight

Constructed weights for the each subject in the control group.

control

Transformed data for the control group.

treated

Tranformed data for the treated group.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
x1=rnorm(1000)
x2=rnorm(1000, mean=0.5)
x=cbind(x1,x2)
ix=sample(1:1000,300)
z=numeric(1000)
z[ix]=1
y=x1*x2
res1=wunt(x,z,y,type='constant',marginal=FALSE,method='Kernel')
res1$est
res2=wunt(x,z,y,type='constant',marginal=FALSE,method='Projection')
res2$est

lakerwsl/WUNT documentation built on Sept. 13, 2020, 12:15 a.m.