R/dwt.cesEst.R

Defines functions durbinWatsonTest.cesEst

Documented in durbinWatsonTest.cesEst

durbinWatsonTest.cesEst <- function( model, ... ) {
   if( is.null( model$grad ) ) {
      stop( "the model object must have a component 'grad';",
         " please re-estimate the model with argument 'returnGrad'",
         " set to 'TRUE'" )
   }
   gMat <- model$grad
   mCoef <- coef( model )
   yDW <- residuals( model ) + gMat %*% mCoef
   dwReg <- lm( yDW ~ gMat - 1 )
   result <- durbinWatsonTest( dwReg, ... )
   return( result )
}

Try the micEconCES package in your browser

Any scripts or data that you put into this service are public.

micEconCES documentation built on Jan. 7, 2021, 3:01 p.m.