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(219277 + ,2534 + ,2534 + ,29761 + ,12791 + ,1151 + ,219313 + ,2266 + ,2266 + ,30066 + ,12891 + ,1220 + ,212610 + ,2088 + ,2088 + ,30315 + ,13098 + ,1290 + ,214771 + ,1932 + ,1932 + ,30571 + ,13418 + ,1330 + ,211142 + ,1784 + ,1784 + ,30757 + ,13614 + ,1419 + ,211457 + ,1851 + ,1851 + ,30742 + ,13653 + ,1443 + ,240048 + ,2700 + ,2700 + ,31310 + ,13980 + ,1516 + ,240636 + ,2580 + ,2580 + ,31381 + ,14087 + ,1546 + ,230580 + ,2829 + ,2829 + ,31470 + ,14332 + ,1579 + ,208795 + ,2298 + ,2298 + ,31226 + ,14232 + ,1591 + ,197922 + ,2045 + ,2045 + ,31081 + ,14226 + ,1603 + ,194596 + ,1824 + ,1824 + ,31061 + ,14186 + ,1606 + ,194581 + ,1872 + ,1872 + ,31114 + ,14310 + ,1616 + ,185686 + ,1801 + ,1801 + ,30828 + ,14152 + ,1628 + ,178106 + ,1735 + ,1735 + ,30418 + ,14127 + ,1594 + ,172608 + ,1639 + ,1639 + ,30195 + ,14163 + ,1596 + ,167302 + ,1521 + ,1521 + ,29877 + ,13964 + ,1526 + ,168053 + ,1758 + ,1758 + ,29192 + ,13811 + ,1535 + ,202300 + ,2603 + ,2603 + ,29876 + ,14440 + ,1581 + ,202388 + ,2540 + ,2540 + ,29409 + ,14724 + ,1611 + ,182516 + ,3103 + ,3103 + ,28458 + ,14790 + ,1571 + ,173476 + ,2801 + ,2801 + ,28340 + ,14961 + ,1535 + ,166444 + ,2590 + ,2590 + ,28164 + ,15117 + ,1498 + ,171297 + ,2324 + ,2324 + ,28438 + ,15452 + ,1493 + ,169701 + ,2424 + ,2424 + ,28053 + ,16080 + ,1480 + ,164182 + ,2288 + ,2288 + ,27599 + ,16284 + ,1448 + ,161914 + ,2163 + ,2163 + ,27226 + ,16524 + ,1462 + ,159612 + ,2082 + ,2082 + ,27119 + ,16782 + ,1428 + ,151001 + ,1937 + ,1937 + ,26625 + ,16663 + ,1315 + ,158114 + ,2155 + ,2155 + ,26541 + ,16678 + ,1186 + ,186530 + ,2874 + ,2874 + ,27023 + ,17448 + ,1230 + ,187069 + ,2836 + ,2836 + ,26631 + ,17745 + ,1271 + ,174330 + ,3439 + ,3439 + ,26154 + ,17789 + ,1243 + ,169362 + ,3278 + ,3278 + ,26029 + ,17864 + ,1220 + ,166827 + ,3129 + ,3129 + ,26008 + ,18079 + ,1214 + ,178037 + ,2959 + ,2959 + ,26632 + ,18483 + ,1227 + ,186413 + ,3060 + ,3060 + ,27010 + ,19037 + ,1262 + ,189226 + ,2898 + ,2898 + ,27041 + ,19344 + ,1274 + ,191563 + ,2783 + ,2783 + ,27244 + ,19590 + ,1272 + ,188906 + ,2632 + ,2632 + ,26976 + ,19862 + ,1249 + ,186005 + ,2465 + ,2465 + ,26715 + ,20207 + ,1266 + ,195309 + ,2689 + ,2689 + ,27017 + ,20593 + ,1307 + ,223532 + ,3321 + ,3321 + ,27714 + ,21253 + ,1345 + ,226899 + ,3359 + ,3359 + ,27655 + ,21507 + ,1369 + ,214126 + ,4108 + ,4108 + ,27103 + ,21528 + ,1374 + ,206903 + ,3407 + ,3407 + ,27088 + ,21818 + ,1400 + ,204442 + ,3241 + ,3241 + ,26968 + ,22205 + ,1425 + ,220375 + ,3013 + ,3013 + ,27770 + ,22621 + ,1465 + ,214320 + ,3067 + ,3067 + ,27616 + ,23006 + ,1510 + ,212588 + ,2965 + ,2965 + ,27481 + ,23178 + ,1508 + ,205816 + ,2823 + ,2823 + ,27279 + ,23358 + ,1512 + ,202196 + ,2718 + ,2718 + ,26918 + ,23519 + ,1539 + ,195722 + ,2567 + ,2567 + ,26503 + ,23725 + ,1569 + ,198563 + ,2658 + ,2658 + ,26547 + ,23789 + ,1571 + ,229139 + ,3436 + ,3436 + ,27467 + ,24472 + ,1650 + ,229527 + ,3375 + ,3375 + ,27305 + ,24773 + ,1736 + ,211868 + ,3931 + ,3931 + ,26259 + ,24477 + ,1700 + ,203555 + ,3371 + ,3371 + ,26048 + ,24669 + ,1731 + ,195770 + ,3038 + ,3038 + ,25743 + ,24827 + ,1752) + ,dim=c(6 + ,59) + ,dimnames=list(c('totaal' + ,'-18' + ,'1824' + ,'5054' + ,'5058' + ,'60+') + ,1:59)) > y <- array(NA,dim=c(6,59),dimnames=list(c('totaal','-18','1824','5054','5058','60+'),1:59)) > for (i in 1:dim(x)[1]) + { + for (j in 1:dim(x)[2]) + { + y[i,j] <- as.numeric(x[i,j]) + } + } > par3 = 'No Linear Trend' > par2 = 'Do not include Seasonal 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 totaal -18 1824 5054 5058 60+ 1 219277 2534 2534 29761 12791 1151 2 219313 2266 2266 30066 12891 1220 3 212610 2088 2088 30315 13098 1290 4 214771 1932 1932 30571 13418 1330 5 211142 1784 1784 30757 13614 1419 6 211457 1851 1851 30742 13653 1443 7 240048 2700 2700 31310 13980 1516 8 240636 2580 2580 31381 14087 1546 9 230580 2829 2829 31470 14332 1579 10 208795 2298 2298 31226 14232 1591 11 197922 2045 2045 31081 14226 1603 12 194596 1824 1824 31061 14186 1606 13 194581 1872 1872 31114 14310 1616 14 185686 1801 1801 30828 14152 1628 15 178106 1735 1735 30418 14127 1594 16 172608 1639 1639 30195 14163 1596 17 167302 1521 1521 29877 13964 1526 18 168053 1758 1758 29192 13811 1535 19 202300 2603 2603 29876 14440 1581 20 202388 2540 2540 29409 14724 1611 21 182516 3103 3103 28458 14790 1571 22 173476 2801 2801 28340 14961 1535 23 166444 2590 2590 28164 15117 1498 24 171297 2324 2324 28438 15452 1493 25 169701 2424 2424 28053 16080 1480 26 164182 2288 2288 27599 16284 1448 27 161914 2163 2163 27226 16524 1462 28 159612 2082 2082 27119 16782 1428 29 151001 1937 1937 26625 16663 1315 30 158114 2155 2155 26541 16678 1186 31 186530 2874 2874 27023 17448 1230 32 187069 2836 2836 26631 17745 1271 33 174330 3439 3439 26154 17789 1243 34 169362 3278 3278 26029 17864 1220 35 166827 3129 3129 26008 18079 1214 36 178037 2959 2959 26632 18483 1227 37 186413 3060 3060 27010 19037 1262 38 189226 2898 2898 27041 19344 1274 39 191563 2783 2783 27244 19590 1272 40 188906 2632 2632 26976 19862 1249 41 186005 2465 2465 26715 20207 1266 42 195309 2689 2689 27017 20593 1307 43 223532 3321 3321 27714 21253 1345 44 226899 3359 3359 27655 21507 1369 45 214126 4108 4108 27103 21528 1374 46 206903 3407 3407 27088 21818 1400 47 204442 3241 3241 26968 22205 1425 48 220375 3013 3013 27770 22621 1465 49 214320 3067 3067 27616 23006 1510 50 212588 2965 2965 27481 23178 1508 51 205816 2823 2823 27279 23358 1512 52 202196 2718 2718 26918 23519 1539 53 195722 2567 2567 26503 23725 1569 54 198563 2658 2658 26547 23789 1571 55 229139 3436 3436 27467 24472 1650 56 229527 3375 3375 27305 24773 1736 57 211868 3931 3931 26259 24477 1700 58 203555 3371 3371 26048 24669 1731 59 195770 3038 3038 25743 24827 1752 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) `-18` `1824` `5054` `5058` `60+` -4.585e+05 1.965e+01 NA 1.991e+01 6.317e+00 -5.089e+01 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -13769.2 -5834.7 -797.2 5934.0 15359.0 Coefficients: (1 not defined because of singularities) Estimate Std. Error t value Pr(>|t|) (Intercept) -4.585e+05 3.458e+04 -13.257 < 2e-16 *** `-18` 1.966e+01 2.618e+00 7.507 6.19e-10 *** `1824` NA NA NA NA `5054` 1.991e+01 1.151e+00 17.301 < 2e-16 *** `5058` 6.317e+00 5.749e-01 10.988 2.20e-15 *** `60+` -5.089e+01 8.699e+00 -5.851 2.96e-07 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 8113 on 54 degrees of freedom Multiple R-squared: 0.8769, Adjusted R-squared: 0.8678 F-statistic: 96.18 on 4 and 54 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.6193167 0.761366638 0.3806833188 [2,] 0.5629825 0.874034920 0.4370174599 [3,] 0.4133575 0.826715039 0.5866424806 [4,] 0.2862412 0.572482432 0.7137587841 [5,] 0.1942234 0.388446805 0.8057765974 [6,] 0.1667815 0.333562949 0.8332185254 [7,] 0.4220771 0.844154278 0.5779228611 [8,] 0.6060012 0.787997632 0.3939988159 [9,] 0.6541076 0.691784718 0.3458923590 [10,] 0.8137871 0.372425863 0.1862129317 [11,] 0.8373231 0.325353865 0.1626769323 [12,] 0.9719507 0.056098679 0.0280493395 [13,] 0.9882326 0.023534874 0.0117674372 [14,] 0.9865658 0.026868468 0.0134342341 [15,] 0.9808986 0.038202785 0.0191013926 [16,] 0.9738176 0.052364856 0.0261824280 [17,] 0.9692563 0.061487390 0.0307436950 [18,] 0.9681767 0.063646546 0.0318232730 [19,] 0.9737115 0.052576986 0.0262884930 [20,] 0.9766785 0.046642969 0.0233214847 [21,] 0.9871135 0.025773081 0.0128865407 [22,] 0.9902946 0.019410752 0.0097053762 [23,] 0.9859579 0.028084257 0.0140421283 [24,] 0.9957841 0.008431844 0.0042159221 [25,] 0.9970328 0.005934430 0.0029672150 [26,] 0.9966206 0.006758841 0.0033794204 [27,] 0.9952176 0.009564832 0.0047824160 [28,] 0.9917863 0.016427420 0.0082137102 [29,] 0.9910055 0.017989093 0.0089945464 [30,] 0.9880721 0.023855700 0.0119278502 [31,] 0.9942041 0.011591844 0.0057959222 [32,] 0.9932225 0.013554926 0.0067774632 [33,] 0.9892091 0.021581783 0.0107908917 [34,] 0.9882066 0.023586770 0.0117933848 [35,] 0.9837012 0.032597569 0.0162987847 [36,] 0.9994563 0.001087476 0.0005437378 [37,] 0.9985244 0.002951166 0.0014755832 [38,] 0.9956804 0.008639213 0.0043196065 [39,] 0.9921418 0.015716358 0.0078581791 [40,] 0.9989423 0.002115388 0.0010576938 [41,] 0.9946801 0.010639772 0.0053198859 [42,] 0.9805736 0.038852728 0.0194263638 > postscript(file="/var/www/html/rcomp/tmp/1hnxl1293488503.ps",horizontal=F,onefile=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/2hnxl1293488503.ps",horizontal=F,onefile=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/3hnxl1293488503.ps",horizontal=F,onefile=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/4see61293488503.ps",horizontal=F,onefile=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/5see61293488503.ps",horizontal=F,onefile=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 = 59 Frequency = 1 1 2 3 4 5 13247.461898 15359.007042 9452.403901 9597.387954 8465.801471 6 7 8 9 10 8737.612204 10983.354984 13367.353475 -3222.762385 -8471.003533 11 12 13 14 15 -10836.024034 -9014.751338 -11302.705959 -11499.698265 -11192.670770 16 17 18 19 20 -10489.958750 -9451.378274 1702.898479 4092.024822 14448.012729 21 22 23 24 25 -9.965882 -3677.439244 -5926.989761 -3671.269245 -4197.024775 26 27 28 29 30 -922.050998 5888.859257 3948.844185 3023.107049 863.569686 31 32 33 34 35 2927.111226 12227.335873 -4570.498154 -5529.899152 -6381.800934 36 37 38 39 40 -6143.533796 -8996.331604 -4945.029297 -6044.834218 -3287.437800 41 42 43 44 45 975.668415 -487.037701 -797.189221 2614.368100 -13769.213799 46 47 48 49 50 -7424.222355 -5405.962680 -1550.000166 -5742.457140 -3970.425001 51 52 53 54 55 -4863.539770 1124.050034 6105.203005 5979.139763 2654.235451 56 57 58 59 9941.640608 2215.896959 9475.045222 14377.712208 > postscript(file="/var/www/html/rcomp/tmp/6see61293488503.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > dum <- cbind(lag(myerror,k=1),myerror) > dum Time Series: Start = 0 End = 59 Frequency = 1 lag(myerror, k = 1) myerror 0 13247.461898 NA 1 15359.007042 13247.461898 2 9452.403901 15359.007042 3 9597.387954 9452.403901 4 8465.801471 9597.387954 5 8737.612204 8465.801471 6 10983.354984 8737.612204 7 13367.353475 10983.354984 8 -3222.762385 13367.353475 9 -8471.003533 -3222.762385 10 -10836.024034 -8471.003533 11 -9014.751338 -10836.024034 12 -11302.705959 -9014.751338 13 -11499.698265 -11302.705959 14 -11192.670770 -11499.698265 15 -10489.958750 -11192.670770 16 -9451.378274 -10489.958750 17 1702.898479 -9451.378274 18 4092.024822 1702.898479 19 14448.012729 4092.024822 20 -9.965882 14448.012729 21 -3677.439244 -9.965882 22 -5926.989761 -3677.439244 23 -3671.269245 -5926.989761 24 -4197.024775 -3671.269245 25 -922.050998 -4197.024775 26 5888.859257 -922.050998 27 3948.844185 5888.859257 28 3023.107049 3948.844185 29 863.569686 3023.107049 30 2927.111226 863.569686 31 12227.335873 2927.111226 32 -4570.498154 12227.335873 33 -5529.899152 -4570.498154 34 -6381.800934 -5529.899152 35 -6143.533796 -6381.800934 36 -8996.331604 -6143.533796 37 -4945.029297 -8996.331604 38 -6044.834218 -4945.029297 39 -3287.437800 -6044.834218 40 975.668415 -3287.437800 41 -487.037701 975.668415 42 -797.189221 -487.037701 43 2614.368100 -797.189221 44 -13769.213799 2614.368100 45 -7424.222355 -13769.213799 46 -5405.962680 -7424.222355 47 -1550.000166 -5405.962680 48 -5742.457140 -1550.000166 49 -3970.425001 -5742.457140 50 -4863.539770 -3970.425001 51 1124.050034 -4863.539770 52 6105.203005 1124.050034 53 5979.139763 6105.203005 54 2654.235451 5979.139763 55 9941.640608 2654.235451 56 2215.896959 9941.640608 57 9475.045222 2215.896959 58 14377.712208 9475.045222 59 NA 14377.712208 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 15359.007042 13247.461898 [2,] 9452.403901 15359.007042 [3,] 9597.387954 9452.403901 [4,] 8465.801471 9597.387954 [5,] 8737.612204 8465.801471 [6,] 10983.354984 8737.612204 [7,] 13367.353475 10983.354984 [8,] -3222.762385 13367.353475 [9,] -8471.003533 -3222.762385 [10,] -10836.024034 -8471.003533 [11,] -9014.751338 -10836.024034 [12,] -11302.705959 -9014.751338 [13,] -11499.698265 -11302.705959 [14,] -11192.670770 -11499.698265 [15,] -10489.958750 -11192.670770 [16,] -9451.378274 -10489.958750 [17,] 1702.898479 -9451.378274 [18,] 4092.024822 1702.898479 [19,] 14448.012729 4092.024822 [20,] -9.965882 14448.012729 [21,] -3677.439244 -9.965882 [22,] -5926.989761 -3677.439244 [23,] -3671.269245 -5926.989761 [24,] -4197.024775 -3671.269245 [25,] -922.050998 -4197.024775 [26,] 5888.859257 -922.050998 [27,] 3948.844185 5888.859257 [28,] 3023.107049 3948.844185 [29,] 863.569686 3023.107049 [30,] 2927.111226 863.569686 [31,] 12227.335873 2927.111226 [32,] -4570.498154 12227.335873 [33,] -5529.899152 -4570.498154 [34,] -6381.800934 -5529.899152 [35,] -6143.533796 -6381.800934 [36,] -8996.331604 -6143.533796 [37,] -4945.029297 -8996.331604 [38,] -6044.834218 -4945.029297 [39,] -3287.437800 -6044.834218 [40,] 975.668415 -3287.437800 [41,] -487.037701 975.668415 [42,] -797.189221 -487.037701 [43,] 2614.368100 -797.189221 [44,] -13769.213799 2614.368100 [45,] -7424.222355 -13769.213799 [46,] -5405.962680 -7424.222355 [47,] -1550.000166 -5405.962680 [48,] -5742.457140 -1550.000166 [49,] -3970.425001 -5742.457140 [50,] -4863.539770 -3970.425001 [51,] 1124.050034 -4863.539770 [52,] 6105.203005 1124.050034 [53,] 5979.139763 6105.203005 [54,] 2654.235451 5979.139763 [55,] 9941.640608 2654.235451 [56,] 2215.896959 9941.640608 [57,] 9475.045222 2215.896959 [58,] 14377.712208 9475.045222 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 15359.007042 13247.461898 2 9452.403901 15359.007042 3 9597.387954 9452.403901 4 8465.801471 9597.387954 5 8737.612204 8465.801471 6 10983.354984 8737.612204 7 13367.353475 10983.354984 8 -3222.762385 13367.353475 9 -8471.003533 -3222.762385 10 -10836.024034 -8471.003533 11 -9014.751338 -10836.024034 12 -11302.705959 -9014.751338 13 -11499.698265 -11302.705959 14 -11192.670770 -11499.698265 15 -10489.958750 -11192.670770 16 -9451.378274 -10489.958750 17 1702.898479 -9451.378274 18 4092.024822 1702.898479 19 14448.012729 4092.024822 20 -9.965882 14448.012729 21 -3677.439244 -9.965882 22 -5926.989761 -3677.439244 23 -3671.269245 -5926.989761 24 -4197.024775 -3671.269245 25 -922.050998 -4197.024775 26 5888.859257 -922.050998 27 3948.844185 5888.859257 28 3023.107049 3948.844185 29 863.569686 3023.107049 30 2927.111226 863.569686 31 12227.335873 2927.111226 32 -4570.498154 12227.335873 33 -5529.899152 -4570.498154 34 -6381.800934 -5529.899152 35 -6143.533796 -6381.800934 36 -8996.331604 -6143.533796 37 -4945.029297 -8996.331604 38 -6044.834218 -4945.029297 39 -3287.437800 -6044.834218 40 975.668415 -3287.437800 41 -487.037701 975.668415 42 -797.189221 -487.037701 43 2614.368100 -797.189221 44 -13769.213799 2614.368100 45 -7424.222355 -13769.213799 46 -5405.962680 -7424.222355 47 -1550.000166 -5405.962680 48 -5742.457140 -1550.000166 49 -3970.425001 -5742.457140 50 -4863.539770 -3970.425001 51 1124.050034 -4863.539770 52 6105.203005 1124.050034 53 5979.139763 6105.203005 54 2654.235451 5979.139763 55 9941.640608 2654.235451 56 2215.896959 9941.640608 57 9475.045222 2215.896959 58 14377.712208 9475.045222 > 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/735e81293488503.ps",horizontal=F,onefile=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/8dxvb1293488503.ps",horizontal=F,onefile=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/9dxvb1293488503.ps",horizontal=F,onefile=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/10dxvb1293488503.ps",horizontal=F,onefile=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='') + } + } Error: subscript out of bounds Execution halted