R version 2.9.0 (2009-04-17) Copyright (C) 2009 The R Foundation for Statistical Computing ISBN 3-900051-07-0 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > x <- array(list(110.3672031 + ,0 + ,102.1880309 + ,114.0150276 + ,108.1560276 + ,100 + ,96.8602511 + ,0 + ,110.3672031 + ,102.1880309 + ,114.0150276 + ,108.1560276 + ,94.1944583 + ,0 + ,96.8602511 + ,110.3672031 + ,102.1880309 + ,114.0150276 + ,99.51621961 + ,0 + ,94.1944583 + ,96.8602511 + ,110.3672031 + ,102.1880309 + ,94.06333487 + ,0 + ,99.51621961 + ,94.1944583 + ,96.8602511 + ,110.3672031 + ,97.5541476 + ,0 + ,94.06333487 + ,99.51621961 + ,94.1944583 + ,96.8602511 + ,78.15062422 + ,0 + ,97.5541476 + ,94.06333487 + ,99.51621961 + ,94.1944583 + ,81.2434643 + ,0 + ,78.15062422 + ,97.5541476 + ,94.06333487 + ,99.51621961 + ,92.36262465 + ,0 + ,81.2434643 + ,78.15062422 + ,97.5541476 + ,94.06333487 + ,96.06324371 + ,0 + ,92.36262465 + ,81.2434643 + ,78.15062422 + ,97.5541476 + ,114.0523777 + ,0 + ,96.06324371 + ,92.36262465 + ,81.2434643 + ,78.15062422 + ,110.6616666 + ,0 + ,114.0523777 + ,96.06324371 + ,92.36262465 + ,81.2434643 + ,104.9171949 + ,0 + ,110.6616666 + ,114.0523777 + ,96.06324371 + ,92.36262465 + ,90.00187193 + ,0 + ,104.9171949 + ,110.6616666 + ,114.0523777 + ,96.06324371 + ,95.7008067 + ,0 + ,90.00187193 + ,104.9171949 + ,110.6616666 + ,114.0523777 + ,86.02741157 + ,0 + ,95.7008067 + ,90.00187193 + ,104.9171949 + ,110.6616666 + ,84.85287668 + ,0 + ,86.02741157 + ,95.7008067 + ,90.00187193 + ,104.9171949 + ,100.04328 + ,0 + ,84.85287668 + ,86.02741157 + ,95.7008067 + ,90.00187193 + ,80.91713823 + ,0 + ,100.04328 + ,84.85287668 + ,86.02741157 + ,95.7008067 + ,74.06539709 + ,0 + ,80.91713823 + ,100.04328 + ,84.85287668 + ,86.02741157 + ,77.30281369 + ,0 + ,74.06539709 + ,80.91713823 + ,100.04328 + ,84.85287668 + ,97.23043249 + ,0 + ,77.30281369 + ,74.06539709 + ,80.91713823 + ,100.04328 + ,90.75515676 + ,0 + ,97.23043249 + ,77.30281369 + ,74.06539709 + ,80.91713823 + ,100.5614455 + ,0 + ,90.75515676 + ,97.23043249 + ,77.30281369 + ,74.06539709 + ,92.01293267 + ,0 + ,100.5614455 + ,90.75515676 + ,97.23043249 + ,77.30281369 + ,99.24012138 + ,0 + ,92.01293267 + ,100.5614455 + ,90.75515676 + ,97.23043249 + ,105.8672755 + ,0 + ,99.24012138 + ,92.01293267 + ,100.5614455 + ,90.75515676 + ,90.9920463 + ,0 + ,105.8672755 + ,99.24012138 + ,92.01293267 + ,100.5614455 + ,93.30624423 + ,0 + ,90.9920463 + ,105.8672755 + ,99.24012138 + ,92.01293267 + ,91.17419413 + ,0 + ,93.30624423 + ,90.9920463 + ,105.8672755 + ,99.24012138 + ,77.33295039 + ,0 + ,91.17419413 + ,93.30624423 + ,90.9920463 + ,105.8672755 + ,91.1277721 + ,0 + ,77.33295039 + ,91.17419413 + ,93.30624423 + ,90.9920463 + ,85.01249943 + ,0 + ,91.1277721 + ,77.33295039 + ,91.17419413 + ,93.30624423 + ,83.90390242 + ,0 + ,85.01249943 + ,91.1277721 + ,77.33295039 + ,91.17419413 + ,104.8626302 + ,0 + ,83.90390242 + ,85.01249943 + ,91.1277721 + ,77.33295039 + ,110.9039108 + ,0 + ,104.8626302 + ,83.90390242 + ,85.01249943 + ,91.1277721 + ,95.43714373 + ,0 + ,110.9039108 + ,104.8626302 + ,83.90390242 + ,85.01249943 + ,111.6238727 + ,0 + ,95.43714373 + ,110.9039108 + ,104.8626302 + ,83.90390242 + ,108.8925403 + ,0 + ,111.6238727 + ,95.43714373 + ,110.9039108 + ,104.8626302 + ,96.17511682 + ,0 + ,108.8925403 + ,111.6238727 + ,95.43714373 + ,110.9039108 + ,101.9740205 + ,0 + ,96.17511682 + ,108.8925403 + ,111.6238727 + ,95.43714373 + ,99.11953031 + ,0 + ,101.9740205 + ,96.17511682 + ,108.8925403 + ,111.6238727 + ,86.78158147 + ,0 + ,99.11953031 + ,101.9740205 + ,96.17511682 + ,108.8925403 + ,118.4195003 + ,0 + ,86.78158147 + ,99.11953031 + ,101.9740205 + ,96.17511682 + ,118.7441447 + ,0 + ,118.4195003 + ,86.78158147 + ,99.11953031 + ,101.9740205 + ,106.5296192 + ,0 + ,118.7441447 + ,118.4195003 + ,86.78158147 + ,99.11953031 + ,134.7772694 + ,0 + ,106.5296192 + ,118.7441447 + ,118.4195003 + ,86.78158147 + ,104.6778714 + ,0 + ,134.7772694 + ,106.5296192 + ,118.7441447 + ,118.4195003 + ,105.2954304 + ,0 + ,104.6778714 + ,134.7772694 + ,106.5296192 + ,118.7441447 + ,139.4139849 + ,0 + ,105.2954304 + ,104.6778714 + ,134.7772694 + ,106.5296192 + ,103.6060491 + ,0 + ,139.4139849 + ,105.2954304 + ,104.6778714 + ,134.7772694 + ,99.78182974 + ,0 + ,103.6060491 + ,139.4139849 + ,105.2954304 + ,104.6778714 + ,103.4610301 + ,0 + ,99.78182974 + ,103.6060491 + ,139.4139849 + ,105.2954304 + ,120.0594945 + ,0 + ,103.4610301 + ,99.78182974 + ,103.6060491 + ,139.4139849 + ,96.71377168 + ,0 + ,120.0594945 + ,103.4610301 + ,99.78182974 + ,103.6060491 + ,107.1308929 + ,0 + ,96.71377168 + ,120.0594945 + ,103.4610301 + ,99.78182974 + ,105.3608372 + ,0 + ,107.1308929 + ,96.71377168 + ,120.0594945 + ,103.4610301 + ,111.6942359 + ,0 + ,105.3608372 + ,107.1308929 + ,96.71377168 + ,120.0594945 + ,132.0519998 + ,0 + ,111.6942359 + ,105.3608372 + ,107.1308929 + ,96.71377168 + ,126.8037879 + ,0 + ,132.0519998 + ,111.6942359 + ,105.3608372 + ,107.1308929 + ,154.4824253 + ,0 + ,126.8037879 + ,132.0519998 + ,111.6942359 + ,105.3608372 + ,141.5570984 + ,0 + ,154.4824253 + ,126.8037879 + ,132.0519998 + ,111.6942359 + ,109.9506882 + ,0 + ,141.5570984 + ,154.4824253 + ,126.8037879 + ,132.0519998 + ,127.904198 + ,0 + ,109.9506882 + ,141.5570984 + ,154.4824253 + ,126.8037879 + ,133.0888617 + ,0 + ,127.904198 + ,109.9506882 + ,141.5570984 + ,154.4824253 + ,120.0796299 + ,0 + ,133.0888617 + ,127.904198 + ,109.9506882 + ,141.5570984 + ,117.5557142 + ,0 + ,120.0796299 + ,133.0888617 + ,127.904198 + ,109.9506882 + ,143.0362309 + ,0 + ,117.5557142 + ,120.0796299 + ,133.0888617 + ,127.904198 + ,159.982927 + ,1 + ,143.0362309 + ,117.5557142 + ,120.0796299 + ,133.0888617 + ,128.5991124 + ,1 + ,159.982927 + ,143.0362309 + ,117.5557142 + ,120.0796299 + ,149.7373327 + ,1 + ,128.5991124 + ,159.982927 + ,143.0362309 + ,117.5557142 + ,126.8169313 + ,1 + ,149.7373327 + ,128.5991124 + ,159.982927 + ,143.0362309 + ,140.9639674 + ,1 + ,126.8169313 + ,149.7373327 + ,128.5991124 + ,159.982927 + ,137.6691981 + ,1 + ,140.9639674 + ,126.8169313 + ,149.7373327 + ,128.5991124 + ,117.9402337 + ,1 + ,137.6691981 + ,140.9639674 + ,126.8169313 + ,149.7373327 + ,122.3095247 + ,1 + ,117.9402337 + ,137.6691981 + ,140.9639674 + ,126.8169313 + ,127.7804207 + ,1 + ,122.3095247 + ,117.9402337 + ,137.6691981 + ,140.9639674 + ,136.1677176 + ,1 + ,127.7804207 + ,122.3095247 + ,117.9402337 + ,137.6691981 + ,116.2405856 + ,1 + ,136.1677176 + ,127.7804207 + ,122.3095247 + ,117.9402337 + ,123.1576893 + ,1 + ,116.2405856 + ,136.1677176 + ,127.7804207 + ,122.3095247 + ,116.3400234 + ,1 + ,123.1576893 + ,116.2405856 + ,136.1677176 + ,127.7804207 + ,108.6119282 + ,1 + ,116.3400234 + ,123.1576893 + ,116.2405856 + ,136.1677176 + ,125.8982264 + ,1 + ,108.6119282 + ,116.3400234 + ,123.1576893 + ,116.2405856 + ,112.8003105 + ,1 + ,125.8982264 + ,108.6119282 + ,116.3400234 + ,123.1576893 + ,107.5182447 + ,1 + ,112.8003105 + ,125.8982264 + ,108.6119282 + ,116.3400234 + ,135.0955413 + ,1 + ,107.5182447 + ,112.8003105 + ,125.8982264 + ,108.6119282 + ,115.5096488 + ,1 + ,135.0955413 + ,107.5182447 + ,112.8003105 + ,125.8982264 + ,115.8640759 + ,1 + ,115.5096488 + ,135.0955413 + ,107.5182447 + ,112.8003105 + ,104.5883906 + ,1 + ,115.8640759 + ,115.5096488 + ,135.0955413 + ,107.5182447 + ,163.7213386 + ,1 + ,104.5883906 + ,115.8640759 + ,115.5096488 + ,135.0955413 + ,113.4482275 + ,1 + ,163.7213386 + ,104.5883906 + ,115.8640759 + ,115.5096488 + ,98.0428844 + ,1 + ,113.4482275 + ,163.7213386 + ,104.5883906 + ,115.8640759 + ,116.7868521 + ,1 + ,98.0428844 + ,113.4482275 + ,163.7213386 + ,104.5883906 + ,126.5330444 + ,1 + ,116.7868521 + ,98.0428844 + ,113.4482275 + ,163.7213386 + ,113.0336597 + ,1 + ,126.5330444 + ,116.7868521 + ,98.0428844 + ,113.4482275 + ,124.3392163 + ,1 + ,113.0336597 + ,126.5330444 + ,116.7868521 + ,98.0428844 + ,109.8298759 + ,1 + ,124.3392163 + ,113.0336597 + ,126.5330444 + ,116.7868521 + ,124.4434777 + ,1 + ,109.8298759 + ,124.3392163 + ,113.0336597 + ,126.5330444 + ,111.5039454 + ,1 + ,124.4434777 + ,109.8298759 + ,124.3392163 + ,113.0336597 + ,102.0350019 + ,1 + ,111.5039454 + ,124.4434777 + ,109.8298759 + ,124.3392163 + ,116.8726598 + ,1 + ,102.0350019 + ,111.5039454 + ,124.4434777 + ,109.8298759 + ,112.2073122 + ,1 + ,116.8726598 + ,102.0350019 + ,111.5039454 + ,124.4434777 + ,101.1513902 + ,1 + ,112.2073122 + ,116.8726598 + ,102.0350019 + ,111.5039454 + ,124.4255108 + ,1 + ,101.1513902 + ,112.2073122 + ,116.8726598 + ,102.0350019) + ,dim=c(6 + ,104) + ,dimnames=list(c('Y' + ,'X' + ,'Y1' + ,'Y2' + ,'Y3' + ,'Y4') + ,1:104)) > y <- array(NA,dim=c(6,104),dimnames=list(c('Y','X','Y1','Y2','Y3','Y4'),1:104)) > for (i in 1:dim(x)[1]) + { + for (j in 1:dim(x)[2]) + { + y[i,j] <- as.numeric(x[i,j]) + } + } > par3 = 'Linear Trend' > par2 = 'Include Monthly Dummies' > par1 = '1' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Prof. Dr. P. Wessa > #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/ > #Source of accompanying publication: Office for Research, Development, and Education > #Technical description: Write here your technical program description (don't use hard returns!) > library(lattice) > library(lmtest) Loading required package: zoo Attaching package: 'zoo' The following object(s) are masked from package:base : as.Date.numeric > n25 <- 25 #minimum number of obs. for Goldfeld-Quandt test > par1 <- as.numeric(par1) > x <- t(y) > k <- length(x[1,]) > n <- length(x[,1]) > x1 <- cbind(x[,par1], x[,1:k!=par1]) > mycolnames <- c(colnames(x)[par1], colnames(x)[1:k!=par1]) > colnames(x1) <- mycolnames #colnames(x)[par1] > x <- x1 > if (par3 == 'First Differences'){ + x2 <- array(0, dim=c(n-1,k), dimnames=list(1:(n-1), paste('(1-B)',colnames(x),sep=''))) + for (i in 1:n-1) { + for (j in 1:k) { + x2[i,j] <- x[i+1,j] - x[i,j] + } + } + x <- x2 + } > if (par2 == 'Include Monthly Dummies'){ + x2 <- array(0, dim=c(n,11), dimnames=list(1:n, paste('M', seq(1:11), sep =''))) + for (i in 1:11){ + x2[seq(i,n,12),i] <- 1 + } + x <- cbind(x, x2) + } > if (par2 == 'Include Quarterly Dummies'){ + x2 <- array(0, dim=c(n,3), dimnames=list(1:n, paste('Q', seq(1:3), sep =''))) + for (i in 1:3){ + x2[seq(i,n,4),i] <- 1 + } + x <- cbind(x, x2) + } > k <- length(x[1,]) > if (par3 == 'Linear Trend'){ + x <- cbind(x, c(1:n)) + colnames(x)[k+1] <- 't' + } > x Y X Y1 Y2 Y3 Y4 M1 M2 M3 M4 M5 M6 M7 M8 1 110.36720 0 102.18803 114.01503 108.15603 100.00000 1 0 0 0 0 0 0 0 2 96.86025 0 110.36720 102.18803 114.01503 108.15603 0 1 0 0 0 0 0 0 3 94.19446 0 96.86025 110.36720 102.18803 114.01503 0 0 1 0 0 0 0 0 4 99.51622 0 94.19446 96.86025 110.36720 102.18803 0 0 0 1 0 0 0 0 5 94.06333 0 99.51622 94.19446 96.86025 110.36720 0 0 0 0 1 0 0 0 6 97.55415 0 94.06333 99.51622 94.19446 96.86025 0 0 0 0 0 1 0 0 7 78.15062 0 97.55415 94.06333 99.51622 94.19446 0 0 0 0 0 0 1 0 8 81.24346 0 78.15062 97.55415 94.06333 99.51622 0 0 0 0 0 0 0 1 9 92.36262 0 81.24346 78.15062 97.55415 94.06333 0 0 0 0 0 0 0 0 10 96.06324 0 92.36262 81.24346 78.15062 97.55415 0 0 0 0 0 0 0 0 11 114.05238 0 96.06324 92.36262 81.24346 78.15062 0 0 0 0 0 0 0 0 12 110.66167 0 114.05238 96.06324 92.36262 81.24346 0 0 0 0 0 0 0 0 13 104.91719 0 110.66167 114.05238 96.06324 92.36262 1 0 0 0 0 0 0 0 14 90.00187 0 104.91719 110.66167 114.05238 96.06324 0 1 0 0 0 0 0 0 15 95.70081 0 90.00187 104.91719 110.66167 114.05238 0 0 1 0 0 0 0 0 16 86.02741 0 95.70081 90.00187 104.91719 110.66167 0 0 0 1 0 0 0 0 17 84.85288 0 86.02741 95.70081 90.00187 104.91719 0 0 0 0 1 0 0 0 18 100.04328 0 84.85288 86.02741 95.70081 90.00187 0 0 0 0 0 1 0 0 19 80.91714 0 100.04328 84.85288 86.02741 95.70081 0 0 0 0 0 0 1 0 20 74.06540 0 80.91714 100.04328 84.85288 86.02741 0 0 0 0 0 0 0 1 21 77.30281 0 74.06540 80.91714 100.04328 84.85288 0 0 0 0 0 0 0 0 22 97.23043 0 77.30281 74.06540 80.91714 100.04328 0 0 0 0 0 0 0 0 23 90.75516 0 97.23043 77.30281 74.06540 80.91714 0 0 0 0 0 0 0 0 24 100.56145 0 90.75516 97.23043 77.30281 74.06540 0 0 0 0 0 0 0 0 25 92.01293 0 100.56145 90.75516 97.23043 77.30281 1 0 0 0 0 0 0 0 26 99.24012 0 92.01293 100.56145 90.75516 97.23043 0 1 0 0 0 0 0 0 27 105.86728 0 99.24012 92.01293 100.56145 90.75516 0 0 1 0 0 0 0 0 28 90.99205 0 105.86728 99.24012 92.01293 100.56145 0 0 0 1 0 0 0 0 29 93.30624 0 90.99205 105.86728 99.24012 92.01293 0 0 0 0 1 0 0 0 30 91.17419 0 93.30624 90.99205 105.86728 99.24012 0 0 0 0 0 1 0 0 31 77.33295 0 91.17419 93.30624 90.99205 105.86728 0 0 0 0 0 0 1 0 32 91.12777 0 77.33295 91.17419 93.30624 90.99205 0 0 0 0 0 0 0 1 33 85.01250 0 91.12777 77.33295 91.17419 93.30624 0 0 0 0 0 0 0 0 34 83.90390 0 85.01250 91.12777 77.33295 91.17419 0 0 0 0 0 0 0 0 35 104.86263 0 83.90390 85.01250 91.12777 77.33295 0 0 0 0 0 0 0 0 36 110.90391 0 104.86263 83.90390 85.01250 91.12777 0 0 0 0 0 0 0 0 37 95.43714 0 110.90391 104.86263 83.90390 85.01250 1 0 0 0 0 0 0 0 38 111.62387 0 95.43714 110.90391 104.86263 83.90390 0 1 0 0 0 0 0 0 39 108.89254 0 111.62387 95.43714 110.90391 104.86263 0 0 1 0 0 0 0 0 40 96.17512 0 108.89254 111.62387 95.43714 110.90391 0 0 0 1 0 0 0 0 41 101.97402 0 96.17512 108.89254 111.62387 95.43714 0 0 0 0 1 0 0 0 42 99.11953 0 101.97402 96.17512 108.89254 111.62387 0 0 0 0 0 1 0 0 43 86.78158 0 99.11953 101.97402 96.17512 108.89254 0 0 0 0 0 0 1 0 44 118.41950 0 86.78158 99.11953 101.97402 96.17512 0 0 0 0 0 0 0 1 45 118.74414 0 118.41950 86.78158 99.11953 101.97402 0 0 0 0 0 0 0 0 46 106.52962 0 118.74414 118.41950 86.78158 99.11953 0 0 0 0 0 0 0 0 47 134.77727 0 106.52962 118.74414 118.41950 86.78158 0 0 0 0 0 0 0 0 48 104.67787 0 134.77727 106.52962 118.74414 118.41950 0 0 0 0 0 0 0 0 49 105.29543 0 104.67787 134.77727 106.52962 118.74414 1 0 0 0 0 0 0 0 50 139.41398 0 105.29543 104.67787 134.77727 106.52962 0 1 0 0 0 0 0 0 51 103.60605 0 139.41398 105.29543 104.67787 134.77727 0 0 1 0 0 0 0 0 52 99.78183 0 103.60605 139.41398 105.29543 104.67787 0 0 0 1 0 0 0 0 53 103.46103 0 99.78183 103.60605 139.41398 105.29543 0 0 0 0 1 0 0 0 54 120.05949 0 103.46103 99.78183 103.60605 139.41398 0 0 0 0 0 1 0 0 55 96.71377 0 120.05949 103.46103 99.78183 103.60605 0 0 0 0 0 0 1 0 56 107.13089 0 96.71377 120.05949 103.46103 99.78183 0 0 0 0 0 0 0 1 57 105.36084 0 107.13089 96.71377 120.05949 103.46103 0 0 0 0 0 0 0 0 58 111.69424 0 105.36084 107.13089 96.71377 120.05949 0 0 0 0 0 0 0 0 59 132.05200 0 111.69424 105.36084 107.13089 96.71377 0 0 0 0 0 0 0 0 60 126.80379 0 132.05200 111.69424 105.36084 107.13089 0 0 0 0 0 0 0 0 61 154.48243 0 126.80379 132.05200 111.69424 105.36084 1 0 0 0 0 0 0 0 62 141.55710 0 154.48243 126.80379 132.05200 111.69424 0 1 0 0 0 0 0 0 63 109.95069 0 141.55710 154.48243 126.80379 132.05200 0 0 1 0 0 0 0 0 64 127.90420 0 109.95069 141.55710 154.48243 126.80379 0 0 0 1 0 0 0 0 65 133.08886 0 127.90420 109.95069 141.55710 154.48243 0 0 0 0 1 0 0 0 66 120.07963 0 133.08886 127.90420 109.95069 141.55710 0 0 0 0 0 1 0 0 67 117.55571 0 120.07963 133.08886 127.90420 109.95069 0 0 0 0 0 0 1 0 68 143.03623 0 117.55571 120.07963 133.08886 127.90420 0 0 0 0 0 0 0 1 69 159.98293 1 143.03623 117.55571 120.07963 133.08886 0 0 0 0 0 0 0 0 70 128.59911 1 159.98293 143.03623 117.55571 120.07963 0 0 0 0 0 0 0 0 71 149.73733 1 128.59911 159.98293 143.03623 117.55571 0 0 0 0 0 0 0 0 72 126.81693 1 149.73733 128.59911 159.98293 143.03623 0 0 0 0 0 0 0 0 73 140.96397 1 126.81693 149.73733 128.59911 159.98293 1 0 0 0 0 0 0 0 74 137.66920 1 140.96397 126.81693 149.73733 128.59911 0 1 0 0 0 0 0 0 75 117.94023 1 137.66920 140.96397 126.81693 149.73733 0 0 1 0 0 0 0 0 76 122.30952 1 117.94023 137.66920 140.96397 126.81693 0 0 0 1 0 0 0 0 77 127.78042 1 122.30952 117.94023 137.66920 140.96397 0 0 0 0 1 0 0 0 78 136.16772 1 127.78042 122.30952 117.94023 137.66920 0 0 0 0 0 1 0 0 79 116.24059 1 136.16772 127.78042 122.30952 117.94023 0 0 0 0 0 0 1 0 80 123.15769 1 116.24059 136.16772 127.78042 122.30952 0 0 0 0 0 0 0 1 81 116.34002 1 123.15769 116.24059 136.16772 127.78042 0 0 0 0 0 0 0 0 82 108.61193 1 116.34002 123.15769 116.24059 136.16772 0 0 0 0 0 0 0 0 83 125.89823 1 108.61193 116.34002 123.15769 116.24059 0 0 0 0 0 0 0 0 84 112.80031 1 125.89823 108.61193 116.34002 123.15769 0 0 0 0 0 0 0 0 85 107.51824 1 112.80031 125.89823 108.61193 116.34002 1 0 0 0 0 0 0 0 86 135.09554 1 107.51824 112.80031 125.89823 108.61193 0 1 0 0 0 0 0 0 87 115.50965 1 135.09554 107.51824 112.80031 125.89823 0 0 1 0 0 0 0 0 88 115.86408 1 115.50965 135.09554 107.51824 112.80031 0 0 0 1 0 0 0 0 89 104.58839 1 115.86408 115.50965 135.09554 107.51824 0 0 0 0 1 0 0 0 90 163.72134 1 104.58839 115.86408 115.50965 135.09554 0 0 0 0 0 1 0 0 91 113.44823 1 163.72134 104.58839 115.86408 115.50965 0 0 0 0 0 0 1 0 92 98.04288 1 113.44823 163.72134 104.58839 115.86408 0 0 0 0 0 0 0 1 93 116.78685 1 98.04288 113.44823 163.72134 104.58839 0 0 0 0 0 0 0 0 94 126.53304 1 116.78685 98.04288 113.44823 163.72134 0 0 0 0 0 0 0 0 95 113.03366 1 126.53304 116.78685 98.04288 113.44823 0 0 0 0 0 0 0 0 96 124.33922 1 113.03366 126.53304 116.78685 98.04288 0 0 0 0 0 0 0 0 97 109.82988 1 124.33922 113.03366 126.53304 116.78685 1 0 0 0 0 0 0 0 98 124.44348 1 109.82988 124.33922 113.03366 126.53304 0 1 0 0 0 0 0 0 99 111.50395 1 124.44348 109.82988 124.33922 113.03366 0 0 1 0 0 0 0 0 100 102.03500 1 111.50395 124.44348 109.82988 124.33922 0 0 0 1 0 0 0 0 101 116.87266 1 102.03500 111.50395 124.44348 109.82988 0 0 0 0 1 0 0 0 102 112.20731 1 116.87266 102.03500 111.50395 124.44348 0 0 0 0 0 1 0 0 103 101.15139 1 112.20731 116.87266 102.03500 111.50395 0 0 0 0 0 0 1 0 104 124.42551 1 101.15139 112.20731 116.87266 102.03500 0 0 0 0 0 0 0 1 M9 M10 M11 t 1 0 0 0 1 2 0 0 0 2 3 0 0 0 3 4 0 0 0 4 5 0 0 0 5 6 0 0 0 6 7 0 0 0 7 8 0 0 0 8 9 1 0 0 9 10 0 1 0 10 11 0 0 1 11 12 0 0 0 12 13 0 0 0 13 14 0 0 0 14 15 0 0 0 15 16 0 0 0 16 17 0 0 0 17 18 0 0 0 18 19 0 0 0 19 20 0 0 0 20 21 1 0 0 21 22 0 1 0 22 23 0 0 1 23 24 0 0 0 24 25 0 0 0 25 26 0 0 0 26 27 0 0 0 27 28 0 0 0 28 29 0 0 0 29 30 0 0 0 30 31 0 0 0 31 32 0 0 0 32 33 1 0 0 33 34 0 1 0 34 35 0 0 1 35 36 0 0 0 36 37 0 0 0 37 38 0 0 0 38 39 0 0 0 39 40 0 0 0 40 41 0 0 0 41 42 0 0 0 42 43 0 0 0 43 44 0 0 0 44 45 1 0 0 45 46 0 1 0 46 47 0 0 1 47 48 0 0 0 48 49 0 0 0 49 50 0 0 0 50 51 0 0 0 51 52 0 0 0 52 53 0 0 0 53 54 0 0 0 54 55 0 0 0 55 56 0 0 0 56 57 1 0 0 57 58 0 1 0 58 59 0 0 1 59 60 0 0 0 60 61 0 0 0 61 62 0 0 0 62 63 0 0 0 63 64 0 0 0 64 65 0 0 0 65 66 0 0 0 66 67 0 0 0 67 68 0 0 0 68 69 1 0 0 69 70 0 1 0 70 71 0 0 1 71 72 0 0 0 72 73 0 0 0 73 74 0 0 0 74 75 0 0 0 75 76 0 0 0 76 77 0 0 0 77 78 0 0 0 78 79 0 0 0 79 80 0 0 0 80 81 1 0 0 81 82 0 1 0 82 83 0 0 1 83 84 0 0 0 84 85 0 0 0 85 86 0 0 0 86 87 0 0 0 87 88 0 0 0 88 89 0 0 0 89 90 0 0 0 90 91 0 0 0 91 92 0 0 0 92 93 1 0 0 93 94 0 1 0 94 95 0 0 1 95 96 0 0 0 96 97 0 0 0 97 98 0 0 0 98 99 0 0 0 99 100 0 0 0 100 101 0 0 0 101 102 0 0 0 102 103 0 0 0 103 104 0 0 0 104 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) X Y1 Y2 Y3 Y4 23.66160 -6.28343 0.25913 0.06786 0.30057 0.11954 M1 M2 M3 M4 M5 M6 0.44712 3.13191 -10.66731 -9.76718 -8.14522 3.22707 M7 M8 M9 M10 M11 t -16.24578 -2.16575 -2.42716 -1.16358 11.82600 0.17752 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -19.737656 -8.726920 -0.000861 6.327707 41.306614 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 23.66160 11.84488 1.998 0.04892 * X -6.28343 4.41128 -1.424 0.15795 Y1 0.25913 0.10664 2.430 0.01718 * Y2 0.06786 0.10574 0.642 0.52272 Y3 0.30057 0.10604 2.834 0.00572 ** Y4 0.11954 0.10777 1.109 0.27041 M1 0.44712 6.06951 0.074 0.94145 M2 3.13191 5.98013 0.524 0.60182 M3 -10.66731 6.02045 -1.772 0.07996 . M4 -9.76718 6.29317 -1.552 0.12433 M5 -8.14522 6.26395 -1.300 0.19696 M6 3.22707 6.31597 0.511 0.61070 M7 -16.24578 5.83511 -2.784 0.00660 ** M8 -2.16575 6.51221 -0.333 0.74027 M9 -2.42716 6.29611 -0.386 0.70082 M10 -1.16358 6.44509 -0.181 0.85715 M11 11.82600 6.10335 1.938 0.05595 . t 0.17752 0.07839 2.265 0.02605 * --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 11.87 on 86 degrees of freedom Multiple R-squared: 0.659, Adjusted R-squared: 0.5916 F-statistic: 9.775 on 17 and 86 DF, p-value: 9.968e-14 > 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.101298808 0.202597616 0.8987012 [2,] 0.045533126 0.091066251 0.9544669 [3,] 0.153679177 0.307358355 0.8463208 [4,] 0.087195888 0.174391775 0.9128041 [5,] 0.053211085 0.106422170 0.9467889 [6,] 0.066779215 0.133558429 0.9332208 [7,] 0.129966155 0.259932310 0.8700338 [8,] 0.083352523 0.166705047 0.9166475 [9,] 0.058059933 0.116119865 0.9419401 [10,] 0.037279531 0.074559062 0.9627205 [11,] 0.024008360 0.048016720 0.9759916 [12,] 0.038840575 0.077681150 0.9611594 [13,] 0.026084798 0.052169596 0.9739152 [14,] 0.022306206 0.044612413 0.9776938 [15,] 0.014133587 0.028267175 0.9858664 [16,] 0.010395603 0.020791205 0.9896044 [17,] 0.006241904 0.012483807 0.9937581 [18,] 0.011905684 0.023811368 0.9880943 [19,] 0.008939773 0.017879546 0.9910602 [20,] 0.005583473 0.011166946 0.9944165 [21,] 0.003310498 0.006620997 0.9966895 [22,] 0.002837717 0.005675433 0.9971623 [23,] 0.001939104 0.003878208 0.9980609 [24,] 0.013824004 0.027648009 0.9861760 [25,] 0.017019109 0.034038219 0.9829809 [26,] 0.012132680 0.024265360 0.9878673 [27,] 0.008539814 0.017079628 0.9914602 [28,] 0.026815028 0.053630056 0.9731850 [29,] 0.021839895 0.043679791 0.9781601 [30,] 0.039083187 0.078166374 0.9609168 [31,] 0.029819485 0.059638969 0.9701805 [32,] 0.021800068 0.043600136 0.9781999 [33,] 0.023975679 0.047951358 0.9760243 [34,] 0.031350330 0.062700661 0.9686497 [35,] 0.026797765 0.053595530 0.9732022 [36,] 0.024667492 0.049334983 0.9753325 [37,] 0.037504830 0.075009659 0.9624952 [38,] 0.035882960 0.071765920 0.9641170 [39,] 0.031004407 0.062008814 0.9689956 [40,] 0.023472024 0.046944049 0.9765280 [41,] 0.121438277 0.242876553 0.8785617 [42,] 0.095728673 0.191457345 0.9042713 [43,] 0.091307412 0.182614824 0.9086926 [44,] 0.067233026 0.134466053 0.9327670 [45,] 0.051631843 0.103263685 0.9483682 [46,] 0.067644726 0.135289451 0.9323553 [47,] 0.056157969 0.112315938 0.9438420 [48,] 0.047641200 0.095282401 0.9523588 [49,] 0.160187502 0.320375004 0.8398125 [50,] 0.284651138 0.569302277 0.7153489 [51,] 0.369721158 0.739442315 0.6302788 [52,] 0.421997812 0.843995625 0.5780022 [53,] 0.442636543 0.885273086 0.5573635 [54,] 0.363160191 0.726320383 0.6368398 [55,] 0.288064507 0.576129014 0.7119355 [56,] 0.214394161 0.428788323 0.7856058 [57,] 0.154686239 0.309372479 0.8453138 [58,] 0.107559446 0.215118893 0.8924406 [59,] 0.066592557 0.133185113 0.9334074 [60,] 0.039165046 0.078330092 0.9608350 [61,] 0.025003703 0.050007406 0.9749963 [62,] 0.020697248 0.041394497 0.9793028 [63,] 0.016252476 0.032504953 0.9837475 > postscript(file="/var/www/html/rcomp/tmp/1tptx1258618612.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(x[,1], type='l', main='Actuals and Interpolation', ylab='value of Actuals and Interpolation (dots)', xlab='time or index') > points(x[,1]-mysum$resid) > grid() > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/2cw3t1258618612.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(mysum$resid, type='b', pch=19, main='Residuals', ylab='value of Residuals', xlab='time or index') > grid() > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/3qrgd1258618612.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > hist(mysum$resid, main='Residual Histogram', xlab='values of Residuals') > grid() > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/4n1yu1258618612.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > densityplot(~mysum$resid,col='black',main='Residual Density Plot', xlab='values of Residuals') > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/5t6bt1258618612.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > qqnorm(mysum$resid, main='Residual Normal Q-Q Plot') > qqline(mysum$resid) > grid() > dev.off() null device 1 > (myerror <- as.ts(mysum$resid)) Time Series: Start = 1 End = 104 Frequency = 1 1 2 3 4 5 6 7.4015059 -13.0206816 3.7346335 8.5415704 3.1730316 -1.4181589 7 8 9 10 11 12 -3.3417517 -8.7125486 2.6084011 7.1914762 11.6900126 11.3233607 13 14 15 16 17 18 2.1706373 -19.7376557 2.7064314 -6.3773052 -2.0616189 2.6099021 19 20 21 22 23 24 1.1487293 -14.5257884 -12.5564215 9.4888856 -11.1911947 10.4352685 25 26 27 28 29 30 -7.2161636 -1.7375502 15.0452673 -1.7182375 1.0510630 -15.0769221 31 32 33 34 35 36 -5.5486423 -1.1973273 -9.4999372 -6.9859992 -0.9837359 11.5391654 37 38 39 40 41 42 -6.4757071 4.2796984 7.7038575 -2.5552859 1.9087340 -14.2493307 43 44 45 46 47 48 -2.7968260 17.7517230 10.9639007 -0.8731595 9.3161550 -19.5054282 49 50 51 52 53 54 -9.9972561 16.1113748 -9.2878994 -3.8135203 -8.8416406 2.1970949 55 56 57 58 59 60 -0.9740402 -0.5399319 -8.7700321 0.9067259 6.2361506 6.2180399 61 62 63 64 65 66 31.5585386 2.0786983 -15.2911489 2.9601100 4.4138703 -11.6620130 67 68 69 70 71 72 6.5108212 15.5660253 35.7388841 -0.8927203 6.7040321 -16.0554166 73 74 75 76 77 78 9.3789422 -1.4903643 -3.3417247 3.7737485 6.9508352 8.3978843 79 80 81 82 83 84 6.2666691 1.3540910 -8.9948319 -11.8799840 -4.9924318 -9.1745866 85 86 87 88 89 90 -9.7224469 12.9782702 2.0967202 7.7308050 -11.7644795 41.3066135 91 92 93 94 95 96 -1.9942578 -19.2958823 -9.4899632 3.0447752 -16.7789879 5.2195969 97 98 99 100 101 102 -17.0980504 0.5382100 -3.3661368 -8.5418851 5.1702048 -12.1050701 103 104 0.7292985 9.5996393 > postscript(file="/var/www/html/rcomp/tmp/6flqj1258618612.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > dum <- cbind(lag(myerror,k=1),myerror) > dum Time Series: Start = 0 End = 104 Frequency = 1 lag(myerror, k = 1) myerror 0 7.4015059 NA 1 -13.0206816 7.4015059 2 3.7346335 -13.0206816 3 8.5415704 3.7346335 4 3.1730316 8.5415704 5 -1.4181589 3.1730316 6 -3.3417517 -1.4181589 7 -8.7125486 -3.3417517 8 2.6084011 -8.7125486 9 7.1914762 2.6084011 10 11.6900126 7.1914762 11 11.3233607 11.6900126 12 2.1706373 11.3233607 13 -19.7376557 2.1706373 14 2.7064314 -19.7376557 15 -6.3773052 2.7064314 16 -2.0616189 -6.3773052 17 2.6099021 -2.0616189 18 1.1487293 2.6099021 19 -14.5257884 1.1487293 20 -12.5564215 -14.5257884 21 9.4888856 -12.5564215 22 -11.1911947 9.4888856 23 10.4352685 -11.1911947 24 -7.2161636 10.4352685 25 -1.7375502 -7.2161636 26 15.0452673 -1.7375502 27 -1.7182375 15.0452673 28 1.0510630 -1.7182375 29 -15.0769221 1.0510630 30 -5.5486423 -15.0769221 31 -1.1973273 -5.5486423 32 -9.4999372 -1.1973273 33 -6.9859992 -9.4999372 34 -0.9837359 -6.9859992 35 11.5391654 -0.9837359 36 -6.4757071 11.5391654 37 4.2796984 -6.4757071 38 7.7038575 4.2796984 39 -2.5552859 7.7038575 40 1.9087340 -2.5552859 41 -14.2493307 1.9087340 42 -2.7968260 -14.2493307 43 17.7517230 -2.7968260 44 10.9639007 17.7517230 45 -0.8731595 10.9639007 46 9.3161550 -0.8731595 47 -19.5054282 9.3161550 48 -9.9972561 -19.5054282 49 16.1113748 -9.9972561 50 -9.2878994 16.1113748 51 -3.8135203 -9.2878994 52 -8.8416406 -3.8135203 53 2.1970949 -8.8416406 54 -0.9740402 2.1970949 55 -0.5399319 -0.9740402 56 -8.7700321 -0.5399319 57 0.9067259 -8.7700321 58 6.2361506 0.9067259 59 6.2180399 6.2361506 60 31.5585386 6.2180399 61 2.0786983 31.5585386 62 -15.2911489 2.0786983 63 2.9601100 -15.2911489 64 4.4138703 2.9601100 65 -11.6620130 4.4138703 66 6.5108212 -11.6620130 67 15.5660253 6.5108212 68 35.7388841 15.5660253 69 -0.8927203 35.7388841 70 6.7040321 -0.8927203 71 -16.0554166 6.7040321 72 9.3789422 -16.0554166 73 -1.4903643 9.3789422 74 -3.3417247 -1.4903643 75 3.7737485 -3.3417247 76 6.9508352 3.7737485 77 8.3978843 6.9508352 78 6.2666691 8.3978843 79 1.3540910 6.2666691 80 -8.9948319 1.3540910 81 -11.8799840 -8.9948319 82 -4.9924318 -11.8799840 83 -9.1745866 -4.9924318 84 -9.7224469 -9.1745866 85 12.9782702 -9.7224469 86 2.0967202 12.9782702 87 7.7308050 2.0967202 88 -11.7644795 7.7308050 89 41.3066135 -11.7644795 90 -1.9942578 41.3066135 91 -19.2958823 -1.9942578 92 -9.4899632 -19.2958823 93 3.0447752 -9.4899632 94 -16.7789879 3.0447752 95 5.2195969 -16.7789879 96 -17.0980504 5.2195969 97 0.5382100 -17.0980504 98 -3.3661368 0.5382100 99 -8.5418851 -3.3661368 100 5.1702048 -8.5418851 101 -12.1050701 5.1702048 102 0.7292985 -12.1050701 103 9.5996393 0.7292985 104 NA 9.5996393 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -13.0206816 7.4015059 [2,] 3.7346335 -13.0206816 [3,] 8.5415704 3.7346335 [4,] 3.1730316 8.5415704 [5,] -1.4181589 3.1730316 [6,] -3.3417517 -1.4181589 [7,] -8.7125486 -3.3417517 [8,] 2.6084011 -8.7125486 [9,] 7.1914762 2.6084011 [10,] 11.6900126 7.1914762 [11,] 11.3233607 11.6900126 [12,] 2.1706373 11.3233607 [13,] -19.7376557 2.1706373 [14,] 2.7064314 -19.7376557 [15,] -6.3773052 2.7064314 [16,] -2.0616189 -6.3773052 [17,] 2.6099021 -2.0616189 [18,] 1.1487293 2.6099021 [19,] -14.5257884 1.1487293 [20,] -12.5564215 -14.5257884 [21,] 9.4888856 -12.5564215 [22,] -11.1911947 9.4888856 [23,] 10.4352685 -11.1911947 [24,] -7.2161636 10.4352685 [25,] -1.7375502 -7.2161636 [26,] 15.0452673 -1.7375502 [27,] -1.7182375 15.0452673 [28,] 1.0510630 -1.7182375 [29,] -15.0769221 1.0510630 [30,] -5.5486423 -15.0769221 [31,] -1.1973273 -5.5486423 [32,] -9.4999372 -1.1973273 [33,] -6.9859992 -9.4999372 [34,] -0.9837359 -6.9859992 [35,] 11.5391654 -0.9837359 [36,] -6.4757071 11.5391654 [37,] 4.2796984 -6.4757071 [38,] 7.7038575 4.2796984 [39,] -2.5552859 7.7038575 [40,] 1.9087340 -2.5552859 [41,] -14.2493307 1.9087340 [42,] -2.7968260 -14.2493307 [43,] 17.7517230 -2.7968260 [44,] 10.9639007 17.7517230 [45,] -0.8731595 10.9639007 [46,] 9.3161550 -0.8731595 [47,] -19.5054282 9.3161550 [48,] -9.9972561 -19.5054282 [49,] 16.1113748 -9.9972561 [50,] -9.2878994 16.1113748 [51,] -3.8135203 -9.2878994 [52,] -8.8416406 -3.8135203 [53,] 2.1970949 -8.8416406 [54,] -0.9740402 2.1970949 [55,] -0.5399319 -0.9740402 [56,] -8.7700321 -0.5399319 [57,] 0.9067259 -8.7700321 [58,] 6.2361506 0.9067259 [59,] 6.2180399 6.2361506 [60,] 31.5585386 6.2180399 [61,] 2.0786983 31.5585386 [62,] -15.2911489 2.0786983 [63,] 2.9601100 -15.2911489 [64,] 4.4138703 2.9601100 [65,] -11.6620130 4.4138703 [66,] 6.5108212 -11.6620130 [67,] 15.5660253 6.5108212 [68,] 35.7388841 15.5660253 [69,] -0.8927203 35.7388841 [70,] 6.7040321 -0.8927203 [71,] -16.0554166 6.7040321 [72,] 9.3789422 -16.0554166 [73,] -1.4903643 9.3789422 [74,] -3.3417247 -1.4903643 [75,] 3.7737485 -3.3417247 [76,] 6.9508352 3.7737485 [77,] 8.3978843 6.9508352 [78,] 6.2666691 8.3978843 [79,] 1.3540910 6.2666691 [80,] -8.9948319 1.3540910 [81,] -11.8799840 -8.9948319 [82,] -4.9924318 -11.8799840 [83,] -9.1745866 -4.9924318 [84,] -9.7224469 -9.1745866 [85,] 12.9782702 -9.7224469 [86,] 2.0967202 12.9782702 [87,] 7.7308050 2.0967202 [88,] -11.7644795 7.7308050 [89,] 41.3066135 -11.7644795 [90,] -1.9942578 41.3066135 [91,] -19.2958823 -1.9942578 [92,] -9.4899632 -19.2958823 [93,] 3.0447752 -9.4899632 [94,] -16.7789879 3.0447752 [95,] 5.2195969 -16.7789879 [96,] -17.0980504 5.2195969 [97,] 0.5382100 -17.0980504 [98,] -3.3661368 0.5382100 [99,] -8.5418851 -3.3661368 [100,] 5.1702048 -8.5418851 [101,] -12.1050701 5.1702048 [102,] 0.7292985 -12.1050701 [103,] 9.5996393 0.7292985 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -13.0206816 7.4015059 2 3.7346335 -13.0206816 3 8.5415704 3.7346335 4 3.1730316 8.5415704 5 -1.4181589 3.1730316 6 -3.3417517 -1.4181589 7 -8.7125486 -3.3417517 8 2.6084011 -8.7125486 9 7.1914762 2.6084011 10 11.6900126 7.1914762 11 11.3233607 11.6900126 12 2.1706373 11.3233607 13 -19.7376557 2.1706373 14 2.7064314 -19.7376557 15 -6.3773052 2.7064314 16 -2.0616189 -6.3773052 17 2.6099021 -2.0616189 18 1.1487293 2.6099021 19 -14.5257884 1.1487293 20 -12.5564215 -14.5257884 21 9.4888856 -12.5564215 22 -11.1911947 9.4888856 23 10.4352685 -11.1911947 24 -7.2161636 10.4352685 25 -1.7375502 -7.2161636 26 15.0452673 -1.7375502 27 -1.7182375 15.0452673 28 1.0510630 -1.7182375 29 -15.0769221 1.0510630 30 -5.5486423 -15.0769221 31 -1.1973273 -5.5486423 32 -9.4999372 -1.1973273 33 -6.9859992 -9.4999372 34 -0.9837359 -6.9859992 35 11.5391654 -0.9837359 36 -6.4757071 11.5391654 37 4.2796984 -6.4757071 38 7.7038575 4.2796984 39 -2.5552859 7.7038575 40 1.9087340 -2.5552859 41 -14.2493307 1.9087340 42 -2.7968260 -14.2493307 43 17.7517230 -2.7968260 44 10.9639007 17.7517230 45 -0.8731595 10.9639007 46 9.3161550 -0.8731595 47 -19.5054282 9.3161550 48 -9.9972561 -19.5054282 49 16.1113748 -9.9972561 50 -9.2878994 16.1113748 51 -3.8135203 -9.2878994 52 -8.8416406 -3.8135203 53 2.1970949 -8.8416406 54 -0.9740402 2.1970949 55 -0.5399319 -0.9740402 56 -8.7700321 -0.5399319 57 0.9067259 -8.7700321 58 6.2361506 0.9067259 59 6.2180399 6.2361506 60 31.5585386 6.2180399 61 2.0786983 31.5585386 62 -15.2911489 2.0786983 63 2.9601100 -15.2911489 64 4.4138703 2.9601100 65 -11.6620130 4.4138703 66 6.5108212 -11.6620130 67 15.5660253 6.5108212 68 35.7388841 15.5660253 69 -0.8927203 35.7388841 70 6.7040321 -0.8927203 71 -16.0554166 6.7040321 72 9.3789422 -16.0554166 73 -1.4903643 9.3789422 74 -3.3417247 -1.4903643 75 3.7737485 -3.3417247 76 6.9508352 3.7737485 77 8.3978843 6.9508352 78 6.2666691 8.3978843 79 1.3540910 6.2666691 80 -8.9948319 1.3540910 81 -11.8799840 -8.9948319 82 -4.9924318 -11.8799840 83 -9.1745866 -4.9924318 84 -9.7224469 -9.1745866 85 12.9782702 -9.7224469 86 2.0967202 12.9782702 87 7.7308050 2.0967202 88 -11.7644795 7.7308050 89 41.3066135 -11.7644795 90 -1.9942578 41.3066135 91 -19.2958823 -1.9942578 92 -9.4899632 -19.2958823 93 3.0447752 -9.4899632 94 -16.7789879 3.0447752 95 5.2195969 -16.7789879 96 -17.0980504 5.2195969 97 0.5382100 -17.0980504 98 -3.3661368 0.5382100 99 -8.5418851 -3.3661368 100 5.1702048 -8.5418851 101 -12.1050701 5.1702048 102 0.7292985 -12.1050701 103 9.5996393 0.7292985 > plot(z,main=paste('Residual Lag plot, lowess, and regression line'), ylab='values of Residuals', xlab='lagged values of Residuals') > lines(lowess(z)) > abline(lm(z)) > grid() > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/7yld41258618612.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > acf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Autocorrelation Function') > grid() > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/8v5e91258618612.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > pacf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Partial Autocorrelation Function') > grid() > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/954991258618612.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > opar <- par(mfrow = c(2,2), oma = c(0, 0, 1.1, 0)) > plot(mylm, las = 1, sub='Residual Diagnostics') > par(opar) > dev.off() null device 1 > if (n > n25) { + postscript(file="/var/www/html/rcomp/tmp/10fkwl1258618612.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) + plot(kp3:nmkm3,gqarr[,2], main='Goldfeld-Quandt test',ylab='2-sided p-value',xlab='breakpoint') + grid() + dev.off() + } null device 1 > > #Note: the /var/www/html/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/rcomp/createtable") > > a<-table.start() > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Estimated Regression Equation', 1, TRUE) > a<-table.row.end(a) > myeq <- colnames(x)[1] > myeq <- paste(myeq, '[t] = ', sep='') > for (i in 1:k){ + if (mysum$coefficients[i,1] > 0) myeq <- paste(myeq, '+', '') + myeq <- paste(myeq, mysum$coefficients[i,1], sep=' ') + if (rownames(mysum$coefficients)[i] != '(Intercept)') { + myeq <- paste(myeq, rownames(mysum$coefficients)[i], sep='') + if (rownames(mysum$coefficients)[i] != 't') myeq <- paste(myeq, '[t]', sep='') + } + } > myeq <- paste(myeq, ' + e[t]') > a<-table.row.start(a) > a<-table.element(a, myeq) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/www/html/rcomp/tmp/11lg3r1258618612.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,hyperlink('http://www.xycoon.com/ols1.htm','Multiple Linear Regression - Ordinary Least Squares',''), 6, TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Variable',header=TRUE) > a<-table.element(a,'Parameter',header=TRUE) > a<-table.element(a,'S.D.',header=TRUE) > a<-table.element(a,'T-STAT
H0: parameter = 0',header=TRUE) > a<-table.element(a,'2-tail p-value',header=TRUE) > a<-table.element(a,'1-tail p-value',header=TRUE) > a<-table.row.end(a) > for (i in 1:k){ + a<-table.row.start(a) + a<-table.element(a,rownames(mysum$coefficients)[i],header=TRUE) + a<-table.element(a,mysum$coefficients[i,1]) + a<-table.element(a, round(mysum$coefficients[i,2],6)) + a<-table.element(a, round(mysum$coefficients[i,3],4)) + a<-table.element(a, round(mysum$coefficients[i,4],6)) + a<-table.element(a, round(mysum$coefficients[i,4]/2,6)) + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/www/html/rcomp/tmp/12a7a61258618612.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Regression Statistics', 2, TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Multiple R',1,TRUE) > a<-table.element(a, sqrt(mysum$r.squared)) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'R-squared',1,TRUE) > a<-table.element(a, mysum$r.squared) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Adjusted R-squared',1,TRUE) > a<-table.element(a, mysum$adj.r.squared) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'F-TEST (value)',1,TRUE) > a<-table.element(a, mysum$fstatistic[1]) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'F-TEST (DF numerator)',1,TRUE) > a<-table.element(a, mysum$fstatistic[2]) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'F-TEST (DF denominator)',1,TRUE) > a<-table.element(a, mysum$fstatistic[3]) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'p-value',1,TRUE) > a<-table.element(a, 1-pf(mysum$fstatistic[1],mysum$fstatistic[2],mysum$fstatistic[3])) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Residual Statistics', 2, TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Residual Standard Deviation',1,TRUE) > a<-table.element(a, mysum$sigma) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Sum Squared Residuals',1,TRUE) > a<-table.element(a, sum(myerror*myerror)) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/www/html/rcomp/tmp/136zqu1258618612.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Actuals, Interpolation, and Residuals', 4, TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Time or Index', 1, TRUE) > a<-table.element(a, 'Actuals', 1, TRUE) > a<-table.element(a, 'Interpolation
Forecast', 1, TRUE) > a<-table.element(a, 'Residuals
Prediction Error', 1, TRUE) > a<-table.row.end(a) > for (i in 1:n) { + a<-table.row.start(a) + a<-table.element(a,i, 1, TRUE) + a<-table.element(a,x[i]) + a<-table.element(a,x[i]-mysum$resid[i]) + a<-table.element(a,mysum$resid[i]) + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/www/html/rcomp/tmp/1459qg1258618612.tab") > if (n > n25) { + a<-table.start() + a<-table.row.start(a) + a<-table.element(a,'Goldfeld-Quandt test for Heteroskedasticity',4,TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'p-values',header=TRUE) + a<-table.element(a,'Alternative Hypothesis',3,header=TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'breakpoint index',header=TRUE) + a<-table.element(a,'greater',header=TRUE) + a<-table.element(a,'2-sided',header=TRUE) + a<-table.element(a,'less',header=TRUE) + a<-table.row.end(a) + for (mypoint in kp3:nmkm3) { + a<-table.row.start(a) + a<-table.element(a,mypoint,header=TRUE) + a<-table.element(a,gqarr[mypoint-kp3+1,1]) + a<-table.element(a,gqarr[mypoint-kp3+1,2]) + a<-table.element(a,gqarr[mypoint-kp3+1,3]) + a<-table.row.end(a) + } + a<-table.end(a) + table.save(a,file="/var/www/html/rcomp/tmp/15b5t41258618612.tab") + a<-table.start() + a<-table.row.start(a) + a<-table.element(a,'Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity',4,TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'Description',header=TRUE) + a<-table.element(a,'# significant tests',header=TRUE) + a<-table.element(a,'% significant tests',header=TRUE) + a<-table.element(a,'OK/NOK',header=TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'1% type I error level',header=TRUE) + a<-table.element(a,numsignificant1) + a<-table.element(a,numsignificant1/numgqtests) + if (numsignificant1/numgqtests < 0.01) dum <- 'OK' else dum <- 'NOK' + a<-table.element(a,dum) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'5% type I error level',header=TRUE) + a<-table.element(a,numsignificant5) + a<-table.element(a,numsignificant5/numgqtests) + if (numsignificant5/numgqtests < 0.05) dum <- 'OK' else dum <- 'NOK' + a<-table.element(a,dum) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'10% type I error level',header=TRUE) + a<-table.element(a,numsignificant10) + a<-table.element(a,numsignificant10/numgqtests) + if (numsignificant10/numgqtests < 0.1) dum <- 'OK' else dum <- 'NOK' + a<-table.element(a,dum) + a<-table.row.end(a) + a<-table.end(a) + table.save(a,file="/var/www/html/rcomp/tmp/16k5yp1258618612.tab") + } > > system("convert tmp/1tptx1258618612.ps tmp/1tptx1258618612.png") > system("convert tmp/2cw3t1258618612.ps tmp/2cw3t1258618612.png") > system("convert tmp/3qrgd1258618612.ps tmp/3qrgd1258618612.png") > system("convert tmp/4n1yu1258618612.ps tmp/4n1yu1258618612.png") > system("convert tmp/5t6bt1258618612.ps tmp/5t6bt1258618612.png") > system("convert tmp/6flqj1258618612.ps tmp/6flqj1258618612.png") > system("convert tmp/7yld41258618612.ps tmp/7yld41258618612.png") > system("convert tmp/8v5e91258618612.ps tmp/8v5e91258618612.png") > system("convert tmp/954991258618612.ps tmp/954991258618612.png") > system("convert tmp/10fkwl1258618612.ps tmp/10fkwl1258618612.png") > > > proc.time() user system elapsed 3.170 1.615 3.755