cragg_donald: Calculate the Cragg-Donald statistic for a given model.

Description Usage Arguments Value Examples

View source: R/cragg.R

Description

Calculate the Cragg-Donald statistic for a given model.

Usage

1

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

1
2
3
4
5
#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)

cragg documentation built on Jan. 13, 2021, 6:16 p.m.