Learn R Programming

systemfit (version 1.0-4)

fitted.systemfit: Fitted values

Description

These functions extract the fitted values from an object returned by systemfit.

Usage

## S3 method for class 'systemfit':
fitted( object, \dots )

## S3 method for class 'systemfit.equation': fitted( object, \dots )

Arguments

object
an object of class systemfit or systemfit.equation.
...
other arguments.

Value

  • fitted.systemfit returns a data.frame of all fitted values, where each column contains the fitted values of one equation.

    fitted.systemfit.equation returns a vector of the fitted values of a single equation.

See Also

systemfit, fitted

Examples

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

## perform OLS on each of the equations in the system
fitols <- systemfit( system, data = Kmenta )

## all fitted values
fitted( fitols )

## fitted values of the first equation
fitted( fitols$eq[[1]] )

## fitted values of the second equation
fitted( fitols$eq[[2]] )

Run the code above in your browser using DataLab