[R] Testing of Diagnostic residuals in R
Hi there, I want to ask a question about any function in r that helps test residuals of the vector error correction model. I find it on Pfaff(2008) but he tests only residual for VAR(vector autoregressive model). I need to workout Portmanteau test, Normality test and Heteroskedasticty for the VECM. Anyway, Pfaff proposes a diagnostic test for the function vec2var. But it ends up to test VAR residuals. Is anybody can tell me if it is possible to use that function to analyse the diagnostic of vecm residuals? Thank you Vec2var codes: vecm.level <- vec2var(vecm1, r = 2) vecm.norm <- normality(vecm.level) vecm.arch <- arch(vecm.level) vecm.serial <- serial(vecm.level) Diagnostic for VAR var2c.serial <- serial(VAR) > var2c.arch <- arch(VAR) > var2c.norm <- normality(VAR) I want something like vecmfemales<-ca.jo(b,type="trace",spec="transitory") vecm.r2<-serial.test(vecmfemales) vecm.norm <- normality(vecm.r2) but i receive this message Error in serial.test(vecmfemale) : Please provide an object of class 'varest', generated by 'var()', or an object of class 'vec2var' generated by 'vec2var()'. By reading this message, i can conclude that there is only 2 ways to make residuals in R: VAR and vec2var? Thank you for your answer [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
[R] Lee carter model
Hi everybody, I'm running codes for for a Lee carter modeling. I compute the demogdata function in the package demography. Age is a class of factor Base<-demogdata(data=x,pop=y,ages=AGE,years=YEAR,type="mortality",label="City",name="Hommes",lambda=1) Now, I try to run codes for lee carter model, and i always get the following message: Error in Summary.factor(c(1L, 2L, 24L, 35L, 46L, 57L, 68L, 79L, 90L, 101L, : max not meaningful for factors Please can you help to understand what means this message. Many Thanks Achille [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.