R version 2.9.0 (2009-04-17) Copyright (C) 2009 The R Foundation for Statistical Computing ISBN 3-900051-07-0 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > x <- array(list(455626 + ,0 + ,454724 + ,461251 + ,470390 + ,474605 + ,516847 + ,0 + ,455626 + ,454724 + ,461251 + ,470390 + ,525192 + ,0 + ,516847 + ,455626 + ,454724 + ,461251 + ,522975 + ,0 + ,525192 + ,516847 + ,455626 + ,454724 + ,518585 + ,0 + ,522975 + ,525192 + ,516847 + ,455626 + ,509239 + ,0 + ,518585 + ,522975 + ,525192 + ,516847 + ,512238 + ,0 + ,509239 + ,518585 + ,522975 + ,525192 + ,519164 + ,0 + ,512238 + ,509239 + ,518585 + ,522975 + ,517009 + ,0 + ,519164 + ,512238 + ,509239 + ,518585 + ,509933 + ,0 + ,517009 + ,519164 + ,512238 + ,509239 + ,509127 + ,0 + ,509933 + ,517009 + ,519164 + ,512238 + ,500875 + ,0 + ,509127 + ,509933 + ,517009 + ,519164 + ,506971 + ,0 + ,500875 + ,509127 + ,509933 + ,517009 + ,569323 + ,0 + ,506971 + ,500875 + ,509127 + ,509933 + ,579714 + ,0 + ,569323 + ,506971 + ,500875 + ,509127 + ,577992 + ,0 + ,579714 + ,569323 + ,506971 + ,500875 + ,565644 + ,0 + ,577992 + ,579714 + ,569323 + ,506971 + ,547344 + ,0 + ,565644 + ,577992 + ,579714 + ,569323 + ,554788 + ,0 + ,547344 + ,565644 + ,577992 + ,579714 + ,562325 + ,0 + ,554788 + ,547344 + ,565644 + ,577992 + ,560854 + ,0 + ,562325 + ,554788 + ,547344 + ,565644 + ,555332 + ,0 + ,560854 + ,562325 + ,554788 + ,547344 + ,543599 + ,0 + ,555332 + ,560854 + ,562325 + ,554788 + ,536662 + ,0 + ,543599 + ,555332 + ,560854 + ,562325 + ,542722 + ,0 + ,536662 + ,543599 + ,555332 + ,560854 + ,593530 + ,0 + ,542722 + ,536662 + ,543599 + ,555332 + ,610763 + ,0 + ,593530 + ,542722 + ,536662 + ,543599 + ,612613 + ,0 + ,610763 + ,593530 + ,542722 + ,536662 + ,611324 + ,0 + ,612613 + ,610763 + ,593530 + ,542722 + ,594167 + ,0 + ,611324 + ,612613 + ,610763 + ,593530 + ,595454 + ,0 + ,594167 + ,611324 + ,612613 + ,610763 + ,590865 + ,0 + ,595454 + ,594167 + ,611324 + ,612613 + ,589379 + ,0 + ,590865 + ,595454 + ,594167 + ,611324 + ,584428 + ,0 + ,589379 + ,590865 + ,595454 + ,594167 + ,573100 + ,0 + ,584428 + ,589379 + ,590865 + ,595454 + ,567456 + ,0 + ,573100 + ,584428 + ,589379 + ,590865 + ,569028 + ,0 + ,567456 + ,573100 + ,584428 + ,589379 + ,620735 + ,0 + ,569028 + ,567456 + ,573100 + ,584428 + ,628884 + ,0 + ,620735 + ,569028 + ,567456 + ,573100 + ,628232 + ,0 + ,628884 + ,620735 + ,569028 + ,567456 + ,612117 + ,0 + ,628232 + ,628884 + ,620735 + ,569028 + ,595404 + ,0 + ,612117 + ,628232 + ,628884 + ,620735 + ,597141 + ,0 + ,595404 + ,612117 + ,628232 + ,628884 + ,593408 + ,0 + ,597141 + ,595404 + ,612117 + ,628232 + ,590072 + ,0 + ,593408 + ,597141 + ,595404 + ,612117 + ,579799 + ,0 + ,590072 + ,593408 + ,597141 + ,595404 + ,574205 + ,0 + ,579799 + ,590072 + ,593408 + ,597141 + ,572775 + ,0 + ,574205 + ,579799 + ,590072 + ,593408 + ,572942 + ,0 + ,572775 + ,574205 + ,579799 + ,590072 + ,619567 + ,0 + ,572942 + ,572775 + ,574205 + ,579799 + ,625809 + ,0 + ,619567 + ,572942 + ,572775 + ,574205 + ,619916 + ,0 + ,625809 + ,619567 + ,572942 + ,572775 + ,587625 + ,0 + ,619916 + ,625809 + ,619567 + ,572942 + ,565724 + ,0 + ,587625 + ,619916 + ,625809 + ,619567 + ,557274 + ,0 + ,565724 + ,587625 + ,619916 + ,625809 + ,560576 + ,0 + ,557274 + ,565724 + ,587625 + ,619916 + ,548854 + ,0 + ,560576 + ,557274 + ,565724 + ,587625 + ,531673 + ,0 + ,548854 + ,560576 + ,557274 + ,565724 + ,525919 + ,0 + ,531673 + ,548854 + ,560576 + ,557274 + ,511038 + ,0 + ,525919 + ,531673 + ,548854 + ,560576 + ,498662 + ,0 + ,511038 + ,525919 + ,531673 + ,548854 + ,555362 + ,0 + ,498662 + ,511038 + ,525919 + ,531673 + ,564591 + ,0 + ,555362 + ,498662 + ,511038 + ,525919 + ,541667 + ,0 + ,564591 + ,555362 + ,498662 + ,511038 + ,527070 + ,0 + ,541667 + ,564591 + ,555362 + ,498662 + ,509846 + ,0 + ,527070 + ,541667 + ,564591 + ,555362 + ,514258 + ,0 + ,509846 + ,527070 + ,541667 + ,564591 + ,516922 + ,0 + ,514258 + ,509846 + ,527070 + ,541667 + ,507561 + ,0 + ,516922 + ,514258 + ,509846 + ,527070 + ,492622 + ,0 + ,507561 + ,516922 + ,514258 + ,509846 + ,490243 + ,0 + ,492622 + ,507561 + ,516922 + ,514258 + ,469357 + ,0 + ,490243 + ,492622 + ,507561 + ,516922 + ,477580 + ,0 + ,469357 + ,490243 + ,492622 + ,507561 + ,528379 + ,0 + ,477580 + ,469357 + ,490243 + ,492622 + ,533590 + ,0 + ,528379 + ,477580 + ,469357 + ,490243 + ,517945 + ,1 + ,533590 + ,528379 + ,477580 + ,469357 + ,506174 + ,1 + ,517945 + ,533590 + ,528379 + ,477580 + ,501866 + ,1 + ,506174 + ,517945 + ,533590 + ,528379 + ,516441 + ,1 + ,501866 + ,506174 + ,517945 + ,533590 + ,528222 + ,1 + ,516441 + ,501866 + ,506174 + ,517945 + ,532638 + ,1 + ,528222 + ,516441 + ,501866 + ,506174) + ,dim=c(6 + ,81) + ,dimnames=list(c('Werkzoekend' + ,'Crisis' + ,'y-1' + ,'y-2' + ,'y-3' + ,'y-4') + ,1:81)) > y <- array(NA,dim=c(6,81),dimnames=list(c('Werkzoekend','Crisis','y-1','y-2','y-3','y-4'),1:81)) > for (i in 1:dim(x)[1]) + { + for (j in 1:dim(x)[2]) + { + y[i,j] <- as.numeric(x[i,j]) + } + } > par3 = 'Linear Trend' > par2 = 'Include Monthly Dummies' > par1 = '1' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Prof. Dr. P. Wessa > #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/ > #Source of accompanying publication: Office for Research, Development, and Education > #Technical description: Write here your technical program description (don't use hard returns!) > library(lattice) > library(lmtest) Loading required package: zoo Attaching package: 'zoo' The following object(s) are masked from package:base : as.Date.numeric > n25 <- 25 #minimum number of obs. for Goldfeld-Quandt test > par1 <- as.numeric(par1) > x <- t(y) > k <- length(x[1,]) > n <- length(x[,1]) > x1 <- cbind(x[,par1], x[,1:k!=par1]) > mycolnames <- c(colnames(x)[par1], colnames(x)[1:k!=par1]) > colnames(x1) <- mycolnames #colnames(x)[par1] > x <- x1 > if (par3 == 'First Differences'){ + x2 <- array(0, dim=c(n-1,k), dimnames=list(1:(n-1), paste('(1-B)',colnames(x),sep=''))) + for (i in 1:n-1) { + for (j in 1:k) { + x2[i,j] <- x[i+1,j] - x[i,j] + } + } + x <- x2 + } > if (par2 == 'Include Monthly Dummies'){ + x2 <- array(0, dim=c(n,11), dimnames=list(1:n, paste('M', seq(1:11), sep =''))) + for (i in 1:11){ + x2[seq(i,n,12),i] <- 1 + } + x <- cbind(x, x2) + } > if (par2 == 'Include Quarterly Dummies'){ + x2 <- array(0, dim=c(n,3), dimnames=list(1:n, paste('Q', seq(1:3), sep =''))) + for (i in 1:3){ + x2[seq(i,n,4),i] <- 1 + } + x <- cbind(x, x2) + } > k <- length(x[1,]) > if (par3 == 'Linear Trend'){ + x <- cbind(x, c(1:n)) + colnames(x)[k+1] <- 't' + } > x Werkzoekend Crisis y-1 y-2 y-3 y-4 M1 M2 M3 M4 M5 M6 M7 M8 M9 1 455626 0 454724 461251 470390 474605 1 0 0 0 0 0 0 0 0 2 516847 0 455626 454724 461251 470390 0 1 0 0 0 0 0 0 0 3 525192 0 516847 455626 454724 461251 0 0 1 0 0 0 0 0 0 4 522975 0 525192 516847 455626 454724 0 0 0 1 0 0 0 0 0 5 518585 0 522975 525192 516847 455626 0 0 0 0 1 0 0 0 0 6 509239 0 518585 522975 525192 516847 0 0 0 0 0 1 0 0 0 7 512238 0 509239 518585 522975 525192 0 0 0 0 0 0 1 0 0 8 519164 0 512238 509239 518585 522975 0 0 0 0 0 0 0 1 0 9 517009 0 519164 512238 509239 518585 0 0 0 0 0 0 0 0 1 10 509933 0 517009 519164 512238 509239 0 0 0 0 0 0 0 0 0 11 509127 0 509933 517009 519164 512238 0 0 0 0 0 0 0 0 0 12 500875 0 509127 509933 517009 519164 0 0 0 0 0 0 0 0 0 13 506971 0 500875 509127 509933 517009 1 0 0 0 0 0 0 0 0 14 569323 0 506971 500875 509127 509933 0 1 0 0 0 0 0 0 0 15 579714 0 569323 506971 500875 509127 0 0 1 0 0 0 0 0 0 16 577992 0 579714 569323 506971 500875 0 0 0 1 0 0 0 0 0 17 565644 0 577992 579714 569323 506971 0 0 0 0 1 0 0 0 0 18 547344 0 565644 577992 579714 569323 0 0 0 0 0 1 0 0 0 19 554788 0 547344 565644 577992 579714 0 0 0 0 0 0 1 0 0 20 562325 0 554788 547344 565644 577992 0 0 0 0 0 0 0 1 0 21 560854 0 562325 554788 547344 565644 0 0 0 0 0 0 0 0 1 22 555332 0 560854 562325 554788 547344 0 0 0 0 0 0 0 0 0 23 543599 0 555332 560854 562325 554788 0 0 0 0 0 0 0 0 0 24 536662 0 543599 555332 560854 562325 0 0 0 0 0 0 0 0 0 25 542722 0 536662 543599 555332 560854 1 0 0 0 0 0 0 0 0 26 593530 0 542722 536662 543599 555332 0 1 0 0 0 0 0 0 0 27 610763 0 593530 542722 536662 543599 0 0 1 0 0 0 0 0 0 28 612613 0 610763 593530 542722 536662 0 0 0 1 0 0 0 0 0 29 611324 0 612613 610763 593530 542722 0 0 0 0 1 0 0 0 0 30 594167 0 611324 612613 610763 593530 0 0 0 0 0 1 0 0 0 31 595454 0 594167 611324 612613 610763 0 0 0 0 0 0 1 0 0 32 590865 0 595454 594167 611324 612613 0 0 0 0 0 0 0 1 0 33 589379 0 590865 595454 594167 611324 0 0 0 0 0 0 0 0 1 34 584428 0 589379 590865 595454 594167 0 0 0 0 0 0 0 0 0 35 573100 0 584428 589379 590865 595454 0 0 0 0 0 0 0 0 0 36 567456 0 573100 584428 589379 590865 0 0 0 0 0 0 0 0 0 37 569028 0 567456 573100 584428 589379 1 0 0 0 0 0 0 0 0 38 620735 0 569028 567456 573100 584428 0 1 0 0 0 0 0 0 0 39 628884 0 620735 569028 567456 573100 0 0 1 0 0 0 0 0 0 40 628232 0 628884 620735 569028 567456 0 0 0 1 0 0 0 0 0 41 612117 0 628232 628884 620735 569028 0 0 0 0 1 0 0 0 0 42 595404 0 612117 628232 628884 620735 0 0 0 0 0 1 0 0 0 43 597141 0 595404 612117 628232 628884 0 0 0 0 0 0 1 0 0 44 593408 0 597141 595404 612117 628232 0 0 0 0 0 0 0 1 0 45 590072 0 593408 597141 595404 612117 0 0 0 0 0 0 0 0 1 46 579799 0 590072 593408 597141 595404 0 0 0 0 0 0 0 0 0 47 574205 0 579799 590072 593408 597141 0 0 0 0 0 0 0 0 0 48 572775 0 574205 579799 590072 593408 0 0 0 0 0 0 0 0 0 49 572942 0 572775 574205 579799 590072 1 0 0 0 0 0 0 0 0 50 619567 0 572942 572775 574205 579799 0 1 0 0 0 0 0 0 0 51 625809 0 619567 572942 572775 574205 0 0 1 0 0 0 0 0 0 52 619916 0 625809 619567 572942 572775 0 0 0 1 0 0 0 0 0 53 587625 0 619916 625809 619567 572942 0 0 0 0 1 0 0 0 0 54 565724 0 587625 619916 625809 619567 0 0 0 0 0 1 0 0 0 55 557274 0 565724 587625 619916 625809 0 0 0 0 0 0 1 0 0 56 560576 0 557274 565724 587625 619916 0 0 0 0 0 0 0 1 0 57 548854 0 560576 557274 565724 587625 0 0 0 0 0 0 0 0 1 58 531673 0 548854 560576 557274 565724 0 0 0 0 0 0 0 0 0 59 525919 0 531673 548854 560576 557274 0 0 0 0 0 0 0 0 0 60 511038 0 525919 531673 548854 560576 0 0 0 0 0 0 0 0 0 61 498662 0 511038 525919 531673 548854 1 0 0 0 0 0 0 0 0 62 555362 0 498662 511038 525919 531673 0 1 0 0 0 0 0 0 0 63 564591 0 555362 498662 511038 525919 0 0 1 0 0 0 0 0 0 64 541667 0 564591 555362 498662 511038 0 0 0 1 0 0 0 0 0 65 527070 0 541667 564591 555362 498662 0 0 0 0 1 0 0 0 0 66 509846 0 527070 541667 564591 555362 0 0 0 0 0 1 0 0 0 67 514258 0 509846 527070 541667 564591 0 0 0 0 0 0 1 0 0 68 516922 0 514258 509846 527070 541667 0 0 0 0 0 0 0 1 0 69 507561 0 516922 514258 509846 527070 0 0 0 0 0 0 0 0 1 70 492622 0 507561 516922 514258 509846 0 0 0 0 0 0 0 0 0 71 490243 0 492622 507561 516922 514258 0 0 0 0 0 0 0 0 0 72 469357 0 490243 492622 507561 516922 0 0 0 0 0 0 0 0 0 73 477580 0 469357 490243 492622 507561 1 0 0 0 0 0 0 0 0 74 528379 0 477580 469357 490243 492622 0 1 0 0 0 0 0 0 0 75 533590 0 528379 477580 469357 490243 0 0 1 0 0 0 0 0 0 76 517945 1 533590 528379 477580 469357 0 0 0 1 0 0 0 0 0 77 506174 1 517945 533590 528379 477580 0 0 0 0 1 0 0 0 0 78 501866 1 506174 517945 533590 528379 0 0 0 0 0 1 0 0 0 79 516441 1 501866 506174 517945 533590 0 0 0 0 0 0 1 0 0 80 528222 1 516441 501866 506174 517945 0 0 0 0 0 0 0 1 0 81 532638 1 528222 516441 501866 506174 0 0 0 0 0 0 0 0 1 M10 M11 t 1 0 0 1 2 0 0 2 3 0 0 3 4 0 0 4 5 0 0 5 6 0 0 6 7 0 0 7 8 0 0 8 9 0 0 9 10 1 0 10 11 0 1 11 12 0 0 12 13 0 0 13 14 0 0 14 15 0 0 15 16 0 0 16 17 0 0 17 18 0 0 18 19 0 0 19 20 0 0 20 21 0 0 21 22 1 0 22 23 0 1 23 24 0 0 24 25 0 0 25 26 0 0 26 27 0 0 27 28 0 0 28 29 0 0 29 30 0 0 30 31 0 0 31 32 0 0 32 33 0 0 33 34 1 0 34 35 0 1 35 36 0 0 36 37 0 0 37 38 0 0 38 39 0 0 39 40 0 0 40 41 0 0 41 42 0 0 42 43 0 0 43 44 0 0 44 45 0 0 45 46 1 0 46 47 0 1 47 48 0 0 48 49 0 0 49 50 0 0 50 51 0 0 51 52 0 0 52 53 0 0 53 54 0 0 54 55 0 0 55 56 0 0 56 57 0 0 57 58 1 0 58 59 0 1 59 60 0 0 60 61 0 0 61 62 0 0 62 63 0 0 63 64 0 0 64 65 0 0 65 66 0 0 66 67 0 0 67 68 0 0 68 69 0 0 69 70 1 0 70 71 0 1 71 72 0 0 72 73 0 0 73 74 0 0 74 75 0 0 75 76 0 0 76 77 0 0 77 78 0 0 78 79 0 0 79 80 0 0 80 81 0 0 81 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) Crisis `y-1` `y-2` `y-3` `y-4` 4.527e+03 9.593e+03 1.015e+00 1.853e-02 1.831e-02 -6.760e-02 M1 M2 M3 M4 M5 M6 1.054e+04 6.309e+04 1.703e+04 -2.024e+03 -9.391e+03 -7.193e+03 M7 M8 M9 M10 M11 t 1.256e+04 1.266e+04 5.038e+03 -1.352e+03 2.791e+03 -1.102e+02 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -14973.7 -2813.7 654.4 2983.1 12204.8 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 4.527e+03 1.056e+04 0.429 0.669609 Crisis 9.593e+03 3.599e+03 2.665 0.009760 ** `y-1` 1.015e+00 1.239e-01 8.194 1.64e-11 *** `y-2` 1.853e-02 1.773e-01 0.105 0.917081 `y-3` 1.831e-02 1.762e-01 0.104 0.917550 `y-4` -6.760e-02 1.297e-01 -0.521 0.603990 M1 1.054e+04 3.433e+03 3.070 0.003156 ** M2 6.309e+04 3.463e+03 18.222 < 2e-16 *** M3 1.703e+04 8.209e+03 2.075 0.042103 * M4 -2.024e+03 8.547e+03 -0.237 0.813605 M5 -9.391e+03 8.525e+03 -1.102 0.274815 M6 -7.193e+03 3.923e+03 -1.834 0.071421 . M7 1.256e+04 3.633e+03 3.456 0.000986 *** M8 1.266e+04 3.800e+03 3.333 0.001443 ** M9 5.038e+03 4.067e+03 1.239 0.220093 M10 -1.352e+03 3.813e+03 -0.354 0.724165 M11 2.791e+03 3.631e+03 0.769 0.444961 t -1.102e+02 4.309e+01 -2.557 0.012978 * --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 5950 on 63 degrees of freedom Multiple R-squared: 0.9838, Adjusted R-squared: 0.9794 F-statistic: 225 on 17 and 63 DF, p-value: < 2.2e-16 > if (n > n25) { + kp3 <- k + 3 + nmkm3 <- n - k - 3 + gqarr <- array(NA, dim=c(nmkm3-kp3+1,3)) + numgqtests <- 0 + numsignificant1 <- 0 + numsignificant5 <- 0 + numsignificant10 <- 0 + for (mypoint in kp3:nmkm3) { + j <- 0 + numgqtests <- numgqtests + 1 + for (myalt in c('greater', 'two.sided', 'less')) { + j <- j + 1 + gqarr[mypoint-kp3+1,j] <- gqtest(mylm, point=mypoint, alternative=myalt)$p.value + } + if (gqarr[mypoint-kp3+1,2] < 0.01) numsignificant1 <- numsignificant1 + 1 + if (gqarr[mypoint-kp3+1,2] < 0.05) numsignificant5 <- numsignificant5 + 1 + if (gqarr[mypoint-kp3+1,2] < 0.10) numsignificant10 <- numsignificant10 + 1 + } + gqarr + } [,1] [,2] [,3] [1,] 0.203762360 0.407524719 0.7962376 [2,] 0.124875466 0.249750932 0.8751245 [3,] 0.303055483 0.606110966 0.6969445 [4,] 0.192697494 0.385394988 0.8073025 [5,] 0.113102661 0.226205322 0.8868973 [6,] 0.211431209 0.422862418 0.7885688 [7,] 0.159597496 0.319194991 0.8404025 [8,] 0.110639472 0.221278944 0.8893605 [9,] 0.140311103 0.280622206 0.8596889 [10,] 0.105097014 0.210194028 0.8949030 [11,] 0.077485235 0.154970471 0.9225148 [12,] 0.148347768 0.296695537 0.8516522 [13,] 0.101123257 0.202246514 0.8988767 [14,] 0.069640910 0.139281820 0.9303591 [15,] 0.092548434 0.185096867 0.9074516 [16,] 0.060400757 0.120801514 0.9395992 [17,] 0.042872337 0.085744673 0.9571277 [18,] 0.041296942 0.082593884 0.9587031 [19,] 0.031564558 0.063129115 0.9684354 [20,] 0.031575233 0.063150466 0.9684248 [21,] 0.038390612 0.076781224 0.9616094 [22,] 0.023693192 0.047386385 0.9763068 [23,] 0.014256338 0.028512675 0.9857437 [24,] 0.013614666 0.027229332 0.9863853 [25,] 0.008018916 0.016037832 0.9919811 [26,] 0.004907541 0.009815081 0.9950925 [27,] 0.003408283 0.006816566 0.9965917 [28,] 0.010834121 0.021668242 0.9891659 [29,] 0.008750353 0.017500706 0.9912496 [30,] 0.006999002 0.013998005 0.9930010 [31,] 0.003767353 0.007534706 0.9962326 [32,] 0.178466513 0.356933027 0.8215335 [33,] 0.349268066 0.698536133 0.6507319 [34,] 0.282021932 0.564043865 0.7179781 [35,] 0.330957693 0.661915386 0.6690423 [36,] 0.277517417 0.555034835 0.7224826 [37,] 0.199539551 0.399079101 0.8004604 [38,] 0.127966921 0.255933841 0.8720331 [39,] 0.094143826 0.188287652 0.9058562 [40,] 0.065732875 0.131465749 0.9342671 > postscript(file="/var/www/html/rcomp/tmp/11dn81259317184.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(x[,1], type='l', main='Actuals and Interpolation', ylab='value of Actuals and Interpolation (dots)', xlab='time or index') > points(x[,1]-mysum$resid) > grid() > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/2mh2d1259317184.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(mysum$resid, type='b', pch=19, main='Residuals', ylab='value of Residuals', xlab='time or index') > grid() > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/3fu741259317184.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > hist(mysum$resid, main='Residual Histogram', xlab='values of Residuals') > grid() > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/4k5j01259317184.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > densityplot(~mysum$resid,col='black',main='Residual Density Plot', xlab='values of Residuals') > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/5xf6w1259317184.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > qqnorm(mysum$resid, main='Residual Normal Q-Q Plot') > qqline(mysum$resid) > grid() > dev.off() null device 1 > (myerror <- as.ts(mysum$resid)) Time Series: Start = 1 End = 81 Frequency = 1 1 2 3 4 5 6 -5861.0654 2001.4651 -6122.2676 765.6808 4888.3145 1936.1244 7 8 9 10 11 12 -4533.1706 -544.2848 -2172.8674 -1377.5706 1079.9708 -2813.7122 13 14 15 16 17 18 1227.2873 4635.8880 -2090.9167 2983.0564 -1062.1431 -4862.7409 19 20 21 22 23 24 2476.1883 2910.4113 889.4441 1846.5905 -7923.2466 586.7735 25 26 27 28 29 30 3477.5614 -4340.4962 6727.4622 8733.6323 12204.7775 -2647.3744 31 32 33 34 35 36 -2433.1757 -7859.0789 3251.1702 5209.2588 -4928.8861 3633.1077 37 38 39 40 41 42 704.7829 -1652.6278 -494.1165 8381.4438 -585.9153 324.8638 43 44 45 46 47 48 244.9486 -4687.4465 2685.4150 1204.7959 2250.4400 9397.9325 49 50 51 52 53 54 654.4002 -5902.0870 -1156.8824 4817.6706 -14973.6892 -3047.0104 55 56 57 58 59 60 -7782.3358 4696.1312 -4265.8590 -4438.8614 2794.9192 -2589.0606 61 62 63 64 65 66 -10662.9338 5369.4030 3345.4461 -11608.4718 2489.4461 2079.2000 67 68 69 70 71 72 5645.6314 2871.7093 -2209.6957 -2444.2132 6726.8027 -8215.0410 73 74 75 76 77 78 10459.9674 -111.5450 -208.7251 -14073.0121 -2960.7905 6216.9375 79 80 81 6381.9138 2612.5585 1822.3928 > postscript(file="/var/www/html/rcomp/tmp/6fhs11259317184.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > dum <- cbind(lag(myerror,k=1),myerror) > dum Time Series: Start = 0 End = 81 Frequency = 1 lag(myerror, k = 1) myerror 0 -5861.0654 NA 1 2001.4651 -5861.0654 2 -6122.2676 2001.4651 3 765.6808 -6122.2676 4 4888.3145 765.6808 5 1936.1244 4888.3145 6 -4533.1706 1936.1244 7 -544.2848 -4533.1706 8 -2172.8674 -544.2848 9 -1377.5706 -2172.8674 10 1079.9708 -1377.5706 11 -2813.7122 1079.9708 12 1227.2873 -2813.7122 13 4635.8880 1227.2873 14 -2090.9167 4635.8880 15 2983.0564 -2090.9167 16 -1062.1431 2983.0564 17 -4862.7409 -1062.1431 18 2476.1883 -4862.7409 19 2910.4113 2476.1883 20 889.4441 2910.4113 21 1846.5905 889.4441 22 -7923.2466 1846.5905 23 586.7735 -7923.2466 24 3477.5614 586.7735 25 -4340.4962 3477.5614 26 6727.4622 -4340.4962 27 8733.6323 6727.4622 28 12204.7775 8733.6323 29 -2647.3744 12204.7775 30 -2433.1757 -2647.3744 31 -7859.0789 -2433.1757 32 3251.1702 -7859.0789 33 5209.2588 3251.1702 34 -4928.8861 5209.2588 35 3633.1077 -4928.8861 36 704.7829 3633.1077 37 -1652.6278 704.7829 38 -494.1165 -1652.6278 39 8381.4438 -494.1165 40 -585.9153 8381.4438 41 324.8638 -585.9153 42 244.9486 324.8638 43 -4687.4465 244.9486 44 2685.4150 -4687.4465 45 1204.7959 2685.4150 46 2250.4400 1204.7959 47 9397.9325 2250.4400 48 654.4002 9397.9325 49 -5902.0870 654.4002 50 -1156.8824 -5902.0870 51 4817.6706 -1156.8824 52 -14973.6892 4817.6706 53 -3047.0104 -14973.6892 54 -7782.3358 -3047.0104 55 4696.1312 -7782.3358 56 -4265.8590 4696.1312 57 -4438.8614 -4265.8590 58 2794.9192 -4438.8614 59 -2589.0606 2794.9192 60 -10662.9338 -2589.0606 61 5369.4030 -10662.9338 62 3345.4461 5369.4030 63 -11608.4718 3345.4461 64 2489.4461 -11608.4718 65 2079.2000 2489.4461 66 5645.6314 2079.2000 67 2871.7093 5645.6314 68 -2209.6957 2871.7093 69 -2444.2132 -2209.6957 70 6726.8027 -2444.2132 71 -8215.0410 6726.8027 72 10459.9674 -8215.0410 73 -111.5450 10459.9674 74 -208.7251 -111.5450 75 -14073.0121 -208.7251 76 -2960.7905 -14073.0121 77 6216.9375 -2960.7905 78 6381.9138 6216.9375 79 2612.5585 6381.9138 80 1822.3928 2612.5585 81 NA 1822.3928 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 2001.4651 -5861.0654 [2,] -6122.2676 2001.4651 [3,] 765.6808 -6122.2676 [4,] 4888.3145 765.6808 [5,] 1936.1244 4888.3145 [6,] -4533.1706 1936.1244 [7,] -544.2848 -4533.1706 [8,] -2172.8674 -544.2848 [9,] -1377.5706 -2172.8674 [10,] 1079.9708 -1377.5706 [11,] -2813.7122 1079.9708 [12,] 1227.2873 -2813.7122 [13,] 4635.8880 1227.2873 [14,] -2090.9167 4635.8880 [15,] 2983.0564 -2090.9167 [16,] -1062.1431 2983.0564 [17,] -4862.7409 -1062.1431 [18,] 2476.1883 -4862.7409 [19,] 2910.4113 2476.1883 [20,] 889.4441 2910.4113 [21,] 1846.5905 889.4441 [22,] -7923.2466 1846.5905 [23,] 586.7735 -7923.2466 [24,] 3477.5614 586.7735 [25,] -4340.4962 3477.5614 [26,] 6727.4622 -4340.4962 [27,] 8733.6323 6727.4622 [28,] 12204.7775 8733.6323 [29,] -2647.3744 12204.7775 [30,] -2433.1757 -2647.3744 [31,] -7859.0789 -2433.1757 [32,] 3251.1702 -7859.0789 [33,] 5209.2588 3251.1702 [34,] -4928.8861 5209.2588 [35,] 3633.1077 -4928.8861 [36,] 704.7829 3633.1077 [37,] -1652.6278 704.7829 [38,] -494.1165 -1652.6278 [39,] 8381.4438 -494.1165 [40,] -585.9153 8381.4438 [41,] 324.8638 -585.9153 [42,] 244.9486 324.8638 [43,] -4687.4465 244.9486 [44,] 2685.4150 -4687.4465 [45,] 1204.7959 2685.4150 [46,] 2250.4400 1204.7959 [47,] 9397.9325 2250.4400 [48,] 654.4002 9397.9325 [49,] -5902.0870 654.4002 [50,] -1156.8824 -5902.0870 [51,] 4817.6706 -1156.8824 [52,] -14973.6892 4817.6706 [53,] -3047.0104 -14973.6892 [54,] -7782.3358 -3047.0104 [55,] 4696.1312 -7782.3358 [56,] -4265.8590 4696.1312 [57,] -4438.8614 -4265.8590 [58,] 2794.9192 -4438.8614 [59,] -2589.0606 2794.9192 [60,] -10662.9338 -2589.0606 [61,] 5369.4030 -10662.9338 [62,] 3345.4461 5369.4030 [63,] -11608.4718 3345.4461 [64,] 2489.4461 -11608.4718 [65,] 2079.2000 2489.4461 [66,] 5645.6314 2079.2000 [67,] 2871.7093 5645.6314 [68,] -2209.6957 2871.7093 [69,] -2444.2132 -2209.6957 [70,] 6726.8027 -2444.2132 [71,] -8215.0410 6726.8027 [72,] 10459.9674 -8215.0410 [73,] -111.5450 10459.9674 [74,] -208.7251 -111.5450 [75,] -14073.0121 -208.7251 [76,] -2960.7905 -14073.0121 [77,] 6216.9375 -2960.7905 [78,] 6381.9138 6216.9375 [79,] 2612.5585 6381.9138 [80,] 1822.3928 2612.5585 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 2001.4651 -5861.0654 2 -6122.2676 2001.4651 3 765.6808 -6122.2676 4 4888.3145 765.6808 5 1936.1244 4888.3145 6 -4533.1706 1936.1244 7 -544.2848 -4533.1706 8 -2172.8674 -544.2848 9 -1377.5706 -2172.8674 10 1079.9708 -1377.5706 11 -2813.7122 1079.9708 12 1227.2873 -2813.7122 13 4635.8880 1227.2873 14 -2090.9167 4635.8880 15 2983.0564 -2090.9167 16 -1062.1431 2983.0564 17 -4862.7409 -1062.1431 18 2476.1883 -4862.7409 19 2910.4113 2476.1883 20 889.4441 2910.4113 21 1846.5905 889.4441 22 -7923.2466 1846.5905 23 586.7735 -7923.2466 24 3477.5614 586.7735 25 -4340.4962 3477.5614 26 6727.4622 -4340.4962 27 8733.6323 6727.4622 28 12204.7775 8733.6323 29 -2647.3744 12204.7775 30 -2433.1757 -2647.3744 31 -7859.0789 -2433.1757 32 3251.1702 -7859.0789 33 5209.2588 3251.1702 34 -4928.8861 5209.2588 35 3633.1077 -4928.8861 36 704.7829 3633.1077 37 -1652.6278 704.7829 38 -494.1165 -1652.6278 39 8381.4438 -494.1165 40 -585.9153 8381.4438 41 324.8638 -585.9153 42 244.9486 324.8638 43 -4687.4465 244.9486 44 2685.4150 -4687.4465 45 1204.7959 2685.4150 46 2250.4400 1204.7959 47 9397.9325 2250.4400 48 654.4002 9397.9325 49 -5902.0870 654.4002 50 -1156.8824 -5902.0870 51 4817.6706 -1156.8824 52 -14973.6892 4817.6706 53 -3047.0104 -14973.6892 54 -7782.3358 -3047.0104 55 4696.1312 -7782.3358 56 -4265.8590 4696.1312 57 -4438.8614 -4265.8590 58 2794.9192 -4438.8614 59 -2589.0606 2794.9192 60 -10662.9338 -2589.0606 61 5369.4030 -10662.9338 62 3345.4461 5369.4030 63 -11608.4718 3345.4461 64 2489.4461 -11608.4718 65 2079.2000 2489.4461 66 5645.6314 2079.2000 67 2871.7093 5645.6314 68 -2209.6957 2871.7093 69 -2444.2132 -2209.6957 70 6726.8027 -2444.2132 71 -8215.0410 6726.8027 72 10459.9674 -8215.0410 73 -111.5450 10459.9674 74 -208.7251 -111.5450 75 -14073.0121 -208.7251 76 -2960.7905 -14073.0121 77 6216.9375 -2960.7905 78 6381.9138 6216.9375 79 2612.5585 6381.9138 80 1822.3928 2612.5585 > plot(z,main=paste('Residual Lag plot, lowess, and regression line'), ylab='values of Residuals', xlab='lagged values of Residuals') > lines(lowess(z)) > abline(lm(z)) > grid() > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/7ty6p1259317184.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > acf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Autocorrelation Function') > grid() > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/8f2lj1259317184.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > pacf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Partial Autocorrelation Function') > grid() > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/9v28e1259317184.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > opar <- par(mfrow = c(2,2), oma = c(0, 0, 1.1, 0)) > plot(mylm, las = 1, sub='Residual Diagnostics') > par(opar) > dev.off() null device 1 > if (n > n25) { + postscript(file="/var/www/html/rcomp/tmp/10trka1259317184.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) + plot(kp3:nmkm3,gqarr[,2], main='Goldfeld-Quandt test',ylab='2-sided p-value',xlab='breakpoint') + grid() + dev.off() + } null device 1 > > #Note: the /var/www/html/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/rcomp/createtable") > > a<-table.start() > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Estimated Regression Equation', 1, TRUE) > a<-table.row.end(a) > myeq <- colnames(x)[1] > myeq <- paste(myeq, '[t] = ', sep='') > for (i in 1:k){ + if (mysum$coefficients[i,1] > 0) myeq <- paste(myeq, '+', '') + myeq <- paste(myeq, mysum$coefficients[i,1], sep=' ') + if (rownames(mysum$coefficients)[i] != '(Intercept)') { + myeq <- paste(myeq, rownames(mysum$coefficients)[i], sep='') + if (rownames(mysum$coefficients)[i] != 't') myeq <- paste(myeq, '[t]', sep='') + } + } > myeq <- paste(myeq, ' + e[t]') > a<-table.row.start(a) > a<-table.element(a, myeq) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/www/html/rcomp/tmp/11d3uz1259317184.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,hyperlink('http://www.xycoon.com/ols1.htm','Multiple Linear Regression - Ordinary Least Squares',''), 6, TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Variable',header=TRUE) > a<-table.element(a,'Parameter',header=TRUE) > a<-table.element(a,'S.D.',header=TRUE) > a<-table.element(a,'T-STAT
H0: parameter = 0',header=TRUE) > a<-table.element(a,'2-tail p-value',header=TRUE) > a<-table.element(a,'1-tail p-value',header=TRUE) > a<-table.row.end(a) > for (i in 1:k){ + a<-table.row.start(a) + a<-table.element(a,rownames(mysum$coefficients)[i],header=TRUE) + a<-table.element(a,mysum$coefficients[i,1]) + a<-table.element(a, round(mysum$coefficients[i,2],6)) + a<-table.element(a, round(mysum$coefficients[i,3],4)) + a<-table.element(a, round(mysum$coefficients[i,4],6)) + a<-table.element(a, round(mysum$coefficients[i,4]/2,6)) + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/www/html/rcomp/tmp/12kof81259317184.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Regression Statistics', 2, TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Multiple R',1,TRUE) > a<-table.element(a, sqrt(mysum$r.squared)) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'R-squared',1,TRUE) > a<-table.element(a, mysum$r.squared) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Adjusted R-squared',1,TRUE) > a<-table.element(a, mysum$adj.r.squared) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'F-TEST (value)',1,TRUE) > a<-table.element(a, mysum$fstatistic[1]) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'F-TEST (DF numerator)',1,TRUE) > a<-table.element(a, mysum$fstatistic[2]) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'F-TEST (DF denominator)',1,TRUE) > a<-table.element(a, mysum$fstatistic[3]) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'p-value',1,TRUE) > a<-table.element(a, 1-pf(mysum$fstatistic[1],mysum$fstatistic[2],mysum$fstatistic[3])) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Residual Statistics', 2, TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Residual Standard Deviation',1,TRUE) > a<-table.element(a, mysum$sigma) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Sum Squared Residuals',1,TRUE) > a<-table.element(a, sum(myerror*myerror)) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/www/html/rcomp/tmp/13eupj1259317184.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Actuals, Interpolation, and Residuals', 4, TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Time or Index', 1, TRUE) > a<-table.element(a, 'Actuals', 1, TRUE) > a<-table.element(a, 'Interpolation
Forecast', 1, TRUE) > a<-table.element(a, 'Residuals
Prediction Error', 1, TRUE) > a<-table.row.end(a) > for (i in 1:n) { + a<-table.row.start(a) + a<-table.element(a,i, 1, TRUE) + a<-table.element(a,x[i]) + a<-table.element(a,x[i]-mysum$resid[i]) + a<-table.element(a,mysum$resid[i]) + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/www/html/rcomp/tmp/1449kf1259317184.tab") > if (n > n25) { + a<-table.start() + a<-table.row.start(a) + a<-table.element(a,'Goldfeld-Quandt test for Heteroskedasticity',4,TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'p-values',header=TRUE) + a<-table.element(a,'Alternative Hypothesis',3,header=TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'breakpoint index',header=TRUE) + a<-table.element(a,'greater',header=TRUE) + a<-table.element(a,'2-sided',header=TRUE) + a<-table.element(a,'less',header=TRUE) + a<-table.row.end(a) + for (mypoint in kp3:nmkm3) { + a<-table.row.start(a) + a<-table.element(a,mypoint,header=TRUE) + a<-table.element(a,gqarr[mypoint-kp3+1,1]) + a<-table.element(a,gqarr[mypoint-kp3+1,2]) + a<-table.element(a,gqarr[mypoint-kp3+1,3]) + a<-table.row.end(a) + } + a<-table.end(a) + table.save(a,file="/var/www/html/rcomp/tmp/154u7d1259317184.tab") + a<-table.start() + a<-table.row.start(a) + a<-table.element(a,'Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity',4,TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'Description',header=TRUE) + a<-table.element(a,'# significant tests',header=TRUE) + a<-table.element(a,'% significant tests',header=TRUE) + a<-table.element(a,'OK/NOK',header=TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'1% type I error level',header=TRUE) + a<-table.element(a,numsignificant1) + a<-table.element(a,numsignificant1/numgqtests) + if (numsignificant1/numgqtests < 0.01) dum <- 'OK' else dum <- 'NOK' + a<-table.element(a,dum) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'5% type I error level',header=TRUE) + a<-table.element(a,numsignificant5) + a<-table.element(a,numsignificant5/numgqtests) + if (numsignificant5/numgqtests < 0.05) dum <- 'OK' else dum <- 'NOK' + a<-table.element(a,dum) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'10% type I error level',header=TRUE) + a<-table.element(a,numsignificant10) + a<-table.element(a,numsignificant10/numgqtests) + if (numsignificant10/numgqtests < 0.1) dum <- 'OK' else dum <- 'NOK' + a<-table.element(a,dum) + a<-table.row.end(a) + a<-table.end(a) + table.save(a,file="/var/www/html/rcomp/tmp/161k9v1259317184.tab") + } > > system("convert tmp/11dn81259317184.ps tmp/11dn81259317184.png") > system("convert tmp/2mh2d1259317184.ps tmp/2mh2d1259317184.png") > system("convert tmp/3fu741259317184.ps tmp/3fu741259317184.png") > system("convert tmp/4k5j01259317184.ps tmp/4k5j01259317184.png") > system("convert tmp/5xf6w1259317184.ps tmp/5xf6w1259317184.png") > system("convert tmp/6fhs11259317184.ps tmp/6fhs11259317184.png") > system("convert tmp/7ty6p1259317184.ps tmp/7ty6p1259317184.png") > system("convert tmp/8f2lj1259317184.ps tmp/8f2lj1259317184.png") > system("convert tmp/9v28e1259317184.ps tmp/9v28e1259317184.png") > system("convert tmp/10trka1259317184.ps tmp/10trka1259317184.png") > > > proc.time() user system elapsed 2.703 1.595 3.209