Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

createSystemfitModel

Create a Model for systemfit


Description

This function creates a model that can be estimated by systemfit. The data, disturbances, and — if not provided by the user — the coefficients as well as the disturbance covariance matrix are generated by random numbers.

Usage

createSystemfitModel( nEq, nRegEq, nObs, coef = NULL, sigma = NULL )

Arguments

nEq

the number of equations.

nRegEq

the number of regressors in each equation (without the intercept).

nObs

the number of observations.

coef

an optional vector of coefficients.

sigma

an optional covariance matrix of the disturbance terms.

Value

createSystemfitModel returns a list with following elements:

formula

a list of the model equations (objects of class formula).

data

a data.frame that contains the data.

coef

a vector of (true) coefficients.

sigma

the covariance matrix of the disturbance terms.

Author(s)

See Also

Examples

## create a model by random numbers
systemfitModel <- createSystemfitModel( 3, 4, 100 )

## estimate this model by "SUR"
fitsur <- systemfit( systemfitModel$formula, "SUR", data = systemfitModel$data )

## compare the "true" and the estimated coefficients
cbind( systemfitModel$coef, coef( fitsur ) )

systemfit

Estimating Systems of Simultaneous Equations

v1.1-24
GPL (>= 2)
Authors
Arne Henningsen and Jeff D. Hamann
Initial release
2019-12-08

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.