Learn R Programming

micsr (version 0.1-1)

sargan: Sargan test for GMM models

Description

When a IV model is over-identified, the set of all the empirical moment conditions can't be exactly 0. The test of the validity of the instruments is based on a quadratic form of the vector of the empirical moments

Usage

sargan(object, ...)

# S3 method for ivreg sargan(object, ...)

# S3 method for micsr sargan(object, ...)

Value

an object of class "htest".

Arguments

object

a model fitted by GMM

...

further arguments

Examples

Run this code
cigmales <- cigmales %>%
       mutate(age2 = age ^ 2, educ2 = educ ^ 2,
              age3 = age ^ 3, educ3 = educ ^ 3,
              educage = educ * age)
gmm_cig <- expreg(cigarettes ~ habit + price + restaurant + income + age + age2 +
                 educ + educ2 + famsize + race | . - habit + age3 + educ3 +
                 educage + lagprice + reslgth, data = cigmales,
                 twosteps = FALSE)
sargan(gmm_cig)

Run the code above in your browser using DataLab