## Repeating the OLS and SUR estimations in Greene (2003, pp. 351)
data( "GrunfeldGreene" )
formulaGrunfeld <- invest ~ value + capital
# OLS
greeneOls <- systemfitClassic( "OLS", formulaGrunfeld, "firm", "year",
data = GrunfeldGreene )
summary( greeneOls )
sapply( greeneOls$eq, function(x){return(x$ssr/20)} ) # sigma^2
# OLS Pooled
greeneOlsPooled <- systemfitClassic( "OLS", formulaGrunfeld, "firm", "year",
data = GrunfeldGreene, pooled = TRUE )
summary( greeneOlsPooled )
sum( sapply( greeneOlsPooled$eq, function(x){return(x$ssr)}) )/97 # sigma^2
# SUR
greeneSur <- systemfitClassic( "SUR", formulaGrunfeld, "firm", "year",
data = GrunfeldGreene, rcovformula = 0 )
summary( greeneSur )
# SUR Pooled
greeneSurPooled <- systemfitClassic( "WSUR", formulaGrunfeld, "firm", "year",
data = GrunfeldGreene, pooled = TRUE, rcovformula = 0 )
summary( greeneSurPooled )
Run the code above in your browser using DataLab