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(100.00 + ,100.00 + ,103.53 + ,102.62 + ,108.36 + ,107.62 + ,115.20 + ,103.46 + ,123.51 + ,103.61 + ,132.87 + ,106.10 + ,130.55 + ,107.13 + ,136.68 + ,108.82 + ,140.63 + ,112.93 + ,143.47 + ,109.35 + ,124.10 + ,108.75 + ,111.49 + ,110.83 + ,119.93 + ,110.95 + ,131.79 + ,114.96 + ,136.61 + ,120.45 + ,141.79 + ,122.89 + ,142.23 + ,120.43 + ,146.74 + ,121.76 + ,154.85 + ,122.78 + ,148.44 + ,125.32 + ,154.18 + ,128.68 + ,149.10 + ,127.91 + ,152.22 + ,125.52 + ,149.34 + ,127.56 + ,160.94 + ,127.90 + ,176.16 + ,130.75 + ,195.12 + ,133.57 + ,186.07 + ,135.83 + ,200.78 + ,135.26 + ,208.15 + ,135.99 + ,209.56 + ,139.12 + ,203.33 + ,137.64 + ,198.84 + ,138.59 + ,200.63 + ,138.32 + ,206.47 + ,135.99 + ,196.68 + ,136.96 + ,203.81 + ,137.13 + ,190.18 + ,138.67 + ,187.50 + ,143.04 + ,187.62 + ,143.98 + ,168.92 + ,144.09 + ,164.78 + ,144.97 + ,175.98 + ,147.77 + ,174.70 + ,149.73 + ,166.95 + ,153.11 + ,161.76 + ,151.58 + ,149.65 + ,149.04 + ,137.42 + ,154.70 + ,142.60 + ,154.91 + ,146.94 + ,159.08 + ,152.52 + ,168.01 + ,147.47 + ,164.17 + ,146.15 + ,163.77 + ,152.04 + ,163.49 + ,144.42 + ,166.13 + ,138.15 + ,166.15 + ,125.94 + ,170.05 + ,112.61 + ,167.37 + ,111.48 + ,164.80 + ,95.25 + ,169.53 + ,105.38 + ,168.17 + ,109.59 + ,172.45 + ,99.07 + ,177.81 + ,92.07 + ,175.38 + ,89.10 + ,175.64 + ,86.36 + ,178.80 + ,95.39 + ,180.49 + ,95.27 + ,182.71 + ,98.56 + ,185.73 + ,101.79 + ,183.17 + ,102.02 + ,182.11 + ,98.21 + ,185.43 + ,104.42 + ,185.29 + ,105.62 + ,188.55 + ,109.46 + ,191.89 + ,110.94 + ,190.62 + ,113.09 + ,190.29 + ,109.58 + ,193.27 + ,111.41 + ,194.54 + ,109.83 + ,195.42 + ,110.58 + ,198.58 + ,109.04 + ,197.60 + ,107.80 + ,194.62 + ,109.79 + ,199.30 + ,110.76 + ,199.51 + ,112.64 + ,203.08 + ,114.17 + ,204.36 + ,115.99 + ,206.47 + ,119.01 + ,206.51 + ,117.92 + ,208.09 + ,115.92 + ,210.08 + ,120.75 + ,212.42 + ,124.94 + ,231.32 + ,129.17 + ,231.94 + ,128.14 + ,228.02 + ,134.18 + ,231.95 + ,131.74 + ,233.88 + ,134.32 + ,235.95 + ,137.80 + ,242.92 + ,141.79 + ,240.80 + ,142.75 + ,240.34 + ,144.30 + ,241.95 + ,145.49 + ,246.61 + ,138.21 + ,247.80 + ,139.02 + ,250.97 + ,141.91 + ,248.11 + ,144.95 + ,243.75 + ,146.11 + ,248.79 + ,150.96 + ,247.03 + ,148.20 + ,250.49 + ,152.12 + ,260.83 + ,154.74 + ,256.22 + ,150.80 + ,255.33 + ,152.60 + ,259.54 + ,158.74 + ,260.64 + ,161.83 + ,262.20 + ,162.40 + ,267.29 + ,156.11 + ,265.55 + ,154.93 + ,258.99 + ,157.18 + ,265.04 + ,159.85 + ,262.18 + ,154.40 + ,265.05 + ,151.57 + ,268.78 + ,133.34 + ,265.93 + ,131.20 + ,261.30 + ,124.17 + ,265.20 + ,133.19 + ,263.26 + ,130.94 + ,265.41 + ,119.58 + ,268.75 + ,118.55 + ,261.95 + ,119.96 + ,258.16 + ,108.42 + ,265.22 + ,95.93 + ,267.34 + ,88.83 + ,269.01 + ,84.98 + ,272.90 + ,81.61 + ,278.76 + ,72.84 + ,278.98 + ,74.72 + ,281.03 + ,83.40 + ,285.65 + ,87.42 + ,287.34 + ,86.33 + ,294.57 + ,94.28 + ,294.24 + ,98.81 + ,295.13 + ,100.96 + ,299.65 + ,99.14 + ,303.59) + ,dim=c(2 + ,145) + ,dimnames=list(c('Y' + ,'X') + ,1:145)) > y <- array(NA,dim=c(2,145),dimnames=list(c('Y','X'),1:145)) > 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 M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11 t 1 100.00 100.00 1 0 0 0 0 0 0 0 0 0 0 1 2 103.53 102.62 0 1 0 0 0 0 0 0 0 0 0 2 3 108.36 107.62 0 0 1 0 0 0 0 0 0 0 0 3 4 115.20 103.46 0 0 0 1 0 0 0 0 0 0 0 4 5 123.51 103.61 0 0 0 0 1 0 0 0 0 0 0 5 6 132.87 106.10 0 0 0 0 0 1 0 0 0 0 0 6 7 130.55 107.13 0 0 0 0 0 0 1 0 0 0 0 7 8 136.68 108.82 0 0 0 0 0 0 0 1 0 0 0 8 9 140.63 112.93 0 0 0 0 0 0 0 0 1 0 0 9 10 143.47 109.35 0 0 0 0 0 0 0 0 0 1 0 10 11 124.10 108.75 0 0 0 0 0 0 0 0 0 0 1 11 12 111.49 110.83 0 0 0 0 0 0 0 0 0 0 0 12 13 119.93 110.95 1 0 0 0 0 0 0 0 0 0 0 13 14 131.79 114.96 0 1 0 0 0 0 0 0 0 0 0 14 15 136.61 120.45 0 0 1 0 0 0 0 0 0 0 0 15 16 141.79 122.89 0 0 0 1 0 0 0 0 0 0 0 16 17 142.23 120.43 0 0 0 0 1 0 0 0 0 0 0 17 18 146.74 121.76 0 0 0 0 0 1 0 0 0 0 0 18 19 154.85 122.78 0 0 0 0 0 0 1 0 0 0 0 19 20 148.44 125.32 0 0 0 0 0 0 0 1 0 0 0 20 21 154.18 128.68 0 0 0 0 0 0 0 0 1 0 0 21 22 149.10 127.91 0 0 0 0 0 0 0 0 0 1 0 22 23 152.22 125.52 0 0 0 0 0 0 0 0 0 0 1 23 24 149.34 127.56 0 0 0 0 0 0 0 0 0 0 0 24 25 160.94 127.90 1 0 0 0 0 0 0 0 0 0 0 25 26 176.16 130.75 0 1 0 0 0 0 0 0 0 0 0 26 27 195.12 133.57 0 0 1 0 0 0 0 0 0 0 0 27 28 186.07 135.83 0 0 0 1 0 0 0 0 0 0 0 28 29 200.78 135.26 0 0 0 0 1 0 0 0 0 0 0 29 30 208.15 135.99 0 0 0 0 0 1 0 0 0 0 0 30 31 209.56 139.12 0 0 0 0 0 0 1 0 0 0 0 31 32 203.33 137.64 0 0 0 0 0 0 0 1 0 0 0 32 33 198.84 138.59 0 0 0 0 0 0 0 0 1 0 0 33 34 200.63 138.32 0 0 0 0 0 0 0 0 0 1 0 34 35 206.47 135.99 0 0 0 0 0 0 0 0 0 0 1 35 36 196.68 136.96 0 0 0 0 0 0 0 0 0 0 0 36 37 203.81 137.13 1 0 0 0 0 0 0 0 0 0 0 37 38 190.18 138.67 0 1 0 0 0 0 0 0 0 0 0 38 39 187.50 143.04 0 0 1 0 0 0 0 0 0 0 0 39 40 187.62 143.98 0 0 0 1 0 0 0 0 0 0 0 40 41 168.92 144.09 0 0 0 0 1 0 0 0 0 0 0 41 42 164.78 144.97 0 0 0 0 0 1 0 0 0 0 0 42 43 175.98 147.77 0 0 0 0 0 0 1 0 0 0 0 43 44 174.70 149.73 0 0 0 0 0 0 0 1 0 0 0 44 45 166.95 153.11 0 0 0 0 0 0 0 0 1 0 0 45 46 161.76 151.58 0 0 0 0 0 0 0 0 0 1 0 46 47 149.65 149.04 0 0 0 0 0 0 0 0 0 0 1 47 48 137.42 154.70 0 0 0 0 0 0 0 0 0 0 0 48 49 142.60 154.91 1 0 0 0 0 0 0 0 0 0 0 49 50 146.94 159.08 0 1 0 0 0 0 0 0 0 0 0 50 51 152.52 168.01 0 0 1 0 0 0 0 0 0 0 0 51 52 147.47 164.17 0 0 0 1 0 0 0 0 0 0 0 52 53 146.15 163.77 0 0 0 0 1 0 0 0 0 0 0 53 54 152.04 163.49 0 0 0 0 0 1 0 0 0 0 0 54 55 144.42 166.13 0 0 0 0 0 0 1 0 0 0 0 55 56 138.15 166.15 0 0 0 0 0 0 0 1 0 0 0 56 57 125.94 170.05 0 0 0 0 0 0 0 0 1 0 0 57 58 112.61 167.37 0 0 0 0 0 0 0 0 0 1 0 58 59 111.48 164.80 0 0 0 0 0 0 0 0 0 0 1 59 60 95.25 169.53 0 0 0 0 0 0 0 0 0 0 0 60 61 105.38 168.17 1 0 0 0 0 0 0 0 0 0 0 61 62 109.59 172.45 0 1 0 0 0 0 0 0 0 0 0 62 63 99.07 177.81 0 0 1 0 0 0 0 0 0 0 0 63 64 92.07 175.38 0 0 0 1 0 0 0 0 0 0 0 64 65 89.10 175.64 0 0 0 0 1 0 0 0 0 0 0 65 66 86.36 178.80 0 0 0 0 0 1 0 0 0 0 0 66 67 95.39 180.49 0 0 0 0 0 0 1 0 0 0 0 67 68 95.27 182.71 0 0 0 0 0 0 0 1 0 0 0 68 69 98.56 185.73 0 0 0 0 0 0 0 0 1 0 0 69 70 101.79 183.17 0 0 0 0 0 0 0 0 0 1 0 70 71 102.02 182.11 0 0 0 0 0 0 0 0 0 0 1 71 72 98.21 185.43 0 0 0 0 0 0 0 0 0 0 0 72 73 104.42 185.29 1 0 0 0 0 0 0 0 0 0 0 73 74 105.62 188.55 0 1 0 0 0 0 0 0 0 0 0 74 75 109.46 191.89 0 0 1 0 0 0 0 0 0 0 0 75 76 110.94 190.62 0 0 0 1 0 0 0 0 0 0 0 76 77 113.09 190.29 0 0 0 0 1 0 0 0 0 0 0 77 78 109.58 193.27 0 0 0 0 0 1 0 0 0 0 0 78 79 111.41 194.54 0 0 0 0 0 0 1 0 0 0 0 79 80 109.83 195.42 0 0 0 0 0 0 0 1 0 0 0 80 81 110.58 198.58 0 0 0 0 0 0 0 0 1 0 0 81 82 109.04 197.60 0 0 0 0 0 0 0 0 0 1 0 82 83 107.80 194.62 0 0 0 0 0 0 0 0 0 0 1 83 84 109.79 199.30 0 0 0 0 0 0 0 0 0 0 0 84 85 110.76 199.51 1 0 0 0 0 0 0 0 0 0 0 85 86 112.64 203.08 0 1 0 0 0 0 0 0 0 0 0 86 87 114.17 204.36 0 0 1 0 0 0 0 0 0 0 0 87 88 115.99 206.47 0 0 0 1 0 0 0 0 0 0 0 88 89 119.01 206.51 0 0 0 0 1 0 0 0 0 0 0 89 90 117.92 208.09 0 0 0 0 0 1 0 0 0 0 0 90 91 115.92 210.08 0 0 0 0 0 0 1 0 0 0 0 91 92 120.75 212.42 0 0 0 0 0 0 0 1 0 0 0 92 93 124.94 231.32 0 0 0 0 0 0 0 0 1 0 0 93 94 129.17 231.94 0 0 0 0 0 0 0 0 0 1 0 94 95 128.14 228.02 0 0 0 0 0 0 0 0 0 0 1 95 96 134.18 231.95 0 0 0 0 0 0 0 0 0 0 0 96 97 131.74 233.88 1 0 0 0 0 0 0 0 0 0 0 97 98 134.32 235.95 0 1 0 0 0 0 0 0 0 0 0 98 99 137.80 242.92 0 0 1 0 0 0 0 0 0 0 0 99 100 141.79 240.80 0 0 0 1 0 0 0 0 0 0 0 100 101 142.75 240.34 0 0 0 0 1 0 0 0 0 0 0 101 102 144.30 241.95 0 0 0 0 0 1 0 0 0 0 0 102 103 145.49 246.61 0 0 0 0 0 0 1 0 0 0 0 103 104 138.21 247.80 0 0 0 0 0 0 0 1 0 0 0 104 105 139.02 250.97 0 0 0 0 0 0 0 0 1 0 0 105 106 141.91 248.11 0 0 0 0 0 0 0 0 0 1 0 106 107 144.95 243.75 0 0 0 0 0 0 0 0 0 0 1 107 108 146.11 248.79 0 0 0 0 0 0 0 0 0 0 0 108 109 150.96 247.03 1 0 0 0 0 0 0 0 0 0 0 109 110 148.20 250.49 0 1 0 0 0 0 0 0 0 0 0 110 111 152.12 260.83 0 0 1 0 0 0 0 0 0 0 0 111 112 154.74 256.22 0 0 0 1 0 0 0 0 0 0 0 112 113 150.80 255.33 0 0 0 0 1 0 0 0 0 0 0 113 114 152.60 259.54 0 0 0 0 0 1 0 0 0 0 0 114 115 158.74 260.64 0 0 0 0 0 0 1 0 0 0 0 115 116 161.83 262.20 0 0 0 0 0 0 0 1 0 0 0 116 117 162.40 267.29 0 0 0 0 0 0 0 0 1 0 0 117 118 156.11 265.55 0 0 0 0 0 0 0 0 0 1 0 118 119 154.93 258.99 0 0 0 0 0 0 0 0 0 0 1 119 120 157.18 265.04 0 0 0 0 0 0 0 0 0 0 0 120 121 159.85 262.18 1 0 0 0 0 0 0 0 0 0 0 121 122 154.40 265.05 0 1 0 0 0 0 0 0 0 0 0 122 123 151.57 268.78 0 0 1 0 0 0 0 0 0 0 0 123 124 133.34 265.93 0 0 0 1 0 0 0 0 0 0 0 124 125 131.20 261.30 0 0 0 0 1 0 0 0 0 0 0 125 126 124.17 265.20 0 0 0 0 0 1 0 0 0 0 0 126 127 133.19 263.26 0 0 0 0 0 0 1 0 0 0 0 127 128 130.94 265.41 0 0 0 0 0 0 0 1 0 0 0 128 129 119.58 268.75 0 0 0 0 0 0 0 0 1 0 0 129 130 118.55 261.95 0 0 0 0 0 0 0 0 0 1 0 130 131 119.96 258.16 0 0 0 0 0 0 0 0 0 0 1 131 132 108.42 265.22 0 0 0 0 0 0 0 0 0 0 0 132 133 95.93 267.34 1 0 0 0 0 0 0 0 0 0 0 133 134 88.83 269.01 0 1 0 0 0 0 0 0 0 0 0 134 135 84.98 272.90 0 0 1 0 0 0 0 0 0 0 0 135 136 81.61 278.76 0 0 0 1 0 0 0 0 0 0 0 136 137 72.84 278.98 0 0 0 0 1 0 0 0 0 0 0 137 138 74.72 281.03 0 0 0 0 0 1 0 0 0 0 0 138 139 83.40 285.65 0 0 0 0 0 0 1 0 0 0 0 139 140 87.42 287.34 0 0 0 0 0 0 0 1 0 0 0 140 141 86.33 294.57 0 0 0 0 0 0 0 0 1 0 0 141 142 94.28 294.24 0 0 0 0 0 0 0 0 0 1 0 142 143 98.81 295.13 0 0 0 0 0 0 0 0 0 0 1 143 144 100.96 299.65 0 0 0 0 0 0 0 0 0 0 0 144 145 99.14 303.59 1 0 0 0 0 0 0 0 0 0 0 145 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) X M1 M2 M3 M4 32.6921 1.2898 0.1449 1.7366 -0.5505 0.6218 M5 M6 M7 M8 M9 M10 2.9661 3.5406 6.7511 5.9059 0.1008 3.8991 M11 t 7.9391 -2.0687 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -59.750 -19.658 -1.705 17.104 70.644 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 32.6921 35.6211 0.918 0.360424 X 1.2898 0.3745 3.444 0.000770 *** M1 0.1449 11.6640 0.012 0.990108 M2 1.7366 11.9039 0.146 0.884237 M3 -0.5505 11.9899 -0.046 0.963451 M4 0.6218 11.9192 0.052 0.958472 M5 2.9661 11.8970 0.249 0.803505 M6 3.5406 11.8957 0.298 0.766452 M7 6.7511 11.8993 0.567 0.571445 M8 5.9059 11.8982 0.496 0.620466 M9 0.1008 12.0161 0.008 0.993318 M10 3.8991 11.8999 0.328 0.743691 M11 7.9391 11.9356 0.665 0.507117 t -2.0687 0.5215 -3.967 0.000119 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 29.12 on 131 degrees of freedom Multiple R-squared: 0.2205, Adjusted R-squared: 0.1431 F-statistic: 2.85 on 13 and 131 DF, p-value: 0.001222 > 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,] 4.666094e-03 9.332188e-03 9.953339e-01 [2,] 2.350127e-03 4.700255e-03 9.976499e-01 [3,] 3.975032e-04 7.950063e-04 9.996025e-01 [4,] 2.193737e-04 4.387473e-04 9.997806e-01 [5,] 6.851592e-05 1.370318e-04 9.999315e-01 [6,] 4.541543e-05 9.083087e-05 9.999546e-01 [7,] 2.271132e-05 4.542263e-05 9.999773e-01 [8,] 4.548538e-05 9.097076e-05 9.999545e-01 [9,] 6.293020e-05 1.258604e-04 9.999371e-01 [10,] 1.108236e-04 2.216473e-04 9.998892e-01 [11,] 2.802151e-04 5.604302e-04 9.997198e-01 [12,] 1.680255e-04 3.360510e-04 9.998320e-01 [13,] 2.615432e-04 5.230864e-04 9.997385e-01 [14,] 2.469207e-04 4.938415e-04 9.997531e-01 [15,] 2.624308e-04 5.248616e-04 9.997376e-01 [16,] 1.293097e-04 2.586194e-04 9.998707e-01 [17,] 8.721869e-05 1.744374e-04 9.999128e-01 [18,] 4.693674e-05 9.387347e-05 9.999531e-01 [19,] 3.444596e-05 6.889192e-05 9.999656e-01 [20,] 2.349151e-05 4.698303e-05 9.999765e-01 [21,] 2.001782e-05 4.003564e-05 9.999800e-01 [22,] 9.220433e-05 1.844087e-04 9.999078e-01 [23,] 5.455184e-04 1.091037e-03 9.994545e-01 [24,] 1.494414e-03 2.988829e-03 9.985056e-01 [25,] 1.714861e-02 3.429722e-02 9.828514e-01 [26,] 9.592137e-02 1.918427e-01 9.040786e-01 [27,] 1.912589e-01 3.825178e-01 8.087411e-01 [28,] 3.066501e-01 6.133002e-01 6.933499e-01 [29,] 5.004591e-01 9.990818e-01 4.995409e-01 [30,] 6.823488e-01 6.353025e-01 3.176512e-01 [31,] 8.153050e-01 3.693900e-01 1.846950e-01 [32,] 9.151589e-01 1.696821e-01 8.484105e-02 [33,] 9.550603e-01 8.987949e-02 4.493975e-02 [34,] 9.712068e-01 5.758637e-02 2.879319e-02 [35,] 9.758854e-01 4.822913e-02 2.411456e-02 [36,] 9.818353e-01 3.632938e-02 1.816469e-02 [37,] 9.854702e-01 2.905952e-02 1.452976e-02 [38,] 9.904356e-01 1.912890e-02 9.564449e-03 [39,] 9.935293e-01 1.294143e-02 6.470714e-03 [40,] 9.959535e-01 8.093008e-03 4.046504e-03 [41,] 9.976423e-01 4.715490e-03 2.357745e-03 [42,] 9.989814e-01 2.037219e-03 1.018610e-03 [43,] 9.994342e-01 1.131548e-03 5.657738e-04 [44,] 9.996846e-01 6.308040e-04 3.154020e-04 [45,] 9.997556e-01 4.887563e-04 2.443782e-04 [46,] 9.997710e-01 4.580420e-04 2.290210e-04 [47,] 9.998686e-01 2.627243e-04 1.313622e-04 [48,] 9.999460e-01 1.080592e-04 5.402961e-05 [49,] 9.999775e-01 4.502519e-05 2.251259e-05 [50,] 9.999903e-01 1.934895e-05 9.674477e-06 [51,] 9.999940e-01 1.190035e-05 5.950176e-06 [52,] 9.999958e-01 8.471105e-06 4.235553e-06 [53,] 9.999952e-01 9.605330e-06 4.802665e-06 [54,] 9.999939e-01 1.224760e-05 6.123801e-06 [55,] 9.999926e-01 1.481107e-05 7.405535e-06 [56,] 9.999911e-01 1.781910e-05 8.909549e-06 [57,] 9.999867e-01 2.662676e-05 1.331338e-05 [58,] 9.999827e-01 3.467993e-05 1.733996e-05 [59,] 9.999752e-01 4.967374e-05 2.483687e-05 [60,] 9.999612e-01 7.766052e-05 3.883026e-05 [61,] 9.999371e-01 1.257997e-04 6.289983e-05 [62,] 9.999034e-01 1.932873e-04 9.664363e-05 [63,] 9.998606e-01 2.787680e-04 1.393840e-04 [64,] 9.998050e-01 3.899036e-04 1.949518e-04 [65,] 9.996905e-01 6.189184e-04 3.094592e-04 [66,] 9.995384e-01 9.231612e-04 4.615806e-04 [67,] 9.993759e-01 1.248274e-03 6.241368e-04 [68,] 9.991483e-01 1.703491e-03 8.517456e-04 [69,] 9.988175e-01 2.364903e-03 1.182451e-03 [70,] 9.984884e-01 3.023172e-03 1.511586e-03 [71,] 9.978542e-01 4.291640e-03 2.145820e-03 [72,] 9.969844e-01 6.031141e-03 3.015571e-03 [73,] 9.957252e-01 8.549607e-03 4.274803e-03 [74,] 9.939743e-01 1.205135e-02 6.025677e-03 [75,] 9.927909e-01 1.441811e-02 7.209055e-03 [76,] 9.917164e-01 1.656727e-02 8.283633e-03 [77,] 9.957909e-01 8.418284e-03 4.209142e-03 [78,] 9.972424e-01 5.515195e-03 2.757597e-03 [79,] 9.983023e-01 3.395431e-03 1.697716e-03 [80,] 9.987915e-01 2.417042e-03 1.208521e-03 [81,] 9.992803e-01 1.439479e-03 7.197395e-04 [82,] 9.994752e-01 1.049508e-03 5.247541e-04 [83,] 9.995887e-01 8.225778e-04 4.112889e-04 [84,] 9.995388e-01 9.223792e-04 4.611896e-04 [85,] 9.994101e-01 1.179834e-03 5.899172e-04 [86,] 9.991872e-01 1.625633e-03 8.128164e-04 [87,] 9.991925e-01 1.615022e-03 8.075110e-04 [88,] 9.995631e-01 8.737738e-04 4.368869e-04 [89,] 9.997466e-01 5.067265e-04 2.533633e-04 [90,] 9.998780e-01 2.440509e-04 1.220254e-04 [91,] 9.999585e-01 8.305164e-05 4.152582e-05 [92,] 9.999901e-01 1.979516e-05 9.897582e-06 [93,] 9.999964e-01 7.112762e-06 3.556381e-06 [94,] 9.999981e-01 3.873436e-06 1.936718e-06 [95,] 9.999991e-01 1.860149e-06 9.300746e-07 [96,] 9.999980e-01 3.921139e-06 1.960570e-06 [97,] 9.999959e-01 8.120194e-06 4.060097e-06 [98,] 9.999905e-01 1.899522e-05 9.497612e-06 [99,] 9.999825e-01 3.503930e-05 1.751965e-05 [100,] 9.999666e-01 6.683665e-05 3.341832e-05 [101,] 9.999176e-01 1.648457e-04 8.242285e-05 [102,] 9.999319e-01 1.362069e-04 6.810343e-05 [103,] 9.999746e-01 5.076014e-05 2.538007e-05 [104,] 9.999968e-01 6.436043e-06 3.218021e-06 [105,] 9.999948e-01 1.034304e-05 5.171519e-06 [106,] 9.999814e-01 3.724081e-05 1.862041e-05 [107,] 9.999455e-01 1.090173e-04 5.450864e-05 [108,] 9.998638e-01 2.723105e-04 1.361552e-04 [109,] 9.994400e-01 1.119990e-03 5.599951e-04 [110,] 9.982434e-01 3.513181e-03 1.756591e-03 [111,] 9.931411e-01 1.371772e-02 6.858861e-03 [112,] 9.700804e-01 5.983915e-02 2.991958e-02 > postscript(file="/var/www/html/rcomp/tmp/1m0yd1260702743.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/2bkw81260702743.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/3pk7i1260702743.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/47jvs1260702743.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/5tl7j1260702743.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 = 145 Frequency = 1 1 2 3 4 5 6 -59.7497825 -59.1220647 -56.3853548 -43.2832986 -35.4423325 -27.7997183 7 8 9 10 11 12 -32.5900231 -25.7258688 -19.2031859 -13.4752199 -34.0425756 -39.3275633 13 14 15 16 17 18 -29.1185042 -21.9536290 -19.8589284 -16.9296498 -13.5922671 -9.3034677 19 20 21 22 23 24 -3.6508744 -10.4230626 -1.1430187 -6.9594322 -2.7280194 1.7685855 25 26 27 28 29 30 14.8538852 26.8749456 46.5534517 35.4848970 50.6545297 58.5772180 31 32 33 34 35 36 54.8083021 53.4011693 55.5596669 55.9683460 62.8423699 61.8090766 37 38 39 40 41 42 70.6436449 55.5043627 51.5436559 51.3476567 32.2302153 28.4494313 43 44 45 46 47 48 34.8961544 34.0020587 29.7663063 24.8201520 14.0150371 4.4925124 49 50 51 52 53 54 11.3254881 10.7639929 9.1817307 9.9810462 8.9014104 16.6468116 55 56 57 58 59 60 4.4799050 1.0980500 -8.2684060 -19.8712733 -19.6576939 -31.9806908 61 62 63 64 65 66 -18.1727058 -19.0060806 -32.0837041 -35.0530274 -38.6339410 -43.9555027 67 68 69 70 71 72 -38.2470853 -38.3165328 -31.0479518 -26.2455969 -26.6196377 -24.7039958 73 74 75 76 77 78 -16.3895849 -18.9173486 -15.0295462 -11.0150547 -8.7149775 -14.5743725 79 80 81 82 83 84 -15.5242329 -15.3253286 -10.7773217 -12.7828741 -12.1504706 -6.1889767 85 86 87 88 89 90 -3.5660010 -5.8136073 -1.5787864 -1.5838689 1.1089768 -0.5246776 91 92 93 94 95 96 -6.2332046 -1.5074299 -13.8211078 -12.1203639 -10.0655345 0.9133204 97 98 99 100 101 102 -2.0921853 -1.7050694 -2.8592947 4.7615394 6.0392925 7.0069437 103 104 105 106 107 108 1.0446112 -4.8563271 -0.2612183 4.5880811 11.2804290 15.9475895 109 110 111 112 113 114 24.9915004 18.2457737 13.1848726 22.6473455 19.5797190 17.4438517 115 116 117 118 119 120 21.0232599 25.0150901 26.8937545 21.1184613 26.4284018 30.8828494 121 122 123 124 125 126 39.1655565 30.4908205 27.2055952 13.5479941 17.1042749 6.5382502 127 128 129 130 131 132 16.9186953 14.8095349 7.0153751 13.0265448 17.3536983 6.7154329 133 134 135 136 137 138 -6.5851376 -15.3620958 -19.8736915 -29.9055795 -39.2349005 -38.5047678 139 140 141 142 143 144 -36.9255077 -32.1713533 -34.7128926 -28.0668247 -26.6560044 -20.3281402 145 -25.3061737 > postscript(file="/var/www/html/rcomp/tmp/6i6c01260702744.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 = 145 Frequency = 1 lag(myerror, k = 1) myerror 0 -59.7497825 NA 1 -59.1220647 -59.7497825 2 -56.3853548 -59.1220647 3 -43.2832986 -56.3853548 4 -35.4423325 -43.2832986 5 -27.7997183 -35.4423325 6 -32.5900231 -27.7997183 7 -25.7258688 -32.5900231 8 -19.2031859 -25.7258688 9 -13.4752199 -19.2031859 10 -34.0425756 -13.4752199 11 -39.3275633 -34.0425756 12 -29.1185042 -39.3275633 13 -21.9536290 -29.1185042 14 -19.8589284 -21.9536290 15 -16.9296498 -19.8589284 16 -13.5922671 -16.9296498 17 -9.3034677 -13.5922671 18 -3.6508744 -9.3034677 19 -10.4230626 -3.6508744 20 -1.1430187 -10.4230626 21 -6.9594322 -1.1430187 22 -2.7280194 -6.9594322 23 1.7685855 -2.7280194 24 14.8538852 1.7685855 25 26.8749456 14.8538852 26 46.5534517 26.8749456 27 35.4848970 46.5534517 28 50.6545297 35.4848970 29 58.5772180 50.6545297 30 54.8083021 58.5772180 31 53.4011693 54.8083021 32 55.5596669 53.4011693 33 55.9683460 55.5596669 34 62.8423699 55.9683460 35 61.8090766 62.8423699 36 70.6436449 61.8090766 37 55.5043627 70.6436449 38 51.5436559 55.5043627 39 51.3476567 51.5436559 40 32.2302153 51.3476567 41 28.4494313 32.2302153 42 34.8961544 28.4494313 43 34.0020587 34.8961544 44 29.7663063 34.0020587 45 24.8201520 29.7663063 46 14.0150371 24.8201520 47 4.4925124 14.0150371 48 11.3254881 4.4925124 49 10.7639929 11.3254881 50 9.1817307 10.7639929 51 9.9810462 9.1817307 52 8.9014104 9.9810462 53 16.6468116 8.9014104 54 4.4799050 16.6468116 55 1.0980500 4.4799050 56 -8.2684060 1.0980500 57 -19.8712733 -8.2684060 58 -19.6576939 -19.8712733 59 -31.9806908 -19.6576939 60 -18.1727058 -31.9806908 61 -19.0060806 -18.1727058 62 -32.0837041 -19.0060806 63 -35.0530274 -32.0837041 64 -38.6339410 -35.0530274 65 -43.9555027 -38.6339410 66 -38.2470853 -43.9555027 67 -38.3165328 -38.2470853 68 -31.0479518 -38.3165328 69 -26.2455969 -31.0479518 70 -26.6196377 -26.2455969 71 -24.7039958 -26.6196377 72 -16.3895849 -24.7039958 73 -18.9173486 -16.3895849 74 -15.0295462 -18.9173486 75 -11.0150547 -15.0295462 76 -8.7149775 -11.0150547 77 -14.5743725 -8.7149775 78 -15.5242329 -14.5743725 79 -15.3253286 -15.5242329 80 -10.7773217 -15.3253286 81 -12.7828741 -10.7773217 82 -12.1504706 -12.7828741 83 -6.1889767 -12.1504706 84 -3.5660010 -6.1889767 85 -5.8136073 -3.5660010 86 -1.5787864 -5.8136073 87 -1.5838689 -1.5787864 88 1.1089768 -1.5838689 89 -0.5246776 1.1089768 90 -6.2332046 -0.5246776 91 -1.5074299 -6.2332046 92 -13.8211078 -1.5074299 93 -12.1203639 -13.8211078 94 -10.0655345 -12.1203639 95 0.9133204 -10.0655345 96 -2.0921853 0.9133204 97 -1.7050694 -2.0921853 98 -2.8592947 -1.7050694 99 4.7615394 -2.8592947 100 6.0392925 4.7615394 101 7.0069437 6.0392925 102 1.0446112 7.0069437 103 -4.8563271 1.0446112 104 -0.2612183 -4.8563271 105 4.5880811 -0.2612183 106 11.2804290 4.5880811 107 15.9475895 11.2804290 108 24.9915004 15.9475895 109 18.2457737 24.9915004 110 13.1848726 18.2457737 111 22.6473455 13.1848726 112 19.5797190 22.6473455 113 17.4438517 19.5797190 114 21.0232599 17.4438517 115 25.0150901 21.0232599 116 26.8937545 25.0150901 117 21.1184613 26.8937545 118 26.4284018 21.1184613 119 30.8828494 26.4284018 120 39.1655565 30.8828494 121 30.4908205 39.1655565 122 27.2055952 30.4908205 123 13.5479941 27.2055952 124 17.1042749 13.5479941 125 6.5382502 17.1042749 126 16.9186953 6.5382502 127 14.8095349 16.9186953 128 7.0153751 14.8095349 129 13.0265448 7.0153751 130 17.3536983 13.0265448 131 6.7154329 17.3536983 132 -6.5851376 6.7154329 133 -15.3620958 -6.5851376 134 -19.8736915 -15.3620958 135 -29.9055795 -19.8736915 136 -39.2349005 -29.9055795 137 -38.5047678 -39.2349005 138 -36.9255077 -38.5047678 139 -32.1713533 -36.9255077 140 -34.7128926 -32.1713533 141 -28.0668247 -34.7128926 142 -26.6560044 -28.0668247 143 -20.3281402 -26.6560044 144 -25.3061737 -20.3281402 145 NA -25.3061737 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -59.1220647 -59.7497825 [2,] -56.3853548 -59.1220647 [3,] -43.2832986 -56.3853548 [4,] -35.4423325 -43.2832986 [5,] -27.7997183 -35.4423325 [6,] -32.5900231 -27.7997183 [7,] -25.7258688 -32.5900231 [8,] -19.2031859 -25.7258688 [9,] -13.4752199 -19.2031859 [10,] -34.0425756 -13.4752199 [11,] -39.3275633 -34.0425756 [12,] -29.1185042 -39.3275633 [13,] -21.9536290 -29.1185042 [14,] -19.8589284 -21.9536290 [15,] -16.9296498 -19.8589284 [16,] -13.5922671 -16.9296498 [17,] -9.3034677 -13.5922671 [18,] -3.6508744 -9.3034677 [19,] -10.4230626 -3.6508744 [20,] -1.1430187 -10.4230626 [21,] -6.9594322 -1.1430187 [22,] -2.7280194 -6.9594322 [23,] 1.7685855 -2.7280194 [24,] 14.8538852 1.7685855 [25,] 26.8749456 14.8538852 [26,] 46.5534517 26.8749456 [27,] 35.4848970 46.5534517 [28,] 50.6545297 35.4848970 [29,] 58.5772180 50.6545297 [30,] 54.8083021 58.5772180 [31,] 53.4011693 54.8083021 [32,] 55.5596669 53.4011693 [33,] 55.9683460 55.5596669 [34,] 62.8423699 55.9683460 [35,] 61.8090766 62.8423699 [36,] 70.6436449 61.8090766 [37,] 55.5043627 70.6436449 [38,] 51.5436559 55.5043627 [39,] 51.3476567 51.5436559 [40,] 32.2302153 51.3476567 [41,] 28.4494313 32.2302153 [42,] 34.8961544 28.4494313 [43,] 34.0020587 34.8961544 [44,] 29.7663063 34.0020587 [45,] 24.8201520 29.7663063 [46,] 14.0150371 24.8201520 [47,] 4.4925124 14.0150371 [48,] 11.3254881 4.4925124 [49,] 10.7639929 11.3254881 [50,] 9.1817307 10.7639929 [51,] 9.9810462 9.1817307 [52,] 8.9014104 9.9810462 [53,] 16.6468116 8.9014104 [54,] 4.4799050 16.6468116 [55,] 1.0980500 4.4799050 [56,] -8.2684060 1.0980500 [57,] -19.8712733 -8.2684060 [58,] -19.6576939 -19.8712733 [59,] -31.9806908 -19.6576939 [60,] -18.1727058 -31.9806908 [61,] -19.0060806 -18.1727058 [62,] -32.0837041 -19.0060806 [63,] -35.0530274 -32.0837041 [64,] -38.6339410 -35.0530274 [65,] -43.9555027 -38.6339410 [66,] -38.2470853 -43.9555027 [67,] -38.3165328 -38.2470853 [68,] -31.0479518 -38.3165328 [69,] -26.2455969 -31.0479518 [70,] -26.6196377 -26.2455969 [71,] -24.7039958 -26.6196377 [72,] -16.3895849 -24.7039958 [73,] -18.9173486 -16.3895849 [74,] -15.0295462 -18.9173486 [75,] -11.0150547 -15.0295462 [76,] -8.7149775 -11.0150547 [77,] -14.5743725 -8.7149775 [78,] -15.5242329 -14.5743725 [79,] -15.3253286 -15.5242329 [80,] -10.7773217 -15.3253286 [81,] -12.7828741 -10.7773217 [82,] -12.1504706 -12.7828741 [83,] -6.1889767 -12.1504706 [84,] -3.5660010 -6.1889767 [85,] -5.8136073 -3.5660010 [86,] -1.5787864 -5.8136073 [87,] -1.5838689 -1.5787864 [88,] 1.1089768 -1.5838689 [89,] -0.5246776 1.1089768 [90,] -6.2332046 -0.5246776 [91,] -1.5074299 -6.2332046 [92,] -13.8211078 -1.5074299 [93,] -12.1203639 -13.8211078 [94,] -10.0655345 -12.1203639 [95,] 0.9133204 -10.0655345 [96,] -2.0921853 0.9133204 [97,] -1.7050694 -2.0921853 [98,] -2.8592947 -1.7050694 [99,] 4.7615394 -2.8592947 [100,] 6.0392925 4.7615394 [101,] 7.0069437 6.0392925 [102,] 1.0446112 7.0069437 [103,] -4.8563271 1.0446112 [104,] -0.2612183 -4.8563271 [105,] 4.5880811 -0.2612183 [106,] 11.2804290 4.5880811 [107,] 15.9475895 11.2804290 [108,] 24.9915004 15.9475895 [109,] 18.2457737 24.9915004 [110,] 13.1848726 18.2457737 [111,] 22.6473455 13.1848726 [112,] 19.5797190 22.6473455 [113,] 17.4438517 19.5797190 [114,] 21.0232599 17.4438517 [115,] 25.0150901 21.0232599 [116,] 26.8937545 25.0150901 [117,] 21.1184613 26.8937545 [118,] 26.4284018 21.1184613 [119,] 30.8828494 26.4284018 [120,] 39.1655565 30.8828494 [121,] 30.4908205 39.1655565 [122,] 27.2055952 30.4908205 [123,] 13.5479941 27.2055952 [124,] 17.1042749 13.5479941 [125,] 6.5382502 17.1042749 [126,] 16.9186953 6.5382502 [127,] 14.8095349 16.9186953 [128,] 7.0153751 14.8095349 [129,] 13.0265448 7.0153751 [130,] 17.3536983 13.0265448 [131,] 6.7154329 17.3536983 [132,] -6.5851376 6.7154329 [133,] -15.3620958 -6.5851376 [134,] -19.8736915 -15.3620958 [135,] -29.9055795 -19.8736915 [136,] -39.2349005 -29.9055795 [137,] -38.5047678 -39.2349005 [138,] -36.9255077 -38.5047678 [139,] -32.1713533 -36.9255077 [140,] -34.7128926 -32.1713533 [141,] -28.0668247 -34.7128926 [142,] -26.6560044 -28.0668247 [143,] -20.3281402 -26.6560044 [144,] -25.3061737 -20.3281402 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -59.1220647 -59.7497825 2 -56.3853548 -59.1220647 3 -43.2832986 -56.3853548 4 -35.4423325 -43.2832986 5 -27.7997183 -35.4423325 6 -32.5900231 -27.7997183 7 -25.7258688 -32.5900231 8 -19.2031859 -25.7258688 9 -13.4752199 -19.2031859 10 -34.0425756 -13.4752199 11 -39.3275633 -34.0425756 12 -29.1185042 -39.3275633 13 -21.9536290 -29.1185042 14 -19.8589284 -21.9536290 15 -16.9296498 -19.8589284 16 -13.5922671 -16.9296498 17 -9.3034677 -13.5922671 18 -3.6508744 -9.3034677 19 -10.4230626 -3.6508744 20 -1.1430187 -10.4230626 21 -6.9594322 -1.1430187 22 -2.7280194 -6.9594322 23 1.7685855 -2.7280194 24 14.8538852 1.7685855 25 26.8749456 14.8538852 26 46.5534517 26.8749456 27 35.4848970 46.5534517 28 50.6545297 35.4848970 29 58.5772180 50.6545297 30 54.8083021 58.5772180 31 53.4011693 54.8083021 32 55.5596669 53.4011693 33 55.9683460 55.5596669 34 62.8423699 55.9683460 35 61.8090766 62.8423699 36 70.6436449 61.8090766 37 55.5043627 70.6436449 38 51.5436559 55.5043627 39 51.3476567 51.5436559 40 32.2302153 51.3476567 41 28.4494313 32.2302153 42 34.8961544 28.4494313 43 34.0020587 34.8961544 44 29.7663063 34.0020587 45 24.8201520 29.7663063 46 14.0150371 24.8201520 47 4.4925124 14.0150371 48 11.3254881 4.4925124 49 10.7639929 11.3254881 50 9.1817307 10.7639929 51 9.9810462 9.1817307 52 8.9014104 9.9810462 53 16.6468116 8.9014104 54 4.4799050 16.6468116 55 1.0980500 4.4799050 56 -8.2684060 1.0980500 57 -19.8712733 -8.2684060 58 -19.6576939 -19.8712733 59 -31.9806908 -19.6576939 60 -18.1727058 -31.9806908 61 -19.0060806 -18.1727058 62 -32.0837041 -19.0060806 63 -35.0530274 -32.0837041 64 -38.6339410 -35.0530274 65 -43.9555027 -38.6339410 66 -38.2470853 -43.9555027 67 -38.3165328 -38.2470853 68 -31.0479518 -38.3165328 69 -26.2455969 -31.0479518 70 -26.6196377 -26.2455969 71 -24.7039958 -26.6196377 72 -16.3895849 -24.7039958 73 -18.9173486 -16.3895849 74 -15.0295462 -18.9173486 75 -11.0150547 -15.0295462 76 -8.7149775 -11.0150547 77 -14.5743725 -8.7149775 78 -15.5242329 -14.5743725 79 -15.3253286 -15.5242329 80 -10.7773217 -15.3253286 81 -12.7828741 -10.7773217 82 -12.1504706 -12.7828741 83 -6.1889767 -12.1504706 84 -3.5660010 -6.1889767 85 -5.8136073 -3.5660010 86 -1.5787864 -5.8136073 87 -1.5838689 -1.5787864 88 1.1089768 -1.5838689 89 -0.5246776 1.1089768 90 -6.2332046 -0.5246776 91 -1.5074299 -6.2332046 92 -13.8211078 -1.5074299 93 -12.1203639 -13.8211078 94 -10.0655345 -12.1203639 95 0.9133204 -10.0655345 96 -2.0921853 0.9133204 97 -1.7050694 -2.0921853 98 -2.8592947 -1.7050694 99 4.7615394 -2.8592947 100 6.0392925 4.7615394 101 7.0069437 6.0392925 102 1.0446112 7.0069437 103 -4.8563271 1.0446112 104 -0.2612183 -4.8563271 105 4.5880811 -0.2612183 106 11.2804290 4.5880811 107 15.9475895 11.2804290 108 24.9915004 15.9475895 109 18.2457737 24.9915004 110 13.1848726 18.2457737 111 22.6473455 13.1848726 112 19.5797190 22.6473455 113 17.4438517 19.5797190 114 21.0232599 17.4438517 115 25.0150901 21.0232599 116 26.8937545 25.0150901 117 21.1184613 26.8937545 118 26.4284018 21.1184613 119 30.8828494 26.4284018 120 39.1655565 30.8828494 121 30.4908205 39.1655565 122 27.2055952 30.4908205 123 13.5479941 27.2055952 124 17.1042749 13.5479941 125 6.5382502 17.1042749 126 16.9186953 6.5382502 127 14.8095349 16.9186953 128 7.0153751 14.8095349 129 13.0265448 7.0153751 130 17.3536983 13.0265448 131 6.7154329 17.3536983 132 -6.5851376 6.7154329 133 -15.3620958 -6.5851376 134 -19.8736915 -15.3620958 135 -29.9055795 -19.8736915 136 -39.2349005 -29.9055795 137 -38.5047678 -39.2349005 138 -36.9255077 -38.5047678 139 -32.1713533 -36.9255077 140 -34.7128926 -32.1713533 141 -28.0668247 -34.7128926 142 -26.6560044 -28.0668247 143 -20.3281402 -26.6560044 144 -25.3061737 -20.3281402 > 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/7hh1b1260702744.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/8eg6s1260702744.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/9w5951260702744.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/10106t1260702744.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/11o8cq1260702744.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/12xcj91260702744.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/131x0j1260702744.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/14pocf1260702744.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/15xnq51260702744.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/16ufur1260702744.tab") + } > > try(system("convert tmp/1m0yd1260702743.ps tmp/1m0yd1260702743.png",intern=TRUE)) character(0) > try(system("convert tmp/2bkw81260702743.ps tmp/2bkw81260702743.png",intern=TRUE)) character(0) > try(system("convert tmp/3pk7i1260702743.ps tmp/3pk7i1260702743.png",intern=TRUE)) character(0) > try(system("convert tmp/47jvs1260702743.ps tmp/47jvs1260702743.png",intern=TRUE)) character(0) > try(system("convert tmp/5tl7j1260702743.ps tmp/5tl7j1260702743.png",intern=TRUE)) character(0) > try(system("convert tmp/6i6c01260702744.ps tmp/6i6c01260702744.png",intern=TRUE)) character(0) > try(system("convert tmp/7hh1b1260702744.ps tmp/7hh1b1260702744.png",intern=TRUE)) character(0) > try(system("convert tmp/8eg6s1260702744.ps tmp/8eg6s1260702744.png",intern=TRUE)) character(0) > try(system("convert tmp/9w5951260702744.ps tmp/9w5951260702744.png",intern=TRUE)) character(0) > try(system("convert tmp/10106t1260702744.ps tmp/10106t1260702744.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.610 1.752 4.765