data( "Kmenta" )
eqDemand <- consump ~ price + income
eqSupply <- consump ~ price + farmPrice + trend
system <- list( demand = eqDemand, supply = eqSupply )
## unconstrained SUR estimation
fitsur <- systemfit( "SUR", system, data=Kmenta )
# create restriction matrix to test whether \eqn{beta_2 = \beta_6}
R1 <- matrix( 0, nrow = 1, ncol = 7 )
R1[ 1, 2 ] <- 1
R1[ 1, 6 ] <- -1
## perform Wald-test
waldTest1 <- waldtest.systemfit( fitsur, R1 )
print( waldTest1 ) # rejected
# create restriction matrix to test whether \eqn{beta_2 = - \beta_6}
R2 <- matrix( 0, nrow = 1, ncol = 7 )
R2[ 1, 2 ] <- 1
R2[ 1, 6 ] <- 1
## perform Wald-test
waldTest2 <- waldtest.systemfit( fitsur, R2 )
print( waldTest2 ) # accepted
Run the code above in your browser using DataLab