t.test.nndd: S3 Methods of nndd

Description Usage Arguments Details Value References Examples

View source: R/nndd.R

Description

Methods for testing, predicting, printing, plotting for a nndd object.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
## S3 method for class 'nndd'
t.test(x, ...)

nndd_ttest(ttest_data, index = c("firm_id", "year", "tg"), nn_time, ...)

## S3 method for class 'nndd'
predict(object, prediction = c("nn", "dd"), newdata, ...)

predict_fun_glm(pformula, link = "logit", data)

## S3 method for class 'nndd'
print(x, digits = max(3, getOption("digits") - 3), ...)

## S3 method for class 'nndd'
plot(x, data, which = c(1L:7L, 8L), 
					ask = prod(par("mfcol")) < length(which) 
					&& dev.interactive()
					, ...)

## S3 method for class 'nndd'
vcov(object, ...)

Arguments

x, object

an object of class "nndd"

ttest_data

a data.frame containing the data on which the ttest should be performed on.

index

a list containing the name of the group, time and treatment 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).

pformula

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

prediction

a list containing specifying which model should be applied for the prediction. If the list contains "nn" the pscores of the GLM model are predicted. In the case of containing "dd" the prediction of the linear difference in differences model is returned. Both predictions are returned if the list is specified as "nn", "dd".

newdata

a data.frame containing the data on which the prediction should be based on.

link

family for the GLM either binomial or logistic.

digits

see print

data

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

which

if a subset of the plots is required, specify a subset of the numbers 1:8.

ask

logical; if TRUE, the user is asked before each plot, see par(ask=.).

...

space for objects to be passed on

Details

t.test is applied only on the time span on which the NN of the nndd object are specified. plot.nndd Creates eight plots in one window. The first tow plots are the distribution of the treated and control pscores pre and post the NN selection. If data is not specified the pre NN plot is omitted. In the following the outcome variable of the DD estimation is plotted over time. For a description of the last four plots see plot.lm.

getSummary (from the memisc package, enabling mtable).

Value

predict_fun_glm

A list containing pscores.

predict.nndd

A data.frame containing the specified predictions.

print.nndd

Returns the imputed object.

plot.nndd

#Fixme: Ns are not well chosen at the Density plots (the N is of the control) Name of the plot is returned.

References

...

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
data("IRCA", package = "nndd")
library(Formula)
formula <- Formula(treated | v_crime ~ officers_pc + income  | 
                     officers_pc + income  + crack_index + unemprate) 

ma <- nndd(formula = formula, data = IRCA, 
           index = c("county", "year"), 
           nn_time = c("1985","1985" ), t_time = "1986" )

ma
t.test(ma)

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