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(5246.24 + ,0 + ,5170.09 + ,4920.10 + ,4926.65 + ,4716.99 + ,5283.61 + ,0 + ,5246.24 + ,5170.09 + ,4920.10 + ,4926.65 + ,4979.05 + ,0 + ,5283.61 + ,5246.24 + ,5170.09 + ,4920.10 + ,4825.20 + ,0 + ,4979.05 + ,5283.61 + ,5246.24 + ,5170.09 + ,4695.12 + ,0 + ,4825.20 + ,4979.05 + ,5283.61 + ,5246.24 + ,4711.54 + ,0 + ,4695.12 + ,4825.20 + ,4979.05 + ,5283.61 + ,4727.22 + ,0 + ,4711.54 + ,4695.12 + ,4825.20 + ,4979.05 + ,4384.96 + ,0 + ,4727.22 + ,4711.54 + ,4695.12 + ,4825.20 + ,4378.75 + ,0 + ,4384.96 + ,4727.22 + ,4711.54 + ,4695.12 + ,4472.93 + ,0 + ,4378.75 + ,4384.96 + ,4727.22 + ,4711.54 + ,4564.07 + ,0 + ,4472.93 + ,4378.75 + ,4384.96 + ,4727.22 + ,4310.54 + ,0 + ,4564.07 + ,4472.93 + ,4378.75 + ,4384.96 + ,4171.38 + ,0 + ,4310.54 + ,4564.07 + ,4472.93 + ,4378.75 + ,4049.38 + ,0 + ,4171.38 + ,4310.54 + ,4564.07 + ,4472.93 + ,3591.37 + ,0 + ,4049.38 + ,4171.38 + ,4310.54 + ,4564.07 + ,3720.46 + ,0 + ,3591.37 + ,4049.38 + ,4171.38 + ,4310.54 + ,4107.23 + ,0 + ,3720.46 + ,3591.37 + ,4049.38 + ,4171.38 + ,4101.71 + ,0 + ,4107.23 + ,3720.46 + ,3591.37 + ,4049.38 + ,4162.34 + ,0 + ,4101.71 + ,4107.23 + ,3720.46 + ,3591.37 + ,4136.22 + ,0 + ,4162.34 + ,4101.71 + ,4107.23 + ,3720.46 + ,4125.88 + ,0 + ,4136.22 + ,4162.34 + ,4101.71 + ,4107.23 + ,4031.48 + ,0 + ,4125.88 + ,4136.22 + ,4162.34 + ,4101.71 + ,3761.36 + ,0 + ,4031.48 + ,4125.88 + ,4136.22 + ,4162.34 + ,3408.56 + ,0 + ,3761.36 + ,4031.48 + ,4125.88 + ,4136.22 + ,3228.47 + ,0 + ,3408.56 + ,3761.36 + ,4031.48 + ,4125.88 + ,3090.45 + ,0 + ,3228.47 + ,3408.56 + ,3761.36 + ,4031.48 + ,2741.14 + ,0 + ,3090.45 + ,3228.47 + ,3408.56 + ,3761.36 + ,2980.44 + ,0 + ,2741.14 + ,3090.45 + ,3228.47 + ,3408.56 + ,3104.33 + ,0 + ,2980.44 + ,2741.14 + ,3090.45 + ,3228.47 + ,3181.57 + ,0 + ,3104.33 + ,2980.44 + ,2741.14 + ,3090.45 + ,2863.86 + ,0 + ,3181.57 + ,3104.33 + ,2980.44 + ,2741.14 + ,2898.01 + ,0 + ,2863.86 + ,3181.57 + ,3104.33 + ,2980.44 + ,3112.33 + ,0 + ,2898.01 + ,2863.86 + ,3181.57 + ,3104.33 + ,3254.33 + ,0 + ,3112.33 + ,2898.01 + ,2863.86 + ,3181.57 + ,3513.47 + ,0 + ,3254.33 + ,3112.33 + ,2898.01 + ,2863.86 + ,3587.61 + ,0 + ,3513.47 + ,3254.33 + ,3112.33 + ,2898.01 + ,3727.45 + ,0 + ,3587.61 + ,3513.47 + ,3254.33 + ,3112.33 + ,3793.34 + ,0 + ,3727.45 + ,3587.61 + ,3513.47 + ,3254.33 + ,3817.58 + ,0 + ,3793.34 + ,3727.45 + ,3587.61 + ,3513.47 + ,3845.13 + ,0 + ,3817.58 + ,3793.34 + ,3727.45 + ,3587.61 + ,3931.86 + ,0 + ,3845.13 + ,3817.58 + ,3793.34 + ,3727.45 + ,4197.52 + ,0 + ,3931.86 + ,3845.13 + ,3817.58 + ,3793.34 + ,4307.13 + ,0 + ,4197.52 + ,3931.86 + ,3845.13 + ,3817.58 + ,4229.43 + ,0 + ,4307.13 + ,4197.52 + ,3931.86 + ,3845.13 + ,4362.28 + ,0 + ,4229.43 + ,4307.13 + ,4197.52 + ,3931.86 + ,4217.34 + ,0 + ,4362.28 + ,4229.43 + ,4307.13 + ,4197.52 + ,4361.28 + ,0 + ,4217.34 + ,4362.28 + ,4229.43 + ,4307.13 + ,4327.74 + ,0 + ,4361.28 + ,4217.34 + ,4362.28 + ,4229.43 + ,4417.65 + ,0 + ,4327.74 + ,4361.28 + ,4217.34 + ,4362.28 + ,4557.68 + ,0 + ,4417.65 + ,4327.74 + ,4361.28 + ,4217.34 + ,4650.35 + ,0 + ,4557.68 + ,4417.65 + ,4327.74 + ,4361.28 + ,4967.18 + ,0 + ,4650.35 + ,4557.68 + ,4417.65 + ,4327.74 + ,5123.42 + ,0 + ,4967.18 + ,4650.35 + ,4557.68 + ,4417.65 + ,5290.85 + ,0 + ,5123.42 + ,4967.18 + ,4650.35 + ,4557.68 + ,5535.66 + ,0 + ,5290.85 + ,5123.42 + ,4967.18 + ,4650.35 + ,5514.06 + ,0 + ,5535.66 + ,5290.85 + ,5123.42 + ,4967.18 + ,5493.88 + ,0 + ,5514.06 + ,5535.66 + ,5290.85 + ,5123.42 + ,5694.83 + ,0 + ,5493.88 + ,5514.06 + ,5535.66 + ,5290.85 + ,5850.41 + ,0 + ,5694.83 + ,5493.88 + ,5514.06 + ,5535.66 + ,6116.64 + ,0 + ,5850.41 + ,5694.83 + ,5493.88 + ,5514.06 + ,6175.00 + ,0 + ,6116.64 + ,5850.41 + ,5694.83 + ,5493.88 + ,6513.58 + ,0 + ,6175.00 + ,6116.64 + ,5850.41 + ,5694.83 + ,6383.78 + ,0 + ,6513.58 + ,6175.00 + ,6116.64 + ,5850.41 + ,6673.66 + ,0 + ,6383.78 + ,6513.58 + ,6175.00 + ,6116.64 + ,6936.61 + ,0 + ,6673.66 + ,6383.78 + ,6513.58 + ,6175.00 + ,7300.68 + ,0 + ,6936.61 + ,6673.66 + ,6383.78 + ,6513.58 + ,7392.93 + ,0 + ,7300.68 + ,6936.61 + ,6673.66 + ,6383.78 + ,7497.31 + ,0 + ,7392.93 + ,7300.68 + ,6936.61 + ,6673.66 + ,7584.71 + ,0 + ,7497.31 + ,7392.93 + ,7300.68 + ,6936.61 + ,7160.79 + ,0 + ,7584.71 + ,7497.31 + ,7392.93 + ,7300.68 + ,7196.19 + ,0 + ,7160.79 + ,7584.71 + ,7497.31 + ,7392.93 + ,7245.63 + ,0 + ,7196.19 + ,7160.79 + ,7584.71 + ,7497.31 + ,7347.51 + ,0 + ,7245.63 + ,7196.19 + ,7160.79 + ,7584.71 + ,7425.75 + ,0 + ,7347.51 + ,7245.63 + ,7196.19 + ,7160.79 + ,7778.51 + ,0 + ,7425.75 + ,7347.51 + ,7245.63 + ,7196.19 + ,7822.33 + ,0 + ,7778.51 + ,7425.75 + ,7347.51 + ,7245.63 + ,8181.22 + ,0 + ,7822.33 + ,7778.51 + ,7425.75 + ,7347.51 + ,8371.47 + ,0 + ,8181.22 + ,7822.33 + ,7778.51 + ,7425.75 + ,8347.71 + ,0 + ,8371.47 + ,8181.22 + ,7822.33 + ,7778.51 + ,8672.11 + ,0 + ,8347.71 + ,8371.47 + ,8181.22 + ,7822.33 + ,8802.79 + ,0 + ,8672.11 + ,8347.71 + ,8371.47 + ,8181.22 + ,9138.46 + ,0 + ,8802.79 + ,8672.11 + ,8347.71 + ,8371.47 + ,9123.29 + ,0 + ,9138.46 + ,8802.79 + ,8672.11 + ,8347.71 + ,9023.21 + ,1 + ,9123.29 + ,9138.46 + ,8802.79 + ,8672.11 + ,8850.41 + ,1 + ,9023.21 + ,9123.29 + ,9138.46 + ,8802.79 + ,8864.58 + ,1 + ,8850.41 + ,9023.21 + ,9123.29 + ,9138.46 + ,9163.74 + ,1 + ,8864.58 + ,8850.41 + ,9023.21 + ,9123.29 + ,8516.66 + ,1 + ,9163.74 + ,8864.58 + ,8850.41 + ,9023.21 + ,8553.44 + ,1 + ,8516.66 + ,9163.74 + ,8864.58 + ,8850.41 + ,7555.20 + ,1 + ,8553.44 + ,8516.66 + ,9163.74 + ,8864.58 + ,7851.22 + ,1 + ,7555.20 + ,8553.44 + ,8516.66 + ,9163.74 + ,7442.00 + ,1 + ,7851.22 + ,7555.20 + ,8553.44 + ,8516.66 + ,7992.53 + ,1 + ,7442.00 + ,7851.22 + ,7555.20 + ,8553.44 + ,8264.04 + ,1 + ,7992.53 + ,7442.00 + ,7851.22 + ,7555.20 + ,7517.39 + ,1 + ,8264.04 + ,7992.53 + ,7442.00 + ,7851.22 + ,7200.40 + ,1 + ,7517.39 + ,8264.04 + ,7992.53 + ,7442.00 + ,7193.69 + ,1 + ,7200.40 + ,7517.39 + ,8264.04 + ,7992.53 + ,6193.58 + ,1 + ,7193.69 + ,7200.40 + ,7517.39 + ,8264.04 + ,5104.21 + ,1 + ,6193.58 + ,7193.69 + ,7200.40 + ,7517.39 + ,4800.46 + ,1 + ,5104.21 + ,6193.58 + ,7193.69 + ,7200.40 + ,4461.61 + ,1 + ,4800.46 + ,5104.21 + ,6193.58 + ,7193.69 + ,4398.59 + ,1 + ,4461.61 + ,4800.46 + ,5104.21 + ,6193.58 + ,4243.63 + ,1 + ,4398.59 + ,4461.61 + ,4800.46 + ,5104.21 + ,4293.82 + ,1 + ,4243.63 + ,4398.59 + ,4461.61 + ,4800.46) + ,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 M9 M10 1 5246.24 0 5170.09 4920.10 4926.65 4716.99 1 0 0 0 0 0 0 0 0 0 2 5283.61 0 5246.24 5170.09 4920.10 4926.65 0 1 0 0 0 0 0 0 0 0 3 4979.05 0 5283.61 5246.24 5170.09 4920.10 0 0 1 0 0 0 0 0 0 0 4 4825.20 0 4979.05 5283.61 5246.24 5170.09 0 0 0 1 0 0 0 0 0 0 5 4695.12 0 4825.20 4979.05 5283.61 5246.24 0 0 0 0 1 0 0 0 0 0 6 4711.54 0 4695.12 4825.20 4979.05 5283.61 0 0 0 0 0 1 0 0 0 0 7 4727.22 0 4711.54 4695.12 4825.20 4979.05 0 0 0 0 0 0 1 0 0 0 8 4384.96 0 4727.22 4711.54 4695.12 4825.20 0 0 0 0 0 0 0 1 0 0 9 4378.75 0 4384.96 4727.22 4711.54 4695.12 0 0 0 0 0 0 0 0 1 0 10 4472.93 0 4378.75 4384.96 4727.22 4711.54 0 0 0 0 0 0 0 0 0 1 11 4564.07 0 4472.93 4378.75 4384.96 4727.22 0 0 0 0 0 0 0 0 0 0 12 4310.54 0 4564.07 4472.93 4378.75 4384.96 0 0 0 0 0 0 0 0 0 0 13 4171.38 0 4310.54 4564.07 4472.93 4378.75 1 0 0 0 0 0 0 0 0 0 14 4049.38 0 4171.38 4310.54 4564.07 4472.93 0 1 0 0 0 0 0 0 0 0 15 3591.37 0 4049.38 4171.38 4310.54 4564.07 0 0 1 0 0 0 0 0 0 0 16 3720.46 0 3591.37 4049.38 4171.38 4310.54 0 0 0 1 0 0 0 0 0 0 17 4107.23 0 3720.46 3591.37 4049.38 4171.38 0 0 0 0 1 0 0 0 0 0 18 4101.71 0 4107.23 3720.46 3591.37 4049.38 0 0 0 0 0 1 0 0 0 0 19 4162.34 0 4101.71 4107.23 3720.46 3591.37 0 0 0 0 0 0 1 0 0 0 20 4136.22 0 4162.34 4101.71 4107.23 3720.46 0 0 0 0 0 0 0 1 0 0 21 4125.88 0 4136.22 4162.34 4101.71 4107.23 0 0 0 0 0 0 0 0 1 0 22 4031.48 0 4125.88 4136.22 4162.34 4101.71 0 0 0 0 0 0 0 0 0 1 23 3761.36 0 4031.48 4125.88 4136.22 4162.34 0 0 0 0 0 0 0 0 0 0 24 3408.56 0 3761.36 4031.48 4125.88 4136.22 0 0 0 0 0 0 0 0 0 0 25 3228.47 0 3408.56 3761.36 4031.48 4125.88 1 0 0 0 0 0 0 0 0 0 26 3090.45 0 3228.47 3408.56 3761.36 4031.48 0 1 0 0 0 0 0 0 0 0 27 2741.14 0 3090.45 3228.47 3408.56 3761.36 0 0 1 0 0 0 0 0 0 0 28 2980.44 0 2741.14 3090.45 3228.47 3408.56 0 0 0 1 0 0 0 0 0 0 29 3104.33 0 2980.44 2741.14 3090.45 3228.47 0 0 0 0 1 0 0 0 0 0 30 3181.57 0 3104.33 2980.44 2741.14 3090.45 0 0 0 0 0 1 0 0 0 0 31 2863.86 0 3181.57 3104.33 2980.44 2741.14 0 0 0 0 0 0 1 0 0 0 32 2898.01 0 2863.86 3181.57 3104.33 2980.44 0 0 0 0 0 0 0 1 0 0 33 3112.33 0 2898.01 2863.86 3181.57 3104.33 0 0 0 0 0 0 0 0 1 0 34 3254.33 0 3112.33 2898.01 2863.86 3181.57 0 0 0 0 0 0 0 0 0 1 35 3513.47 0 3254.33 3112.33 2898.01 2863.86 0 0 0 0 0 0 0 0 0 0 36 3587.61 0 3513.47 3254.33 3112.33 2898.01 0 0 0 0 0 0 0 0 0 0 37 3727.45 0 3587.61 3513.47 3254.33 3112.33 1 0 0 0 0 0 0 0 0 0 38 3793.34 0 3727.45 3587.61 3513.47 3254.33 0 1 0 0 0 0 0 0 0 0 39 3817.58 0 3793.34 3727.45 3587.61 3513.47 0 0 1 0 0 0 0 0 0 0 40 3845.13 0 3817.58 3793.34 3727.45 3587.61 0 0 0 1 0 0 0 0 0 0 41 3931.86 0 3845.13 3817.58 3793.34 3727.45 0 0 0 0 1 0 0 0 0 0 42 4197.52 0 3931.86 3845.13 3817.58 3793.34 0 0 0 0 0 1 0 0 0 0 43 4307.13 0 4197.52 3931.86 3845.13 3817.58 0 0 0 0 0 0 1 0 0 0 44 4229.43 0 4307.13 4197.52 3931.86 3845.13 0 0 0 0 0 0 0 1 0 0 45 4362.28 0 4229.43 4307.13 4197.52 3931.86 0 0 0 0 0 0 0 0 1 0 46 4217.34 0 4362.28 4229.43 4307.13 4197.52 0 0 0 0 0 0 0 0 0 1 47 4361.28 0 4217.34 4362.28 4229.43 4307.13 0 0 0 0 0 0 0 0 0 0 48 4327.74 0 4361.28 4217.34 4362.28 4229.43 0 0 0 0 0 0 0 0 0 0 49 4417.65 0 4327.74 4361.28 4217.34 4362.28 1 0 0 0 0 0 0 0 0 0 50 4557.68 0 4417.65 4327.74 4361.28 4217.34 0 1 0 0 0 0 0 0 0 0 51 4650.35 0 4557.68 4417.65 4327.74 4361.28 0 0 1 0 0 0 0 0 0 0 52 4967.18 0 4650.35 4557.68 4417.65 4327.74 0 0 0 1 0 0 0 0 0 0 53 5123.42 0 4967.18 4650.35 4557.68 4417.65 0 0 0 0 1 0 0 0 0 0 54 5290.85 0 5123.42 4967.18 4650.35 4557.68 0 0 0 0 0 1 0 0 0 0 55 5535.66 0 5290.85 5123.42 4967.18 4650.35 0 0 0 0 0 0 1 0 0 0 56 5514.06 0 5535.66 5290.85 5123.42 4967.18 0 0 0 0 0 0 0 1 0 0 57 5493.88 0 5514.06 5535.66 5290.85 5123.42 0 0 0 0 0 0 0 0 1 0 58 5694.83 0 5493.88 5514.06 5535.66 5290.85 0 0 0 0 0 0 0 0 0 1 59 5850.41 0 5694.83 5493.88 5514.06 5535.66 0 0 0 0 0 0 0 0 0 0 60 6116.64 0 5850.41 5694.83 5493.88 5514.06 0 0 0 0 0 0 0 0 0 0 61 6175.00 0 6116.64 5850.41 5694.83 5493.88 1 0 0 0 0 0 0 0 0 0 62 6513.58 0 6175.00 6116.64 5850.41 5694.83 0 1 0 0 0 0 0 0 0 0 63 6383.78 0 6513.58 6175.00 6116.64 5850.41 0 0 1 0 0 0 0 0 0 0 64 6673.66 0 6383.78 6513.58 6175.00 6116.64 0 0 0 1 0 0 0 0 0 0 65 6936.61 0 6673.66 6383.78 6513.58 6175.00 0 0 0 0 1 0 0 0 0 0 66 7300.68 0 6936.61 6673.66 6383.78 6513.58 0 0 0 0 0 1 0 0 0 0 67 7392.93 0 7300.68 6936.61 6673.66 6383.78 0 0 0 0 0 0 1 0 0 0 68 7497.31 0 7392.93 7300.68 6936.61 6673.66 0 0 0 0 0 0 0 1 0 0 69 7584.71 0 7497.31 7392.93 7300.68 6936.61 0 0 0 0 0 0 0 0 1 0 70 7160.79 0 7584.71 7497.31 7392.93 7300.68 0 0 0 0 0 0 0 0 0 1 71 7196.19 0 7160.79 7584.71 7497.31 7392.93 0 0 0 0 0 0 0 0 0 0 72 7245.63 0 7196.19 7160.79 7584.71 7497.31 0 0 0 0 0 0 0 0 0 0 73 7347.51 0 7245.63 7196.19 7160.79 7584.71 1 0 0 0 0 0 0 0 0 0 74 7425.75 0 7347.51 7245.63 7196.19 7160.79 0 1 0 0 0 0 0 0 0 0 75 7778.51 0 7425.75 7347.51 7245.63 7196.19 0 0 1 0 0 0 0 0 0 0 76 7822.33 0 7778.51 7425.75 7347.51 7245.63 0 0 0 1 0 0 0 0 0 0 77 8181.22 0 7822.33 7778.51 7425.75 7347.51 0 0 0 0 1 0 0 0 0 0 78 8371.47 0 8181.22 7822.33 7778.51 7425.75 0 0 0 0 0 1 0 0 0 0 79 8347.71 0 8371.47 8181.22 7822.33 7778.51 0 0 0 0 0 0 1 0 0 0 80 8672.11 0 8347.71 8371.47 8181.22 7822.33 0 0 0 0 0 0 0 1 0 0 81 8802.79 0 8672.11 8347.71 8371.47 8181.22 0 0 0 0 0 0 0 0 1 0 82 9138.46 0 8802.79 8672.11 8347.71 8371.47 0 0 0 0 0 0 0 0 0 1 83 9123.29 0 9138.46 8802.79 8672.11 8347.71 0 0 0 0 0 0 0 0 0 0 84 9023.21 1 9123.29 9138.46 8802.79 8672.11 0 0 0 0 0 0 0 0 0 0 85 8850.41 1 9023.21 9123.29 9138.46 8802.79 1 0 0 0 0 0 0 0 0 0 86 8864.58 1 8850.41 9023.21 9123.29 9138.46 0 1 0 0 0 0 0 0 0 0 87 9163.74 1 8864.58 8850.41 9023.21 9123.29 0 0 1 0 0 0 0 0 0 0 88 8516.66 1 9163.74 8864.58 8850.41 9023.21 0 0 0 1 0 0 0 0 0 0 89 8553.44 1 8516.66 9163.74 8864.58 8850.41 0 0 0 0 1 0 0 0 0 0 90 7555.20 1 8553.44 8516.66 9163.74 8864.58 0 0 0 0 0 1 0 0 0 0 91 7851.22 1 7555.20 8553.44 8516.66 9163.74 0 0 0 0 0 0 1 0 0 0 92 7442.00 1 7851.22 7555.20 8553.44 8516.66 0 0 0 0 0 0 0 1 0 0 93 7992.53 1 7442.00 7851.22 7555.20 8553.44 0 0 0 0 0 0 0 0 1 0 94 8264.04 1 7992.53 7442.00 7851.22 7555.20 0 0 0 0 0 0 0 0 0 1 95 7517.39 1 8264.04 7992.53 7442.00 7851.22 0 0 0 0 0 0 0 0 0 0 96 7200.40 1 7517.39 8264.04 7992.53 7442.00 0 0 0 0 0 0 0 0 0 0 97 7193.69 1 7200.40 7517.39 8264.04 7992.53 1 0 0 0 0 0 0 0 0 0 98 6193.58 1 7193.69 7200.40 7517.39 8264.04 0 1 0 0 0 0 0 0 0 0 99 5104.21 1 6193.58 7193.69 7200.40 7517.39 0 0 1 0 0 0 0 0 0 0 100 4800.46 1 5104.21 6193.58 7193.69 7200.40 0 0 0 1 0 0 0 0 0 0 101 4461.61 1 4800.46 5104.21 6193.58 7193.69 0 0 0 0 1 0 0 0 0 0 102 4398.59 1 4461.61 4800.46 5104.21 6193.58 0 0 0 0 0 1 0 0 0 0 103 4243.63 1 4398.59 4461.61 4800.46 5104.21 0 0 0 0 0 0 1 0 0 0 104 4293.82 1 4243.63 4398.59 4461.61 4800.46 0 0 0 0 0 0 0 1 0 0 M11 t 1 0 1 2 0 2 3 0 3 4 0 4 5 0 5 6 0 6 7 0 7 8 0 8 9 0 9 10 0 10 11 1 11 12 0 12 13 0 13 14 0 14 15 0 15 16 0 16 17 0 17 18 0 18 19 0 19 20 0 20 21 0 21 22 0 22 23 1 23 24 0 24 25 0 25 26 0 26 27 0 27 28 0 28 29 0 29 30 0 30 31 0 31 32 0 32 33 0 33 34 0 34 35 1 35 36 0 36 37 0 37 38 0 38 39 0 39 40 0 40 41 0 41 42 0 42 43 0 43 44 0 44 45 0 45 46 0 46 47 1 47 48 0 48 49 0 49 50 0 50 51 0 51 52 0 52 53 0 53 54 0 54 55 0 55 56 0 56 57 0 57 58 0 58 59 1 59 60 0 60 61 0 61 62 0 62 63 0 63 64 0 64 65 0 65 66 0 66 67 0 67 68 0 68 69 0 69 70 0 70 71 1 71 72 0 72 73 0 73 74 0 74 75 0 75 76 0 76 77 0 77 78 0 78 79 0 79 80 0 80 81 0 81 82 0 82 83 1 83 84 0 84 85 0 85 86 0 86 87 0 87 88 0 88 89 0 89 90 0 90 91 0 91 92 0 92 93 0 93 94 0 94 95 1 95 96 0 96 97 0 97 98 0 98 99 0 99 100 0 100 101 0 101 102 0 102 103 0 103 104 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 -98.98235 -368.12344 1.01131 0.16324 -0.21024 0.02255 M1 M2 M3 M4 M5 M6 99.05808 32.16264 -87.15409 89.53009 212.31613 70.63638 M7 M8 M9 M10 M11 t 87.01675 28.97323 175.44504 104.14894 -24.90582 3.29961 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -761.80 -101.53 11.68 120.83 712.70 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) -98.98235 128.46007 -0.771 0.44310 X -368.12344 114.42225 -3.217 0.00183 ** Y1 1.01131 0.10684 9.466 5.54e-15 *** Y2 0.16324 0.15089 1.082 0.28236 Y3 -0.21024 0.15095 -1.393 0.16729 Y4 0.02255 0.11015 0.205 0.83828 M1 99.05808 127.61786 0.776 0.43976 M2 32.16264 129.02156 0.249 0.80374 M3 -87.15409 128.57130 -0.678 0.49968 M4 89.53009 128.84269 0.695 0.48900 M5 212.31613 130.91175 1.622 0.10850 M6 70.63638 132.80048 0.532 0.59617 M7 87.01675 128.22664 0.679 0.49920 M8 28.97323 127.54522 0.227 0.82084 M9 175.44504 132.18703 1.327 0.18794 M10 104.14894 133.40795 0.781 0.43713 M11 -24.90582 133.70184 -0.186 0.85266 t 3.29961 1.52691 2.161 0.03348 * --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 261.1 on 86 degrees of freedom Multiple R-squared: 0.9838, Adjusted R-squared: 0.9807 F-statistic: 308.1 on 17 and 86 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,] 2.401845e-01 4.803691e-01 0.7598155 [2,] 1.186604e-01 2.373208e-01 0.8813396 [3,] 7.913282e-02 1.582656e-01 0.9208672 [4,] 4.460354e-02 8.920709e-02 0.9553965 [5,] 2.155755e-02 4.311510e-02 0.9784425 [6,] 9.582123e-03 1.916425e-02 0.9904179 [7,] 4.111834e-03 8.223669e-03 0.9958882 [8,] 1.630297e-03 3.260593e-03 0.9983697 [9,] 1.492397e-03 2.984793e-03 0.9985076 [10,] 5.938682e-04 1.187736e-03 0.9994061 [11,] 7.202474e-03 1.440495e-02 0.9927975 [12,] 5.029358e-03 1.005872e-02 0.9949706 [13,] 2.738170e-03 5.476341e-03 0.9972618 [14,] 1.535489e-03 3.070979e-03 0.9984645 [15,] 1.935988e-03 3.871977e-03 0.9980640 [16,] 2.769089e-03 5.538179e-03 0.9972309 [17,] 2.601442e-03 5.202883e-03 0.9973986 [18,] 1.449324e-03 2.898648e-03 0.9985507 [19,] 1.970198e-03 3.940396e-03 0.9980298 [20,] 1.374582e-03 2.749165e-03 0.9986254 [21,] 7.133655e-04 1.426731e-03 0.9992866 [22,] 6.260394e-04 1.252079e-03 0.9993740 [23,] 3.524587e-04 7.049173e-04 0.9996475 [24,] 1.941799e-04 3.883598e-04 0.9998058 [25,] 9.453114e-05 1.890623e-04 0.9999055 [26,] 8.435222e-05 1.687044e-04 0.9999156 [27,] 5.880688e-05 1.176138e-04 0.9999412 [28,] 3.114122e-05 6.228244e-05 0.9999689 [29,] 1.614406e-05 3.228811e-05 0.9999839 [30,] 7.758507e-06 1.551701e-05 0.9999922 [31,] 6.267258e-06 1.253452e-05 0.9999937 [32,] 3.118954e-06 6.237907e-06 0.9999969 [33,] 1.569556e-06 3.139113e-06 0.9999984 [34,] 6.425290e-07 1.285058e-06 0.9999994 [35,] 3.605988e-07 7.211977e-07 0.9999996 [36,] 1.893056e-07 3.786111e-07 0.9999998 [37,] 1.834829e-07 3.669658e-07 0.9999998 [38,] 1.027037e-07 2.054074e-07 0.9999999 [39,] 4.353013e-08 8.706027e-08 1.0000000 [40,] 5.736813e-08 1.147363e-07 0.9999999 [41,] 3.294377e-08 6.588755e-08 1.0000000 [42,] 2.742547e-08 5.485094e-08 1.0000000 [43,] 1.445918e-08 2.891836e-08 1.0000000 [44,] 6.047247e-09 1.209449e-08 1.0000000 [45,] 2.106316e-09 4.212632e-09 1.0000000 [46,] 1.228260e-09 2.456519e-09 1.0000000 [47,] 4.971869e-10 9.943738e-10 1.0000000 [48,] 1.900638e-10 3.801276e-10 1.0000000 [49,] 1.525799e-10 3.051597e-10 1.0000000 [50,] 2.492298e-07 4.984596e-07 0.9999998 [51,] 2.177244e-07 4.354488e-07 0.9999998 [52,] 1.239934e-07 2.479869e-07 0.9999999 [53,] 2.664889e-07 5.329779e-07 0.9999997 [54,] 2.904837e-07 5.809673e-07 0.9999997 [55,] 6.770011e-07 1.354002e-06 0.9999993 [56,] 6.206230e-07 1.241246e-06 0.9999994 [57,] 2.846145e-07 5.692291e-07 0.9999997 [58,] 1.251396e-07 2.502791e-07 0.9999999 [59,] 6.775400e-08 1.355080e-07 0.9999999 [60,] 4.255703e-08 8.511406e-08 1.0000000 [61,] 3.269770e-08 6.539540e-08 1.0000000 [62,] 5.095048e-08 1.019010e-07 0.9999999 [63,] 1.438506e-08 2.877012e-08 1.0000000 > postscript(file="/var/www/html/rcomp/tmp/1a4311258654105.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/2341h1258654105.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/337751258654105.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/4zcir1258654105.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/5e69q1258654105.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 140.577277 117.619404 -68.441491 -89.999463 -134.720082 111.872277 7 8 9 10 11 12 87.023065 -242.909363 -48.935527 178.317652 228.672023 -154.195764 13 14 15 16 17 18 -134.254378 6.498271 -244.755715 163.913951 346.302729 -26.592761 19 20 21 22 23 24 -5.729123 40.883411 -112.591550 -111.403145 -165.471357 -259.477934 25 26 27 28 29 30 -160.656057 -50.024343 -182.420243 222.778905 10.642462 -8.417350 31 32 33 34 35 36 -385.957804 32.280072 127.600474 46.742790 267.390675 72.363670 37 38 39 40 41 42 17.587181 44.828652 105.367262 -54.608450 -115.083113 200.359662 43 44 45 46 47 48 12.713884 -146.844801 -49.184136 -230.742054 145.038418 -8.932358 49 50 51 52 53 54 -44.424990 107.279248 149.379311 189.308232 -88.664568 23.745375 55 56 57 58 59 60 118.568149 -97.493363 -253.885946 86.687751 158.033837 202.160966 61 62 63 64 65 66 -93.771051 234.103530 -79.150379 113.010245 47.772144 202.056174 67 68 69 70 71 72 -72.613023 -17.466806 -129.844898 -580.010275 15.455188 86.111007 73 74 75 76 77 78 -61.239256 -13.504552 369.113142 -116.266519 28.789966 59.718780 79 80 81 82 83 84 -233.448669 213.131956 -98.243254 111.025863 -70.449116 150.095083 85 86 87 88 89 90 46.249243 304.347486 712.703527 -453.288162 69.842979 -659.008637 91 92 93 94 95 96 478.066962 9.499178 565.084837 499.381419 -578.669668 -88.124670 97 98 99 100 101 102 289.932031 -751.147695 -761.795414 25.151260 -164.882516 96.266482 103 104 1.376560 208.919717 > postscript(file="/var/www/html/rcomp/tmp/6lzpe1258654105.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 140.577277 NA 1 117.619404 140.577277 2 -68.441491 117.619404 3 -89.999463 -68.441491 4 -134.720082 -89.999463 5 111.872277 -134.720082 6 87.023065 111.872277 7 -242.909363 87.023065 8 -48.935527 -242.909363 9 178.317652 -48.935527 10 228.672023 178.317652 11 -154.195764 228.672023 12 -134.254378 -154.195764 13 6.498271 -134.254378 14 -244.755715 6.498271 15 163.913951 -244.755715 16 346.302729 163.913951 17 -26.592761 346.302729 18 -5.729123 -26.592761 19 40.883411 -5.729123 20 -112.591550 40.883411 21 -111.403145 -112.591550 22 -165.471357 -111.403145 23 -259.477934 -165.471357 24 -160.656057 -259.477934 25 -50.024343 -160.656057 26 -182.420243 -50.024343 27 222.778905 -182.420243 28 10.642462 222.778905 29 -8.417350 10.642462 30 -385.957804 -8.417350 31 32.280072 -385.957804 32 127.600474 32.280072 33 46.742790 127.600474 34 267.390675 46.742790 35 72.363670 267.390675 36 17.587181 72.363670 37 44.828652 17.587181 38 105.367262 44.828652 39 -54.608450 105.367262 40 -115.083113 -54.608450 41 200.359662 -115.083113 42 12.713884 200.359662 43 -146.844801 12.713884 44 -49.184136 -146.844801 45 -230.742054 -49.184136 46 145.038418 -230.742054 47 -8.932358 145.038418 48 -44.424990 -8.932358 49 107.279248 -44.424990 50 149.379311 107.279248 51 189.308232 149.379311 52 -88.664568 189.308232 53 23.745375 -88.664568 54 118.568149 23.745375 55 -97.493363 118.568149 56 -253.885946 -97.493363 57 86.687751 -253.885946 58 158.033837 86.687751 59 202.160966 158.033837 60 -93.771051 202.160966 61 234.103530 -93.771051 62 -79.150379 234.103530 63 113.010245 -79.150379 64 47.772144 113.010245 65 202.056174 47.772144 66 -72.613023 202.056174 67 -17.466806 -72.613023 68 -129.844898 -17.466806 69 -580.010275 -129.844898 70 15.455188 -580.010275 71 86.111007 15.455188 72 -61.239256 86.111007 73 -13.504552 -61.239256 74 369.113142 -13.504552 75 -116.266519 369.113142 76 28.789966 -116.266519 77 59.718780 28.789966 78 -233.448669 59.718780 79 213.131956 -233.448669 80 -98.243254 213.131956 81 111.025863 -98.243254 82 -70.449116 111.025863 83 150.095083 -70.449116 84 46.249243 150.095083 85 304.347486 46.249243 86 712.703527 304.347486 87 -453.288162 712.703527 88 69.842979 -453.288162 89 -659.008637 69.842979 90 478.066962 -659.008637 91 9.499178 478.066962 92 565.084837 9.499178 93 499.381419 565.084837 94 -578.669668 499.381419 95 -88.124670 -578.669668 96 289.932031 -88.124670 97 -751.147695 289.932031 98 -761.795414 -751.147695 99 25.151260 -761.795414 100 -164.882516 25.151260 101 96.266482 -164.882516 102 1.376560 96.266482 103 208.919717 1.376560 104 NA 208.919717 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 117.619404 140.577277 [2,] -68.441491 117.619404 [3,] -89.999463 -68.441491 [4,] -134.720082 -89.999463 [5,] 111.872277 -134.720082 [6,] 87.023065 111.872277 [7,] -242.909363 87.023065 [8,] -48.935527 -242.909363 [9,] 178.317652 -48.935527 [10,] 228.672023 178.317652 [11,] -154.195764 228.672023 [12,] -134.254378 -154.195764 [13,] 6.498271 -134.254378 [14,] -244.755715 6.498271 [15,] 163.913951 -244.755715 [16,] 346.302729 163.913951 [17,] -26.592761 346.302729 [18,] -5.729123 -26.592761 [19,] 40.883411 -5.729123 [20,] -112.591550 40.883411 [21,] -111.403145 -112.591550 [22,] -165.471357 -111.403145 [23,] -259.477934 -165.471357 [24,] -160.656057 -259.477934 [25,] -50.024343 -160.656057 [26,] -182.420243 -50.024343 [27,] 222.778905 -182.420243 [28,] 10.642462 222.778905 [29,] -8.417350 10.642462 [30,] -385.957804 -8.417350 [31,] 32.280072 -385.957804 [32,] 127.600474 32.280072 [33,] 46.742790 127.600474 [34,] 267.390675 46.742790 [35,] 72.363670 267.390675 [36,] 17.587181 72.363670 [37,] 44.828652 17.587181 [38,] 105.367262 44.828652 [39,] -54.608450 105.367262 [40,] -115.083113 -54.608450 [41,] 200.359662 -115.083113 [42,] 12.713884 200.359662 [43,] -146.844801 12.713884 [44,] -49.184136 -146.844801 [45,] -230.742054 -49.184136 [46,] 145.038418 -230.742054 [47,] -8.932358 145.038418 [48,] -44.424990 -8.932358 [49,] 107.279248 -44.424990 [50,] 149.379311 107.279248 [51,] 189.308232 149.379311 [52,] -88.664568 189.308232 [53,] 23.745375 -88.664568 [54,] 118.568149 23.745375 [55,] -97.493363 118.568149 [56,] -253.885946 -97.493363 [57,] 86.687751 -253.885946 [58,] 158.033837 86.687751 [59,] 202.160966 158.033837 [60,] -93.771051 202.160966 [61,] 234.103530 -93.771051 [62,] -79.150379 234.103530 [63,] 113.010245 -79.150379 [64,] 47.772144 113.010245 [65,] 202.056174 47.772144 [66,] -72.613023 202.056174 [67,] -17.466806 -72.613023 [68,] -129.844898 -17.466806 [69,] -580.010275 -129.844898 [70,] 15.455188 -580.010275 [71,] 86.111007 15.455188 [72,] -61.239256 86.111007 [73,] -13.504552 -61.239256 [74,] 369.113142 -13.504552 [75,] -116.266519 369.113142 [76,] 28.789966 -116.266519 [77,] 59.718780 28.789966 [78,] -233.448669 59.718780 [79,] 213.131956 -233.448669 [80,] -98.243254 213.131956 [81,] 111.025863 -98.243254 [82,] -70.449116 111.025863 [83,] 150.095083 -70.449116 [84,] 46.249243 150.095083 [85,] 304.347486 46.249243 [86,] 712.703527 304.347486 [87,] -453.288162 712.703527 [88,] 69.842979 -453.288162 [89,] -659.008637 69.842979 [90,] 478.066962 -659.008637 [91,] 9.499178 478.066962 [92,] 565.084837 9.499178 [93,] 499.381419 565.084837 [94,] -578.669668 499.381419 [95,] -88.124670 -578.669668 [96,] 289.932031 -88.124670 [97,] -751.147695 289.932031 [98,] -761.795414 -751.147695 [99,] 25.151260 -761.795414 [100,] -164.882516 25.151260 [101,] 96.266482 -164.882516 [102,] 1.376560 96.266482 [103,] 208.919717 1.376560 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 117.619404 140.577277 2 -68.441491 117.619404 3 -89.999463 -68.441491 4 -134.720082 -89.999463 5 111.872277 -134.720082 6 87.023065 111.872277 7 -242.909363 87.023065 8 -48.935527 -242.909363 9 178.317652 -48.935527 10 228.672023 178.317652 11 -154.195764 228.672023 12 -134.254378 -154.195764 13 6.498271 -134.254378 14 -244.755715 6.498271 15 163.913951 -244.755715 16 346.302729 163.913951 17 -26.592761 346.302729 18 -5.729123 -26.592761 19 40.883411 -5.729123 20 -112.591550 40.883411 21 -111.403145 -112.591550 22 -165.471357 -111.403145 23 -259.477934 -165.471357 24 -160.656057 -259.477934 25 -50.024343 -160.656057 26 -182.420243 -50.024343 27 222.778905 -182.420243 28 10.642462 222.778905 29 -8.417350 10.642462 30 -385.957804 -8.417350 31 32.280072 -385.957804 32 127.600474 32.280072 33 46.742790 127.600474 34 267.390675 46.742790 35 72.363670 267.390675 36 17.587181 72.363670 37 44.828652 17.587181 38 105.367262 44.828652 39 -54.608450 105.367262 40 -115.083113 -54.608450 41 200.359662 -115.083113 42 12.713884 200.359662 43 -146.844801 12.713884 44 -49.184136 -146.844801 45 -230.742054 -49.184136 46 145.038418 -230.742054 47 -8.932358 145.038418 48 -44.424990 -8.932358 49 107.279248 -44.424990 50 149.379311 107.279248 51 189.308232 149.379311 52 -88.664568 189.308232 53 23.745375 -88.664568 54 118.568149 23.745375 55 -97.493363 118.568149 56 -253.885946 -97.493363 57 86.687751 -253.885946 58 158.033837 86.687751 59 202.160966 158.033837 60 -93.771051 202.160966 61 234.103530 -93.771051 62 -79.150379 234.103530 63 113.010245 -79.150379 64 47.772144 113.010245 65 202.056174 47.772144 66 -72.613023 202.056174 67 -17.466806 -72.613023 68 -129.844898 -17.466806 69 -580.010275 -129.844898 70 15.455188 -580.010275 71 86.111007 15.455188 72 -61.239256 86.111007 73 -13.504552 -61.239256 74 369.113142 -13.504552 75 -116.266519 369.113142 76 28.789966 -116.266519 77 59.718780 28.789966 78 -233.448669 59.718780 79 213.131956 -233.448669 80 -98.243254 213.131956 81 111.025863 -98.243254 82 -70.449116 111.025863 83 150.095083 -70.449116 84 46.249243 150.095083 85 304.347486 46.249243 86 712.703527 304.347486 87 -453.288162 712.703527 88 69.842979 -453.288162 89 -659.008637 69.842979 90 478.066962 -659.008637 91 9.499178 478.066962 92 565.084837 9.499178 93 499.381419 565.084837 94 -578.669668 499.381419 95 -88.124670 -578.669668 96 289.932031 -88.124670 97 -751.147695 289.932031 98 -761.795414 -751.147695 99 25.151260 -761.795414 100 -164.882516 25.151260 101 96.266482 -164.882516 102 1.376560 96.266482 103 208.919717 1.376560 > 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/7wzym1258654105.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/8kmnd1258654105.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/9a36b1258654105.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/10vcul1258654105.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/11due71258654105.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/124usz1258654105.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/136a781258654106.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/14o86h1258654106.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/15fzwp1258654106.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/167dab1258654106.tab") + } > > system("convert tmp/1a4311258654105.ps tmp/1a4311258654105.png") > system("convert tmp/2341h1258654105.ps tmp/2341h1258654105.png") > system("convert tmp/337751258654105.ps tmp/337751258654105.png") > system("convert tmp/4zcir1258654105.ps tmp/4zcir1258654105.png") > system("convert tmp/5e69q1258654105.ps tmp/5e69q1258654105.png") > system("convert tmp/6lzpe1258654105.ps tmp/6lzpe1258654105.png") > system("convert tmp/7wzym1258654105.ps tmp/7wzym1258654105.png") > system("convert tmp/8kmnd1258654105.ps tmp/8kmnd1258654105.png") > system("convert tmp/9a36b1258654105.ps tmp/9a36b1258654105.png") > system("convert tmp/10vcul1258654105.ps tmp/10vcul1258654105.png") > > > proc.time() user system elapsed 3.167 1.586 3.562