cragg_donald {cragg}R Documentation

Calculate the Cragg-Donald statistic for a given model.

Description

Calculate the Cragg-Donald statistic for a given model.

Usage

cragg_donald(X, D, Z, data = data.frame())

Arguments

X

(formula). A one-sided formula of control variables.

D

(formula). A one-sided formula of endogenous variables (treatments)

Z

(formula). A one-sided formula of instruments

data

(dataframe). An optional dataframe, list, or environment containing the variables used in the model. As with many of the base R functions, if the variables are not found here, they may be searched for in the environment cragg_donald() was called.

Value

(cd_test) results object of class "cd_test"

Examples

#Obtain the Cragg-Donald statistic for a model that instruments
#Sepal Width on Petal Length, Petal Width, and Species, while controlling
#for Sepal.Length (a toy example).
cragg_donald(X=~Sepal.Length, D=~Sepal.Width,
			Z=~Petal.Length + Petal.Width + Species, data = iris)

[Package cragg version 0.0.1 Index]