R version 2.15.1 (2012-06-22) -- "Roasted Marshmallows" Copyright (C) 2012 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i686-pc-linux-gnu (32-bit) 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(14 + ,501 + ,11 + ,20 + ,91.81 + ,77585 + ,1303.2 + ,13 + ,14 + ,485 + ,11 + ,19 + ,91.98 + ,77585 + ,-58.7 + ,15 + ,15 + ,464 + ,11 + ,18 + ,91.72 + ,77585 + ,-378.9 + ,3 + ,13 + ,460 + ,11 + ,13 + ,90.27 + ,78302 + ,175.6 + ,2 + ,8 + ,467 + ,11 + ,17 + ,91.89 + ,78302 + ,233.7 + ,-2 + ,7 + ,460 + ,9 + ,17 + ,92.07 + ,78302 + ,706.8 + ,1 + ,3 + ,448 + ,8 + ,13 + ,92.92 + ,78224 + ,-23.6 + ,1 + ,3 + ,443 + ,6 + ,14 + ,93.34 + ,78224 + ,420.9 + ,-1 + ,4 + ,436 + ,7 + ,13 + ,93.6 + ,78224 + ,722.1 + ,-6 + ,4 + ,431 + ,8 + ,17 + ,92.41 + ,78178 + ,1401.3 + ,-13 + ,0 + ,484 + ,6 + ,17 + ,93.6 + ,78178 + ,-94.9 + ,-25 + ,-4 + ,510 + ,5 + ,15 + ,93.77 + ,78178 + ,1043.6 + ,-26 + ,-14 + ,513 + ,2 + ,9 + ,93.6 + ,77988 + ,1300.1 + ,-9 + ,-18 + ,503 + ,3 + ,10 + ,93.6 + ,77988 + ,721.1 + ,1 + ,-8 + ,471 + ,3 + ,9 + ,93.51 + ,77988 + ,-45.6 + ,3 + ,-1 + ,471 + ,7 + ,14 + ,92.66 + ,77876 + ,787.5 + ,6 + ,1 + ,476 + ,8 + ,18 + ,94.2 + ,77876 + ,694.3 + ,2 + ,2 + ,475 + ,7 + ,18 + ,94.37 + ,77876 + ,1054.7 + ,5 + ,0 + ,470 + ,7 + ,12 + ,94.45 + ,78432 + ,821.9 + ,5 + ,1 + ,461 + ,6 + ,16 + ,94.62 + ,78432 + ,1100.7 + ,0 + ,0 + ,455 + ,6 + ,12 + ,94.37 + ,78432 + ,862.4 + ,-5 + ,-1 + ,456 + ,7 + ,19 + ,93.43 + ,79025 + ,1656.1 + ,-4 + ,-3 + ,517 + ,5 + ,13 + ,94.79 + ,79025 + ,-174 + ,-2 + ,-3 + ,525 + ,5 + ,12 + ,94.88 + ,79025 + ,1337.6 + ,-1 + ,-3 + ,523 + ,5 + ,13 + ,94.79 + ,79407 + ,1394.9 + ,-8 + ,-4 + ,519 + ,4 + ,11 + ,94.62 + ,79407 + ,915.7 + ,-16 + ,-8 + ,509 + ,4 + ,10 + ,94.71 + ,79407 + ,-481.1 + ,-19 + ,-9 + ,512 + ,4 + ,16 + ,93.77 + ,79644 + ,167.9 + ,-28 + ,-13 + ,519 + ,1 + ,12 + ,95.73 + ,79644 + ,208.2 + ,-11 + ,-18 + ,517 + ,-1 + ,6 + ,95.99 + ,79644 + ,382.2 + ,-4 + ,-11 + ,510 + ,3 + ,8 + ,95.82 + ,79381 + ,1004 + ,-9 + ,-9 + ,509 + ,4 + ,6 + ,95.47 + ,79381 + ,864.7 + ,-12 + ,-10 + ,501 + ,3 + ,8 + ,95.82 + ,79381 + ,1052.9 + ,-10 + ,-13 + ,507 + ,2 + ,8 + ,94.71 + ,79536 + ,1417.6 + ,-2 + ,-11 + ,569 + ,1 + ,9 + ,96.33 + ,79536 + ,-197.7 + ,-13 + ,-5 + ,580 + ,4 + ,13 + ,96.5 + ,79536 + ,1262.1 + ,0 + ,-15 + ,578 + ,3 + ,8 + ,96.16 + ,79813 + ,1147.2 + ,0 + ,-6 + ,565 + ,5 + ,11 + ,96.33 + ,79813 + ,700.2 + ,4 + ,-6 + ,547 + ,6 + ,8 + ,96.33 + ,79813 + ,45.3 + ,7 + ,-3 + ,555 + ,6 + ,10 + ,95.05 + ,80332 + ,458.5 + ,5 + ,-1 + ,562 + ,6 + ,15 + ,96.84 + ,80332 + ,610.2 + ,2 + ,-3 + ,561 + ,6 + ,12 + ,96.92 + ,80332 + ,786.4 + ,-2 + ,-4 + ,555 + ,6 + ,13 + ,97.44 + ,81434 + ,787.2 + ,6 + ,-6 + ,544 + ,5 + ,12 + ,97.78 + ,81434 + ,1040 + ,-3 + ,0 + ,537 + ,6 + ,15 + ,97.69 + ,81434 + ,324.1 + ,1 + ,-4 + ,543 + ,5 + ,13 + ,96.67 + ,82167 + ,1343 + ,0 + ,-2 + ,594 + ,6 + ,13 + ,98.29 + ,82167 + ,-501.2 + ,-7 + ,-2 + ,611 + ,5 + ,16 + ,98.2 + ,82167 + ,800.4 + ,-6 + ,-6 + ,613 + ,7 + ,14 + ,98.71 + ,82816 + ,916.7 + ,-4 + ,-7 + ,611 + ,4 + ,12 + ,98.54 + ,82816 + ,695.8 + ,-4 + ,-6 + ,594 + ,5 + ,15 + ,98.2 + ,82816 + ,28 + ,-2 + ,-6 + ,595 + ,6 + ,14 + ,96.92 + ,83000 + ,495.6 + ,2 + ,-3 + ,591 + ,6 + ,19 + ,99.06 + ,83000 + ,366.2 + ,-5 + ,-2 + ,589 + ,5 + ,16 + ,99.65 + ,83000 + ,633 + ,-15 + ,-5 + ,584 + ,3 + ,16 + ,99.82 + ,83251 + ,848.3 + ,-16 + ,-11 + ,573 + ,2 + ,11 + ,99.99 + ,83251 + ,472.2 + ,-18 + ,-11 + ,567 + ,3 + ,13 + ,100.33 + ,83251 + ,357.8 + ,-13 + ,-11 + ,569 + ,3 + ,12 + ,99.31 + ,83591 + ,824.3 + ,-23 + ,-10 + ,621 + ,2 + ,11 + ,101.1 + ,83591 + ,-880.1 + ,-10 + ,-14 + ,629 + ,0 + ,6 + ,101.1 + ,83591 + ,1066.8 + ,-10 + ,-8 + ,628 + ,4 + ,9 + ,100.93 + ,83910 + ,1052.8 + ,-6 + ,-9 + ,612 + ,4 + ,6 + ,100.85 + ,83910 + ,-32.1 + ,-3 + ,-5 + ,595 + ,5 + ,15 + ,100.93 + ,83910 + ,-1331.4 + ,-4 + ,-1 + ,597 + ,6 + ,17 + ,99.6 + ,84599 + ,-767.1 + ,-7 + ,-2 + ,593 + ,6 + ,13 + ,101.88 + ,84599 + ,-236.7 + ,-7 + ,-5 + ,590 + ,5 + ,12 + ,101.81 + ,84599 + ,-184.9 + ,-7 + ,-4 + ,580 + ,5 + ,13 + ,102.38 + ,85275 + ,-143.4 + ,-3 + ,-6 + ,574 + ,3 + ,10 + ,102.74 + ,85275 + ,493.9 + ,0 + ,-2 + ,573 + ,5 + ,14 + ,102.82 + ,85275 + ,549.7 + ,-5 + ,-2 + ,573 + ,5 + ,13 + ,101.72 + ,85608 + ,982.7 + ,-3 + ,-2 + ,620 + ,5 + ,10 + ,103.47 + ,85608 + ,-856.3 + ,3 + ,-2 + ,626 + ,3 + ,11 + ,102.98 + ,85608 + ,967 + ,2 + ,2 + ,620 + ,6 + ,12 + ,102.68 + ,86303 + ,659.4 + ,-7 + ,1 + ,588 + ,6 + ,7 + ,102.9 + ,86303 + ,577.2 + ,-1 + ,-8 + ,566 + ,4 + ,11 + ,103.03 + ,86303 + ,-213.1 + ,0 + ,-1 + ,557 + ,6 + ,9 + ,101.29 + ,87115 + ,17.7 + ,-3 + ,1 + ,561 + ,5 + ,13 + ,103.69 + ,87115 + ,390.1 + ,4 + ,-1 + ,549 + ,4 + ,12 + ,103.68 + ,87115 + ,509.3 + ,2 + ,2 + ,532 + ,5 + ,5 + ,104.2 + ,87931 + ,410 + ,3 + ,2 + ,526 + ,5 + ,13 + ,104.08 + ,87931 + ,212.5 + ,0 + ,1 + ,511 + ,4 + ,11 + ,104.16 + ,87931 + ,818 + ,-10 + ,-1 + ,499 + ,3 + ,8 + ,103.05 + ,88164 + ,422.7 + ,-10 + ,-2 + ,555 + ,2 + ,8 + ,104.66 + ,88164 + ,-158 + ,-9 + ,-2 + ,565 + ,3 + ,8 + ,104.46 + ,88164 + ,427.2 + ,-22 + ,-1 + ,542 + ,2 + ,8 + ,104.95 + ,88792 + ,243.4 + ,-16 + ,-8 + ,527 + ,-1 + ,0 + ,105.85 + ,88792 + ,-419.3 + ,-18 + ,-4 + ,510 + ,0 + ,3 + ,106.23 + ,88792 + ,-1459.8 + ,-14 + ,-6 + ,514 + ,-2 + ,0 + ,104.86 + ,89263 + ,-1389.8 + ,-12 + ,-3 + ,517 + ,1 + ,-1 + ,107.44 + ,89263 + ,-2.1 + ,-17 + ,-3 + ,508 + ,-2 + ,-1 + ,108.23 + ,89263 + ,-938.6 + ,-23 + ,-7 + ,493 + ,-2 + ,-4 + ,108.45 + ,89881 + ,-839.9 + ,-28 + ,-9 + ,490 + ,-2 + ,1 + ,109.39 + ,89881 + ,-297.6 + ,-31 + ,-11 + ,469 + ,-6 + ,-1 + ,110.15 + ,89881 + ,-376.3 + ,-21 + ,-13 + ,478 + ,-4 + ,0 + ,109.13 + ,90120 + ,-79.4 + ,-19 + ,-11 + ,528 + ,-2 + ,-1 + ,110.28 + ,90120 + ,-2091.3 + ,-22 + ,-9 + ,534 + ,0 + ,6 + ,110.17 + ,90120 + ,-1023 + ,-22 + ,-17 + ,518 + ,-5 + ,0 + ,109.99 + ,89703 + ,-765.6 + ,-25 + ,-22 + ,506 + ,-4 + ,-3 + ,109.26 + ,89703 + ,-1592.3 + ,-16 + ,-25 + ,502 + ,-5 + ,-3 + ,109.11 + ,89703 + ,-1588.8 + ,-22 + ,-20 + ,516 + ,-1 + ,4 + ,107.06 + ,87818 + ,-1318 + ,-21 + ,-24 + ,528 + ,-2 + ,1 + ,109.53 + ,87818 + ,-402.4 + ,-10 + ,-24 + ,533 + ,-4 + ,0 + ,108.92 + ,87818 + ,-814.5 + ,-7 + ,-22 + ,536 + ,-1 + ,-4 + ,109.24 + ,86273 + ,-98.4 + ,-5 + ,-19 + ,537 + ,1 + ,-2 + ,109.12 + ,86273 + ,-305.9 + ,-4 + ,-18 + ,524 + ,1 + ,3 + ,109 + ,86273 + ,-18.4 + ,7 + ,-17 + ,536 + ,-2 + ,2 + ,107.23 + ,86316 + ,610.3 + ,6 + ,-11 + ,587 + ,1 + ,5 + ,109.49 + ,86316 + ,-917.3 + ,3 + ,-11 + ,597 + ,1 + ,6 + ,109.04 + ,86316 + ,88.4 + ,10 + ,-12 + ,581 + ,3 + ,6 + ,109.02 + ,87234 + ,-740.2 + ,0 + ,-10 + ,564 + ,3 + ,3 + ,109.23 + ,87234 + ,29.3 + ,-2 + ,-15 + ,558 + ,1 + ,4 + ,109.46 + ,87234 + ,-893.2 + ,-1 + ,-15 + ,575 + ,1 + ,7 + ,107.9 + ,87885 + ,-1030.2 + ,2 + ,-15 + ,580 + ,0 + ,5 + ,110.42 + ,87885 + ,-403.4 + ,8 + ,-13 + ,575 + ,2 + ,6 + ,110.98 + ,87885 + ,-46.9 + ,-6 + ,-8 + ,563 + ,2 + ,1 + ,111.48 + ,88003 + ,-321.2 + ,-4 + ,-13 + ,552 + ,-1 + ,3 + ,111.88 + ,88003 + ,-239.9 + ,4 + ,-9 + ,537 + ,1 + ,6 + ,111.89 + ,88003 + ,640.9 + ,7 + ,-7 + ,545 + ,0 + ,0 + ,109.85 + ,88910 + ,511.6 + ,3 + ,-4 + ,601 + ,1 + ,3 + ,112.1 + ,88910 + ,-665.1 + ,3 + ,-4 + ,604 + ,1 + ,4 + ,112.24 + ,88910 + ,657.7 + ,8 + ,-2 + ,586 + ,3 + ,7 + ,112.39 + ,89397 + ,-207.7 + ,3 + ,0 + ,564 + ,2 + ,6 + ,112.52 + ,89397 + ,-885.2 + ,-3 + ,-2 + ,549 + ,0 + ,6 + ,113.16 + ,89397 + ,-1595.8 + ,4 + ,-3 + ,551 + ,0 + ,6 + ,111.84 + ,89813 + ,-1374.9 + ,-5 + ,1 + ,556 + ,3 + ,6 + ,114.33 + ,89813 + ,-316.6 + ,-1 + ,-2 + ,548 + ,-2 + ,2 + ,114.82 + ,89813 + ,-283.4 + ,5 + ,-1 + ,540 + ,0 + ,2 + ,115.2 + ,90539 + ,-175.8 + ,0 + ,1 + ,531 + ,1 + ,2 + ,115.4 + ,90539 + ,-694.2 + ,-6 + ,-3 + ,521 + ,-1 + ,3 + ,115.74 + ,90539 + ,-249.9 + ,-13 + ,-4 + ,519 + ,-2 + ,-1 + ,114.19 + ,90688 + ,268.2 + ,-15 + ,-9 + ,572 + ,-1 + ,-4 + ,115.94 + ,90688 + ,-2105.1 + ,-8 + ,-9 + ,581 + ,-1 + ,4 + ,116.03 + ,90688 + ,-762.8 + ,-20 + ,-7 + ,563 + ,1 + ,5 + ,116.24 + ,90691 + ,-117.1 + ,-10 + ,-14 + ,548 + ,-2 + ,3 + ,116.66 + ,90691 + ,-1094.4 + ,-22 + ,-12 + ,539 + ,-5 + ,-1 + ,116.79 + ,90691 + ,-2095.2 + ,-25 + ,-16 + ,541 + ,-5 + ,-4 + ,115.48 + ,90645 + ,-1587.6 + ,-10 + ,-20 + ,562 + ,-6 + ,0 + ,118.16 + ,90645 + ,-528 + ,-8 + ,-12 + ,559 + ,-4 + ,-1 + ,118.38 + ,90645 + ,-324.2 + ,-9 + ,-12 + ,546 + ,-3 + ,-1 + ,118.51 + ,90861 + ,-276.1 + ,-5 + ,-10 + ,536 + ,-3 + ,3 + ,118.42 + ,90861 + ,-139.1 + ,-7 + ,-10 + ,528 + ,-1 + ,2 + ,118.24 + ,90861 + ,268 + ,-11 + ,-13 + ,530 + ,-2 + ,-4 + ,116.47 + ,90401 + ,570.5 + ,-11 + ,-16 + ,582 + ,-3 + ,-3 + ,118.96 + ,90401 + ,-316.5 + ,-16) + ,dim=c(8 + ,143) + ,dimnames=list(c('i' + ,'w' + ,'f' + ,'s' + ,'c' + ,'b' + ,'h' + ,'a') + ,1:143)) > y <- array(NA,dim=c(8,143),dimnames=list(c('i','w','f','s','c','b','h','a'),1:143)) > 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' > 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, 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 i w f s c b h a 1 14 501 11 20 91.81 77585 1303.2 13 2 14 485 11 19 91.98 77585 -58.7 15 3 15 464 11 18 91.72 77585 -378.9 3 4 13 460 11 13 90.27 78302 175.6 2 5 8 467 11 17 91.89 78302 233.7 -2 6 7 460 9 17 92.07 78302 706.8 1 7 3 448 8 13 92.92 78224 -23.6 1 8 3 443 6 14 93.34 78224 420.9 -1 9 4 436 7 13 93.60 78224 722.1 -6 10 4 431 8 17 92.41 78178 1401.3 -13 11 0 484 6 17 93.60 78178 -94.9 -25 12 -4 510 5 15 93.77 78178 1043.6 -26 13 -14 513 2 9 93.60 77988 1300.1 -9 14 -18 503 3 10 93.60 77988 721.1 1 15 -8 471 3 9 93.51 77988 -45.6 3 16 -1 471 7 14 92.66 77876 787.5 6 17 1 476 8 18 94.20 77876 694.3 2 18 2 475 7 18 94.37 77876 1054.7 5 19 0 470 7 12 94.45 78432 821.9 5 20 1 461 6 16 94.62 78432 1100.7 0 21 0 455 6 12 94.37 78432 862.4 -5 22 -1 456 7 19 93.43 79025 1656.1 -4 23 -3 517 5 13 94.79 79025 -174.0 -2 24 -3 525 5 12 94.88 79025 1337.6 -1 25 -3 523 5 13 94.79 79407 1394.9 -8 26 -4 519 4 11 94.62 79407 915.7 -16 27 -8 509 4 10 94.71 79407 -481.1 -19 28 -9 512 4 16 93.77 79644 167.9 -28 29 -13 519 1 12 95.73 79644 208.2 -11 30 -18 517 -1 6 95.99 79644 382.2 -4 31 -11 510 3 8 95.82 79381 1004.0 -9 32 -9 509 4 6 95.47 79381 864.7 -12 33 -10 501 3 8 95.82 79381 1052.9 -10 34 -13 507 2 8 94.71 79536 1417.6 -2 35 -11 569 1 9 96.33 79536 -197.7 -13 36 -5 580 4 13 96.50 79536 1262.1 0 37 -15 578 3 8 96.16 79813 1147.2 0 38 -6 565 5 11 96.33 79813 700.2 4 39 -6 547 6 8 96.33 79813 45.3 7 40 -3 555 6 10 95.05 80332 458.5 5 41 -1 562 6 15 96.84 80332 610.2 2 42 -3 561 6 12 96.92 80332 786.4 -2 43 -4 555 6 13 97.44 81434 787.2 6 44 -6 544 5 12 97.78 81434 1040.0 -3 45 0 537 6 15 97.69 81434 324.1 1 46 -4 543 5 13 96.67 82167 1343.0 0 47 -2 594 6 13 98.29 82167 -501.2 -7 48 -2 611 5 16 98.20 82167 800.4 -6 49 -6 613 7 14 98.71 82816 916.7 -4 50 -7 611 4 12 98.54 82816 695.8 -4 51 -6 594 5 15 98.20 82816 28.0 -2 52 -6 595 6 14 96.92 83000 495.6 2 53 -3 591 6 19 99.06 83000 366.2 -5 54 -2 589 5 16 99.65 83000 633.0 -15 55 -5 584 3 16 99.82 83251 848.3 -16 56 -11 573 2 11 99.99 83251 472.2 -18 57 -11 567 3 13 100.33 83251 357.8 -13 58 -11 569 3 12 99.31 83591 824.3 -23 59 -10 621 2 11 101.10 83591 -880.1 -10 60 -14 629 0 6 101.10 83591 1066.8 -10 61 -8 628 4 9 100.93 83910 1052.8 -6 62 -9 612 4 6 100.85 83910 -32.1 -3 63 -5 595 5 15 100.93 83910 -1331.4 -4 64 -1 597 6 17 99.60 84599 -767.1 -7 65 -2 593 6 13 101.88 84599 -236.7 -7 66 -5 590 5 12 101.81 84599 -184.9 -7 67 -4 580 5 13 102.38 85275 -143.4 -3 68 -6 574 3 10 102.74 85275 493.9 0 69 -2 573 5 14 102.82 85275 549.7 -5 70 -2 573 5 13 101.72 85608 982.7 -3 71 -2 620 5 10 103.47 85608 -856.3 3 72 -2 626 3 11 102.98 85608 967.0 2 73 2 620 6 12 102.68 86303 659.4 -7 74 1 588 6 7 102.90 86303 577.2 -1 75 -8 566 4 11 103.03 86303 -213.1 0 76 -1 557 6 9 101.29 87115 17.7 -3 77 1 561 5 13 103.69 87115 390.1 4 78 -1 549 4 12 103.68 87115 509.3 2 79 2 532 5 5 104.20 87931 410.0 3 80 2 526 5 13 104.08 87931 212.5 0 81 1 511 4 11 104.16 87931 818.0 -10 82 -1 499 3 8 103.05 88164 422.7 -10 83 -2 555 2 8 104.66 88164 -158.0 -9 84 -2 565 3 8 104.46 88164 427.2 -22 85 -1 542 2 8 104.95 88792 243.4 -16 86 -8 527 -1 0 105.85 88792 -419.3 -18 87 -4 510 0 3 106.23 88792 -1459.8 -14 88 -6 514 -2 0 104.86 89263 -1389.8 -12 89 -3 517 1 -1 107.44 89263 -2.1 -17 90 -3 508 -2 -1 108.23 89263 -938.6 -23 91 -7 493 -2 -4 108.45 89881 -839.9 -28 92 -9 490 -2 1 109.39 89881 -297.6 -31 93 -11 469 -6 -1 110.15 89881 -376.3 -21 94 -13 478 -4 0 109.13 90120 -79.4 -19 95 -11 528 -2 -1 110.28 90120 -2091.3 -22 96 -9 534 0 6 110.17 90120 -1023.0 -22 97 -17 518 -5 0 109.99 89703 -765.6 -25 98 -22 506 -4 -3 109.26 89703 -1592.3 -16 99 -25 502 -5 -3 109.11 89703 -1588.8 -22 100 -20 516 -1 4 107.06 87818 -1318.0 -21 101 -24 528 -2 1 109.53 87818 -402.4 -10 102 -24 533 -4 0 108.92 87818 -814.5 -7 103 -22 536 -1 -4 109.24 86273 -98.4 -5 104 -19 537 1 -2 109.12 86273 -305.9 -4 105 -18 524 1 3 109.00 86273 -18.4 7 106 -17 536 -2 2 107.23 86316 610.3 6 107 -11 587 1 5 109.49 86316 -917.3 3 108 -11 597 1 6 109.04 86316 88.4 10 109 -12 581 3 6 109.02 87234 -740.2 0 110 -10 564 3 3 109.23 87234 29.3 -2 111 -15 558 1 4 109.46 87234 -893.2 -1 112 -15 575 1 7 107.90 87885 -1030.2 2 113 -15 580 0 5 110.42 87885 -403.4 8 114 -13 575 2 6 110.98 87885 -46.9 -6 115 -8 563 2 1 111.48 88003 -321.2 -4 116 -13 552 -1 3 111.88 88003 -239.9 4 117 -9 537 1 6 111.89 88003 640.9 7 118 -7 545 0 0 109.85 88910 511.6 3 119 -4 601 1 3 112.10 88910 -665.1 3 120 -4 604 1 4 112.24 88910 657.7 8 121 -2 586 3 7 112.39 89397 -207.7 3 122 0 564 2 6 112.52 89397 -885.2 -3 123 -2 549 0 6 113.16 89397 -1595.8 4 124 -3 551 0 6 111.84 89813 -1374.9 -5 125 1 556 3 6 114.33 89813 -316.6 -1 126 -2 548 -2 2 114.82 89813 -283.4 5 127 -1 540 0 2 115.20 90539 -175.8 0 128 1 531 1 2 115.40 90539 -694.2 -6 129 -3 521 -1 3 115.74 90539 -249.9 -13 130 -4 519 -2 -1 114.19 90688 268.2 -15 131 -9 572 -1 -4 115.94 90688 -2105.1 -8 132 -9 581 -1 4 116.03 90688 -762.8 -20 133 -7 563 1 5 116.24 90691 -117.1 -10 134 -14 548 -2 3 116.66 90691 -1094.4 -22 135 -12 539 -5 -1 116.79 90691 -2095.2 -25 136 -16 541 -5 -4 115.48 90645 -1587.6 -10 137 -20 562 -6 0 118.16 90645 -528.0 -8 138 -12 559 -4 -1 118.38 90645 -324.2 -9 139 -12 546 -3 -1 118.51 90861 -276.1 -5 140 -10 536 -3 3 118.42 90861 -139.1 -7 141 -10 528 -1 2 118.24 90861 268.0 -11 142 -13 530 -2 -4 116.47 90401 570.5 -11 143 -16 582 -3 -3 118.96 90401 -316.5 -16 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) w f s c b -8.411e+01 -5.391e-02 2.061e+00 3.182e-01 8.315e-02 1.068e-03 h a 8.043e-05 -5.053e-03 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -10.5150 -1.8303 0.1509 2.3993 9.7411 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) -8.411e+01 1.089e+01 -7.722 2.30e-12 *** w -5.391e-02 8.285e-03 -6.507 1.38e-09 *** f 2.061e+00 2.157e-01 9.555 < 2e-16 *** s 3.182e-01 1.250e-01 2.545 0.012 * c 8.315e-02 1.518e-01 0.548 0.585 b 1.068e-03 2.448e-04 4.362 2.54e-05 *** h 8.043e-05 5.138e-04 0.157 0.876 a -5.053e-03 4.406e-02 -0.115 0.909 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 3.857 on 135 degrees of freedom Multiple R-squared: 0.7483, Adjusted R-squared: 0.7353 F-statistic: 57.34 on 7 and 135 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.1128309880 0.225661976 0.8871690 [2,] 0.0598477512 0.119695502 0.9401522 [3,] 0.1889222114 0.377844423 0.8110778 [4,] 0.5187608043 0.962478391 0.4812392 [5,] 0.4433671681 0.886734336 0.5566328 [6,] 0.3795404399 0.759080880 0.6204596 [7,] 0.3204893335 0.640978667 0.6795107 [8,] 0.2541986535 0.508397307 0.7458013 [9,] 0.2190393037 0.438078607 0.7809607 [10,] 0.1993412710 0.398682542 0.8006587 [11,] 0.1603114252 0.320622850 0.8396886 [12,] 0.1188977105 0.237795421 0.8811023 [13,] 0.1234209925 0.246841985 0.8765790 [14,] 0.1246956566 0.249391313 0.8753043 [15,] 0.0994164249 0.198832850 0.9005836 [16,] 0.0888199985 0.177639997 0.9111800 [17,] 0.0769746143 0.153949229 0.9230254 [18,] 0.0603786145 0.120757229 0.9396214 [19,] 0.0481914791 0.096382958 0.9518085 [20,] 0.0386943553 0.077388711 0.9613056 [21,] 0.0294376615 0.058875323 0.9705623 [22,] 0.0220409020 0.044081804 0.9779591 [23,] 0.0146136295 0.029227259 0.9853864 [24,] 0.0093308279 0.018661656 0.9906692 [25,] 0.0111916962 0.022383392 0.9888083 [26,] 0.0090065684 0.018013137 0.9909934 [27,] 0.0140143025 0.028028605 0.9859857 [28,] 0.0113990176 0.022798035 0.9886010 [29,] 0.0134552253 0.026910451 0.9865448 [30,] 0.0106791952 0.021358390 0.9893208 [31,] 0.0092247100 0.018449420 0.9907753 [32,] 0.0080406132 0.016081226 0.9919594 [33,] 0.0064453399 0.012890680 0.9935547 [34,] 0.0046863194 0.009372639 0.9953137 [35,] 0.0053840204 0.010768041 0.9946160 [36,] 0.0042633301 0.008526660 0.9957367 [37,] 0.0040530018 0.008106004 0.9959470 [38,] 0.0042134603 0.008426921 0.9957865 [39,] 0.0076792887 0.015358577 0.9923207 [40,] 0.0057111793 0.011422359 0.9942888 [41,] 0.0044233557 0.008846711 0.9955766 [42,] 0.0038068742 0.007613748 0.9961931 [43,] 0.0027414347 0.005482869 0.9972586 [44,] 0.0029920471 0.005984094 0.9970080 [45,] 0.0041392466 0.008278493 0.9958608 [46,] 0.0032164096 0.006432819 0.9967836 [47,] 0.0026982097 0.005396419 0.9973018 [48,] 0.0018296163 0.003659233 0.9981704 [49,] 0.0016694761 0.003338952 0.9983305 [50,] 0.0033956775 0.006791355 0.9966043 [51,] 0.0024229134 0.004845827 0.9975771 [52,] 0.0017819106 0.003563821 0.9982181 [53,] 0.0017759946 0.003551989 0.9982240 [54,] 0.0012959477 0.002591895 0.9987041 [55,] 0.0011000307 0.002200061 0.9989000 [56,] 0.0009001624 0.001800325 0.9990998 [57,] 0.0006255360 0.001251072 0.9993745 [58,] 0.0007335361 0.001467072 0.9992665 [59,] 0.0007009831 0.001401966 0.9992990 [60,] 0.0005547449 0.001109490 0.9994453 [61,] 0.0005962930 0.001192586 0.9994037 [62,] 0.0036618263 0.007323653 0.9963382 [63,] 0.0048519002 0.009703800 0.9951481 [64,] 0.0047462792 0.009492558 0.9952537 [65,] 0.0046310952 0.009262190 0.9953689 [66,] 0.0036745646 0.007349129 0.9963254 [67,] 0.0028588175 0.005717635 0.9971412 [68,] 0.0021974534 0.004394907 0.9978025 [69,] 0.0019885372 0.003977074 0.9980115 [70,] 0.0014740816 0.002948163 0.9985259 [71,] 0.0010897124 0.002179425 0.9989103 [72,] 0.0009116591 0.001823318 0.9990883 [73,] 0.0011250534 0.002250107 0.9988749 [74,] 0.0009878048 0.001975610 0.9990122 [75,] 0.0010294777 0.002058955 0.9989705 [76,] 0.0010331312 0.002066262 0.9989669 [77,] 0.0010578020 0.002115604 0.9989422 [78,] 0.0015197341 0.003039468 0.9984803 [79,] 0.0011241765 0.002248353 0.9988758 [80,] 0.0105280347 0.021056069 0.9894720 [81,] 0.0144634162 0.028926832 0.9855366 [82,] 0.0170792358 0.034158472 0.9829208 [83,] 0.0505575610 0.101115122 0.9494424 [84,] 0.0458117652 0.091623530 0.9541882 [85,] 0.0455551768 0.091110354 0.9544448 [86,] 0.0451291936 0.090258387 0.9548708 [87,] 0.0638178103 0.127635621 0.9361822 [88,] 0.1271541407 0.254308281 0.8728459 [89,] 0.2218274807 0.443654961 0.7781725 [90,] 0.3100871837 0.620174367 0.6899128 [91,] 0.4894760411 0.978952082 0.5105240 [92,] 0.5088961930 0.982207614 0.4911038 [93,] 0.4835207634 0.967041527 0.5164792 [94,] 0.4595522058 0.919104412 0.5404478 [95,] 0.5108035466 0.978392907 0.4891965 [96,] 0.4652691399 0.930538280 0.5347309 [97,] 0.5640921260 0.871815748 0.4359079 [98,] 0.6788041133 0.642391773 0.3211959 [99,] 0.6409914733 0.718017053 0.3590085 [100,] 0.5838116982 0.832376604 0.4161883 [101,] 0.5337846586 0.932430683 0.4662153 [102,] 0.7338010920 0.532397816 0.2661989 [103,] 0.8046462222 0.390707556 0.1953538 [104,] 0.8076820613 0.384635877 0.1923179 [105,] 0.7702079091 0.459584182 0.2297921 [106,] 0.7416532323 0.516693535 0.2583468 [107,] 0.7995638122 0.400872376 0.2004362 [108,] 0.8700736134 0.259852773 0.1299264 [109,] 0.8597163937 0.280567213 0.1402836 [110,] 0.8426583326 0.314683335 0.1573417 [111,] 0.8188809176 0.362238165 0.1811191 [112,] 0.7787147612 0.442570478 0.2212852 [113,] 0.7599964385 0.480007123 0.2400036 [114,] 0.7790336958 0.441932608 0.2209663 [115,] 0.7741020290 0.451795942 0.2258980 [116,] 0.7409987183 0.518002563 0.2590013 [117,] 0.6807822112 0.638435578 0.3192178 [118,] 0.6549865630 0.690026874 0.3450134 [119,] 0.8023558906 0.395288219 0.1976441 [120,] 0.8046389566 0.390722087 0.1953610 [121,] 0.6810597403 0.637880519 0.3189403 [122,] 0.7223266536 0.555346693 0.2776733 > postscript(file="/var/wessaorg/rcomp/tmp/1m6uy1351893223.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/wessaorg/rcomp/tmp/2z2th1351893223.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/wessaorg/rcomp/tmp/38bv11351893223.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/wessaorg/rcomp/tmp/4uhbw1351893223.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/wessaorg/rcomp/tmp/5oevf1351893223.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 = 143 Frequency = 1 1 2 3 4 5 6 5.56753904 5.12869523 5.30152111 3.98240501 -2.07276335 0.63416904 7 8 9 10 11 12 -0.60736625 2.84622965 1.65488740 -1.89066119 1.04962520 1.03815522 13 14 15 16 17 18 -0.42511306 -7.24646891 1.42583806 -1.27130916 -2.47657009 0.50264220 19 20 21 22 23 24 -0.43907714 0.80201283 0.76619658 -5.08248344 2.28200851 2.90753613 25 26 27 28 29 30 2.04108789 3.53526835 -0.59590673 -3.61619404 0.13710612 1.06066473 31 32 33 34 35 36 -0.97787899 -0.43124903 -0.47207470 -1.14963093 5.87541174 4.94634680 37 38 39 40 41 42 -1.76743990 1.49682613 -0.51212556 1.79160926 2.40158810 1.26136545 43 44 45 46 47 48 -1.55991231 -1.86769437 0.82438166 -0.93943897 1.72725365 3.65797231 49 50 51 52 53 54 -4.45453730 1.28929287 -1.55093978 -3.34731164 -2.35707125 1.42987322 55 56 57 58 59 60 1.97797576 -0.95675197 -3.97160392 -3.91181491 2.32488502 4.31297664 61 62 63 64 65 66 0.75483574 -0.04396429 -1.79293476 -1.06833200 -1.24325879 -2.02401019 67 68 69 70 71 72 -2.63370888 0.05368631 -1.43177480 -1.40235662 2.11895887 6.13540928 73 74 75 76 77 78 2.57253745 1.45718920 -5.82185797 -3.54883288 -0.73920545 -1.02568230 79 80 81 82 83 84 0.32291264 -2.53578765 -1.75277892 -1.50860995 2.48945043 0.87135895 85 86 87 88 89 90 2.02626434 2.91514333 3.05512475 5.96314901 2.90845157 8.58582948 91 92 93 94 95 96 4.02049395 0.13061192 5.87295961 -0.26640936 0.67630307 -3.42687219 97 98 99 100 101 102 0.34979499 -6.23084910 -7.40353370 -9.95433550 -10.51501993 -5.70601242 103 104 105 106 107 108 -6.87897400 -8.55200351 -9.80163597 -1.60753741 -0.07621852 0.13655850 109 110 111 112 113 114 -6.81064686 -4.86188913 -6.32129837 -6.89874148 -4.16124531 -7.01720326 115 116 117 118 119 120 -1.20834626 -1.25397251 -3.19607692 2.39710815 5.30793326 5.05865570 121 122 123 124 125 126 0.52319801 3.72982717 5.08263075 3.79277965 1.60711740 9.74113576 127 128 129 130 131 132 5.34694300 4.79539304 3.96083240 6.10507195 2.93679861 0.69999640 133 134 135 136 137 138 -2.73291639 -3.73879773 5.28675552 2.54231267 0.16462913 4.15921716 139 140 141 142 143 1.17216326 1.34643402 -2.92678877 -1.23440595 0.15091160 > postscript(file="/var/wessaorg/rcomp/tmp/6rhtq1351893223.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 = 143 Frequency = 1 lag(myerror, k = 1) myerror 0 5.56753904 NA 1 5.12869523 5.56753904 2 5.30152111 5.12869523 3 3.98240501 5.30152111 4 -2.07276335 3.98240501 5 0.63416904 -2.07276335 6 -0.60736625 0.63416904 7 2.84622965 -0.60736625 8 1.65488740 2.84622965 9 -1.89066119 1.65488740 10 1.04962520 -1.89066119 11 1.03815522 1.04962520 12 -0.42511306 1.03815522 13 -7.24646891 -0.42511306 14 1.42583806 -7.24646891 15 -1.27130916 1.42583806 16 -2.47657009 -1.27130916 17 0.50264220 -2.47657009 18 -0.43907714 0.50264220 19 0.80201283 -0.43907714 20 0.76619658 0.80201283 21 -5.08248344 0.76619658 22 2.28200851 -5.08248344 23 2.90753613 2.28200851 24 2.04108789 2.90753613 25 3.53526835 2.04108789 26 -0.59590673 3.53526835 27 -3.61619404 -0.59590673 28 0.13710612 -3.61619404 29 1.06066473 0.13710612 30 -0.97787899 1.06066473 31 -0.43124903 -0.97787899 32 -0.47207470 -0.43124903 33 -1.14963093 -0.47207470 34 5.87541174 -1.14963093 35 4.94634680 5.87541174 36 -1.76743990 4.94634680 37 1.49682613 -1.76743990 38 -0.51212556 1.49682613 39 1.79160926 -0.51212556 40 2.40158810 1.79160926 41 1.26136545 2.40158810 42 -1.55991231 1.26136545 43 -1.86769437 -1.55991231 44 0.82438166 -1.86769437 45 -0.93943897 0.82438166 46 1.72725365 -0.93943897 47 3.65797231 1.72725365 48 -4.45453730 3.65797231 49 1.28929287 -4.45453730 50 -1.55093978 1.28929287 51 -3.34731164 -1.55093978 52 -2.35707125 -3.34731164 53 1.42987322 -2.35707125 54 1.97797576 1.42987322 55 -0.95675197 1.97797576 56 -3.97160392 -0.95675197 57 -3.91181491 -3.97160392 58 2.32488502 -3.91181491 59 4.31297664 2.32488502 60 0.75483574 4.31297664 61 -0.04396429 0.75483574 62 -1.79293476 -0.04396429 63 -1.06833200 -1.79293476 64 -1.24325879 -1.06833200 65 -2.02401019 -1.24325879 66 -2.63370888 -2.02401019 67 0.05368631 -2.63370888 68 -1.43177480 0.05368631 69 -1.40235662 -1.43177480 70 2.11895887 -1.40235662 71 6.13540928 2.11895887 72 2.57253745 6.13540928 73 1.45718920 2.57253745 74 -5.82185797 1.45718920 75 -3.54883288 -5.82185797 76 -0.73920545 -3.54883288 77 -1.02568230 -0.73920545 78 0.32291264 -1.02568230 79 -2.53578765 0.32291264 80 -1.75277892 -2.53578765 81 -1.50860995 -1.75277892 82 2.48945043 -1.50860995 83 0.87135895 2.48945043 84 2.02626434 0.87135895 85 2.91514333 2.02626434 86 3.05512475 2.91514333 87 5.96314901 3.05512475 88 2.90845157 5.96314901 89 8.58582948 2.90845157 90 4.02049395 8.58582948 91 0.13061192 4.02049395 92 5.87295961 0.13061192 93 -0.26640936 5.87295961 94 0.67630307 -0.26640936 95 -3.42687219 0.67630307 96 0.34979499 -3.42687219 97 -6.23084910 0.34979499 98 -7.40353370 -6.23084910 99 -9.95433550 -7.40353370 100 -10.51501993 -9.95433550 101 -5.70601242 -10.51501993 102 -6.87897400 -5.70601242 103 -8.55200351 -6.87897400 104 -9.80163597 -8.55200351 105 -1.60753741 -9.80163597 106 -0.07621852 -1.60753741 107 0.13655850 -0.07621852 108 -6.81064686 0.13655850 109 -4.86188913 -6.81064686 110 -6.32129837 -4.86188913 111 -6.89874148 -6.32129837 112 -4.16124531 -6.89874148 113 -7.01720326 -4.16124531 114 -1.20834626 -7.01720326 115 -1.25397251 -1.20834626 116 -3.19607692 -1.25397251 117 2.39710815 -3.19607692 118 5.30793326 2.39710815 119 5.05865570 5.30793326 120 0.52319801 5.05865570 121 3.72982717 0.52319801 122 5.08263075 3.72982717 123 3.79277965 5.08263075 124 1.60711740 3.79277965 125 9.74113576 1.60711740 126 5.34694300 9.74113576 127 4.79539304 5.34694300 128 3.96083240 4.79539304 129 6.10507195 3.96083240 130 2.93679861 6.10507195 131 0.69999640 2.93679861 132 -2.73291639 0.69999640 133 -3.73879773 -2.73291639 134 5.28675552 -3.73879773 135 2.54231267 5.28675552 136 0.16462913 2.54231267 137 4.15921716 0.16462913 138 1.17216326 4.15921716 139 1.34643402 1.17216326 140 -2.92678877 1.34643402 141 -1.23440595 -2.92678877 142 0.15091160 -1.23440595 143 NA 0.15091160 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 5.12869523 5.56753904 [2,] 5.30152111 5.12869523 [3,] 3.98240501 5.30152111 [4,] -2.07276335 3.98240501 [5,] 0.63416904 -2.07276335 [6,] -0.60736625 0.63416904 [7,] 2.84622965 -0.60736625 [8,] 1.65488740 2.84622965 [9,] -1.89066119 1.65488740 [10,] 1.04962520 -1.89066119 [11,] 1.03815522 1.04962520 [12,] -0.42511306 1.03815522 [13,] -7.24646891 -0.42511306 [14,] 1.42583806 -7.24646891 [15,] -1.27130916 1.42583806 [16,] -2.47657009 -1.27130916 [17,] 0.50264220 -2.47657009 [18,] -0.43907714 0.50264220 [19,] 0.80201283 -0.43907714 [20,] 0.76619658 0.80201283 [21,] -5.08248344 0.76619658 [22,] 2.28200851 -5.08248344 [23,] 2.90753613 2.28200851 [24,] 2.04108789 2.90753613 [25,] 3.53526835 2.04108789 [26,] -0.59590673 3.53526835 [27,] -3.61619404 -0.59590673 [28,] 0.13710612 -3.61619404 [29,] 1.06066473 0.13710612 [30,] -0.97787899 1.06066473 [31,] -0.43124903 -0.97787899 [32,] -0.47207470 -0.43124903 [33,] -1.14963093 -0.47207470 [34,] 5.87541174 -1.14963093 [35,] 4.94634680 5.87541174 [36,] -1.76743990 4.94634680 [37,] 1.49682613 -1.76743990 [38,] -0.51212556 1.49682613 [39,] 1.79160926 -0.51212556 [40,] 2.40158810 1.79160926 [41,] 1.26136545 2.40158810 [42,] -1.55991231 1.26136545 [43,] -1.86769437 -1.55991231 [44,] 0.82438166 -1.86769437 [45,] -0.93943897 0.82438166 [46,] 1.72725365 -0.93943897 [47,] 3.65797231 1.72725365 [48,] -4.45453730 3.65797231 [49,] 1.28929287 -4.45453730 [50,] -1.55093978 1.28929287 [51,] -3.34731164 -1.55093978 [52,] -2.35707125 -3.34731164 [53,] 1.42987322 -2.35707125 [54,] 1.97797576 1.42987322 [55,] -0.95675197 1.97797576 [56,] -3.97160392 -0.95675197 [57,] -3.91181491 -3.97160392 [58,] 2.32488502 -3.91181491 [59,] 4.31297664 2.32488502 [60,] 0.75483574 4.31297664 [61,] -0.04396429 0.75483574 [62,] -1.79293476 -0.04396429 [63,] -1.06833200 -1.79293476 [64,] -1.24325879 -1.06833200 [65,] -2.02401019 -1.24325879 [66,] -2.63370888 -2.02401019 [67,] 0.05368631 -2.63370888 [68,] -1.43177480 0.05368631 [69,] -1.40235662 -1.43177480 [70,] 2.11895887 -1.40235662 [71,] 6.13540928 2.11895887 [72,] 2.57253745 6.13540928 [73,] 1.45718920 2.57253745 [74,] -5.82185797 1.45718920 [75,] -3.54883288 -5.82185797 [76,] -0.73920545 -3.54883288 [77,] -1.02568230 -0.73920545 [78,] 0.32291264 -1.02568230 [79,] -2.53578765 0.32291264 [80,] -1.75277892 -2.53578765 [81,] -1.50860995 -1.75277892 [82,] 2.48945043 -1.50860995 [83,] 0.87135895 2.48945043 [84,] 2.02626434 0.87135895 [85,] 2.91514333 2.02626434 [86,] 3.05512475 2.91514333 [87,] 5.96314901 3.05512475 [88,] 2.90845157 5.96314901 [89,] 8.58582948 2.90845157 [90,] 4.02049395 8.58582948 [91,] 0.13061192 4.02049395 [92,] 5.87295961 0.13061192 [93,] -0.26640936 5.87295961 [94,] 0.67630307 -0.26640936 [95,] -3.42687219 0.67630307 [96,] 0.34979499 -3.42687219 [97,] -6.23084910 0.34979499 [98,] -7.40353370 -6.23084910 [99,] -9.95433550 -7.40353370 [100,] -10.51501993 -9.95433550 [101,] -5.70601242 -10.51501993 [102,] -6.87897400 -5.70601242 [103,] -8.55200351 -6.87897400 [104,] -9.80163597 -8.55200351 [105,] -1.60753741 -9.80163597 [106,] -0.07621852 -1.60753741 [107,] 0.13655850 -0.07621852 [108,] -6.81064686 0.13655850 [109,] -4.86188913 -6.81064686 [110,] -6.32129837 -4.86188913 [111,] -6.89874148 -6.32129837 [112,] -4.16124531 -6.89874148 [113,] -7.01720326 -4.16124531 [114,] -1.20834626 -7.01720326 [115,] -1.25397251 -1.20834626 [116,] -3.19607692 -1.25397251 [117,] 2.39710815 -3.19607692 [118,] 5.30793326 2.39710815 [119,] 5.05865570 5.30793326 [120,] 0.52319801 5.05865570 [121,] 3.72982717 0.52319801 [122,] 5.08263075 3.72982717 [123,] 3.79277965 5.08263075 [124,] 1.60711740 3.79277965 [125,] 9.74113576 1.60711740 [126,] 5.34694300 9.74113576 [127,] 4.79539304 5.34694300 [128,] 3.96083240 4.79539304 [129,] 6.10507195 3.96083240 [130,] 2.93679861 6.10507195 [131,] 0.69999640 2.93679861 [132,] -2.73291639 0.69999640 [133,] -3.73879773 -2.73291639 [134,] 5.28675552 -3.73879773 [135,] 2.54231267 5.28675552 [136,] 0.16462913 2.54231267 [137,] 4.15921716 0.16462913 [138,] 1.17216326 4.15921716 [139,] 1.34643402 1.17216326 [140,] -2.92678877 1.34643402 [141,] -1.23440595 -2.92678877 [142,] 0.15091160 -1.23440595 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 5.12869523 5.56753904 2 5.30152111 5.12869523 3 3.98240501 5.30152111 4 -2.07276335 3.98240501 5 0.63416904 -2.07276335 6 -0.60736625 0.63416904 7 2.84622965 -0.60736625 8 1.65488740 2.84622965 9 -1.89066119 1.65488740 10 1.04962520 -1.89066119 11 1.03815522 1.04962520 12 -0.42511306 1.03815522 13 -7.24646891 -0.42511306 14 1.42583806 -7.24646891 15 -1.27130916 1.42583806 16 -2.47657009 -1.27130916 17 0.50264220 -2.47657009 18 -0.43907714 0.50264220 19 0.80201283 -0.43907714 20 0.76619658 0.80201283 21 -5.08248344 0.76619658 22 2.28200851 -5.08248344 23 2.90753613 2.28200851 24 2.04108789 2.90753613 25 3.53526835 2.04108789 26 -0.59590673 3.53526835 27 -3.61619404 -0.59590673 28 0.13710612 -3.61619404 29 1.06066473 0.13710612 30 -0.97787899 1.06066473 31 -0.43124903 -0.97787899 32 -0.47207470 -0.43124903 33 -1.14963093 -0.47207470 34 5.87541174 -1.14963093 35 4.94634680 5.87541174 36 -1.76743990 4.94634680 37 1.49682613 -1.76743990 38 -0.51212556 1.49682613 39 1.79160926 -0.51212556 40 2.40158810 1.79160926 41 1.26136545 2.40158810 42 -1.55991231 1.26136545 43 -1.86769437 -1.55991231 44 0.82438166 -1.86769437 45 -0.93943897 0.82438166 46 1.72725365 -0.93943897 47 3.65797231 1.72725365 48 -4.45453730 3.65797231 49 1.28929287 -4.45453730 50 -1.55093978 1.28929287 51 -3.34731164 -1.55093978 52 -2.35707125 -3.34731164 53 1.42987322 -2.35707125 54 1.97797576 1.42987322 55 -0.95675197 1.97797576 56 -3.97160392 -0.95675197 57 -3.91181491 -3.97160392 58 2.32488502 -3.91181491 59 4.31297664 2.32488502 60 0.75483574 4.31297664 61 -0.04396429 0.75483574 62 -1.79293476 -0.04396429 63 -1.06833200 -1.79293476 64 -1.24325879 -1.06833200 65 -2.02401019 -1.24325879 66 -2.63370888 -2.02401019 67 0.05368631 -2.63370888 68 -1.43177480 0.05368631 69 -1.40235662 -1.43177480 70 2.11895887 -1.40235662 71 6.13540928 2.11895887 72 2.57253745 6.13540928 73 1.45718920 2.57253745 74 -5.82185797 1.45718920 75 -3.54883288 -5.82185797 76 -0.73920545 -3.54883288 77 -1.02568230 -0.73920545 78 0.32291264 -1.02568230 79 -2.53578765 0.32291264 80 -1.75277892 -2.53578765 81 -1.50860995 -1.75277892 82 2.48945043 -1.50860995 83 0.87135895 2.48945043 84 2.02626434 0.87135895 85 2.91514333 2.02626434 86 3.05512475 2.91514333 87 5.96314901 3.05512475 88 2.90845157 5.96314901 89 8.58582948 2.90845157 90 4.02049395 8.58582948 91 0.13061192 4.02049395 92 5.87295961 0.13061192 93 -0.26640936 5.87295961 94 0.67630307 -0.26640936 95 -3.42687219 0.67630307 96 0.34979499 -3.42687219 97 -6.23084910 0.34979499 98 -7.40353370 -6.23084910 99 -9.95433550 -7.40353370 100 -10.51501993 -9.95433550 101 -5.70601242 -10.51501993 102 -6.87897400 -5.70601242 103 -8.55200351 -6.87897400 104 -9.80163597 -8.55200351 105 -1.60753741 -9.80163597 106 -0.07621852 -1.60753741 107 0.13655850 -0.07621852 108 -6.81064686 0.13655850 109 -4.86188913 -6.81064686 110 -6.32129837 -4.86188913 111 -6.89874148 -6.32129837 112 -4.16124531 -6.89874148 113 -7.01720326 -4.16124531 114 -1.20834626 -7.01720326 115 -1.25397251 -1.20834626 116 -3.19607692 -1.25397251 117 2.39710815 -3.19607692 118 5.30793326 2.39710815 119 5.05865570 5.30793326 120 0.52319801 5.05865570 121 3.72982717 0.52319801 122 5.08263075 3.72982717 123 3.79277965 5.08263075 124 1.60711740 3.79277965 125 9.74113576 1.60711740 126 5.34694300 9.74113576 127 4.79539304 5.34694300 128 3.96083240 4.79539304 129 6.10507195 3.96083240 130 2.93679861 6.10507195 131 0.69999640 2.93679861 132 -2.73291639 0.69999640 133 -3.73879773 -2.73291639 134 5.28675552 -3.73879773 135 2.54231267 5.28675552 136 0.16462913 2.54231267 137 4.15921716 0.16462913 138 1.17216326 4.15921716 139 1.34643402 1.17216326 140 -2.92678877 1.34643402 141 -1.23440595 -2.92678877 142 0.15091160 -1.23440595 > 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/wessaorg/rcomp/tmp/79jvi1351893223.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/wessaorg/rcomp/tmp/8j50v1351893223.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/wessaorg/rcomp/tmp/9uvdf1351893223.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/wessaorg/rcomp/tmp/10unm21351893223.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/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/wessaorg/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/wessaorg/rcomp/tmp/113s3i1351893223.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/wessaorg/rcomp/tmp/12bggy1351893223.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/wessaorg/rcomp/tmp/13phvr1351893223.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/wessaorg/rcomp/tmp/14lynk1351893223.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/wessaorg/rcomp/tmp/153dne1351893223.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/wessaorg/rcomp/tmp/16dael1351893223.tab") + } > > try(system("convert tmp/1m6uy1351893223.ps tmp/1m6uy1351893223.png",intern=TRUE)) character(0) > try(system("convert tmp/2z2th1351893223.ps tmp/2z2th1351893223.png",intern=TRUE)) character(0) > try(system("convert tmp/38bv11351893223.ps tmp/38bv11351893223.png",intern=TRUE)) character(0) > try(system("convert tmp/4uhbw1351893223.ps tmp/4uhbw1351893223.png",intern=TRUE)) character(0) > try(system("convert tmp/5oevf1351893223.ps tmp/5oevf1351893223.png",intern=TRUE)) character(0) > try(system("convert tmp/6rhtq1351893223.ps tmp/6rhtq1351893223.png",intern=TRUE)) character(0) > try(system("convert tmp/79jvi1351893223.ps tmp/79jvi1351893223.png",intern=TRUE)) character(0) > try(system("convert tmp/8j50v1351893223.ps tmp/8j50v1351893223.png",intern=TRUE)) character(0) > try(system("convert tmp/9uvdf1351893223.ps tmp/9uvdf1351893223.png",intern=TRUE)) character(0) > try(system("convert tmp/10unm21351893223.ps tmp/10unm21351893223.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 7.195 0.847 8.048