Advertisement
Guest User

Untitled

a guest
Sep 28th, 2016
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. # Load libraries
  2. library(nlme) # Estimation of mixed effects models
  3. library(lme4) # Alternative package for mixed effects models
  4. library(plm) # Econometrics package for linear panel models
  5. library(arm) # Gelman & Hill code for mixed effects simulation
  6. library(pcse) # Calculate PCSEs for LS models (Beck & Katz)
  7. library(tseries) # For ADF unit root test
  8. library(simcf) # For panel functions and simulators
  9. # Estimate a random effects AR(I)MA(p,q) model using lme (Restricted ML)
  10. lme.res1 <- lme(# A formula object including the response,
  11. # the fixed covariates, and any grouping variables
  12. fixed = GDPWdiff ~ OIL + REG + EDT,
  13.  
  14. # The random effects component
  15. random = ~ 1 | COUNTRY,
  16.  
  17. # The TS dynamics: specify the time & group variables,
  18. # and the order of the ARMA(p,q) process
  19. correlation = corARMA(form = ~ YEAR | COUNTRY,
  20. p = 1, # AR(p) order
  21. q = 0 # MA(q) order
  22. )
  23. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement