systemfit             package:systemfit             R Documentation

_L_i_n_e_a_r _E_q_u_a_t_i_o_n _S_y_s_t_e_m _E_s_t_i_m_a_t_i_o_n

_D_e_s_c_r_i_p_t_i_o_n:

     Fits a set of linear structural equations using Ordinary Least
     Squares (OLS), Weighted Least Squares (WLS), Seemingly Unrelated
     Regression (SUR), Two-Stage Least Squares (2SLS), Weighted
     Two-Stage Least Squares (W2SLS) or Three-Stage Least Squares
     (3SLS).

_U_s_a_g_e:

     systemfit( formula, method = "OLS",
                inst=NULL, data=list(),
                restrict.matrix = NULL, restrict.rhs = NULL, restrict.regMat = NULL,
                pooled = FALSE, control = systemfit.control( ... ), ... )

_A_r_g_u_m_e_n_t_s:

 formula: an object of class 'formula' (for single-equation models) or
          (typically) a list of objects of class 'formula' (for
          multiple-equation models); if argument 'data' is of class
          'plm.dim' (created with 'plm.data'), this argument must be a
          single object of class 'formula' that represents the formula
          to be estimated for all individuals.

  method: the estimation method, one of "OLS", "WLS", "SUR", "2SLS",
          "W2SLS", or "3SLS" (see details); iterated estimation methods
          can be specified by setting control parameter 'maxiter'
          larger than 1 (e.g. 500).

    inst: one-sided model formula specifying instrumental variables or
          a list of one-sided model formulas if different instruments
          should be used for the different equations (only needed for
          2SLS, W2SLS, and 3SLS estimations).

    data: an optional data frame containing the variables in the model.
          By default the variables are taken from the environment from
          which systemfit is called.

restrict.matrix: an optional j x k matrix to impose linear restrictions
          on the coefficients by 'restrict.matrix' * b = 'restrict.rhs'
          (j = number of restrictions, k = number of all coefficients,
          b = vector of all coefficients) or a character vector giving
          the restrictions in symbolic form (see documentation of
          'linear.hypothesis' in package "car" for details). The number
          and the names of the coefficients can be obtained by
          estimating the system without restrictions and applying the
          'coef' method to the returned object.

restrict.rhs: an optional vector with j elements to impose linear
          restrictions (see 'restrict.matrix'); default is a vector
          that contains j zeros.

restrict.regMat: an optional matrix to impose restrictions on the
          coefficients by post-multiplying the regressor matrix with
          this matrix (see details).

 control: list of control parameters. The default is constructed by the
          function 'systemfit.control'. See the documentation of
          'systemfit.control' for details.

  pooled: logical, restrict coefficients to be equal in all equations
          (only for panel-like data).

     ...: arguments passed to 'systemfit.control'.

_D_e_t_a_i_l_s:

     The estimation of systems of equations with unequal numbers of
     observations has not been thoroughly tested yet. Currently,
     'systemfit' calculates the residual covariance matrix only from
     the residuals/observations that are available in all equations.

     If argument 'data' is of class 'plm.dim' (created with 'plm.data'
     and thus, contains panel data in long format), argument 'formula'
     must be a single equation that is applied to all individuals. In
     this case, argument 'pooled' specifies whether the coefficients
     are restricted to be equal for all individuals.

     If argument 'restrict.regMat' is specified, the regressor matrix X
     is post-multiplied by this matrix: X^{*} = X cdot
     'restrict.regMat'. Then, this modified regressor matrix X^{*} is
     used for the estimation of the coefficient vector b^{*}. This
     means that the coefficients of the original regressors (X), vector
     b, can be represented by b = 'restrict.regMat' cdot b^{*}. If
     'restrict.regMat' is a non-singular quadratic matrix, there are no
     restrictions on the coefficients imposed, but the coefficients
     b^{*} are linear combinations of the original coefficients b. If
     'restrict.regMat' has less columns than rows, linear restrictions
     are imposed on the coefficients b. However, imposing linear
     restrictions by the 'restrict.regMat' matrix is less flexible than
     by providing the matrix 'restrict.matrix' and the vector
     'restrict.rhs'. The advantage of imposing restrictions on the
     coefficients by the matrix 'restrict.regMat' is that the matrix,
     which has to be inverted during the estimation, gets smaller by
     this procedure, while it gets larger if the restrictions are
     imposed by 'restrict.matrix' and 'restrict.rhs'.

     In the context of multi-equation models,  the term "weighted" in
     "weighted least squares" (WLS) and "weighted two-stage least
     squares" (W2SLS) means that the _equations_ might have different
     weights and _not_ that the _observations_ have different weights.

     It is important to realize the limitations on estimating the
     residuals covariance matrix imposed by the number of observations
     T in each equation. With g equations we estimate g*(g+1)/2
     elements using T*g observations total. Beck and Katz (1995,1993)
     discuss the issue and the resulting overconfidence when the ratio
     of T/g is small (e.g. 3). Even for T/g=5 the estimate is unstable
     both numerically and statistically and the 95 approximately
     [0.5*s^2, 3*s^2], which is inadequate precision if the covariance
     matrix will be used for simulation of asset return paths either
     for investment or risk management decisions. For a starter on
     models with large cross-sections see Reichlin (2002). [This
     paragraph has been provided by Stephen C. Bond - Thanks!]

_V_a_l_u_e:

     'systemfit' returns a list of the class 'systemfit' and contains
     all results that belong to the whole system. This list contains
     one special object: "eq". It is a list and contains one object for
     each estimated equation. These objects are of the class
     'systemfit.equation' and contain the results that belong only to
     the regarding equation.

     The objects of the class 'systemfit' and 'systemfit.equation' have
     the following components (the elements of the latter are marked
     with an asterisk (*)):

    call: the matched call.

  method: estimation method.

    rank: total number of linear independent coefficients = number of
          coefficients minus number of linear restrictions.

df.residual: degrees of freedom of the whole system.

    iter: number of iteration steps.

coefficients: vector of all estimated coefficients.

 coefCov: estimated covariance matrix of 'coefficients'.

residCov: estimated residual covariance matrix.

residCovEst: residual covariance matrix used for estimation (only WLS,
          W2SLS, SUR and 3SLS).

restrict.matrix: the restriction matrix.

restrict.rhs: the restriction vector.

restrict.regMat: matrix used to impose restrictions on the coefficients
          by post-multiplying the regressor matrix with this matrix.

 control: list of control parameters used for the estimation.

panelLike: logical. Was this an analysis with panel-like data?

      eq: a list that contains the results that belong to the
          individual equations.

eqnLabel*: the label of this equation.

  eqnNo*: the number of this equation.

  terms*: the 'terms' object used for the ith equation.

   inst*: instruments of the ith equation (only 2SLS, W2SLS, and 3SLS).

   rank*: number of linear independent coefficients in the ith equation
          (differs from the number of coefficients only if there are
          restrictions that are not cross-equation).

nCoef.sys*: total number of coefficients in all equations.

rank.sys*: total number of linear independent coefficients in all
          equations.

df.residual*: degrees of freedom of the ith equation.

df.residual.sys*: degrees of freedom of the whole system.

coefficients*: estimated coefficients of the ith equation.

   covb*: estimated covariance matrix of 'coefficients'.

  model*: if requested (the default), the model frame of the ith
          equation.

      x*: if requested, the model matrix of the ith equation.

      y*: if requested, the response of the ith equation.

      z*: if requested, the matrix of instrumental variables of the ith
          equation (only 2SLS, W2SLS, and 3SLS).

fitted.values*: vector of fitted values of the ith equation.

residuals*: vector of residuals of the ith equation.

_A_u_t_h_o_r(_s):

     Arne Henningsen arne.henningsen@googlemail.com,
      Jeff D. Hamann jeff.hamann@forestinformatics.com

_R_e_f_e_r_e_n_c_e_s:

     Beck, N.; J.N. Katz (1995) What to do (and not to do) with
     Time-Series Cross-Section Data, _The American Political Science
     Review_, 89, pp. 634-647.

     Beck, N.; J.N. Katz; M.R. Alvarez; G. Garrett; P. Lange (1993)
     Government Partisanship, Labor Organization, and Macroeconomic
     Performance: a Corrigendum, _American Political Science Review_,
     87, pp. 945-48.

     Greene, W. H. (2003) _Econometric Analysis, Fifth Edition_,
     Prentice Hall.

     Judge, George G.; W. E. Griffiths; R. Carter Hill; Helmut
     Luetkepohl and Tsoung-Chao Lee (1985) _The Theory and Practice of
     Econometrics, Second Edition_, Wiley.

     Kmenta, J. (1997) _Elements of Econometrics, Second Edition_,
     University of Michigan Publishing.

     Reichlin, L. (2002) _Factor models in large cross-sections of time
     series_, Working Paper, ECARES and CEPR.

     Schmidt, P. (1990) _Three-Stage Least Squares with different
     Instruments for different equations_, Journal of Econometrics 43,
     p. 389-394.

     Theil, H. (1971) _Principles of Econometrics_, Wiley, New York.

_S_e_e _A_l_s_o:

     'lm' and 'nlsystemfit'

_E_x_a_m_p_l_e_s:

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

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

     ## OLS estimation with 2 restrictions
     Rrestr <- matrix(0,2,7)
     Rrestr[1,3] <-  1
     Rrestr[1,7] <- -1
     Rrestr[2,2] <- -1
     Rrestr[2,5] <-  1
     qrestr <- c( 0, 0.5 )
     fitols2 <- systemfit( system, data = Kmenta,
                           restrict.matrix = Rrestr, restrict.rhs = qrestr )
     print( fitols2 )

     ## OLS estimation with the same 2 restrictions in symbolic form
     restrict <- c( "demand_income - supply_trend = 0",
        "- demand_price + supply_price = 0.5" )
     fitols2b <- systemfit( system, data = Kmenta, restrict.matrix = restrict )
     print( fitols2b )

     # test whether both restricted estimators are identical
     all.equal( coef( fitols2 ), coef( fitols2b ) )

     ## OLS with restrictions on the coefficients by modifying the regressor matrix
     ## with argument restrict.regMat
     modReg <- matrix( 0, 7, 6 )
     colnames( modReg ) <- c( "demIntercept", "demPrice", "demIncome",
        "supIntercept", "supPrice2", "supTrend" )
     modReg[ 1, "demIntercept" ] <- 1
     modReg[ 2, "demPrice" ]     <- 1
     modReg[ 3, "demIncome" ]    <- 1
     modReg[ 4, "supIntercept" ] <- 1
     modReg[ 5, "supPrice2" ]    <- 1
     modReg[ 6, "supPrice2" ]    <- 1
     modReg[ 7, "supTrend" ]     <- 1
     fitols3 <- systemfit( system, data = Kmenta, restrict.regMat = modReg )
     print( fitols3 )

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

     ## 2SLS estimation
     inst <- ~ income + farmPrice + trend
     fit2sls <- systemfit( system, "2SLS", inst = inst, data = Kmenta )
     print( fit2sls )

     ## 2SLS estimation with different instruments in each equation
     inst1 <- ~ income + farmPrice
     inst2 <- ~ income + farmPrice + trend
     instlist <- list( inst1, inst2 )
     fit2sls2 <- systemfit( system, "2SLS", inst = instlist, data = Kmenta )
     print( fit2sls2 )

     ## 3SLS estimation with GMM-3SLS formula
     inst <- ~ income + farmPrice + trend
     fit3sls <- systemfit( system, "3SLS", inst = inst, data = Kmenta,
        method3sls = "GMM" )
     print( fit3sls )

     ## Examples how to use systemfit() with panel-like data
     ## Repeating the SUR estimations in Greene (2003, p. 351)
     data( "GrunfeldGreene" )
     library( plm )
     GGPanel <- plm.data( GrunfeldGreene, c( "firm", "year" ) )
     formulaGrunfeld <- invest ~ value + capital
     # SUR
     greeneSur <- systemfit( formulaGrunfeld, "SUR",
        data = GGPanel, methodResidCov = "noDfCor" )
     summary( greeneSur )
     # SUR Pooled
     greeneSurPooled <- systemfit( formulaGrunfeld, "SUR",
        data = GGPanel, pooled = TRUE, methodResidCov = "noDfCor",
        residCovWeighted = TRUE )
     summary( greeneSurPooled )

     ## Further examples are in the documentation to the data sets
     ## 'KleinI' and 'GrunfeldGreene'.

