Fitted values

Share:

Description

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

Usage

1
2
3
4
5
   ## S3 method for class 'systemfit'
fitted( object, ... )

   ## S3 method for class 'systemfit.equation'
fitted( object, na.rm = FALSE, ... )

Arguments

object

an object of class systemfit or systemfit.equation.

na.rm

a logical value indicating whether NA values (corresponding to observations that were not included in the estimation) should be removed from the vector of fitted values before it is returned.

...

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.

Author(s)

Arne Henningsen arne.henningsen@googlemail.com

See Also

systemfit, fitted

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
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]] )

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.