nndd: Nearest Neighbour Matching (NN) followed by a Linear Model...

Description Usage Arguments Value References Examples

View source: R/nndd.R

Description

Constructs NN by estimating pscores with a GLM and estimates a linear model in a DD setting

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
nndd(formula, data, index = c("firm_id", "year"),  t_time , nn_time,
                     time_ids = c("year", ""),
                     link = "logit",
                     subset , na.action, clustervariables, 
                     model = TRUE, y = TRUE, x = FALSE, displ_coefs, 
                      ...)


nndd_reshape(object_nndd)

nndd_reshape_other(call, data)

Arguments

formula

a formula expression of the form tg | outcome ~ x | z where tg is the response and the z regressor variable of the GLM. outcome is the response and x the regressor variable of the DD model.

data

a data frame containing the variables occurring in the formulas such as time and group identifiers. The data has to be a panel.

index

a list containing the name of the group, time identifier.

nn_time

a list containing the start timing and end timing for the NN estimation. The GLM is estimated at the end timing. However, it contains all regressor variables lagged in the given interval (start , end). In the case of omitting nn_time, the GLM is estimated at the given t_time.

t_time

a string containing the timing of the treatment.

time_ids

#Fixme: might be implemented in future.

link

family for the GLM either binomial or logistic.

clustervariables

list of variables on which the standard errors should be clustered.

subset

an optional vector specifying a subset of observations to be used for fitting.

na.action

a function which indicates what should happen when the data contain NAs.

model

logical. If TRUE model frame is included as a component of the returned value.

x, y

#Fixme: do I need this?

displ_coefs

a list of coefficients being displayed of the DD if a summary function is applied

object_nndd

an object of class nndd

...

arguments to be passed on to the estimation of the DD (lm.fit)

call

a call of a nndd object

Value

nndd

An object of class nndd.

nndd_reshape

A data.frame containing a reshaped model matrix of the nndd object.

nndd_reshape_other

A data.frame containing reshaped data.

References

Angrist JD, Pischke JS (2008). Mostly Harmless Econometrics: An Empiricist's Companion. Princeton University Press.

Caliendo M, Kopeinig S (2008). "Some Practical Guidance for the Implementation of Propensity Score Matching." Journal of Economic Surveys, 22(1), 31–72.

Rubin DB (1973). "Matching to Remove Bias in Observational Studies." Biometrics, 29(1), 159–183.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
data("IRCA", package = "nndd")
library(Formula)
formula <- Formula(treated | v_crime ~ officers_pc + income + p_crime 
						   | officers_pc + income + p_crime + crack_index 
						   + unemprate) 
						   
nndd <- nndd(formula = formula, data = IRCA, 
			index = c("county", "year"), 
			t_time = "1986" )
names(nndd)
print(nndd)
plot(nndd, IRCA)

nndd documentation built on May 2, 2019, 6:52 p.m.