Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Question 2
- #part a
- #Question 1
- data1 = read.table("TPdata.txt",header=TRUE)
- time = ts(data1$YER, frequency=4, start=c(1970,1))
- #Part a
- LYER <- log(data1$YER)
- DLYER <- diff(LYER)
- LPCR <- log(data1$PCR)
- DLPCR <- diff(LPCR)
- plot(DLYER, type="l") #YES
- plot(DLPCR, type="l") #YES
- #Part b
- time2 = ts(LYER, frequency=4, start=c(1970,1))
- time3 = ts(LPCR, frequency=4, start=c(1970,1))
- time2
- time3
- library(urca)
- adf2 = ur.df(time2, type="drift", selectlags="BIC")
- summary(adf2) # -1.66 and test stat: -2.88. unit root at 1% sign level for LYER
- adf3 = ur.df(time3, type="drift", selectlags="BIC")
- summary(adf3) # -3.5787 and test stat: -2.88.(reject) no unit root at 1% sign levelfor LPCR
- # Part c
- reg= lm(LPCR~LYER)
- summary(reg)
- e = reg$residuals
- adf4 = ur.df(e, type="drift", selectlags="BIC")
- summary(adf4) # -2.7343 and test statistic -2.88. no cointegration (reject) the nul at 10% sing level
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement