# bread.systemfit: Bread for Sandwiches In systemfit: Estimating Systems of Simultaneous Equations

### Description

Extract the estimator for the bread of sandwhiches (see `bread`).

### Usage

``````## S3 method for class 'systemfit'
``````

### Arguments

 `x` an object of class `systemfit`. `...` further arguments (currently ignored).

### Value

Quadratic symmetric matrix, which is an estimator for the expectation of the negative derivative of the estimating function (see `estfun.systemfit`).

### Warnings

The sandwich package must be loaded before this method can be used.

This method might not be suitable for specific formulas for 3SLS estimations in case of unbalanced systems or different instruments for different equations.

### Author(s)

Arne Henningsen

`bread`, `systemfit`.

### Examples

``````data( "Kmenta" )
eqDemand <- consump ~ price + income
eqSupply <- consump ~ price + farmPrice + trend
system <- list( demand = eqDemand, supply = eqSupply )
inst <- ~ income + farmPrice + trend

## OLS estimation
fitols <- systemfit( system, "OLS", data = Kmenta )

library( "sandwich" )

## this is only true for OLS models
solve( crossprod( model.matrix( fitols ) ) / 40 ) )

## 2SLS estimation
fit2sls <- systemfit( system, "2SLS", inst = inst, data = Kmenta )

## this is only true for 2SLS models
solve( crossprod( model.matrix( fit2sls, which = "xHat" ) ) / 40 ) )

## iterated SUR estimation
fitsur <- systemfit( system, "SUR", data = Kmenta, maxit = 100 )

## this should be true for SUR and WLS models
solve( t( model.matrix( fitsur ) ) %*%
(  ( solve( fitsur\$residCovEst ) %x% diag( nrow( Kmenta ) ) ) %*%
model.matrix( fitsur ) ) / 40 ), check.attributes = FALSE )

## 3SLS estimation
fit3sls <- systemfit( system, "3SLS", inst = inst, data = Kmenta )