Learn R Programming

systemfit (version 0.7-1)

lrtest.systemfit: Likelihood Ratio test for Equation Systems

Description

Perform a Likelihood Ratio test to test linear restrictions when estimating an equation system.

Usage

lrtest.systemfit( resultc, resultu )

Arguments

resultc
an object of type systemfit.system that contains the results of the restricted estimation.
resultu
an object of type systemfit.system that contains the results of the unconstrained estimation.

Value

  • lrtest.sur.systemfit returns a three values:
  • lrthe empirical likelihood ratio value.
  • pthe p-value of a $\chi^2$-test.
  • dfthe degrees of freedom of the test (= number of restrictions).

Details

At the moment only the LR test for SUR models is implemented. This test calculates the likelihood ratio value by calculating the estimated residual covariance matrix $\hat{\Sigma}$ by the maximum likelihood formula $\hat{\sigma}_{ij} = (\hat{e}_i' \hat{e}_j) / T$ (no matter which formula is used in the estimation).

References

Greene, W. H. (2002) Econometric Analysis, Fifth Edition, Prentice Hall.

See Also

systemfit

Examples

Run this code
library( systemfit )
data( kmenta )
demand <- q ~ p + d
supply <- q ~ p + f + a
labels <- list( "demand", "supply" )
system <- list( demand, supply )

## unconstrained SUR estimation
fitsur <- systemfit("SUR", system, labels, data=kmenta )
print( fitsur )

## SUR estimation with 2 restrictions
Rrestr <- matrix(0,2,7)
qrestr <- matrix(0,2,1)
Rrestr[1,3] <-  1
Rrestr[1,7] <- -1
Rrestr[2,2] <- -1
Rrestr[2,5] <-  1
qrestr[2,1] <-  0.5
fitsur2 <- systemfit("SUR", system, labels, data=kmenta,
                      R.restr=Rrestr, q.restr=qrestr )
print( fitsur2 )

## perform LR-test
lrtest.systemfit( fitsur2, fitsur )

Run the code above in your browser using DataLab