R version 2.8.0 (2008-10-20) Copyright (C) 2008 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(1778.8 + ,0 + ,1264.9 + ,0 + ,1749.1 + ,0 + ,1795.6 + ,0 + ,1759 + ,0 + ,1645.1 + ,0 + ,1589.9 + ,0 + ,1712.6 + ,0 + ,1782.5 + ,0 + ,1606.6 + ,0 + ,1882.1 + ,0 + ,1846.9 + ,0 + ,1873.2 + ,0 + ,1368.3 + ,0 + ,1843.5 + ,0 + ,2074.5 + ,0 + ,1848.5 + ,0 + ,1909.3 + ,0 + ,1932.9 + ,0 + ,2119.1 + ,0 + ,2202 + ,0 + ,2260.8 + ,0 + ,2097.1 + ,0 + ,2026.2 + ,0 + ,2475.2 + ,0 + ,1732.3 + ,0 + ,2385.2 + ,0 + ,2362.2 + ,0 + ,2119 + ,0 + ,2260.3 + ,0 + ,2006.5 + ,0 + ,2073.2 + ,0 + ,2207.8 + ,0 + ,2018.9 + ,0 + ,2082.8 + ,0 + ,2314.3 + ,0 + ,2252.7 + ,0 + ,1633.1 + ,0 + ,2161.1 + ,0 + ,1987.9 + ,0 + ,1870.3 + ,0 + ,1984.6 + ,0 + ,1735.9 + ,0 + ,1910 + ,0 + ,2410.1 + ,0 + ,1994.6 + ,0 + ,2152.3 + ,0 + ,2554 + ,0 + ,2754.5 + ,0 + ,1812.3 + ,0 + ,2549.9 + ,0 + ,2558.4 + ,0 + ,2279.2 + ,0 + ,2591.8 + ,0 + ,2442.4 + ,0 + ,2607.7 + ,0 + ,3106.7 + ,0 + ,2447.5 + ,0 + ,3129.5 + ,0 + ,2606.6 + ,0 + ,2964.4 + ,0 + ,2211.6 + ,0 + ,3246.1 + ,0 + ,3141.8 + ,0 + ,3125.9 + ,0 + ,2890.5 + ,0 + ,2554.3 + ,0 + ,2771.1 + ,0 + ,2950 + ,0 + ,2512.1 + ,0 + ,2800 + ,0 + ,2877.2 + ,0 + ,3048.7 + ,0 + ,2082.7 + ,0 + ,2454.8 + ,0 + ,2807.8 + ,0 + ,2627.6 + ,0 + ,2515.9 + ,0 + ,2690.3 + ,0 + ,2770.8 + ,0 + ,2907.7 + ,0 + ,2906.3 + ,0 + ,3104.6 + ,0 + ,2862.1 + ,0 + ,3189.1 + ,0 + ,2071.8 + ,0 + ,2907.7 + ,0 + ,3194.5 + ,0 + ,2722.9 + ,0 + ,2854.8 + ,0 + ,2803 + ,0 + ,2744.9 + ,0 + ,2574.2 + ,0 + ,2740.9 + ,0 + ,2635.9 + ,0 + ,2612.7 + ,0 + ,3094.2 + ,0 + ,2029 + ,0 + ,2931.1 + ,0 + ,2952.2 + ,0 + ,2601.9 + ,0 + ,2874 + ,0 + ,2570.9 + ,0 + ,2849.8 + ,0 + ,3171.5 + ,0 + ,2843.6 + ,0 + ,2831.5 + ,0 + ,3284.4 + ,0 + ,3230.1 + ,0 + ,2412.2 + ,0 + ,3052.7 + ,0 + ,3048.9 + ,0 + ,2819.9 + ,0 + ,2962.7 + ,0 + ,2796.6 + ,0 + ,2857.2 + ,0 + ,3213.1 + ,0 + ,3116.2 + ,0 + ,3340.1 + ,0 + ,3602 + ,0 + ,3626.4 + ,0 + ,2741.6 + ,1 + ,3756.2 + ,1 + ,3140 + ,1 + ,3421.6 + ,1 + ,3243.7 + ,1 + ,3085.2 + ,1 + ,3152.8 + ,1 + ,3543.6 + ,1 + ,2959.3 + ,1 + ,3594.1 + ,1 + ,3207.9 + ,1 + ,3366.7 + ,1 + ,2658.4 + ,1 + ,3340.4 + ,1 + ,3368.4 + ,1 + ,3422.1 + ,1 + ,3268 + ,1 + ,3234.4 + ,1 + ,3365.1 + ,1 + ,3923.6 + ,1 + ,3147.3 + ,1 + ,3447.7 + ,1 + ,3719.8 + ,1 + ,4090.4 + ,1 + ,3386.7 + ,1 + ,3436.8 + ,1 + ,3744.9 + ,1 + ,3325.8 + ,1 + ,3322.1 + ,1 + ,3338.6 + ,1 + ,3464.2 + ,1 + ,3404.1 + ,1 + ,3942 + ,1 + ,3859.9 + ,1 + ,3895.4 + ,1 + ,4472.2 + ,1 + ,3025.5 + ,1 + ,4285.9 + ,1) + ,dim=c(2 + ,159) + ,dimnames=list(c('x' + ,'y') + ,1:159)) > y <- array(NA,dim=c(2,159),dimnames=list(c('x','y'),1:159)) > 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 x y M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11 t 1 1778.8 0 1 0 0 0 0 0 0 0 0 0 0 1 2 1264.9 0 0 1 0 0 0 0 0 0 0 0 0 2 3 1749.1 0 0 0 1 0 0 0 0 0 0 0 0 3 4 1795.6 0 0 0 0 1 0 0 0 0 0 0 0 4 5 1759.0 0 0 0 0 0 1 0 0 0 0 0 0 5 6 1645.1 0 0 0 0 0 0 1 0 0 0 0 0 6 7 1589.9 0 0 0 0 0 0 0 1 0 0 0 0 7 8 1712.6 0 0 0 0 0 0 0 0 1 0 0 0 8 9 1782.5 0 0 0 0 0 0 0 0 0 1 0 0 9 10 1606.6 0 0 0 0 0 0 0 0 0 0 1 0 10 11 1882.1 0 0 0 0 0 0 0 0 0 0 0 1 11 12 1846.9 0 0 0 0 0 0 0 0 0 0 0 0 12 13 1873.2 0 1 0 0 0 0 0 0 0 0 0 0 13 14 1368.3 0 0 1 0 0 0 0 0 0 0 0 0 14 15 1843.5 0 0 0 1 0 0 0 0 0 0 0 0 15 16 2074.5 0 0 0 0 1 0 0 0 0 0 0 0 16 17 1848.5 0 0 0 0 0 1 0 0 0 0 0 0 17 18 1909.3 0 0 0 0 0 0 1 0 0 0 0 0 18 19 1932.9 0 0 0 0 0 0 0 1 0 0 0 0 19 20 2119.1 0 0 0 0 0 0 0 0 1 0 0 0 20 21 2202.0 0 0 0 0 0 0 0 0 0 1 0 0 21 22 2260.8 0 0 0 0 0 0 0 0 0 0 1 0 22 23 2097.1 0 0 0 0 0 0 0 0 0 0 0 1 23 24 2026.2 0 0 0 0 0 0 0 0 0 0 0 0 24 25 2475.2 0 1 0 0 0 0 0 0 0 0 0 0 25 26 1732.3 0 0 1 0 0 0 0 0 0 0 0 0 26 27 2385.2 0 0 0 1 0 0 0 0 0 0 0 0 27 28 2362.2 0 0 0 0 1 0 0 0 0 0 0 0 28 29 2119.0 0 0 0 0 0 1 0 0 0 0 0 0 29 30 2260.3 0 0 0 0 0 0 1 0 0 0 0 0 30 31 2006.5 0 0 0 0 0 0 0 1 0 0 0 0 31 32 2073.2 0 0 0 0 0 0 0 0 1 0 0 0 32 33 2207.8 0 0 0 0 0 0 0 0 0 1 0 0 33 34 2018.9 0 0 0 0 0 0 0 0 0 0 1 0 34 35 2082.8 0 0 0 0 0 0 0 0 0 0 0 1 35 36 2314.3 0 0 0 0 0 0 0 0 0 0 0 0 36 37 2252.7 0 1 0 0 0 0 0 0 0 0 0 0 37 38 1633.1 0 0 1 0 0 0 0 0 0 0 0 0 38 39 2161.1 0 0 0 1 0 0 0 0 0 0 0 0 39 40 1987.9 0 0 0 0 1 0 0 0 0 0 0 0 40 41 1870.3 0 0 0 0 0 1 0 0 0 0 0 0 41 42 1984.6 0 0 0 0 0 0 1 0 0 0 0 0 42 43 1735.9 0 0 0 0 0 0 0 1 0 0 0 0 43 44 1910.0 0 0 0 0 0 0 0 0 1 0 0 0 44 45 2410.1 0 0 0 0 0 0 0 0 0 1 0 0 45 46 1994.6 0 0 0 0 0 0 0 0 0 0 1 0 46 47 2152.3 0 0 0 0 0 0 0 0 0 0 0 1 47 48 2554.0 0 0 0 0 0 0 0 0 0 0 0 0 48 49 2754.5 0 1 0 0 0 0 0 0 0 0 0 0 49 50 1812.3 0 0 1 0 0 0 0 0 0 0 0 0 50 51 2549.9 0 0 0 1 0 0 0 0 0 0 0 0 51 52 2558.4 0 0 0 0 1 0 0 0 0 0 0 0 52 53 2279.2 0 0 0 0 0 1 0 0 0 0 0 0 53 54 2591.8 0 0 0 0 0 0 1 0 0 0 0 0 54 55 2442.4 0 0 0 0 0 0 0 1 0 0 0 0 55 56 2607.7 0 0 0 0 0 0 0 0 1 0 0 0 56 57 3106.7 0 0 0 0 0 0 0 0 0 1 0 0 57 58 2447.5 0 0 0 0 0 0 0 0 0 0 1 0 58 59 3129.5 0 0 0 0 0 0 0 0 0 0 0 1 59 60 2606.6 0 0 0 0 0 0 0 0 0 0 0 0 60 61 2964.4 0 1 0 0 0 0 0 0 0 0 0 0 61 62 2211.6 0 0 1 0 0 0 0 0 0 0 0 0 62 63 3246.1 0 0 0 1 0 0 0 0 0 0 0 0 63 64 3141.8 0 0 0 0 1 0 0 0 0 0 0 0 64 65 3125.9 0 0 0 0 0 1 0 0 0 0 0 0 65 66 2890.5 0 0 0 0 0 0 1 0 0 0 0 0 66 67 2554.3 0 0 0 0 0 0 0 1 0 0 0 0 67 68 2771.1 0 0 0 0 0 0 0 0 1 0 0 0 68 69 2950.0 0 0 0 0 0 0 0 0 0 1 0 0 69 70 2512.1 0 0 0 0 0 0 0 0 0 0 1 0 70 71 2800.0 0 0 0 0 0 0 0 0 0 0 0 1 71 72 2877.2 0 0 0 0 0 0 0 0 0 0 0 0 72 73 3048.7 0 1 0 0 0 0 0 0 0 0 0 0 73 74 2082.7 0 0 1 0 0 0 0 0 0 0 0 0 74 75 2454.8 0 0 0 1 0 0 0 0 0 0 0 0 75 76 2807.8 0 0 0 0 1 0 0 0 0 0 0 0 76 77 2627.6 0 0 0 0 0 1 0 0 0 0 0 0 77 78 2515.9 0 0 0 0 0 0 1 0 0 0 0 0 78 79 2690.3 0 0 0 0 0 0 0 1 0 0 0 0 79 80 2770.8 0 0 0 0 0 0 0 0 1 0 0 0 80 81 2907.7 0 0 0 0 0 0 0 0 0 1 0 0 81 82 2906.3 0 0 0 0 0 0 0 0 0 0 1 0 82 83 3104.6 0 0 0 0 0 0 0 0 0 0 0 1 83 84 2862.1 0 0 0 0 0 0 0 0 0 0 0 0 84 85 3189.1 0 1 0 0 0 0 0 0 0 0 0 0 85 86 2071.8 0 0 1 0 0 0 0 0 0 0 0 0 86 87 2907.7 0 0 0 1 0 0 0 0 0 0 0 0 87 88 3194.5 0 0 0 0 1 0 0 0 0 0 0 0 88 89 2722.9 0 0 0 0 0 1 0 0 0 0 0 0 89 90 2854.8 0 0 0 0 0 0 1 0 0 0 0 0 90 91 2803.0 0 0 0 0 0 0 0 1 0 0 0 0 91 92 2744.9 0 0 0 0 0 0 0 0 1 0 0 0 92 93 2574.2 0 0 0 0 0 0 0 0 0 1 0 0 93 94 2740.9 0 0 0 0 0 0 0 0 0 0 1 0 94 95 2635.9 0 0 0 0 0 0 0 0 0 0 0 1 95 96 2612.7 0 0 0 0 0 0 0 0 0 0 0 0 96 97 3094.2 0 1 0 0 0 0 0 0 0 0 0 0 97 98 2029.0 0 0 1 0 0 0 0 0 0 0 0 0 98 99 2931.1 0 0 0 1 0 0 0 0 0 0 0 0 99 100 2952.2 0 0 0 0 1 0 0 0 0 0 0 0 100 101 2601.9 0 0 0 0 0 1 0 0 0 0 0 0 101 102 2874.0 0 0 0 0 0 0 1 0 0 0 0 0 102 103 2570.9 0 0 0 0 0 0 0 1 0 0 0 0 103 104 2849.8 0 0 0 0 0 0 0 0 1 0 0 0 104 105 3171.5 0 0 0 0 0 0 0 0 0 1 0 0 105 106 2843.6 0 0 0 0 0 0 0 0 0 0 1 0 106 107 2831.5 0 0 0 0 0 0 0 0 0 0 0 1 107 108 3284.4 0 0 0 0 0 0 0 0 0 0 0 0 108 109 3230.1 0 1 0 0 0 0 0 0 0 0 0 0 109 110 2412.2 0 0 1 0 0 0 0 0 0 0 0 0 110 111 3052.7 0 0 0 1 0 0 0 0 0 0 0 0 111 112 3048.9 0 0 0 0 1 0 0 0 0 0 0 0 112 113 2819.9 0 0 0 0 0 1 0 0 0 0 0 0 113 114 2962.7 0 0 0 0 0 0 1 0 0 0 0 0 114 115 2796.6 0 0 0 0 0 0 0 1 0 0 0 0 115 116 2857.2 0 0 0 0 0 0 0 0 1 0 0 0 116 117 3213.1 0 0 0 0 0 0 0 0 0 1 0 0 117 118 3116.2 0 0 0 0 0 0 0 0 0 0 1 0 118 119 3340.1 0 0 0 0 0 0 0 0 0 0 0 1 119 120 3602.0 0 0 0 0 0 0 0 0 0 0 0 0 120 121 3626.4 0 1 0 0 0 0 0 0 0 0 0 0 121 122 2741.6 1 0 1 0 0 0 0 0 0 0 0 0 122 123 3756.2 1 0 0 1 0 0 0 0 0 0 0 0 123 124 3140.0 1 0 0 0 1 0 0 0 0 0 0 0 124 125 3421.6 1 0 0 0 0 1 0 0 0 0 0 0 125 126 3243.7 1 0 0 0 0 0 1 0 0 0 0 0 126 127 3085.2 1 0 0 0 0 0 0 1 0 0 0 0 127 128 3152.8 1 0 0 0 0 0 0 0 1 0 0 0 128 129 3543.6 1 0 0 0 0 0 0 0 0 1 0 0 129 130 2959.3 1 0 0 0 0 0 0 0 0 0 1 0 130 131 3594.1 1 0 0 0 0 0 0 0 0 0 0 1 131 132 3207.9 1 0 0 0 0 0 0 0 0 0 0 0 132 133 3366.7 1 1 0 0 0 0 0 0 0 0 0 0 133 134 2658.4 1 0 1 0 0 0 0 0 0 0 0 0 134 135 3340.4 1 0 0 1 0 0 0 0 0 0 0 0 135 136 3368.4 1 0 0 0 1 0 0 0 0 0 0 0 136 137 3422.1 1 0 0 0 0 1 0 0 0 0 0 0 137 138 3268.0 1 0 0 0 0 0 1 0 0 0 0 0 138 139 3234.4 1 0 0 0 0 0 0 1 0 0 0 0 139 140 3365.1 1 0 0 0 0 0 0 0 1 0 0 0 140 141 3923.6 1 0 0 0 0 0 0 0 0 1 0 0 141 142 3147.3 1 0 0 0 0 0 0 0 0 0 1 0 142 143 3447.7 1 0 0 0 0 0 0 0 0 0 0 1 143 144 3719.8 1 0 0 0 0 0 0 0 0 0 0 0 144 145 4090.4 1 1 0 0 0 0 0 0 0 0 0 0 145 146 3386.7 1 0 1 0 0 0 0 0 0 0 0 0 146 147 3436.8 1 0 0 1 0 0 0 0 0 0 0 0 147 148 3744.9 1 0 0 0 1 0 0 0 0 0 0 0 148 149 3325.8 1 0 0 0 0 1 0 0 0 0 0 0 149 150 3322.1 1 0 0 0 0 0 1 0 0 0 0 0 150 151 3338.6 1 0 0 0 0 0 0 1 0 0 0 0 151 152 3464.2 1 0 0 0 0 0 0 0 1 0 0 0 152 153 3404.1 1 0 0 0 0 0 0 0 0 1 0 0 153 154 3942.0 1 0 0 0 0 0 0 0 0 0 1 0 154 155 3859.9 1 0 0 0 0 0 0 0 0 0 0 1 155 156 3895.4 1 0 0 0 0 0 0 0 0 0 0 0 156 157 4472.2 1 1 0 0 0 0 0 0 0 0 0 0 157 158 3025.5 1 0 1 0 0 0 0 0 0 0 0 0 158 159 4285.9 1 0 0 1 0 0 0 0 0 0 0 0 159 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) y M1 M2 M3 M4 1860.374 31.818 198.457 -657.710 20.989 1.385 M5 M6 M7 M8 M9 M10 -182.439 -165.300 -295.931 -183.523 35.100 -200.062 M11 t -22.738 12.023 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -439.42 -159.88 -17.07 126.20 666.47 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 1860.3737 74.9187 24.832 < 2e-16 *** y 31.8182 63.3521 0.502 0.61626 M1 198.4574 88.1338 2.252 0.02584 * M2 -657.7098 88.2732 -7.451 7.68e-12 *** M3 20.9885 88.2423 0.238 0.81233 M4 1.3845 89.8445 0.015 0.98773 M5 -182.4385 89.8155 -2.031 0.04406 * M6 -165.3001 89.7905 -1.841 0.06767 . M7 -295.9308 89.7692 -3.297 0.00123 ** M8 -183.5231 89.7519 -2.045 0.04268 * M9 35.1000 89.7384 0.391 0.69627 M10 -200.0616 89.7287 -2.230 0.02731 * M11 -22.7385 89.7229 -0.253 0.80029 t 12.0231 0.5886 20.428 < 2e-16 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 228.7 on 145 degrees of freedom Multiple R-squared: 0.8835, Adjusted R-squared: 0.873 F-statistic: 84.58 on 13 and 145 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.030874342 0.061748685 0.9691257 [2,] 0.016174639 0.032349277 0.9838254 [3,] 0.015025671 0.030051342 0.9849743 [4,] 0.017071399 0.034142798 0.9829286 [5,] 0.015031696 0.030063393 0.9849683 [6,] 0.058300269 0.116600538 0.9416997 [7,] 0.031864869 0.063729738 0.9681351 [8,] 0.017936154 0.035872307 0.9820638 [9,] 0.019522026 0.039044052 0.9804780 [10,] 0.010326376 0.020652753 0.9896736 [11,] 0.006983115 0.013966230 0.9930169 [12,] 0.003530012 0.007060025 0.9964700 [13,] 0.002299044 0.004598088 0.9977010 [14,] 0.001146625 0.002293251 0.9988534 [15,] 0.001031062 0.002062125 0.9989689 [16,] 0.001463535 0.002927071 0.9985365 [17,] 0.001218412 0.002436824 0.9987816 [18,] 0.002017785 0.004035570 0.9979822 [19,] 0.002660563 0.005321127 0.9973394 [20,] 0.001463725 0.002927450 0.9985363 [21,] 0.002010821 0.004021643 0.9979892 [22,] 0.002345385 0.004690770 0.9976546 [23,] 0.002708992 0.005417984 0.9972910 [24,] 0.013695250 0.027390500 0.9863048 [25,] 0.027744331 0.055488662 0.9722557 [26,] 0.032355566 0.064711133 0.9676444 [27,] 0.064481055 0.128962110 0.9355189 [28,] 0.090668271 0.181336542 0.9093317 [29,] 0.073734045 0.147468091 0.9262660 [30,] 0.079505252 0.159010504 0.9204947 [31,] 0.082122529 0.164245057 0.9178775 [32,] 0.080117550 0.160235099 0.9198825 [33,] 0.098062543 0.196125087 0.9019375 [34,] 0.077735215 0.155470430 0.9222648 [35,] 0.069052968 0.138105936 0.9309470 [36,] 0.058596249 0.117192499 0.9414038 [37,] 0.048167730 0.096335459 0.9518323 [38,] 0.049718991 0.099437981 0.9502810 [39,] 0.047589995 0.095179990 0.9524100 [40,] 0.047032179 0.094064358 0.9529678 [41,] 0.116568140 0.233136280 0.8834319 [42,] 0.093899483 0.187798965 0.9061005 [43,] 0.243194685 0.486389371 0.7568053 [44,] 0.209882406 0.419764812 0.7901176 [45,] 0.188350441 0.376700882 0.8116496 [46,] 0.163398191 0.326796381 0.8366018 [47,] 0.308271997 0.616543994 0.6917280 [48,] 0.395875165 0.791750331 0.6041248 [49,] 0.629184248 0.741631503 0.3708158 [50,] 0.656931825 0.686136350 0.3430682 [51,] 0.620877371 0.758245259 0.3791226 [52,] 0.607642171 0.784715658 0.3923578 [53,] 0.589418781 0.821162438 0.4105812 [54,] 0.559087825 0.881824351 0.4409122 [55,] 0.521335585 0.957328830 0.4786644 [56,] 0.482134676 0.964269353 0.5178653 [57,] 0.435260258 0.870520516 0.5647397 [58,] 0.439306929 0.878613858 0.5606931 [59,] 0.587981454 0.824037091 0.4120185 [60,] 0.561763234 0.876473531 0.4382368 [61,] 0.539718839 0.920562323 0.4602812 [62,] 0.549488970 0.901022061 0.4505110 [63,] 0.529572621 0.940854759 0.4704274 [64,] 0.511825852 0.976348296 0.4881741 [65,] 0.490833806 0.981667613 0.5091662 [66,] 0.505898073 0.988203853 0.4941019 [67,] 0.544435070 0.911129859 0.4555649 [68,] 0.511099009 0.977801981 0.4889010 [69,] 0.476318575 0.952637150 0.5236814 [70,] 0.491916240 0.983832481 0.5080838 [71,] 0.456410841 0.912821683 0.5435892 [72,] 0.534736345 0.930527309 0.4652637 [73,] 0.523905124 0.952189751 0.4760949 [74,] 0.529723560 0.940552881 0.4702764 [75,] 0.568547632 0.862904736 0.4314524 [76,] 0.571001014 0.857997973 0.4289990 [77,] 0.693882640 0.612234719 0.3061174 [78,] 0.672719996 0.654560009 0.3272800 [79,] 0.713765983 0.572468034 0.2862340 [80,] 0.780604870 0.438790261 0.2193951 [81,] 0.750602900 0.498794200 0.2493971 [82,] 0.784718816 0.430562368 0.2152812 [83,] 0.755213375 0.489573250 0.2447866 [84,] 0.730880723 0.538238555 0.2691193 [85,] 0.735146499 0.529707003 0.2648535 [86,] 0.705643401 0.588713198 0.2943566 [87,] 0.686071601 0.627856797 0.3139284 [88,] 0.650415032 0.699169936 0.3495850 [89,] 0.609045891 0.781908218 0.3909541 [90,] 0.561464687 0.877070625 0.4385353 [91,] 0.567643274 0.864713452 0.4323567 [92,] 0.533905468 0.932189065 0.4660945 [93,] 0.500644090 0.998711820 0.4993559 [94,] 0.451838432 0.903676864 0.5481616 [95,] 0.425350769 0.850701538 0.5746492 [96,] 0.381550898 0.763101796 0.6184491 [97,] 0.370185621 0.740371243 0.6298144 [98,] 0.321159442 0.642318885 0.6788406 [99,] 0.283192873 0.566385746 0.7168071 [100,] 0.263034020 0.526068039 0.7369660 [101,] 0.230227510 0.460455019 0.7697725 [102,] 0.187676489 0.375352978 0.8123235 [103,] 0.154511325 0.309022649 0.8454887 [104,] 0.154136472 0.308272945 0.8458635 [105,] 0.123764960 0.247529920 0.8762350 [106,] 0.097106275 0.194212551 0.9028937 [107,] 0.142123895 0.284247790 0.8578761 [108,] 0.127999546 0.255999092 0.8720005 [109,] 0.140718938 0.281437876 0.8592811 [110,] 0.137309655 0.274619311 0.8626903 [111,] 0.113760346 0.227520693 0.8862397 [112,] 0.089812702 0.179625405 0.9101873 [113,] 0.083376843 0.166753686 0.9166232 [114,] 0.069436643 0.138873286 0.9305634 [115,] 0.076778297 0.153556594 0.9232217 [116,] 0.060016355 0.120032710 0.9399836 [117,] 0.098281386 0.196562771 0.9017186 [118,] 0.077499680 0.154999360 0.9225003 [119,] 0.060850933 0.121701866 0.9391491 [120,] 0.043290848 0.086581697 0.9567092 [121,] 0.033504965 0.067009930 0.9664950 [122,] 0.020721438 0.041442876 0.9792786 [123,] 0.011461023 0.022922047 0.9885390 [124,] 0.005903723 0.011807447 0.9940963 [125,] 0.044705694 0.089411388 0.9552943 [126,] 0.052240470 0.104480941 0.9477595 > postscript(file="/var/www/html/freestat/rcomp/tmp/1ok661230123185.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/freestat/rcomp/tmp/2dn0h1230123185.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/freestat/rcomp/tmp/3y46n1230123185.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/freestat/rcomp/tmp/4zprv1230123185.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/freestat/rcomp/tmp/513rz1230123185.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 = 159 Frequency = 1 1 2 3 4 5 6 -292.054196 38.189964 -168.331465 -114.250525 20.949475 -122.112063 7 8 9 10 11 12 -58.704371 -60.435140 -221.181294 -173.942832 -87.788986 -157.750525 13 14 15 16 17 18 -341.930971 -2.686811 -218.208239 20.372700 -33.827300 -2.188838 19 20 21 22 23 24 140.018854 201.788085 54.041931 335.980393 -17.065761 -122.727300 25 26 27 28 29 30 115.792254 217.036414 179.214986 163.795925 92.395925 204.534387 31 32 33 34 35 36 69.342079 11.611310 -84.434844 -50.196382 -175.642536 21.095925 37 38 39 40 41 42 -250.984521 -26.440361 -189.161789 -354.780850 -300.580850 -215.442388 43 44 45 46 47 48 -345.534696 -295.865465 -26.411619 -218.773157 -250.419311 116.519150 49 50 51 52 53 54 106.538704 8.482864 55.361436 71.442375 -35.957625 247.480837 55 56 57 58 59 60 216.688529 257.557760 525.911606 89.850068 582.503914 24.842375 61 62 63 64 65 66 172.161929 263.506089 607.284661 510.565600 666.465600 401.904062 67 68 69 70 71 72 184.311754 276.680985 224.934831 10.173293 108.727139 151.165600 73 74 75 76 77 78 112.185154 -9.670686 -328.292114 32.288826 23.888826 -116.972713 79 80 81 82 83 84 176.034979 132.104210 38.358056 260.096518 269.050364 -8.211174 85 86 87 88 89 90 108.308379 -164.847461 -19.668889 274.712051 -25.087949 77.650512 91 92 93 94 95 96 144.458204 -38.072565 -439.418719 -49.580257 -343.926411 -401.887949 97 98 99 100 101 102 -130.868396 -351.924236 -140.545664 -111.864724 -290.364724 -47.426263 103 104 105 106 107 108 -231.918571 -77.449340 13.604506 -91.157032 -292.603186 125.535276 109 110 111 112 113 114 -139.245171 -113.001011 -163.222439 -159.441499 -216.641499 -103.003038 115 116 117 118 119 120 -150.495345 -214.326115 -89.072269 37.166193 71.720039 298.858501 121 122 123 124 125 126 112.778054 40.303971 364.182542 -244.436518 208.963482 1.901943 127 128 129 130 131 132 -37.990364 -94.821134 65.332713 -295.828826 149.625020 -271.336518 133 134 135 136 137 138 -323.016965 -187.172804 -195.894233 -160.313293 65.186707 -118.074832 139 140 141 142 143 144 -33.067139 -26.797909 301.055938 -252.105601 -141.051755 96.286707 145 146 147 148 149 150 256.406260 396.850421 -243.771008 71.909932 -175.390068 -208.251607 151 152 153 154 155 156 -73.143914 -71.974684 -362.720837 398.317624 126.871470 127.609932 157 158 159 493.929485 -108.626354 461.052217 > postscript(file="/var/www/html/freestat/rcomp/tmp/619v31230123185.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 = 159 Frequency = 1 lag(myerror, k = 1) myerror 0 -292.054196 NA 1 38.189964 -292.054196 2 -168.331465 38.189964 3 -114.250525 -168.331465 4 20.949475 -114.250525 5 -122.112063 20.949475 6 -58.704371 -122.112063 7 -60.435140 -58.704371 8 -221.181294 -60.435140 9 -173.942832 -221.181294 10 -87.788986 -173.942832 11 -157.750525 -87.788986 12 -341.930971 -157.750525 13 -2.686811 -341.930971 14 -218.208239 -2.686811 15 20.372700 -218.208239 16 -33.827300 20.372700 17 -2.188838 -33.827300 18 140.018854 -2.188838 19 201.788085 140.018854 20 54.041931 201.788085 21 335.980393 54.041931 22 -17.065761 335.980393 23 -122.727300 -17.065761 24 115.792254 -122.727300 25 217.036414 115.792254 26 179.214986 217.036414 27 163.795925 179.214986 28 92.395925 163.795925 29 204.534387 92.395925 30 69.342079 204.534387 31 11.611310 69.342079 32 -84.434844 11.611310 33 -50.196382 -84.434844 34 -175.642536 -50.196382 35 21.095925 -175.642536 36 -250.984521 21.095925 37 -26.440361 -250.984521 38 -189.161789 -26.440361 39 -354.780850 -189.161789 40 -300.580850 -354.780850 41 -215.442388 -300.580850 42 -345.534696 -215.442388 43 -295.865465 -345.534696 44 -26.411619 -295.865465 45 -218.773157 -26.411619 46 -250.419311 -218.773157 47 116.519150 -250.419311 48 106.538704 116.519150 49 8.482864 106.538704 50 55.361436 8.482864 51 71.442375 55.361436 52 -35.957625 71.442375 53 247.480837 -35.957625 54 216.688529 247.480837 55 257.557760 216.688529 56 525.911606 257.557760 57 89.850068 525.911606 58 582.503914 89.850068 59 24.842375 582.503914 60 172.161929 24.842375 61 263.506089 172.161929 62 607.284661 263.506089 63 510.565600 607.284661 64 666.465600 510.565600 65 401.904062 666.465600 66 184.311754 401.904062 67 276.680985 184.311754 68 224.934831 276.680985 69 10.173293 224.934831 70 108.727139 10.173293 71 151.165600 108.727139 72 112.185154 151.165600 73 -9.670686 112.185154 74 -328.292114 -9.670686 75 32.288826 -328.292114 76 23.888826 32.288826 77 -116.972713 23.888826 78 176.034979 -116.972713 79 132.104210 176.034979 80 38.358056 132.104210 81 260.096518 38.358056 82 269.050364 260.096518 83 -8.211174 269.050364 84 108.308379 -8.211174 85 -164.847461 108.308379 86 -19.668889 -164.847461 87 274.712051 -19.668889 88 -25.087949 274.712051 89 77.650512 -25.087949 90 144.458204 77.650512 91 -38.072565 144.458204 92 -439.418719 -38.072565 93 -49.580257 -439.418719 94 -343.926411 -49.580257 95 -401.887949 -343.926411 96 -130.868396 -401.887949 97 -351.924236 -130.868396 98 -140.545664 -351.924236 99 -111.864724 -140.545664 100 -290.364724 -111.864724 101 -47.426263 -290.364724 102 -231.918571 -47.426263 103 -77.449340 -231.918571 104 13.604506 -77.449340 105 -91.157032 13.604506 106 -292.603186 -91.157032 107 125.535276 -292.603186 108 -139.245171 125.535276 109 -113.001011 -139.245171 110 -163.222439 -113.001011 111 -159.441499 -163.222439 112 -216.641499 -159.441499 113 -103.003038 -216.641499 114 -150.495345 -103.003038 115 -214.326115 -150.495345 116 -89.072269 -214.326115 117 37.166193 -89.072269 118 71.720039 37.166193 119 298.858501 71.720039 120 112.778054 298.858501 121 40.303971 112.778054 122 364.182542 40.303971 123 -244.436518 364.182542 124 208.963482 -244.436518 125 1.901943 208.963482 126 -37.990364 1.901943 127 -94.821134 -37.990364 128 65.332713 -94.821134 129 -295.828826 65.332713 130 149.625020 -295.828826 131 -271.336518 149.625020 132 -323.016965 -271.336518 133 -187.172804 -323.016965 134 -195.894233 -187.172804 135 -160.313293 -195.894233 136 65.186707 -160.313293 137 -118.074832 65.186707 138 -33.067139 -118.074832 139 -26.797909 -33.067139 140 301.055938 -26.797909 141 -252.105601 301.055938 142 -141.051755 -252.105601 143 96.286707 -141.051755 144 256.406260 96.286707 145 396.850421 256.406260 146 -243.771008 396.850421 147 71.909932 -243.771008 148 -175.390068 71.909932 149 -208.251607 -175.390068 150 -73.143914 -208.251607 151 -71.974684 -73.143914 152 -362.720837 -71.974684 153 398.317624 -362.720837 154 126.871470 398.317624 155 127.609932 126.871470 156 493.929485 127.609932 157 -108.626354 493.929485 158 461.052217 -108.626354 159 NA 461.052217 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 38.189964 -292.054196 [2,] -168.331465 38.189964 [3,] -114.250525 -168.331465 [4,] 20.949475 -114.250525 [5,] -122.112063 20.949475 [6,] -58.704371 -122.112063 [7,] -60.435140 -58.704371 [8,] -221.181294 -60.435140 [9,] -173.942832 -221.181294 [10,] -87.788986 -173.942832 [11,] -157.750525 -87.788986 [12,] -341.930971 -157.750525 [13,] -2.686811 -341.930971 [14,] -218.208239 -2.686811 [15,] 20.372700 -218.208239 [16,] -33.827300 20.372700 [17,] -2.188838 -33.827300 [18,] 140.018854 -2.188838 [19,] 201.788085 140.018854 [20,] 54.041931 201.788085 [21,] 335.980393 54.041931 [22,] -17.065761 335.980393 [23,] -122.727300 -17.065761 [24,] 115.792254 -122.727300 [25,] 217.036414 115.792254 [26,] 179.214986 217.036414 [27,] 163.795925 179.214986 [28,] 92.395925 163.795925 [29,] 204.534387 92.395925 [30,] 69.342079 204.534387 [31,] 11.611310 69.342079 [32,] -84.434844 11.611310 [33,] -50.196382 -84.434844 [34,] -175.642536 -50.196382 [35,] 21.095925 -175.642536 [36,] -250.984521 21.095925 [37,] -26.440361 -250.984521 [38,] -189.161789 -26.440361 [39,] -354.780850 -189.161789 [40,] -300.580850 -354.780850 [41,] -215.442388 -300.580850 [42,] -345.534696 -215.442388 [43,] -295.865465 -345.534696 [44,] -26.411619 -295.865465 [45,] -218.773157 -26.411619 [46,] -250.419311 -218.773157 [47,] 116.519150 -250.419311 [48,] 106.538704 116.519150 [49,] 8.482864 106.538704 [50,] 55.361436 8.482864 [51,] 71.442375 55.361436 [52,] -35.957625 71.442375 [53,] 247.480837 -35.957625 [54,] 216.688529 247.480837 [55,] 257.557760 216.688529 [56,] 525.911606 257.557760 [57,] 89.850068 525.911606 [58,] 582.503914 89.850068 [59,] 24.842375 582.503914 [60,] 172.161929 24.842375 [61,] 263.506089 172.161929 [62,] 607.284661 263.506089 [63,] 510.565600 607.284661 [64,] 666.465600 510.565600 [65,] 401.904062 666.465600 [66,] 184.311754 401.904062 [67,] 276.680985 184.311754 [68,] 224.934831 276.680985 [69,] 10.173293 224.934831 [70,] 108.727139 10.173293 [71,] 151.165600 108.727139 [72,] 112.185154 151.165600 [73,] -9.670686 112.185154 [74,] -328.292114 -9.670686 [75,] 32.288826 -328.292114 [76,] 23.888826 32.288826 [77,] -116.972713 23.888826 [78,] 176.034979 -116.972713 [79,] 132.104210 176.034979 [80,] 38.358056 132.104210 [81,] 260.096518 38.358056 [82,] 269.050364 260.096518 [83,] -8.211174 269.050364 [84,] 108.308379 -8.211174 [85,] -164.847461 108.308379 [86,] -19.668889 -164.847461 [87,] 274.712051 -19.668889 [88,] -25.087949 274.712051 [89,] 77.650512 -25.087949 [90,] 144.458204 77.650512 [91,] -38.072565 144.458204 [92,] -439.418719 -38.072565 [93,] -49.580257 -439.418719 [94,] -343.926411 -49.580257 [95,] -401.887949 -343.926411 [96,] -130.868396 -401.887949 [97,] -351.924236 -130.868396 [98,] -140.545664 -351.924236 [99,] -111.864724 -140.545664 [100,] -290.364724 -111.864724 [101,] -47.426263 -290.364724 [102,] -231.918571 -47.426263 [103,] -77.449340 -231.918571 [104,] 13.604506 -77.449340 [105,] -91.157032 13.604506 [106,] -292.603186 -91.157032 [107,] 125.535276 -292.603186 [108,] -139.245171 125.535276 [109,] -113.001011 -139.245171 [110,] -163.222439 -113.001011 [111,] -159.441499 -163.222439 [112,] -216.641499 -159.441499 [113,] -103.003038 -216.641499 [114,] -150.495345 -103.003038 [115,] -214.326115 -150.495345 [116,] -89.072269 -214.326115 [117,] 37.166193 -89.072269 [118,] 71.720039 37.166193 [119,] 298.858501 71.720039 [120,] 112.778054 298.858501 [121,] 40.303971 112.778054 [122,] 364.182542 40.303971 [123,] -244.436518 364.182542 [124,] 208.963482 -244.436518 [125,] 1.901943 208.963482 [126,] -37.990364 1.901943 [127,] -94.821134 -37.990364 [128,] 65.332713 -94.821134 [129,] -295.828826 65.332713 [130,] 149.625020 -295.828826 [131,] -271.336518 149.625020 [132,] -323.016965 -271.336518 [133,] -187.172804 -323.016965 [134,] -195.894233 -187.172804 [135,] -160.313293 -195.894233 [136,] 65.186707 -160.313293 [137,] -118.074832 65.186707 [138,] -33.067139 -118.074832 [139,] -26.797909 -33.067139 [140,] 301.055938 -26.797909 [141,] -252.105601 301.055938 [142,] -141.051755 -252.105601 [143,] 96.286707 -141.051755 [144,] 256.406260 96.286707 [145,] 396.850421 256.406260 [146,] -243.771008 396.850421 [147,] 71.909932 -243.771008 [148,] -175.390068 71.909932 [149,] -208.251607 -175.390068 [150,] -73.143914 -208.251607 [151,] -71.974684 -73.143914 [152,] -362.720837 -71.974684 [153,] 398.317624 -362.720837 [154,] 126.871470 398.317624 [155,] 127.609932 126.871470 [156,] 493.929485 127.609932 [157,] -108.626354 493.929485 [158,] 461.052217 -108.626354 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 38.189964 -292.054196 2 -168.331465 38.189964 3 -114.250525 -168.331465 4 20.949475 -114.250525 5 -122.112063 20.949475 6 -58.704371 -122.112063 7 -60.435140 -58.704371 8 -221.181294 -60.435140 9 -173.942832 -221.181294 10 -87.788986 -173.942832 11 -157.750525 -87.788986 12 -341.930971 -157.750525 13 -2.686811 -341.930971 14 -218.208239 -2.686811 15 20.372700 -218.208239 16 -33.827300 20.372700 17 -2.188838 -33.827300 18 140.018854 -2.188838 19 201.788085 140.018854 20 54.041931 201.788085 21 335.980393 54.041931 22 -17.065761 335.980393 23 -122.727300 -17.065761 24 115.792254 -122.727300 25 217.036414 115.792254 26 179.214986 217.036414 27 163.795925 179.214986 28 92.395925 163.795925 29 204.534387 92.395925 30 69.342079 204.534387 31 11.611310 69.342079 32 -84.434844 11.611310 33 -50.196382 -84.434844 34 -175.642536 -50.196382 35 21.095925 -175.642536 36 -250.984521 21.095925 37 -26.440361 -250.984521 38 -189.161789 -26.440361 39 -354.780850 -189.161789 40 -300.580850 -354.780850 41 -215.442388 -300.580850 42 -345.534696 -215.442388 43 -295.865465 -345.534696 44 -26.411619 -295.865465 45 -218.773157 -26.411619 46 -250.419311 -218.773157 47 116.519150 -250.419311 48 106.538704 116.519150 49 8.482864 106.538704 50 55.361436 8.482864 51 71.442375 55.361436 52 -35.957625 71.442375 53 247.480837 -35.957625 54 216.688529 247.480837 55 257.557760 216.688529 56 525.911606 257.557760 57 89.850068 525.911606 58 582.503914 89.850068 59 24.842375 582.503914 60 172.161929 24.842375 61 263.506089 172.161929 62 607.284661 263.506089 63 510.565600 607.284661 64 666.465600 510.565600 65 401.904062 666.465600 66 184.311754 401.904062 67 276.680985 184.311754 68 224.934831 276.680985 69 10.173293 224.934831 70 108.727139 10.173293 71 151.165600 108.727139 72 112.185154 151.165600 73 -9.670686 112.185154 74 -328.292114 -9.670686 75 32.288826 -328.292114 76 23.888826 32.288826 77 -116.972713 23.888826 78 176.034979 -116.972713 79 132.104210 176.034979 80 38.358056 132.104210 81 260.096518 38.358056 82 269.050364 260.096518 83 -8.211174 269.050364 84 108.308379 -8.211174 85 -164.847461 108.308379 86 -19.668889 -164.847461 87 274.712051 -19.668889 88 -25.087949 274.712051 89 77.650512 -25.087949 90 144.458204 77.650512 91 -38.072565 144.458204 92 -439.418719 -38.072565 93 -49.580257 -439.418719 94 -343.926411 -49.580257 95 -401.887949 -343.926411 96 -130.868396 -401.887949 97 -351.924236 -130.868396 98 -140.545664 -351.924236 99 -111.864724 -140.545664 100 -290.364724 -111.864724 101 -47.426263 -290.364724 102 -231.918571 -47.426263 103 -77.449340 -231.918571 104 13.604506 -77.449340 105 -91.157032 13.604506 106 -292.603186 -91.157032 107 125.535276 -292.603186 108 -139.245171 125.535276 109 -113.001011 -139.245171 110 -163.222439 -113.001011 111 -159.441499 -163.222439 112 -216.641499 -159.441499 113 -103.003038 -216.641499 114 -150.495345 -103.003038 115 -214.326115 -150.495345 116 -89.072269 -214.326115 117 37.166193 -89.072269 118 71.720039 37.166193 119 298.858501 71.720039 120 112.778054 298.858501 121 40.303971 112.778054 122 364.182542 40.303971 123 -244.436518 364.182542 124 208.963482 -244.436518 125 1.901943 208.963482 126 -37.990364 1.901943 127 -94.821134 -37.990364 128 65.332713 -94.821134 129 -295.828826 65.332713 130 149.625020 -295.828826 131 -271.336518 149.625020 132 -323.016965 -271.336518 133 -187.172804 -323.016965 134 -195.894233 -187.172804 135 -160.313293 -195.894233 136 65.186707 -160.313293 137 -118.074832 65.186707 138 -33.067139 -118.074832 139 -26.797909 -33.067139 140 301.055938 -26.797909 141 -252.105601 301.055938 142 -141.051755 -252.105601 143 96.286707 -141.051755 144 256.406260 96.286707 145 396.850421 256.406260 146 -243.771008 396.850421 147 71.909932 -243.771008 148 -175.390068 71.909932 149 -208.251607 -175.390068 150 -73.143914 -208.251607 151 -71.974684 -73.143914 152 -362.720837 -71.974684 153 398.317624 -362.720837 154 126.871470 398.317624 155 127.609932 126.871470 156 493.929485 127.609932 157 -108.626354 493.929485 158 461.052217 -108.626354 > 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/freestat/rcomp/tmp/7vjvs1230123185.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/freestat/rcomp/tmp/8p0wv1230123185.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/freestat/rcomp/tmp/995ez1230123185.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/freestat/rcomp/tmp/10spdt1230123185.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/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/freestat/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/freestat/rcomp/tmp/11f0h51230123185.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/freestat/rcomp/tmp/12032g1230123186.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/freestat/rcomp/tmp/13uftd1230123186.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/freestat/rcomp/tmp/14qrxu1230123186.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/freestat/rcomp/tmp/15hgc91230123186.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/freestat/rcomp/tmp/16s2z51230123186.tab") + } > > system("convert tmp/1ok661230123185.ps tmp/1ok661230123185.png") > system("convert tmp/2dn0h1230123185.ps tmp/2dn0h1230123185.png") > system("convert tmp/3y46n1230123185.ps tmp/3y46n1230123185.png") > system("convert tmp/4zprv1230123185.ps tmp/4zprv1230123185.png") > system("convert tmp/513rz1230123185.ps tmp/513rz1230123185.png") > system("convert tmp/619v31230123185.ps tmp/619v31230123185.png") > system("convert tmp/7vjvs1230123185.ps tmp/7vjvs1230123185.png") > system("convert tmp/8p0wv1230123185.ps tmp/8p0wv1230123185.png") > system("convert tmp/995ez1230123185.ps tmp/995ez1230123185.png") > system("convert tmp/10spdt1230123185.ps tmp/10spdt1230123185.png") > > > proc.time() user system elapsed 5.480 2.693 6.046