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 + ,14 + ,485 + ,11 + ,19 + ,91.98 + ,77585 + ,-58.7 + ,15 + ,464 + ,11 + ,18 + ,91.72 + ,77585 + ,-378.9 + ,13 + ,460 + ,11 + ,13 + ,90.27 + ,78302 + ,175.6 + ,8 + ,467 + ,11 + ,17 + ,91.89 + ,78302 + ,233.7 + ,7 + ,460 + ,9 + ,17 + ,92.07 + ,78302 + ,706.8 + ,3 + ,448 + ,8 + ,13 + ,92.92 + ,78224 + ,-23.6 + ,3 + ,443 + ,6 + ,14 + ,93.34 + ,78224 + ,420.9 + ,4 + ,436 + ,7 + ,13 + ,93.6 + ,78224 + ,722.1 + ,4 + ,431 + ,8 + ,17 + ,92.41 + ,78178 + ,1401.3 + ,0 + ,484 + ,6 + ,17 + ,93.6 + ,78178 + ,-94.9 + ,-4 + ,510 + ,5 + ,15 + ,93.77 + ,78178 + ,1043.6 + ,-14 + ,513 + ,2 + ,9 + ,93.6 + ,77988 + ,1300.1 + ,-18 + ,503 + ,3 + ,10 + ,93.6 + ,77988 + ,721.1 + ,-8 + ,471 + ,3 + ,9 + ,93.51 + ,77988 + ,-45.6 + ,-1 + ,471 + ,7 + ,14 + ,92.66 + ,77876 + ,787.5 + ,1 + ,476 + ,8 + ,18 + ,94.2 + ,77876 + ,694.3 + ,2 + ,475 + ,7 + ,18 + ,94.37 + ,77876 + ,1054.7 + ,0 + ,470 + ,7 + ,12 + ,94.45 + ,78432 + ,821.9 + ,1 + ,461 + ,6 + ,16 + ,94.62 + ,78432 + ,1100.7 + ,0 + ,455 + ,6 + ,12 + ,94.37 + ,78432 + ,862.4 + ,-1 + ,456 + ,7 + ,19 + ,93.43 + ,79025 + ,1656.1 + ,-3 + ,517 + ,5 + ,13 + ,94.79 + ,79025 + ,-174 + ,-3 + ,525 + ,5 + ,12 + ,94.88 + ,79025 + ,1337.6 + ,-3 + ,523 + ,5 + ,13 + ,94.79 + ,79407 + ,1394.9 + ,-4 + ,519 + ,4 + ,11 + ,94.62 + ,79407 + ,915.7 + ,-8 + ,509 + ,4 + ,10 + ,94.71 + ,79407 + ,-481.1 + ,-9 + ,512 + ,4 + ,16 + ,93.77 + ,79644 + ,167.9 + ,-13 + ,519 + ,1 + ,12 + ,95.73 + ,79644 + ,208.2 + ,-18 + ,517 + ,-1 + ,6 + ,95.99 + ,79644 + ,382.2 + ,-11 + ,510 + ,3 + ,8 + ,95.82 + ,79381 + ,1004 + ,-9 + ,509 + ,4 + ,6 + ,95.47 + ,79381 + ,864.7 + ,-10 + ,501 + ,3 + ,8 + ,95.82 + ,79381 + ,1052.9 + ,-13 + ,507 + ,2 + ,8 + ,94.71 + ,79536 + ,1417.6 + ,-11 + ,569 + ,1 + ,9 + ,96.33 + ,79536 + ,-197.7 + ,-5 + ,580 + ,4 + ,13 + ,96.5 + ,79536 + ,1262.1 + ,-15 + ,578 + ,3 + ,8 + ,96.16 + ,79813 + ,1147.2 + ,-6 + ,565 + ,5 + ,11 + ,96.33 + ,79813 + ,700.2 + ,-6 + ,547 + ,6 + ,8 + ,96.33 + ,79813 + ,45.3 + ,-3 + ,555 + ,6 + ,10 + ,95.05 + ,80332 + ,458.5 + ,-1 + ,562 + ,6 + ,15 + ,96.84 + ,80332 + ,610.2 + ,-3 + ,561 + ,6 + ,12 + ,96.92 + ,80332 + ,786.4 + ,-4 + ,555 + ,6 + ,13 + ,97.44 + ,81434 + ,787.2 + ,-6 + ,544 + ,5 + ,12 + ,97.78 + ,81434 + ,1040 + ,0 + ,537 + ,6 + ,15 + ,97.69 + ,81434 + ,324.1 + ,-4 + ,543 + ,5 + ,13 + ,96.67 + ,82167 + ,1343 + ,-2 + ,594 + ,6 + ,13 + ,98.29 + ,82167 + ,-501.2 + ,-2 + ,611 + ,5 + ,16 + ,98.2 + ,82167 + ,800.4 + ,-6 + ,613 + ,7 + ,14 + ,98.71 + ,82816 + ,916.7 + ,-7 + ,611 + ,4 + ,12 + ,98.54 + ,82816 + ,695.8 + ,-6 + ,594 + ,5 + ,15 + ,98.2 + ,82816 + ,28 + ,-6 + ,595 + ,6 + ,14 + ,96.92 + ,83000 + ,495.6 + ,-3 + ,591 + ,6 + ,19 + ,99.06 + ,83000 + ,366.2 + ,-2 + ,589 + ,5 + ,16 + ,99.65 + ,83000 + ,633 + ,-5 + ,584 + ,3 + ,16 + ,99.82 + ,83251 + ,848.3 + ,-11 + ,573 + ,2 + ,11 + ,99.99 + ,83251 + ,472.2 + ,-11 + ,567 + ,3 + ,13 + ,100.33 + ,83251 + ,357.8 + ,-11 + ,569 + ,3 + ,12 + ,99.31 + ,83591 + ,824.3 + ,-10 + ,621 + ,2 + ,11 + ,101.1 + ,83591 + ,-880.1 + ,-14 + ,629 + ,0 + ,6 + ,101.1 + ,83591 + ,1066.8 + ,-8 + ,628 + ,4 + ,9 + ,100.93 + ,83910 + ,1052.8 + ,-9 + ,612 + ,4 + ,6 + ,100.85 + ,83910 + ,-32.1 + ,-5 + ,595 + ,5 + ,15 + ,100.93 + ,83910 + ,-1331.4 + ,-1 + ,597 + ,6 + ,17 + ,99.6 + ,84599 + ,-767.1 + ,-2 + ,593 + ,6 + ,13 + ,101.88 + ,84599 + ,-236.7 + ,-5 + ,590 + ,5 + ,12 + ,101.81 + ,84599 + ,-184.9 + ,-4 + ,580 + ,5 + ,13 + ,102.38 + ,85275 + ,-143.4 + ,-6 + ,574 + ,3 + ,10 + ,102.74 + ,85275 + ,493.9 + ,-2 + ,573 + ,5 + ,14 + ,102.82 + ,85275 + ,549.7 + ,-2 + ,573 + ,5 + ,13 + ,101.72 + ,85608 + ,982.7 + ,-2 + ,620 + ,5 + ,10 + ,103.47 + ,85608 + ,-856.3 + ,-2 + ,626 + ,3 + ,11 + ,102.98 + ,85608 + ,967 + ,2 + ,620 + ,6 + ,12 + ,102.68 + ,86303 + ,659.4 + ,1 + ,588 + ,6 + ,7 + ,102.9 + ,86303 + ,577.2 + ,-8 + ,566 + ,4 + ,11 + ,103.03 + ,86303 + ,-213.1 + ,-1 + ,557 + ,6 + ,9 + ,101.29 + ,87115 + ,17.7 + ,1 + ,561 + ,5 + ,13 + ,103.69 + ,87115 + ,390.1 + ,-1 + ,549 + ,4 + ,12 + ,103.68 + ,87115 + ,509.3 + ,2 + ,532 + ,5 + ,5 + ,104.2 + ,87931 + ,410 + ,2 + ,526 + ,5 + ,13 + ,104.08 + ,87931 + ,212.5 + ,1 + ,511 + ,4 + ,11 + ,104.16 + ,87931 + ,818 + ,-1 + ,499 + ,3 + ,8 + ,103.05 + ,88164 + ,422.7 + ,-2 + ,555 + ,2 + ,8 + ,104.66 + ,88164 + ,-158 + ,-2 + ,565 + ,3 + ,8 + ,104.46 + ,88164 + ,427.2 + ,-1 + ,542 + ,2 + ,8 + ,104.95 + ,88792 + ,243.4 + ,-8 + ,527 + ,-1 + ,0 + ,105.85 + ,88792 + ,-419.3 + ,-4 + ,510 + ,0 + ,3 + ,106.23 + ,88792 + ,-1459.8 + ,-6 + ,514 + ,-2 + ,0 + ,104.86 + ,89263 + ,-1389.8 + ,-3 + ,517 + ,1 + ,-1 + ,107.44 + ,89263 + ,-2.1 + ,-3 + ,508 + ,-2 + ,-1 + ,108.23 + ,89263 + ,-938.6 + ,-7 + ,493 + ,-2 + ,-4 + ,108.45 + ,89881 + ,-839.9 + ,-9 + ,490 + ,-2 + ,1 + ,109.39 + ,89881 + ,-297.6 + ,-11 + ,469 + ,-6 + ,-1 + ,110.15 + ,89881 + ,-376.3 + ,-13 + ,478 + ,-4 + ,0 + ,109.13 + ,90120 + ,-79.4 + ,-11 + ,528 + ,-2 + ,-1 + ,110.28 + ,90120 + ,-2091.3 + ,-9 + ,534 + ,0 + ,6 + ,110.17 + ,90120 + ,-1023 + ,-17 + ,518 + ,-5 + ,0 + ,109.99 + ,89703 + ,-765.6 + ,-22 + ,506 + ,-4 + ,-3 + ,109.26 + ,89703 + ,-1592.3 + ,-25 + ,502 + ,-5 + ,-3 + ,109.11 + ,89703 + ,-1588.8 + ,-20 + ,516 + ,-1 + ,4 + ,107.06 + ,87818 + ,-1318 + ,-24 + ,528 + ,-2 + ,1 + ,109.53 + ,87818 + ,-402.4 + ,-24 + ,533 + ,-4 + ,0 + ,108.92 + ,87818 + ,-814.5 + ,-22 + ,536 + ,-1 + ,-4 + ,109.24 + ,86273 + ,-98.4 + ,-19 + ,537 + ,1 + ,-2 + ,109.12 + ,86273 + ,-305.9 + ,-18 + ,524 + ,1 + ,3 + ,109 + ,86273 + ,-18.4 + ,-17 + ,536 + ,-2 + ,2 + ,107.23 + ,86316 + ,610.3 + ,-11 + ,587 + ,1 + ,5 + ,109.49 + ,86316 + ,-917.3 + ,-11 + ,597 + ,1 + ,6 + ,109.04 + ,86316 + ,88.4 + ,-12 + ,581 + ,3 + ,6 + ,109.02 + ,87234 + ,-740.2 + ,-10 + ,564 + ,3 + ,3 + ,109.23 + ,87234 + ,29.3 + ,-15 + ,558 + ,1 + ,4 + ,109.46 + ,87234 + ,-893.2 + ,-15 + ,575 + ,1 + ,7 + ,107.9 + ,87885 + ,-1030.2 + ,-15 + ,580 + ,0 + ,5 + ,110.42 + ,87885 + ,-403.4 + ,-13 + ,575 + ,2 + ,6 + ,110.98 + ,87885 + ,-46.9 + ,-8 + ,563 + ,2 + ,1 + ,111.48 + ,88003 + ,-321.2 + ,-13 + ,552 + ,-1 + ,3 + ,111.88 + ,88003 + ,-239.9 + ,-9 + ,537 + ,1 + ,6 + ,111.89 + ,88003 + ,640.9 + ,-7 + ,545 + ,0 + ,0 + ,109.85 + ,88910 + ,511.6 + ,-4 + ,601 + ,1 + ,3 + ,112.1 + ,88910 + ,-665.1 + ,-4 + ,604 + ,1 + ,4 + ,112.24 + ,88910 + ,657.7 + ,-2 + ,586 + ,3 + ,7 + ,112.39 + ,89397 + ,-207.7 + ,0 + ,564 + ,2 + ,6 + ,112.52 + ,89397 + ,-885.2 + ,-2 + ,549 + ,0 + ,6 + ,113.16 + ,89397 + ,-1595.8 + ,-3 + ,551 + ,0 + ,6 + ,111.84 + ,89813 + ,-1374.9 + ,1 + ,556 + ,3 + ,6 + ,114.33 + ,89813 + ,-316.6 + ,-2 + ,548 + ,-2 + ,2 + ,114.82 + ,89813 + ,-283.4 + ,-1 + ,540 + ,0 + ,2 + ,115.2 + ,90539 + ,-175.8 + ,1 + ,531 + ,1 + ,2 + ,115.4 + ,90539 + ,-694.2 + ,-3 + ,521 + ,-1 + ,3 + ,115.74 + ,90539 + ,-249.9 + ,-4 + ,519 + ,-2 + ,-1 + ,114.19 + ,90688 + ,268.2 + ,-9 + ,572 + ,-1 + ,-4 + ,115.94 + ,90688 + ,-2105.1 + ,-9 + ,581 + ,-1 + ,4 + ,116.03 + ,90688 + ,-762.8 + ,-7 + ,563 + ,1 + ,5 + ,116.24 + ,90691 + ,-117.1 + ,-14 + ,548 + ,-2 + ,3 + ,116.66 + ,90691 + ,-1094.4 + ,-12 + ,539 + ,-5 + ,-1 + ,116.79 + ,90691 + ,-2095.2 + ,-16 + ,541 + ,-5 + ,-4 + ,115.48 + ,90645 + ,-1587.6 + ,-20 + ,562 + ,-6 + ,0 + ,118.16 + ,90645 + ,-528 + ,-12 + ,559 + ,-4 + ,-1 + ,118.38 + ,90645 + ,-324.2 + ,-12 + ,546 + ,-3 + ,-1 + ,118.51 + ,90861 + ,-276.1 + ,-10 + ,536 + ,-3 + ,3 + ,118.42 + ,90861 + ,-139.1 + ,-10 + ,528 + ,-1 + ,2 + ,118.24 + ,90861 + ,268 + ,-13 + ,530 + ,-2 + ,-4 + ,116.47 + ,90401 + ,570.5 + ,-16 + ,582 + ,-3 + ,-3 + ,118.96 + ,90401 + ,-316.5) + ,dim=c(7 + ,143) + ,dimnames=list(c('i' + ,'w' + ,'f' + ,'s' + ,'c' + ,'b' + ,'h') + ,1:143)) > y <- array(NA,dim=c(7,143),dimnames=list(c('i','w','f','s','c','b','h'),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 1 14 501 11 20 91.81 77585 1303.2 2 14 485 11 19 91.98 77585 -58.7 3 15 464 11 18 91.72 77585 -378.9 4 13 460 11 13 90.27 78302 175.6 5 8 467 11 17 91.89 78302 233.7 6 7 460 9 17 92.07 78302 706.8 7 3 448 8 13 92.92 78224 -23.6 8 3 443 6 14 93.34 78224 420.9 9 4 436 7 13 93.60 78224 722.1 10 4 431 8 17 92.41 78178 1401.3 11 0 484 6 17 93.60 78178 -94.9 12 -4 510 5 15 93.77 78178 1043.6 13 -14 513 2 9 93.60 77988 1300.1 14 -18 503 3 10 93.60 77988 721.1 15 -8 471 3 9 93.51 77988 -45.6 16 -1 471 7 14 92.66 77876 787.5 17 1 476 8 18 94.20 77876 694.3 18 2 475 7 18 94.37 77876 1054.7 19 0 470 7 12 94.45 78432 821.9 20 1 461 6 16 94.62 78432 1100.7 21 0 455 6 12 94.37 78432 862.4 22 -1 456 7 19 93.43 79025 1656.1 23 -3 517 5 13 94.79 79025 -174.0 24 -3 525 5 12 94.88 79025 1337.6 25 -3 523 5 13 94.79 79407 1394.9 26 -4 519 4 11 94.62 79407 915.7 27 -8 509 4 10 94.71 79407 -481.1 28 -9 512 4 16 93.77 79644 167.9 29 -13 519 1 12 95.73 79644 208.2 30 -18 517 -1 6 95.99 79644 382.2 31 -11 510 3 8 95.82 79381 1004.0 32 -9 509 4 6 95.47 79381 864.7 33 -10 501 3 8 95.82 79381 1052.9 34 -13 507 2 8 94.71 79536 1417.6 35 -11 569 1 9 96.33 79536 -197.7 36 -5 580 4 13 96.50 79536 1262.1 37 -15 578 3 8 96.16 79813 1147.2 38 -6 565 5 11 96.33 79813 700.2 39 -6 547 6 8 96.33 79813 45.3 40 -3 555 6 10 95.05 80332 458.5 41 -1 562 6 15 96.84 80332 610.2 42 -3 561 6 12 96.92 80332 786.4 43 -4 555 6 13 97.44 81434 787.2 44 -6 544 5 12 97.78 81434 1040.0 45 0 537 6 15 97.69 81434 324.1 46 -4 543 5 13 96.67 82167 1343.0 47 -2 594 6 13 98.29 82167 -501.2 48 -2 611 5 16 98.20 82167 800.4 49 -6 613 7 14 98.71 82816 916.7 50 -7 611 4 12 98.54 82816 695.8 51 -6 594 5 15 98.20 82816 28.0 52 -6 595 6 14 96.92 83000 495.6 53 -3 591 6 19 99.06 83000 366.2 54 -2 589 5 16 99.65 83000 633.0 55 -5 584 3 16 99.82 83251 848.3 56 -11 573 2 11 99.99 83251 472.2 57 -11 567 3 13 100.33 83251 357.8 58 -11 569 3 12 99.31 83591 824.3 59 -10 621 2 11 101.10 83591 -880.1 60 -14 629 0 6 101.10 83591 1066.8 61 -8 628 4 9 100.93 83910 1052.8 62 -9 612 4 6 100.85 83910 -32.1 63 -5 595 5 15 100.93 83910 -1331.4 64 -1 597 6 17 99.60 84599 -767.1 65 -2 593 6 13 101.88 84599 -236.7 66 -5 590 5 12 101.81 84599 -184.9 67 -4 580 5 13 102.38 85275 -143.4 68 -6 574 3 10 102.74 85275 493.9 69 -2 573 5 14 102.82 85275 549.7 70 -2 573 5 13 101.72 85608 982.7 71 -2 620 5 10 103.47 85608 -856.3 72 -2 626 3 11 102.98 85608 967.0 73 2 620 6 12 102.68 86303 659.4 74 1 588 6 7 102.90 86303 577.2 75 -8 566 4 11 103.03 86303 -213.1 76 -1 557 6 9 101.29 87115 17.7 77 1 561 5 13 103.69 87115 390.1 78 -1 549 4 12 103.68 87115 509.3 79 2 532 5 5 104.20 87931 410.0 80 2 526 5 13 104.08 87931 212.5 81 1 511 4 11 104.16 87931 818.0 82 -1 499 3 8 103.05 88164 422.7 83 -2 555 2 8 104.66 88164 -158.0 84 -2 565 3 8 104.46 88164 427.2 85 -1 542 2 8 104.95 88792 243.4 86 -8 527 -1 0 105.85 88792 -419.3 87 -4 510 0 3 106.23 88792 -1459.8 88 -6 514 -2 0 104.86 89263 -1389.8 89 -3 517 1 -1 107.44 89263 -2.1 90 -3 508 -2 -1 108.23 89263 -938.6 91 -7 493 -2 -4 108.45 89881 -839.9 92 -9 490 -2 1 109.39 89881 -297.6 93 -11 469 -6 -1 110.15 89881 -376.3 94 -13 478 -4 0 109.13 90120 -79.4 95 -11 528 -2 -1 110.28 90120 -2091.3 96 -9 534 0 6 110.17 90120 -1023.0 97 -17 518 -5 0 109.99 89703 -765.6 98 -22 506 -4 -3 109.26 89703 -1592.3 99 -25 502 -5 -3 109.11 89703 -1588.8 100 -20 516 -1 4 107.06 87818 -1318.0 101 -24 528 -2 1 109.53 87818 -402.4 102 -24 533 -4 0 108.92 87818 -814.5 103 -22 536 -1 -4 109.24 86273 -98.4 104 -19 537 1 -2 109.12 86273 -305.9 105 -18 524 1 3 109.00 86273 -18.4 106 -17 536 -2 2 107.23 86316 610.3 107 -11 587 1 5 109.49 86316 -917.3 108 -11 597 1 6 109.04 86316 88.4 109 -12 581 3 6 109.02 87234 -740.2 110 -10 564 3 3 109.23 87234 29.3 111 -15 558 1 4 109.46 87234 -893.2 112 -15 575 1 7 107.90 87885 -1030.2 113 -15 580 0 5 110.42 87885 -403.4 114 -13 575 2 6 110.98 87885 -46.9 115 -8 563 2 1 111.48 88003 -321.2 116 -13 552 -1 3 111.88 88003 -239.9 117 -9 537 1 6 111.89 88003 640.9 118 -7 545 0 0 109.85 88910 511.6 119 -4 601 1 3 112.10 88910 -665.1 120 -4 604 1 4 112.24 88910 657.7 121 -2 586 3 7 112.39 89397 -207.7 122 0 564 2 6 112.52 89397 -885.2 123 -2 549 0 6 113.16 89397 -1595.8 124 -3 551 0 6 111.84 89813 -1374.9 125 1 556 3 6 114.33 89813 -316.6 126 -2 548 -2 2 114.82 89813 -283.4 127 -1 540 0 2 115.20 90539 -175.8 128 1 531 1 2 115.40 90539 -694.2 129 -3 521 -1 3 115.74 90539 -249.9 130 -4 519 -2 -1 114.19 90688 268.2 131 -9 572 -1 -4 115.94 90688 -2105.1 132 -9 581 -1 4 116.03 90688 -762.8 133 -7 563 1 5 116.24 90691 -117.1 134 -14 548 -2 3 116.66 90691 -1094.4 135 -12 539 -5 -1 116.79 90691 -2095.2 136 -16 541 -5 -4 115.48 90645 -1587.6 137 -20 562 -6 0 118.16 90645 -528.0 138 -12 559 -4 -1 118.38 90645 -324.2 139 -12 546 -3 -1 118.51 90861 -276.1 140 -10 536 -3 3 118.42 90861 -139.1 141 -10 528 -1 2 118.24 90861 268.0 142 -13 530 -2 -4 116.47 90401 570.5 143 -16 582 -3 -3 118.96 90401 -316.5 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) w f s c b -8.407e+01 -5.410e-02 2.049e+00 3.209e-01 7.643e-02 1.077e-03 h 7.412e-05 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -10.5242 -1.8201 0.2005 2.3687 9.6748 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) -8.407e+01 1.085e+01 -7.750 1.91e-12 *** w -5.410e-02 8.085e-03 -6.692 5.29e-10 *** f 2.049e+00 1.884e-01 10.878 < 2e-16 *** s 3.209e-01 1.224e-01 2.622 0.00973 ** c 7.643e-02 1.396e-01 0.548 0.58484 b 1.077e-03 2.296e-04 4.691 6.55e-06 *** h 7.412e-05 5.090e-04 0.146 0.88444 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 3.843 on 136 degrees of freedom Multiple R-squared: 0.7483, Adjusted R-squared: 0.7372 F-statistic: 67.39 on 6 and 136 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.1106556789 0.2213113579 0.8893443 [2,] 0.0535156151 0.1070312302 0.9464844 [3,] 0.0430459103 0.0860918207 0.9569541 [4,] 0.1126470521 0.2252941042 0.8873529 [5,] 0.4469998207 0.8939996415 0.5530002 [6,] 0.3659196711 0.7318393422 0.6340803 [7,] 0.3173344791 0.6346689582 0.6826655 [8,] 0.2795495894 0.5590991789 0.7204504 [9,] 0.2106759552 0.4213519105 0.7893240 [10,] 0.1762755759 0.3525511517 0.8237244 [11,] 0.1500050874 0.3000101748 0.8499949 [12,] 0.1210117008 0.2420234016 0.8789883 [13,] 0.0956656616 0.1913313232 0.9043343 [14,] 0.0934697917 0.1869395835 0.9065302 [15,] 0.0953616835 0.1907233671 0.9046383 [16,] 0.0757631446 0.1515262892 0.9242369 [17,] 0.0698272796 0.1396545591 0.9301727 [18,] 0.0594096195 0.1188192391 0.9405904 [19,] 0.0464088959 0.0928177919 0.9535911 [20,] 0.0359397422 0.0718794845 0.9640603 [21,] 0.0290105617 0.0580211234 0.9709894 [22,] 0.0222298045 0.0444596091 0.9777702 [23,] 0.0171894540 0.0343789080 0.9828105 [24,] 0.0113454851 0.0226909703 0.9886545 [25,] 0.0072062958 0.0144125917 0.9927937 [26,] 0.0088574472 0.0177148944 0.9911426 [27,] 0.0072643665 0.0145287329 0.9927356 [28,] 0.0110465855 0.0220931711 0.9889534 [29,] 0.0088483156 0.0176966312 0.9911517 [30,] 0.0104703610 0.0209407221 0.9895296 [31,] 0.0082813482 0.0165626964 0.9917187 [32,] 0.0071724543 0.0143449085 0.9928275 [33,] 0.0063062066 0.0126124132 0.9936938 [34,] 0.0050011441 0.0100022882 0.9949989 [35,] 0.0036280246 0.0072560492 0.9963720 [36,] 0.0042142672 0.0084285344 0.9957857 [37,] 0.0033334239 0.0066668477 0.9966666 [38,] 0.0032278636 0.0064557272 0.9967721 [39,] 0.0033943828 0.0067887655 0.9966056 [40,] 0.0065678275 0.0131356551 0.9934322 [41,] 0.0049110024 0.0098220049 0.9950890 [42,] 0.0037317217 0.0074634434 0.9962683 [43,] 0.0031585835 0.0063171669 0.9968414 [44,] 0.0022701367 0.0045402735 0.9977299 [45,] 0.0024886350 0.0049772701 0.9975114 [46,] 0.0034736731 0.0069473461 0.9965263 [47,] 0.0026574948 0.0053149896 0.9973425 [48,] 0.0022013766 0.0044027532 0.9977986 [49,] 0.0014742811 0.0029485621 0.9985257 [50,] 0.0013069592 0.0026139184 0.9986930 [51,] 0.0026250675 0.0052501351 0.9973749 [52,] 0.0018252687 0.0036505375 0.9981747 [53,] 0.0012999996 0.0025999991 0.9987000 [54,] 0.0012528580 0.0025057161 0.9987471 [55,] 0.0008726267 0.0017452534 0.9991274 [56,] 0.0006560263 0.0013120527 0.9993440 [57,] 0.0004699595 0.0009399190 0.9995300 [58,] 0.0003058200 0.0006116400 0.9996942 [59,] 0.0003440566 0.0006881131 0.9996559 [60,] 0.0002680114 0.0005360227 0.9997320 [61,] 0.0001969029 0.0003938058 0.9998031 [62,] 0.0001970479 0.0003940958 0.9998030 [63,] 0.0012646006 0.0025292012 0.9987354 [64,] 0.0012825773 0.0025651546 0.9987174 [65,] 0.0010914698 0.0021829395 0.9989085 [66,] 0.0010556012 0.0021112025 0.9989444 [67,] 0.0007950589 0.0015901177 0.9992049 [68,] 0.0006135628 0.0012271256 0.9993864 [69,] 0.0004711551 0.0009423103 0.9995288 [70,] 0.0003939756 0.0007879511 0.9996060 [71,] 0.0002605862 0.0005211724 0.9997394 [72,] 0.0001834776 0.0003669552 0.9998165 [73,] 0.0001426297 0.0002852593 0.9998574 [74,] 0.0001808735 0.0003617471 0.9998191 [75,] 0.0001385646 0.0002771293 0.9998614 [76,] 0.0001412619 0.0002825238 0.9998587 [77,] 0.0001326486 0.0002652973 0.9998674 [78,] 0.0001446822 0.0002893644 0.9998553 [79,] 0.0002940081 0.0005880162 0.9997060 [80,] 0.0002007843 0.0004015686 0.9997992 [81,] 0.0014865661 0.0029731322 0.9985134 [82,] 0.0015219898 0.0030439796 0.9984780 [83,] 0.0011188880 0.0022377761 0.9988811 [84,] 0.0035461521 0.0070923041 0.9964538 [85,] 0.0029894735 0.0059789469 0.9970105 [86,] 0.0027313612 0.0054627225 0.9972686 [87,] 0.0032946547 0.0065893093 0.9967053 [88,] 0.0025706361 0.0051412722 0.9974294 [89,] 0.0067782160 0.0135564320 0.9932218 [90,] 0.0201352660 0.0402705319 0.9798647 [91,] 0.0628209588 0.1256419176 0.9371790 [92,] 0.1920073501 0.3840147002 0.8079926 [93,] 0.2300435305 0.4600870610 0.7699565 [94,] 0.2147218504 0.4294437008 0.7852781 [95,] 0.2079610953 0.4159221905 0.7920389 [96,] 0.2195630060 0.4391260121 0.7804370 [97,] 0.1832581113 0.3665162225 0.8167419 [98,] 0.2293266537 0.4586533073 0.7706733 [99,] 0.3164030798 0.6328061596 0.6835969 [100,] 0.2971442693 0.5942885386 0.7028557 [101,] 0.2519242066 0.5038484133 0.7480758 [102,] 0.2315020702 0.4630041403 0.7684979 [103,] 0.4365025026 0.8730050052 0.5634975 [104,] 0.4605812885 0.9211625770 0.5394187 [105,] 0.6086875547 0.7826248906 0.3913124 [106,] 0.5705097771 0.8589804458 0.4294902 [107,] 0.5600632579 0.8798734842 0.4399367 [108,] 0.7136444887 0.5727110227 0.2863555 [109,] 0.8263589068 0.3472821863 0.1736411 [110,] 0.8163018230 0.3673963541 0.1836982 [111,] 0.7994905592 0.4010188816 0.2005094 [112,] 0.7685203951 0.4629592099 0.2314796 [113,] 0.7340750870 0.5318498260 0.2659249 [114,] 0.7088487062 0.5823025875 0.2911513 [115,] 0.7257358824 0.5485282353 0.2742641 [116,] 0.7283339288 0.5433321424 0.2716661 [117,] 0.7370792802 0.5258414396 0.2629207 [118,] 0.7347420964 0.5305158072 0.2652579 [119,] 0.7461769308 0.5076461383 0.2538231 [120,] 0.8244813043 0.3510373914 0.1755187 [121,] 0.8846262410 0.2307475180 0.1153738 [122,] 0.8021513746 0.3956972507 0.1978486 [123,] 0.7167924543 0.5664150914 0.2832075 [124,] 0.7934722796 0.4130554408 0.2065277 > postscript(file="/var/fisher/rcomp/tmp/191xj1351894379.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/fisher/rcomp/tmp/2zfi61351894379.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/fisher/rcomp/tmp/3yo471351894379.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/fisher/rcomp/tmp/4ce4v1351894379.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/fisher/rcomp/tmp/59ozp1351894379.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.52919952 5.07241366 5.30076623 3.98633361 -2.04676693 0.62405370 7 8 9 10 11 12 -0.61910451 2.82277377 1.67359563 -1.83965205 1.14615542 1.14651466 13 14 15 16 17 18 -0.41940590 -7.28764016 1.36567205 -1.31183064 -2.48499450 0.47038150 19 20 21 22 23 24 -0.46237659 0.78251066 0.77836453 -5.08898518 2.26696724 2.90181067 25 26 27 28 29 30 2.06380593 3.58693803 -0.53652479 -3.53133751 0.12586194 1.00881570 31 32 33 34 35 36 -0.95828076 -0.38264071 -0.44883827 -1.18419829 5.89439494 4.93708860 37 38 39 40 41 42 -1.78119242 1.47444859 -0.53728266 1.76181321 2.38785586 1.27735896 43 44 45 46 47 48 -1.59510019 -1.86485214 0.80439615 -0.96711524 1.75586145 3.67243643 49 50 51 52 53 54 -4.42259139 1.28797178 -1.56827489 -3.37746809 -2.35248166 1.48640859 55 56 57 58 59 60 2.01492314 -0.91151713 -3.94468337 -3.83842663 2.33459429 4.32612842 61 62 63 64 65 66 0.78290216 -0.03345343 -1.80055594 -1.06577307 -1.21204754 -2.00273714 67 68 69 70 71 72 -2.63954862 0.02222911 -1.42419958 -1.41001248 2.09819274 6.10256924 73 74 75 76 77 78 2.60651945 1.46911346 -5.85786832 -3.56014907 -0.78928521 -1.07648915 79 80 81 82 83 84 0.28964843 -2.57857862 -1.75008817 -1.52422982 2.47475147 0.93851704 85 86 87 88 89 90 2.04298806 2.92673077 3.04307925 5.91278455 2.94843528 8.61808604 91 92 93 94 95 96 4.07945288 0.20047241 5.85063218 -0.28323630 0.70572991 -3.38527487 97 98 99 100 101 102 0.36443138 -6.25415219 -7.41017821 -9.92876331 -10.52419245 -5.75721489 103 104 105 106 107 108 -6.87195857 -8.53352590 -9.85364492 -1.69356254 -0.10411323 0.07585055 109 110 111 112 113 114 -6.81413303 -4.84419788 -6.34058485 -6.95549837 -4.23299670 -6.99203200 115 116 117 118 119 120 -1.18163943 -1.30767845 -3.24642815 2.34959365 5.28268621 5.01532941 121 122 123 124 125 126 0.50837938 3.72848719 5.01905309 3.76364485 1.61786863 9.67475582 127 128 129 130 131 132 5.32447118 4.81149036 3.98897924 6.13321898 2.95646277 0.76961678 133 134 135 136 137 138 -2.69068292 -3.67249850 5.33606743 2.51910675 0.13740077 4.16572946 139 140 141 142 143 1.16701499 1.33899551 -2.88769099 -1.19635567 0.22072944 > postscript(file="/var/fisher/rcomp/tmp/6kffo1351894379.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.52919952 NA 1 5.07241366 5.52919952 2 5.30076623 5.07241366 3 3.98633361 5.30076623 4 -2.04676693 3.98633361 5 0.62405370 -2.04676693 6 -0.61910451 0.62405370 7 2.82277377 -0.61910451 8 1.67359563 2.82277377 9 -1.83965205 1.67359563 10 1.14615542 -1.83965205 11 1.14651466 1.14615542 12 -0.41940590 1.14651466 13 -7.28764016 -0.41940590 14 1.36567205 -7.28764016 15 -1.31183064 1.36567205 16 -2.48499450 -1.31183064 17 0.47038150 -2.48499450 18 -0.46237659 0.47038150 19 0.78251066 -0.46237659 20 0.77836453 0.78251066 21 -5.08898518 0.77836453 22 2.26696724 -5.08898518 23 2.90181067 2.26696724 24 2.06380593 2.90181067 25 3.58693803 2.06380593 26 -0.53652479 3.58693803 27 -3.53133751 -0.53652479 28 0.12586194 -3.53133751 29 1.00881570 0.12586194 30 -0.95828076 1.00881570 31 -0.38264071 -0.95828076 32 -0.44883827 -0.38264071 33 -1.18419829 -0.44883827 34 5.89439494 -1.18419829 35 4.93708860 5.89439494 36 -1.78119242 4.93708860 37 1.47444859 -1.78119242 38 -0.53728266 1.47444859 39 1.76181321 -0.53728266 40 2.38785586 1.76181321 41 1.27735896 2.38785586 42 -1.59510019 1.27735896 43 -1.86485214 -1.59510019 44 0.80439615 -1.86485214 45 -0.96711524 0.80439615 46 1.75586145 -0.96711524 47 3.67243643 1.75586145 48 -4.42259139 3.67243643 49 1.28797178 -4.42259139 50 -1.56827489 1.28797178 51 -3.37746809 -1.56827489 52 -2.35248166 -3.37746809 53 1.48640859 -2.35248166 54 2.01492314 1.48640859 55 -0.91151713 2.01492314 56 -3.94468337 -0.91151713 57 -3.83842663 -3.94468337 58 2.33459429 -3.83842663 59 4.32612842 2.33459429 60 0.78290216 4.32612842 61 -0.03345343 0.78290216 62 -1.80055594 -0.03345343 63 -1.06577307 -1.80055594 64 -1.21204754 -1.06577307 65 -2.00273714 -1.21204754 66 -2.63954862 -2.00273714 67 0.02222911 -2.63954862 68 -1.42419958 0.02222911 69 -1.41001248 -1.42419958 70 2.09819274 -1.41001248 71 6.10256924 2.09819274 72 2.60651945 6.10256924 73 1.46911346 2.60651945 74 -5.85786832 1.46911346 75 -3.56014907 -5.85786832 76 -0.78928521 -3.56014907 77 -1.07648915 -0.78928521 78 0.28964843 -1.07648915 79 -2.57857862 0.28964843 80 -1.75008817 -2.57857862 81 -1.52422982 -1.75008817 82 2.47475147 -1.52422982 83 0.93851704 2.47475147 84 2.04298806 0.93851704 85 2.92673077 2.04298806 86 3.04307925 2.92673077 87 5.91278455 3.04307925 88 2.94843528 5.91278455 89 8.61808604 2.94843528 90 4.07945288 8.61808604 91 0.20047241 4.07945288 92 5.85063218 0.20047241 93 -0.28323630 5.85063218 94 0.70572991 -0.28323630 95 -3.38527487 0.70572991 96 0.36443138 -3.38527487 97 -6.25415219 0.36443138 98 -7.41017821 -6.25415219 99 -9.92876331 -7.41017821 100 -10.52419245 -9.92876331 101 -5.75721489 -10.52419245 102 -6.87195857 -5.75721489 103 -8.53352590 -6.87195857 104 -9.85364492 -8.53352590 105 -1.69356254 -9.85364492 106 -0.10411323 -1.69356254 107 0.07585055 -0.10411323 108 -6.81413303 0.07585055 109 -4.84419788 -6.81413303 110 -6.34058485 -4.84419788 111 -6.95549837 -6.34058485 112 -4.23299670 -6.95549837 113 -6.99203200 -4.23299670 114 -1.18163943 -6.99203200 115 -1.30767845 -1.18163943 116 -3.24642815 -1.30767845 117 2.34959365 -3.24642815 118 5.28268621 2.34959365 119 5.01532941 5.28268621 120 0.50837938 5.01532941 121 3.72848719 0.50837938 122 5.01905309 3.72848719 123 3.76364485 5.01905309 124 1.61786863 3.76364485 125 9.67475582 1.61786863 126 5.32447118 9.67475582 127 4.81149036 5.32447118 128 3.98897924 4.81149036 129 6.13321898 3.98897924 130 2.95646277 6.13321898 131 0.76961678 2.95646277 132 -2.69068292 0.76961678 133 -3.67249850 -2.69068292 134 5.33606743 -3.67249850 135 2.51910675 5.33606743 136 0.13740077 2.51910675 137 4.16572946 0.13740077 138 1.16701499 4.16572946 139 1.33899551 1.16701499 140 -2.88769099 1.33899551 141 -1.19635567 -2.88769099 142 0.22072944 -1.19635567 143 NA 0.22072944 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 5.07241366 5.52919952 [2,] 5.30076623 5.07241366 [3,] 3.98633361 5.30076623 [4,] -2.04676693 3.98633361 [5,] 0.62405370 -2.04676693 [6,] -0.61910451 0.62405370 [7,] 2.82277377 -0.61910451 [8,] 1.67359563 2.82277377 [9,] -1.83965205 1.67359563 [10,] 1.14615542 -1.83965205 [11,] 1.14651466 1.14615542 [12,] -0.41940590 1.14651466 [13,] -7.28764016 -0.41940590 [14,] 1.36567205 -7.28764016 [15,] -1.31183064 1.36567205 [16,] -2.48499450 -1.31183064 [17,] 0.47038150 -2.48499450 [18,] -0.46237659 0.47038150 [19,] 0.78251066 -0.46237659 [20,] 0.77836453 0.78251066 [21,] -5.08898518 0.77836453 [22,] 2.26696724 -5.08898518 [23,] 2.90181067 2.26696724 [24,] 2.06380593 2.90181067 [25,] 3.58693803 2.06380593 [26,] -0.53652479 3.58693803 [27,] -3.53133751 -0.53652479 [28,] 0.12586194 -3.53133751 [29,] 1.00881570 0.12586194 [30,] -0.95828076 1.00881570 [31,] -0.38264071 -0.95828076 [32,] -0.44883827 -0.38264071 [33,] -1.18419829 -0.44883827 [34,] 5.89439494 -1.18419829 [35,] 4.93708860 5.89439494 [36,] -1.78119242 4.93708860 [37,] 1.47444859 -1.78119242 [38,] -0.53728266 1.47444859 [39,] 1.76181321 -0.53728266 [40,] 2.38785586 1.76181321 [41,] 1.27735896 2.38785586 [42,] -1.59510019 1.27735896 [43,] -1.86485214 -1.59510019 [44,] 0.80439615 -1.86485214 [45,] -0.96711524 0.80439615 [46,] 1.75586145 -0.96711524 [47,] 3.67243643 1.75586145 [48,] -4.42259139 3.67243643 [49,] 1.28797178 -4.42259139 [50,] -1.56827489 1.28797178 [51,] -3.37746809 -1.56827489 [52,] -2.35248166 -3.37746809 [53,] 1.48640859 -2.35248166 [54,] 2.01492314 1.48640859 [55,] -0.91151713 2.01492314 [56,] -3.94468337 -0.91151713 [57,] -3.83842663 -3.94468337 [58,] 2.33459429 -3.83842663 [59,] 4.32612842 2.33459429 [60,] 0.78290216 4.32612842 [61,] -0.03345343 0.78290216 [62,] -1.80055594 -0.03345343 [63,] -1.06577307 -1.80055594 [64,] -1.21204754 -1.06577307 [65,] -2.00273714 -1.21204754 [66,] -2.63954862 -2.00273714 [67,] 0.02222911 -2.63954862 [68,] -1.42419958 0.02222911 [69,] -1.41001248 -1.42419958 [70,] 2.09819274 -1.41001248 [71,] 6.10256924 2.09819274 [72,] 2.60651945 6.10256924 [73,] 1.46911346 2.60651945 [74,] -5.85786832 1.46911346 [75,] -3.56014907 -5.85786832 [76,] -0.78928521 -3.56014907 [77,] -1.07648915 -0.78928521 [78,] 0.28964843 -1.07648915 [79,] -2.57857862 0.28964843 [80,] -1.75008817 -2.57857862 [81,] -1.52422982 -1.75008817 [82,] 2.47475147 -1.52422982 [83,] 0.93851704 2.47475147 [84,] 2.04298806 0.93851704 [85,] 2.92673077 2.04298806 [86,] 3.04307925 2.92673077 [87,] 5.91278455 3.04307925 [88,] 2.94843528 5.91278455 [89,] 8.61808604 2.94843528 [90,] 4.07945288 8.61808604 [91,] 0.20047241 4.07945288 [92,] 5.85063218 0.20047241 [93,] -0.28323630 5.85063218 [94,] 0.70572991 -0.28323630 [95,] -3.38527487 0.70572991 [96,] 0.36443138 -3.38527487 [97,] -6.25415219 0.36443138 [98,] -7.41017821 -6.25415219 [99,] -9.92876331 -7.41017821 [100,] -10.52419245 -9.92876331 [101,] -5.75721489 -10.52419245 [102,] -6.87195857 -5.75721489 [103,] -8.53352590 -6.87195857 [104,] -9.85364492 -8.53352590 [105,] -1.69356254 -9.85364492 [106,] -0.10411323 -1.69356254 [107,] 0.07585055 -0.10411323 [108,] -6.81413303 0.07585055 [109,] -4.84419788 -6.81413303 [110,] -6.34058485 -4.84419788 [111,] -6.95549837 -6.34058485 [112,] -4.23299670 -6.95549837 [113,] -6.99203200 -4.23299670 [114,] -1.18163943 -6.99203200 [115,] -1.30767845 -1.18163943 [116,] -3.24642815 -1.30767845 [117,] 2.34959365 -3.24642815 [118,] 5.28268621 2.34959365 [119,] 5.01532941 5.28268621 [120,] 0.50837938 5.01532941 [121,] 3.72848719 0.50837938 [122,] 5.01905309 3.72848719 [123,] 3.76364485 5.01905309 [124,] 1.61786863 3.76364485 [125,] 9.67475582 1.61786863 [126,] 5.32447118 9.67475582 [127,] 4.81149036 5.32447118 [128,] 3.98897924 4.81149036 [129,] 6.13321898 3.98897924 [130,] 2.95646277 6.13321898 [131,] 0.76961678 2.95646277 [132,] -2.69068292 0.76961678 [133,] -3.67249850 -2.69068292 [134,] 5.33606743 -3.67249850 [135,] 2.51910675 5.33606743 [136,] 0.13740077 2.51910675 [137,] 4.16572946 0.13740077 [138,] 1.16701499 4.16572946 [139,] 1.33899551 1.16701499 [140,] -2.88769099 1.33899551 [141,] -1.19635567 -2.88769099 [142,] 0.22072944 -1.19635567 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 5.07241366 5.52919952 2 5.30076623 5.07241366 3 3.98633361 5.30076623 4 -2.04676693 3.98633361 5 0.62405370 -2.04676693 6 -0.61910451 0.62405370 7 2.82277377 -0.61910451 8 1.67359563 2.82277377 9 -1.83965205 1.67359563 10 1.14615542 -1.83965205 11 1.14651466 1.14615542 12 -0.41940590 1.14651466 13 -7.28764016 -0.41940590 14 1.36567205 -7.28764016 15 -1.31183064 1.36567205 16 -2.48499450 -1.31183064 17 0.47038150 -2.48499450 18 -0.46237659 0.47038150 19 0.78251066 -0.46237659 20 0.77836453 0.78251066 21 -5.08898518 0.77836453 22 2.26696724 -5.08898518 23 2.90181067 2.26696724 24 2.06380593 2.90181067 25 3.58693803 2.06380593 26 -0.53652479 3.58693803 27 -3.53133751 -0.53652479 28 0.12586194 -3.53133751 29 1.00881570 0.12586194 30 -0.95828076 1.00881570 31 -0.38264071 -0.95828076 32 -0.44883827 -0.38264071 33 -1.18419829 -0.44883827 34 5.89439494 -1.18419829 35 4.93708860 5.89439494 36 -1.78119242 4.93708860 37 1.47444859 -1.78119242 38 -0.53728266 1.47444859 39 1.76181321 -0.53728266 40 2.38785586 1.76181321 41 1.27735896 2.38785586 42 -1.59510019 1.27735896 43 -1.86485214 -1.59510019 44 0.80439615 -1.86485214 45 -0.96711524 0.80439615 46 1.75586145 -0.96711524 47 3.67243643 1.75586145 48 -4.42259139 3.67243643 49 1.28797178 -4.42259139 50 -1.56827489 1.28797178 51 -3.37746809 -1.56827489 52 -2.35248166 -3.37746809 53 1.48640859 -2.35248166 54 2.01492314 1.48640859 55 -0.91151713 2.01492314 56 -3.94468337 -0.91151713 57 -3.83842663 -3.94468337 58 2.33459429 -3.83842663 59 4.32612842 2.33459429 60 0.78290216 4.32612842 61 -0.03345343 0.78290216 62 -1.80055594 -0.03345343 63 -1.06577307 -1.80055594 64 -1.21204754 -1.06577307 65 -2.00273714 -1.21204754 66 -2.63954862 -2.00273714 67 0.02222911 -2.63954862 68 -1.42419958 0.02222911 69 -1.41001248 -1.42419958 70 2.09819274 -1.41001248 71 6.10256924 2.09819274 72 2.60651945 6.10256924 73 1.46911346 2.60651945 74 -5.85786832 1.46911346 75 -3.56014907 -5.85786832 76 -0.78928521 -3.56014907 77 -1.07648915 -0.78928521 78 0.28964843 -1.07648915 79 -2.57857862 0.28964843 80 -1.75008817 -2.57857862 81 -1.52422982 -1.75008817 82 2.47475147 -1.52422982 83 0.93851704 2.47475147 84 2.04298806 0.93851704 85 2.92673077 2.04298806 86 3.04307925 2.92673077 87 5.91278455 3.04307925 88 2.94843528 5.91278455 89 8.61808604 2.94843528 90 4.07945288 8.61808604 91 0.20047241 4.07945288 92 5.85063218 0.20047241 93 -0.28323630 5.85063218 94 0.70572991 -0.28323630 95 -3.38527487 0.70572991 96 0.36443138 -3.38527487 97 -6.25415219 0.36443138 98 -7.41017821 -6.25415219 99 -9.92876331 -7.41017821 100 -10.52419245 -9.92876331 101 -5.75721489 -10.52419245 102 -6.87195857 -5.75721489 103 -8.53352590 -6.87195857 104 -9.85364492 -8.53352590 105 -1.69356254 -9.85364492 106 -0.10411323 -1.69356254 107 0.07585055 -0.10411323 108 -6.81413303 0.07585055 109 -4.84419788 -6.81413303 110 -6.34058485 -4.84419788 111 -6.95549837 -6.34058485 112 -4.23299670 -6.95549837 113 -6.99203200 -4.23299670 114 -1.18163943 -6.99203200 115 -1.30767845 -1.18163943 116 -3.24642815 -1.30767845 117 2.34959365 -3.24642815 118 5.28268621 2.34959365 119 5.01532941 5.28268621 120 0.50837938 5.01532941 121 3.72848719 0.50837938 122 5.01905309 3.72848719 123 3.76364485 5.01905309 124 1.61786863 3.76364485 125 9.67475582 1.61786863 126 5.32447118 9.67475582 127 4.81149036 5.32447118 128 3.98897924 4.81149036 129 6.13321898 3.98897924 130 2.95646277 6.13321898 131 0.76961678 2.95646277 132 -2.69068292 0.76961678 133 -3.67249850 -2.69068292 134 5.33606743 -3.67249850 135 2.51910675 5.33606743 136 0.13740077 2.51910675 137 4.16572946 0.13740077 138 1.16701499 4.16572946 139 1.33899551 1.16701499 140 -2.88769099 1.33899551 141 -1.19635567 -2.88769099 142 0.22072944 -1.19635567 > 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/fisher/rcomp/tmp/7aras1351894379.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/fisher/rcomp/tmp/8u1051351894379.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/fisher/rcomp/tmp/9vp1z1351894379.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/fisher/rcomp/tmp/10c2k81351894379.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/fisher/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/fisher/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/fisher/rcomp/tmp/11rvdi1351894379.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/fisher/rcomp/tmp/1201qf1351894379.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/fisher/rcomp/tmp/13m1ns1351894379.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/fisher/rcomp/tmp/14szfy1351894379.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/fisher/rcomp/tmp/15mdtc1351894379.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/fisher/rcomp/tmp/16zujz1351894379.tab") + } > > try(system("convert tmp/191xj1351894379.ps tmp/191xj1351894379.png",intern=TRUE)) character(0) > try(system("convert tmp/2zfi61351894379.ps tmp/2zfi61351894379.png",intern=TRUE)) character(0) > try(system("convert tmp/3yo471351894379.ps tmp/3yo471351894379.png",intern=TRUE)) character(0) > try(system("convert tmp/4ce4v1351894379.ps tmp/4ce4v1351894379.png",intern=TRUE)) character(0) > try(system("convert tmp/59ozp1351894379.ps tmp/59ozp1351894379.png",intern=TRUE)) character(0) > try(system("convert tmp/6kffo1351894379.ps tmp/6kffo1351894379.png",intern=TRUE)) character(0) > try(system("convert tmp/7aras1351894379.ps tmp/7aras1351894379.png",intern=TRUE)) character(0) > try(system("convert tmp/8u1051351894379.ps tmp/8u1051351894379.png",intern=TRUE)) character(0) > try(system("convert tmp/9vp1z1351894379.ps tmp/9vp1z1351894379.png",intern=TRUE)) character(0) > try(system("convert tmp/10c2k81351894379.ps tmp/10c2k81351894379.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 7.585 1.150 8.737