data( "Kmenta" )
demand <- consump ~ price + income
supply <- consump ~ price + farmPrice + trend
labels <- list( "demand", "supply" )
system <- list( demand, supply )
## perform OLS on each of the equations in the system
fitols <- systemfit( "OLS", system, labels, data = Kmenta )
## all coefficients
coef( fitols )
coef( summary( fitols ) )
## coefficients of the first equation
coef( fitols$eq[[1]] )
coef( summary( fitols$eq[[1]] ) )
## coefficients of the second equation
coef( fitols$eq[[2]] )
coef( summary( fitols$eq[[2]] ) )
Run the code above in your browser using DataLab