R version 2.11.1 (2010-05-31) Copyright (C) 2010 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(15 + ,10 + ,77 + ,15 + ,11 + ,6 + ,4 + ,16 + ,9 + ,20 + ,63 + ,12 + ,26 + ,5 + ,4 + ,24 + ,12 + ,16 + ,73 + ,15 + ,26 + ,20 + ,10 + ,22 + ,15 + ,10 + ,76 + ,12 + ,15 + ,12 + ,6 + ,21 + ,17 + ,8 + ,90 + ,14 + ,10 + ,11 + ,5 + ,23 + ,14 + ,14 + ,67 + ,8 + ,21 + ,12 + ,8 + ,23 + ,9 + ,19 + ,69 + ,11 + ,27 + ,11 + ,9 + ,21 + ,11 + ,23 + ,54 + ,4 + ,21 + ,13 + ,8 + ,22 + ,13 + ,9 + ,54 + ,13 + ,21 + ,9 + ,11 + ,20 + ,16 + ,12 + ,76 + ,19 + ,22 + ,14 + ,6 + ,12 + ,16 + ,14 + ,75 + ,10 + ,29 + ,12 + ,8 + ,23 + ,15 + ,13 + ,76 + ,15 + ,29 + ,18 + ,11 + ,23 + ,10 + ,11 + ,80 + ,6 + ,29 + ,9 + ,5 + ,30 + ,16 + ,11 + ,89 + ,7 + ,30 + ,15 + ,10 + ,22 + ,12 + ,10 + ,73 + ,14 + ,19 + ,12 + ,7 + ,21 + ,15 + ,12 + ,74 + ,16 + ,19 + ,12 + ,7 + ,21 + ,13 + ,18 + ,78 + ,16 + ,22 + ,12 + ,13 + ,15 + ,18 + ,12 + ,76 + ,14 + ,18 + ,15 + ,10 + ,22 + ,13 + ,10 + ,69 + ,15 + ,28 + ,11 + ,8 + ,24 + ,17 + ,15 + ,74 + ,14 + ,17 + ,13 + ,6 + ,23 + ,14 + ,15 + ,82 + ,12 + ,18 + ,10 + ,8 + ,15 + ,13 + ,12 + ,77 + ,9 + ,20 + ,17 + ,7 + ,24 + ,13 + ,9 + ,84 + ,12 + ,16 + ,13 + ,5 + ,24 + ,15 + ,11 + ,75 + ,14 + ,17 + ,17 + ,9 + ,21 + ,15 + ,16 + ,79 + ,14 + ,25 + ,15 + ,11 + ,21 + ,13 + ,17 + ,79 + ,10 + ,22 + ,13 + ,11 + ,18 + ,13 + ,11 + ,88 + ,16 + ,31 + ,17 + ,9 + ,19 + ,16 + ,13 + ,57 + ,10 + ,38 + ,21 + ,7 + ,29 + ,14 + ,9 + ,69 + ,8 + ,18 + ,12 + ,6 + ,20 + ,18 + ,11 + ,86 + ,12 + ,20 + ,15 + ,6 + ,24 + ,9 + ,20 + ,66 + ,8 + ,23 + ,8 + ,5 + ,27 + ,16 + ,8 + ,54 + ,13 + ,12 + ,15 + ,4 + ,28 + ,16 + ,12 + ,85 + ,11 + ,20 + ,16 + ,10 + ,24 + ,17 + ,10 + ,79 + ,12 + ,15 + ,9 + ,8 + ,29 + ,13 + ,11 + ,84 + ,16 + ,21 + ,13 + ,6 + ,24 + ,17 + ,13 + ,70 + ,16 + ,20 + ,11 + ,4 + ,25 + ,15 + ,13 + ,54 + ,13 + ,30 + ,9 + ,9 + ,14 + ,14 + ,13 + ,70 + ,14 + ,22 + ,15 + ,10 + ,22 + ,10 + ,15 + ,54 + ,5 + ,33 + ,9 + ,6 + ,24 + ,13 + ,12 + ,69 + ,14 + ,25 + ,15 + ,9 + ,24 + ,11 + ,13 + ,68 + ,13 + ,20 + ,14 + ,10 + ,24 + ,11 + ,14 + ,66 + ,15 + ,21 + ,14 + ,13 + ,21 + ,15 + ,9 + ,67 + ,11 + ,16 + ,12 + ,8 + ,21 + ,15 + ,9 + ,71 + ,15 + ,23 + ,15 + ,10 + ,21 + ,12 + ,15 + ,54 + ,16 + ,25 + ,11 + ,5 + ,15 + ,17 + ,10 + ,76 + ,13 + ,18 + ,11 + ,8 + ,26 + ,15 + ,13 + ,77 + ,11 + ,33 + ,9 + ,6 + ,22 + ,16 + ,8 + ,71 + ,12 + ,18 + ,8 + ,9 + ,24 + ,14 + ,15 + ,69 + ,12 + ,18 + ,13 + ,9 + ,13 + ,17 + ,13 + ,73 + ,10 + ,13 + ,12 + ,7 + ,19 + ,10 + ,24 + ,46 + ,8 + ,24 + ,24 + ,20 + ,10 + ,11 + ,11 + ,66 + ,9 + ,19 + ,11 + ,8 + ,28 + ,15 + ,13 + ,77 + ,12 + ,20 + ,11 + ,8 + ,25 + ,15 + ,12 + ,77 + ,14 + ,21 + ,16 + ,7 + ,24 + ,7 + ,22 + ,70 + ,12 + ,18 + ,12 + ,7 + ,22 + ,17 + ,11 + ,86 + ,11 + ,29 + ,18 + ,10 + ,30 + ,14 + ,15 + ,38 + ,14 + ,13 + ,12 + ,5 + ,22 + ,18 + ,7 + ,66 + ,7 + ,26 + ,14 + ,8 + ,24 + ,14 + ,14 + ,75 + ,16 + ,22 + ,16 + ,9 + ,23 + ,14 + ,10 + ,64 + ,11 + ,28 + ,24 + ,20 + ,20 + ,9 + ,9 + ,80 + ,16 + ,28 + ,13 + ,6 + ,22 + ,14 + ,12 + ,86 + ,13 + ,23 + ,11 + ,10 + ,22 + ,11 + ,16 + ,54 + ,11 + ,22 + ,14 + ,11 + ,19 + ,16 + ,13 + ,74 + ,13 + ,28 + ,12 + ,7 + ,22 + ,17 + ,11 + ,88 + ,14 + ,31 + ,21 + ,12 + ,26 + ,12 + ,11 + ,63 + ,10 + ,15 + ,11 + ,8 + ,12 + ,15 + ,13 + ,81 + ,15 + ,15 + ,6 + ,6 + ,25 + ,15 + ,10 + ,74 + ,11 + ,22 + ,14 + ,9 + ,23 + ,16 + ,11 + ,80 + ,6 + ,17 + ,16 + ,5 + ,23 + ,16 + ,9 + ,80 + ,11 + ,25 + ,18 + ,11 + ,17 + ,11 + ,13 + ,60 + ,12 + ,32 + ,9 + ,6 + ,26 + ,12 + ,14 + ,62 + ,12 + ,23 + ,13 + ,10 + ,27 + ,14 + ,14 + ,63 + ,8 + ,20 + ,17 + ,8 + ,23 + ,15 + ,11 + ,89 + ,9 + ,20 + ,11 + ,7 + ,20 + ,17 + ,10 + ,76 + ,10 + ,28 + ,16 + ,8 + ,24 + ,19 + ,11 + ,81 + ,16 + ,20 + ,11 + ,9 + ,22 + ,15 + ,12 + ,72 + ,15 + ,20 + ,11 + ,8 + ,26 + ,16 + ,14 + ,84 + ,14 + ,23 + ,11 + ,10 + ,29 + ,14 + ,14 + ,76 + ,12 + ,20 + ,20 + ,13 + ,20 + ,16 + ,21 + ,76 + ,12 + ,21 + ,10 + ,7 + ,17 + ,15 + ,13 + ,72 + ,12 + ,14 + ,12 + ,7 + ,16 + ,17 + ,11 + ,81 + ,8 + ,31 + ,11 + ,8 + ,24 + ,12 + ,12 + ,72 + ,16 + ,21 + ,14 + ,9 + ,24 + ,18 + ,12 + ,78 + ,11 + ,18 + ,12 + ,9 + ,19 + ,13 + ,11 + ,79 + ,12 + ,26 + ,12 + ,8 + ,29 + ,14 + ,14 + ,52 + ,9 + ,25 + ,12 + ,7 + ,25 + ,14 + ,13 + ,67 + ,14 + ,9 + ,10 + ,6 + ,25 + ,14 + ,13 + ,74 + ,15 + ,18 + ,12 + ,8 + ,24 + ,12 + ,12 + ,73 + ,8 + ,19 + ,10 + ,8 + ,29 + ,14 + ,14 + ,69 + ,12 + ,29 + ,7 + ,4 + ,22 + ,12 + ,12 + ,67 + ,10 + ,31 + ,10 + ,8 + ,23 + ,15 + ,12 + ,76 + ,16 + ,24 + ,13 + ,10 + ,15 + ,11 + ,18 + ,63 + ,8 + ,19 + ,13 + ,8 + ,21 + ,15 + ,11 + ,84 + ,9 + ,19 + ,9 + ,7 + ,23 + ,14 + ,15 + ,90 + ,8 + ,22 + ,14 + ,10 + ,20 + ,15 + ,13 + ,75 + ,11 + ,31 + ,14 + ,9 + ,25 + ,16 + ,11 + ,76 + ,16 + ,20 + ,12 + ,8 + ,28 + ,14 + ,22 + ,53 + ,5 + ,26 + ,18 + ,5 + ,18 + ,18 + ,10 + ,87 + ,15 + ,17 + ,17 + ,8 + ,25 + ,14 + ,11 + ,78 + ,15 + ,16 + ,15 + ,9 + ,24 + ,13 + ,15 + ,54 + ,12 + ,9 + ,8 + ,11 + ,23 + ,14 + ,14 + ,58 + ,12 + ,19 + ,8 + ,7 + ,25 + ,14 + ,11 + ,80 + ,16 + ,22 + ,12 + ,8 + ,27 + ,17 + ,10 + ,74 + ,12 + ,15 + ,10 + ,4 + ,24 + ,12 + ,14 + ,56 + ,10 + ,25 + ,18 + ,16 + ,24 + ,16 + ,14 + ,82 + ,12 + ,30 + ,15 + ,9 + ,26 + ,10 + ,15 + ,67 + ,11 + ,24 + ,11 + ,12 + ,26 + ,13 + ,11 + ,75 + ,16 + ,20 + ,10 + ,8 + ,23 + ,15 + ,10 + ,69 + ,7 + ,12 + ,7 + ,4 + ,28 + ,16 + ,10 + ,72 + ,9 + ,31 + ,17 + ,11 + ,20 + ,14 + ,12 + ,54 + ,11 + ,25 + ,7 + ,8 + ,23 + ,13 + ,15 + ,54 + ,6 + ,23 + ,14 + ,12 + ,24 + ,17 + ,10 + ,71 + ,14 + ,23 + ,12 + ,8 + ,21 + ,14 + ,12 + ,53 + ,11 + ,26 + ,15 + ,6 + ,25 + ,16 + ,15 + ,54 + ,11 + ,14 + ,13 + ,8 + ,16 + ,12 + ,11 + ,69 + ,16 + ,28 + ,16 + ,14 + ,22 + ,16 + ,10 + ,30 + ,7 + ,19 + ,11 + ,10 + ,27 + ,8 + ,20 + ,53 + ,8 + ,21 + ,7 + ,5 + ,24 + ,9 + ,19 + ,68 + ,10 + ,18 + ,15 + ,8 + ,17 + ,13 + ,17 + ,69 + ,14 + ,29 + ,18 + ,12 + ,21 + ,19 + ,8 + ,54 + ,9 + ,16 + ,11 + ,11 + ,21 + ,11 + ,17 + ,66 + ,13 + ,22 + ,13 + ,8 + ,19 + ,15 + ,11 + ,79 + ,13 + ,15 + ,11 + ,8 + ,25 + ,11 + ,13 + ,67 + ,12 + ,21 + ,13 + ,9 + ,24 + ,15 + ,9 + ,74 + ,11 + ,17 + ,12 + ,6 + ,21 + ,16 + ,10 + ,86 + ,10 + ,17 + ,11 + ,5 + ,26 + ,15 + ,13 + ,63 + ,12 + ,33 + ,11 + ,8 + ,25 + ,12 + ,16 + ,69 + ,14 + ,17 + ,13 + ,7 + ,25 + ,16 + ,12 + ,73 + ,11 + ,20 + ,8 + ,4 + ,13 + ,15 + ,14 + ,69 + ,13 + ,17 + ,12 + ,9 + ,25 + ,13 + ,11 + ,71 + ,14 + ,16 + ,9 + ,5 + ,23 + ,14 + ,13 + ,77 + ,13 + ,18 + ,14 + ,9 + ,26 + ,11 + ,15 + ,74 + ,16 + ,32 + ,18 + ,12 + ,22 + ,15 + ,14 + ,82 + ,13 + ,22 + ,15 + ,6 + ,20 + ,14 + ,14 + ,54 + ,9 + ,29 + ,11 + ,6 + ,24 + ,13 + ,10 + ,80 + ,14 + ,23 + ,17 + ,7 + ,21 + ,15 + ,8 + ,76 + ,15 + ,17 + ,12 + ,9 + ,24) + ,dim=c(8 + ,137) + ,dimnames=list(c('Happiness' + ,'Depression' + ,'Belonging' + ,'Popularity' + ,'ConcernOverMistakes' + ,'ParentalExpectations' + ,'ParentalCriticism' + ,'Organization') + ,1:137)) > y <- array(NA,dim=c(8,137),dimnames=list(c('Happiness','Depression','Belonging','Popularity','ConcernOverMistakes','ParentalExpectations','ParentalCriticism','Organization'),1:137)) > for (i in 1:dim(x)[1]) + { + for (j in 1:dim(x)[2]) + { + y[i,j] <- as.numeric(x[i,j]) + } + } > par3 = 'No Linear Trend' > par2 = 'Do not include Seasonal Dummies' > par1 = '1' > #'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 > 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 Happiness Depression Belonging Popularity ConcernOverMistakes 1 15 10 77 15 11 2 9 20 63 12 26 3 12 16 73 15 26 4 15 10 76 12 15 5 17 8 90 14 10 6 14 14 67 8 21 7 9 19 69 11 27 8 11 23 54 4 21 9 13 9 54 13 21 10 16 12 76 19 22 11 16 14 75 10 29 12 15 13 76 15 29 13 10 11 80 6 29 14 16 11 89 7 30 15 12 10 73 14 19 16 15 12 74 16 19 17 13 18 78 16 22 18 18 12 76 14 18 19 13 10 69 15 28 20 17 15 74 14 17 21 14 15 82 12 18 22 13 12 77 9 20 23 13 9 84 12 16 24 15 11 75 14 17 25 15 16 79 14 25 26 13 17 79 10 22 27 13 11 88 16 31 28 16 13 57 10 38 29 14 9 69 8 18 30 18 11 86 12 20 31 9 20 66 8 23 32 16 8 54 13 12 33 16 12 85 11 20 34 17 10 79 12 15 35 13 11 84 16 21 36 17 13 70 16 20 37 15 13 54 13 30 38 14 13 70 14 22 39 10 15 54 5 33 40 13 12 69 14 25 41 11 13 68 13 20 42 11 14 66 15 21 43 15 9 67 11 16 44 15 9 71 15 23 45 12 15 54 16 25 46 17 10 76 13 18 47 15 13 77 11 33 48 16 8 71 12 18 49 14 15 69 12 18 50 17 13 73 10 13 51 10 24 46 8 24 52 11 11 66 9 19 53 15 13 77 12 20 54 15 12 77 14 21 55 7 22 70 12 18 56 17 11 86 11 29 57 14 15 38 14 13 58 18 7 66 7 26 59 14 14 75 16 22 60 14 10 64 11 28 61 9 9 80 16 28 62 14 12 86 13 23 63 11 16 54 11 22 64 16 13 74 13 28 65 17 11 88 14 31 66 12 11 63 10 15 67 15 13 81 15 15 68 15 10 74 11 22 69 16 11 80 6 17 70 16 9 80 11 25 71 11 13 60 12 32 72 12 14 62 12 23 73 14 14 63 8 20 74 15 11 89 9 20 75 17 10 76 10 28 76 19 11 81 16 20 77 15 12 72 15 20 78 16 14 84 14 23 79 14 14 76 12 20 80 16 21 76 12 21 81 15 13 72 12 14 82 17 11 81 8 31 83 12 12 72 16 21 84 18 12 78 11 18 85 13 11 79 12 26 86 14 14 52 9 25 87 14 13 67 14 9 88 14 13 74 15 18 89 12 12 73 8 19 90 14 14 69 12 29 91 12 12 67 10 31 92 15 12 76 16 24 93 11 18 63 8 19 94 15 11 84 9 19 95 14 15 90 8 22 96 15 13 75 11 31 97 16 11 76 16 20 98 14 22 53 5 26 99 18 10 87 15 17 100 14 11 78 15 16 101 13 15 54 12 9 102 14 14 58 12 19 103 14 11 80 16 22 104 17 10 74 12 15 105 12 14 56 10 25 106 16 14 82 12 30 107 10 15 67 11 24 108 13 11 75 16 20 109 15 10 69 7 12 110 16 10 72 9 31 111 14 12 54 11 25 112 13 15 54 6 23 113 17 10 71 14 23 114 14 12 53 11 26 115 16 15 54 11 14 116 12 11 69 16 28 117 16 10 30 7 19 118 8 20 53 8 21 119 9 19 68 10 18 120 13 17 69 14 29 121 19 8 54 9 16 122 11 17 66 13 22 123 15 11 79 13 15 124 11 13 67 12 21 125 15 9 74 11 17 126 16 10 86 10 17 127 15 13 63 12 33 128 12 16 69 14 17 129 16 12 73 11 20 130 15 14 69 13 17 131 13 11 71 14 16 132 14 13 77 13 18 133 11 15 74 16 32 134 15 14 82 13 22 135 14 14 54 9 29 136 13 10 80 14 23 137 15 8 76 15 17 ParentalExpectations ParentalCriticism Organization 1 6 4 16 2 5 4 24 3 20 10 22 4 12 6 21 5 11 5 23 6 12 8 23 7 11 9 21 8 13 8 22 9 9 11 20 10 14 6 12 11 12 8 23 12 18 11 23 13 9 5 30 14 15 10 22 15 12 7 21 16 12 7 21 17 12 13 15 18 15 10 22 19 11 8 24 20 13 6 23 21 10 8 15 22 17 7 24 23 13 5 24 24 17 9 21 25 15 11 21 26 13 11 18 27 17 9 19 28 21 7 29 29 12 6 20 30 15 6 24 31 8 5 27 32 15 4 28 33 16 10 24 34 9 8 29 35 13 6 24 36 11 4 25 37 9 9 14 38 15 10 22 39 9 6 24 40 15 9 24 41 14 10 24 42 14 13 21 43 12 8 21 44 15 10 21 45 11 5 15 46 11 8 26 47 9 6 22 48 8 9 24 49 13 9 13 50 12 7 19 51 24 20 10 52 11 8 28 53 11 8 25 54 16 7 24 55 12 7 22 56 18 10 30 57 12 5 22 58 14 8 24 59 16 9 23 60 24 20 20 61 13 6 22 62 11 10 22 63 14 11 19 64 12 7 22 65 21 12 26 66 11 8 12 67 6 6 25 68 14 9 23 69 16 5 23 70 18 11 17 71 9 6 26 72 13 10 27 73 17 8 23 74 11 7 20 75 16 8 24 76 11 9 22 77 11 8 26 78 11 10 29 79 20 13 20 80 10 7 17 81 12 7 16 82 11 8 24 83 14 9 24 84 12 9 19 85 12 8 29 86 12 7 25 87 10 6 25 88 12 8 24 89 10 8 29 90 7 4 22 91 10 8 23 92 13 10 15 93 13 8 21 94 9 7 23 95 14 10 20 96 14 9 25 97 12 8 28 98 18 5 18 99 17 8 25 100 15 9 24 101 8 11 23 102 8 7 25 103 12 8 27 104 10 4 24 105 18 16 24 106 15 9 26 107 11 12 26 108 10 8 23 109 7 4 28 110 17 11 20 111 7 8 23 112 14 12 24 113 12 8 21 114 15 6 25 115 13 8 16 116 16 14 22 117 11 10 27 118 7 5 24 119 15 8 17 120 18 12 21 121 11 11 21 122 13 8 19 123 11 8 25 124 13 9 24 125 12 6 21 126 11 5 26 127 11 8 25 128 13 7 25 129 8 4 13 130 12 9 25 131 9 5 23 132 14 9 26 133 18 12 22 134 15 6 20 135 11 6 24 136 17 7 21 137 12 9 24 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) Depression Belonging 18.47137 -0.37185 0.03458 Popularity ConcernOverMistakes ParentalExpectations -0.05517 -0.04486 0.11165 ParentalCriticism Organization -0.07922 -0.05481 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -6.52275 -1.32970 0.05296 1.28674 4.68317 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 18.47137 2.20371 8.382 7.71e-14 *** Depression -0.37185 0.05838 -6.370 3.06e-09 *** Belonging 0.03458 0.01718 2.014 0.0461 * Popularity -0.05517 0.06232 -0.885 0.3776 ConcernOverMistakes -0.04486 0.03211 -1.397 0.1647 ParentalExpectations 0.11165 0.06177 1.808 0.0730 . ParentalCriticism -0.07922 0.07844 -1.010 0.3144 Organization -0.05481 0.04683 -1.170 0.2440 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 1.966 on 129 degrees of freedom Multiple R-squared: 0.3477, Adjusted R-squared: 0.3123 F-statistic: 9.822 on 7 and 129 DF, p-value: 8.891e-10 > 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.2679063 0.53581261 0.73209369 [2,] 0.2212448 0.44248955 0.77875522 [3,] 0.7308467 0.53830657 0.26915329 [4,] 0.6192638 0.76147240 0.38073620 [5,] 0.6576396 0.68472079 0.34236039 [6,] 0.6022411 0.79551771 0.39775886 [7,] 0.5203631 0.95927380 0.47963690 [8,] 0.6465989 0.70680227 0.35340114 [9,] 0.5662885 0.86742292 0.43371146 [10,] 0.6844091 0.63118171 0.31559086 [11,] 0.6130168 0.77396639 0.38698320 [12,] 0.6513692 0.69726162 0.34863081 [13,] 0.7095347 0.58093061 0.29046531 [14,] 0.6515423 0.69691536 0.34845768 [15,] 0.6045584 0.79088330 0.39544165 [16,] 0.5497544 0.90049116 0.45024558 [17,] 0.5460529 0.90789414 0.45394707 [18,] 0.6582523 0.68349548 0.34174774 [19,] 0.6182868 0.76342646 0.38171323 [20,] 0.6648345 0.67033096 0.33516548 [21,] 0.6348951 0.73020985 0.36510493 [22,] 0.5722799 0.85544014 0.42772007 [23,] 0.5144270 0.97114602 0.48557301 [24,] 0.5363790 0.92724205 0.46362102 [25,] 0.5398321 0.92033587 0.46016793 [26,] 0.6427393 0.71452139 0.35726069 [27,] 0.6894099 0.62118016 0.31059008 [28,] 0.6420959 0.71580813 0.35790406 [29,] 0.6223726 0.75525476 0.37762738 [30,] 0.5963234 0.80735313 0.40367656 [31,] 0.6787928 0.64241438 0.32120719 [32,] 0.7053800 0.58923997 0.29461999 [33,] 0.6578027 0.68439455 0.34219727 [34,] 0.6054953 0.78900943 0.39450471 [35,] 0.5623773 0.87524544 0.43762272 [36,] 0.5809809 0.83803819 0.41901909 [37,] 0.5830281 0.83394382 0.41697191 [38,] 0.5482857 0.90342861 0.45171430 [39,] 0.4944607 0.98892137 0.50553932 [40,] 0.5141293 0.97174144 0.48587072 [41,] 0.4686594 0.93731872 0.53134064 [42,] 0.5462879 0.90742415 0.45371207 [43,] 0.5090443 0.98191139 0.49095569 [44,] 0.4561960 0.91239196 0.54380402 [45,] 0.6057618 0.78847648 0.39423824 [46,] 0.5989118 0.80217645 0.40108823 [47,] 0.5853469 0.82930615 0.41465308 [48,] 0.5832033 0.83359333 0.41679666 [49,] 0.5334122 0.93317565 0.46658782 [50,] 0.5008217 0.99835661 0.49917831 [51,] 0.8900561 0.21988788 0.10994394 [52,] 0.8660918 0.26781631 0.13390816 [53,] 0.8502963 0.29940745 0.14970373 [54,] 0.8563563 0.28728731 0.14364365 [55,] 0.8504870 0.29902597 0.14951298 [56,] 0.9035135 0.19297298 0.09648649 [57,] 0.8878728 0.22425430 0.11212715 [58,] 0.8624153 0.27516943 0.13758472 [59,] 0.8327544 0.33449126 0.16724563 [60,] 0.8027562 0.39448755 0.19724378 [61,] 0.8000090 0.39998209 0.19999105 [62,] 0.7682785 0.46344309 0.23172155 [63,] 0.7268838 0.54623242 0.27311621 [64,] 0.6958879 0.60822427 0.30411213 [65,] 0.6786547 0.64269070 0.32134535 [66,] 0.8215232 0.35695355 0.17847677 [67,] 0.7976845 0.40463096 0.20231548 [68,] 0.8525414 0.29491725 0.14745862 [69,] 0.8221411 0.35571789 0.17785894 [70,] 0.9574407 0.08511858 0.04255929 [71,] 0.9441614 0.11167724 0.05583862 [72,] 0.9495654 0.10086920 0.05043460 [73,] 0.9524435 0.09511294 0.04755647 [74,] 0.9731692 0.05366152 0.02683076 [75,] 0.9679858 0.06402845 0.03201422 [76,] 0.9598188 0.08036248 0.04018124 [77,] 0.9463464 0.10730723 0.05365362 [78,] 0.9307283 0.13854349 0.06927175 [79,] 0.9340184 0.13196318 0.06598159 [80,] 0.9203448 0.15931032 0.07965516 [81,] 0.9235960 0.15280796 0.07640398 [82,] 0.9061788 0.18764237 0.09382119 [83,] 0.8896554 0.22068914 0.11034457 [84,] 0.8600557 0.27988863 0.13994431 [85,] 0.8278861 0.34422783 0.17211392 [86,] 0.8047398 0.39052044 0.19526022 [87,] 0.8092308 0.38153838 0.19076919 [88,] 0.8441036 0.31179271 0.15589636 [89,] 0.8762884 0.24742316 0.12371158 [90,] 0.8464170 0.30716600 0.15358300 [91,] 0.8183922 0.36321570 0.18160785 [92,] 0.7976828 0.40463437 0.20231718 [93,] 0.7521205 0.49575905 0.24787952 [94,] 0.7325684 0.53486325 0.26743162 [95,] 0.6909852 0.61802951 0.30901475 [96,] 0.8105671 0.37886584 0.18943292 [97,] 0.8091646 0.38167080 0.19083540 [98,] 0.7770835 0.44583309 0.22291655 [99,] 0.7262649 0.54747017 0.27373509 [100,] 0.6658327 0.66833463 0.33416731 [101,] 0.6098227 0.78035464 0.39017732 [102,] 0.5438838 0.91223243 0.45611621 [103,] 0.5397371 0.92052585 0.46026292 [104,] 0.4618606 0.92372123 0.53813939 [105,] 0.5736008 0.85279842 0.42639921 [106,] 0.6613642 0.67727153 0.33863576 [107,] 0.6110357 0.77792853 0.38896426 [108,] 0.7055261 0.58894779 0.29447389 [109,] 0.8369650 0.32607009 0.16303505 [110,] 0.7875068 0.42498635 0.21249318 [111,] 0.8657883 0.26842348 0.13421174 [112,] 0.8325771 0.33484577 0.16742289 [113,] 0.7386163 0.52276739 0.26138370 [114,] 0.9025495 0.19490105 0.09745053 [115,] 0.8208562 0.35828756 0.17914378 [116,] 0.8190814 0.36183719 0.18091859 > postscript(file="/var/www/rcomp/tmp/198et1290350865.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/rcomp/tmp/298et1290350865.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/rcomp/tmp/398et1290350865.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/rcomp/tmp/42zdv1290350865.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/rcomp/tmp/52zdv1290350865.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 = 137 Frequency = 1 1 2 3 4 5 6 -0.57075628 -1.31049464 -1.28728685 -0.75965217 0.04055082 0.35556191 7 8 9 10 11 12 -2.33839356 0.76465104 -1.37003575 0.96770993 2.54814868 0.98533924 13 14 15 16 17 18 -4.48005384 0.59643823 -3.28687327 0.53259273 0.90642331 3.26573517 19 20 21 22 23 24 -1.33427925 3.36681601 0.07957252 -2.30634371 -3.38975323 -0.47373451 25 26 27 28 29 30 1.98784480 0.06327839 -2.29450739 2.44735758 -2.03033128 2.32015369 31 32 33 34 35 36 -1.86083588 0.06835323 0.87665376 2.06848878 -2.12181259 3.18087195 37 38 39 40 41 42 2.03382863 0.02454557 -2.21882877 -1.14773020 -2.82991335 -2.16044692 43 44 45 46 47 48 -0.67211100 -0.45221481 -0.76665185 1.97426808 1.46345953 0.65287036 49 50 51 52 53 54 0.16380829 2.22917674 -0.16677329 -3.37425130 1.03497863 0.12604370 55 56 57 58 59 60 -3.82131269 1.97955590 1.41000451 1.78784169 0.19776039 -1.10210691 61 62 63 64 65 66 -6.52275359 -0.46435055 -1.44563828 2.19750658 1.76988188 -3.27175988 67 68 69 70 71 72 1.23766223 -0.30762497 -0.18366555 -0.36941970 -1.71905642 -0.89505489 73 74 75 76 77 78 -0.10922798 -0.64253326 1.58949908 4.28842708 1.05638197 2.78737193 79 80 81 82 83 84 -0.44139978 4.68317252 0.25453940 2.37093493 -2.20893678 3.12234508 85 86 87 88 89 90 -1.40111557 1.13935162 -0.04912816 0.04806211 -2.13319938 1.05256050 91 92 93 94 95 96 -1.60584798 0.48489295 -1.32970131 -0.12673831 -0.25244910 1.28674033 97 98 99 100 101 102 1.59933923 2.69170164 1.93460232 -1.17943768 0.54361487 1.27479680 103 104 105 106 107 108 -0.50408050 1.53880853 -0.95552945 2.36997198 -2.37949509 -1.41682796 109 110 111 112 113 114 -0.14453165 0.71402412 0.96469315 0.30478273 2.04097314 0.10209796 115 116 117 118 119 120 2.53315009 -2.09980105 2.49220979 -2.55375220 -3.50783592 0.62925702 121 122 123 124 125 126 3.64460371 -1.50446405 0.05296401 -2.77321022 -1.02778143 0.18037220 127 128 129 130 131 132 2.10238512 -0.89956755 1.10662053 1.57165503 -1.69431206 -0.20049794 133 134 135 136 137 -1.98761360 0.49969924 1.22725711 -2.90776846 -0.84600080 > postscript(file="/var/www/rcomp/tmp/62zdv1290350865.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 = 137 Frequency = 1 lag(myerror, k = 1) myerror 0 -0.57075628 NA 1 -1.31049464 -0.57075628 2 -1.28728685 -1.31049464 3 -0.75965217 -1.28728685 4 0.04055082 -0.75965217 5 0.35556191 0.04055082 6 -2.33839356 0.35556191 7 0.76465104 -2.33839356 8 -1.37003575 0.76465104 9 0.96770993 -1.37003575 10 2.54814868 0.96770993 11 0.98533924 2.54814868 12 -4.48005384 0.98533924 13 0.59643823 -4.48005384 14 -3.28687327 0.59643823 15 0.53259273 -3.28687327 16 0.90642331 0.53259273 17 3.26573517 0.90642331 18 -1.33427925 3.26573517 19 3.36681601 -1.33427925 20 0.07957252 3.36681601 21 -2.30634371 0.07957252 22 -3.38975323 -2.30634371 23 -0.47373451 -3.38975323 24 1.98784480 -0.47373451 25 0.06327839 1.98784480 26 -2.29450739 0.06327839 27 2.44735758 -2.29450739 28 -2.03033128 2.44735758 29 2.32015369 -2.03033128 30 -1.86083588 2.32015369 31 0.06835323 -1.86083588 32 0.87665376 0.06835323 33 2.06848878 0.87665376 34 -2.12181259 2.06848878 35 3.18087195 -2.12181259 36 2.03382863 3.18087195 37 0.02454557 2.03382863 38 -2.21882877 0.02454557 39 -1.14773020 -2.21882877 40 -2.82991335 -1.14773020 41 -2.16044692 -2.82991335 42 -0.67211100 -2.16044692 43 -0.45221481 -0.67211100 44 -0.76665185 -0.45221481 45 1.97426808 -0.76665185 46 1.46345953 1.97426808 47 0.65287036 1.46345953 48 0.16380829 0.65287036 49 2.22917674 0.16380829 50 -0.16677329 2.22917674 51 -3.37425130 -0.16677329 52 1.03497863 -3.37425130 53 0.12604370 1.03497863 54 -3.82131269 0.12604370 55 1.97955590 -3.82131269 56 1.41000451 1.97955590 57 1.78784169 1.41000451 58 0.19776039 1.78784169 59 -1.10210691 0.19776039 60 -6.52275359 -1.10210691 61 -0.46435055 -6.52275359 62 -1.44563828 -0.46435055 63 2.19750658 -1.44563828 64 1.76988188 2.19750658 65 -3.27175988 1.76988188 66 1.23766223 -3.27175988 67 -0.30762497 1.23766223 68 -0.18366555 -0.30762497 69 -0.36941970 -0.18366555 70 -1.71905642 -0.36941970 71 -0.89505489 -1.71905642 72 -0.10922798 -0.89505489 73 -0.64253326 -0.10922798 74 1.58949908 -0.64253326 75 4.28842708 1.58949908 76 1.05638197 4.28842708 77 2.78737193 1.05638197 78 -0.44139978 2.78737193 79 4.68317252 -0.44139978 80 0.25453940 4.68317252 81 2.37093493 0.25453940 82 -2.20893678 2.37093493 83 3.12234508 -2.20893678 84 -1.40111557 3.12234508 85 1.13935162 -1.40111557 86 -0.04912816 1.13935162 87 0.04806211 -0.04912816 88 -2.13319938 0.04806211 89 1.05256050 -2.13319938 90 -1.60584798 1.05256050 91 0.48489295 -1.60584798 92 -1.32970131 0.48489295 93 -0.12673831 -1.32970131 94 -0.25244910 -0.12673831 95 1.28674033 -0.25244910 96 1.59933923 1.28674033 97 2.69170164 1.59933923 98 1.93460232 2.69170164 99 -1.17943768 1.93460232 100 0.54361487 -1.17943768 101 1.27479680 0.54361487 102 -0.50408050 1.27479680 103 1.53880853 -0.50408050 104 -0.95552945 1.53880853 105 2.36997198 -0.95552945 106 -2.37949509 2.36997198 107 -1.41682796 -2.37949509 108 -0.14453165 -1.41682796 109 0.71402412 -0.14453165 110 0.96469315 0.71402412 111 0.30478273 0.96469315 112 2.04097314 0.30478273 113 0.10209796 2.04097314 114 2.53315009 0.10209796 115 -2.09980105 2.53315009 116 2.49220979 -2.09980105 117 -2.55375220 2.49220979 118 -3.50783592 -2.55375220 119 0.62925702 -3.50783592 120 3.64460371 0.62925702 121 -1.50446405 3.64460371 122 0.05296401 -1.50446405 123 -2.77321022 0.05296401 124 -1.02778143 -2.77321022 125 0.18037220 -1.02778143 126 2.10238512 0.18037220 127 -0.89956755 2.10238512 128 1.10662053 -0.89956755 129 1.57165503 1.10662053 130 -1.69431206 1.57165503 131 -0.20049794 -1.69431206 132 -1.98761360 -0.20049794 133 0.49969924 -1.98761360 134 1.22725711 0.49969924 135 -2.90776846 1.22725711 136 -0.84600080 -2.90776846 137 NA -0.84600080 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -1.31049464 -0.57075628 [2,] -1.28728685 -1.31049464 [3,] -0.75965217 -1.28728685 [4,] 0.04055082 -0.75965217 [5,] 0.35556191 0.04055082 [6,] -2.33839356 0.35556191 [7,] 0.76465104 -2.33839356 [8,] -1.37003575 0.76465104 [9,] 0.96770993 -1.37003575 [10,] 2.54814868 0.96770993 [11,] 0.98533924 2.54814868 [12,] -4.48005384 0.98533924 [13,] 0.59643823 -4.48005384 [14,] -3.28687327 0.59643823 [15,] 0.53259273 -3.28687327 [16,] 0.90642331 0.53259273 [17,] 3.26573517 0.90642331 [18,] -1.33427925 3.26573517 [19,] 3.36681601 -1.33427925 [20,] 0.07957252 3.36681601 [21,] -2.30634371 0.07957252 [22,] -3.38975323 -2.30634371 [23,] -0.47373451 -3.38975323 [24,] 1.98784480 -0.47373451 [25,] 0.06327839 1.98784480 [26,] -2.29450739 0.06327839 [27,] 2.44735758 -2.29450739 [28,] -2.03033128 2.44735758 [29,] 2.32015369 -2.03033128 [30,] -1.86083588 2.32015369 [31,] 0.06835323 -1.86083588 [32,] 0.87665376 0.06835323 [33,] 2.06848878 0.87665376 [34,] -2.12181259 2.06848878 [35,] 3.18087195 -2.12181259 [36,] 2.03382863 3.18087195 [37,] 0.02454557 2.03382863 [38,] -2.21882877 0.02454557 [39,] -1.14773020 -2.21882877 [40,] -2.82991335 -1.14773020 [41,] -2.16044692 -2.82991335 [42,] -0.67211100 -2.16044692 [43,] -0.45221481 -0.67211100 [44,] -0.76665185 -0.45221481 [45,] 1.97426808 -0.76665185 [46,] 1.46345953 1.97426808 [47,] 0.65287036 1.46345953 [48,] 0.16380829 0.65287036 [49,] 2.22917674 0.16380829 [50,] -0.16677329 2.22917674 [51,] -3.37425130 -0.16677329 [52,] 1.03497863 -3.37425130 [53,] 0.12604370 1.03497863 [54,] -3.82131269 0.12604370 [55,] 1.97955590 -3.82131269 [56,] 1.41000451 1.97955590 [57,] 1.78784169 1.41000451 [58,] 0.19776039 1.78784169 [59,] -1.10210691 0.19776039 [60,] -6.52275359 -1.10210691 [61,] -0.46435055 -6.52275359 [62,] -1.44563828 -0.46435055 [63,] 2.19750658 -1.44563828 [64,] 1.76988188 2.19750658 [65,] -3.27175988 1.76988188 [66,] 1.23766223 -3.27175988 [67,] -0.30762497 1.23766223 [68,] -0.18366555 -0.30762497 [69,] -0.36941970 -0.18366555 [70,] -1.71905642 -0.36941970 [71,] -0.89505489 -1.71905642 [72,] -0.10922798 -0.89505489 [73,] -0.64253326 -0.10922798 [74,] 1.58949908 -0.64253326 [75,] 4.28842708 1.58949908 [76,] 1.05638197 4.28842708 [77,] 2.78737193 1.05638197 [78,] -0.44139978 2.78737193 [79,] 4.68317252 -0.44139978 [80,] 0.25453940 4.68317252 [81,] 2.37093493 0.25453940 [82,] -2.20893678 2.37093493 [83,] 3.12234508 -2.20893678 [84,] -1.40111557 3.12234508 [85,] 1.13935162 -1.40111557 [86,] -0.04912816 1.13935162 [87,] 0.04806211 -0.04912816 [88,] -2.13319938 0.04806211 [89,] 1.05256050 -2.13319938 [90,] -1.60584798 1.05256050 [91,] 0.48489295 -1.60584798 [92,] -1.32970131 0.48489295 [93,] -0.12673831 -1.32970131 [94,] -0.25244910 -0.12673831 [95,] 1.28674033 -0.25244910 [96,] 1.59933923 1.28674033 [97,] 2.69170164 1.59933923 [98,] 1.93460232 2.69170164 [99,] -1.17943768 1.93460232 [100,] 0.54361487 -1.17943768 [101,] 1.27479680 0.54361487 [102,] -0.50408050 1.27479680 [103,] 1.53880853 -0.50408050 [104,] -0.95552945 1.53880853 [105,] 2.36997198 -0.95552945 [106,] -2.37949509 2.36997198 [107,] -1.41682796 -2.37949509 [108,] -0.14453165 -1.41682796 [109,] 0.71402412 -0.14453165 [110,] 0.96469315 0.71402412 [111,] 0.30478273 0.96469315 [112,] 2.04097314 0.30478273 [113,] 0.10209796 2.04097314 [114,] 2.53315009 0.10209796 [115,] -2.09980105 2.53315009 [116,] 2.49220979 -2.09980105 [117,] -2.55375220 2.49220979 [118,] -3.50783592 -2.55375220 [119,] 0.62925702 -3.50783592 [120,] 3.64460371 0.62925702 [121,] -1.50446405 3.64460371 [122,] 0.05296401 -1.50446405 [123,] -2.77321022 0.05296401 [124,] -1.02778143 -2.77321022 [125,] 0.18037220 -1.02778143 [126,] 2.10238512 0.18037220 [127,] -0.89956755 2.10238512 [128,] 1.10662053 -0.89956755 [129,] 1.57165503 1.10662053 [130,] -1.69431206 1.57165503 [131,] -0.20049794 -1.69431206 [132,] -1.98761360 -0.20049794 [133,] 0.49969924 -1.98761360 [134,] 1.22725711 0.49969924 [135,] -2.90776846 1.22725711 [136,] -0.84600080 -2.90776846 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -1.31049464 -0.57075628 2 -1.28728685 -1.31049464 3 -0.75965217 -1.28728685 4 0.04055082 -0.75965217 5 0.35556191 0.04055082 6 -2.33839356 0.35556191 7 0.76465104 -2.33839356 8 -1.37003575 0.76465104 9 0.96770993 -1.37003575 10 2.54814868 0.96770993 11 0.98533924 2.54814868 12 -4.48005384 0.98533924 13 0.59643823 -4.48005384 14 -3.28687327 0.59643823 15 0.53259273 -3.28687327 16 0.90642331 0.53259273 17 3.26573517 0.90642331 18 -1.33427925 3.26573517 19 3.36681601 -1.33427925 20 0.07957252 3.36681601 21 -2.30634371 0.07957252 22 -3.38975323 -2.30634371 23 -0.47373451 -3.38975323 24 1.98784480 -0.47373451 25 0.06327839 1.98784480 26 -2.29450739 0.06327839 27 2.44735758 -2.29450739 28 -2.03033128 2.44735758 29 2.32015369 -2.03033128 30 -1.86083588 2.32015369 31 0.06835323 -1.86083588 32 0.87665376 0.06835323 33 2.06848878 0.87665376 34 -2.12181259 2.06848878 35 3.18087195 -2.12181259 36 2.03382863 3.18087195 37 0.02454557 2.03382863 38 -2.21882877 0.02454557 39 -1.14773020 -2.21882877 40 -2.82991335 -1.14773020 41 -2.16044692 -2.82991335 42 -0.67211100 -2.16044692 43 -0.45221481 -0.67211100 44 -0.76665185 -0.45221481 45 1.97426808 -0.76665185 46 1.46345953 1.97426808 47 0.65287036 1.46345953 48 0.16380829 0.65287036 49 2.22917674 0.16380829 50 -0.16677329 2.22917674 51 -3.37425130 -0.16677329 52 1.03497863 -3.37425130 53 0.12604370 1.03497863 54 -3.82131269 0.12604370 55 1.97955590 -3.82131269 56 1.41000451 1.97955590 57 1.78784169 1.41000451 58 0.19776039 1.78784169 59 -1.10210691 0.19776039 60 -6.52275359 -1.10210691 61 -0.46435055 -6.52275359 62 -1.44563828 -0.46435055 63 2.19750658 -1.44563828 64 1.76988188 2.19750658 65 -3.27175988 1.76988188 66 1.23766223 -3.27175988 67 -0.30762497 1.23766223 68 -0.18366555 -0.30762497 69 -0.36941970 -0.18366555 70 -1.71905642 -0.36941970 71 -0.89505489 -1.71905642 72 -0.10922798 -0.89505489 73 -0.64253326 -0.10922798 74 1.58949908 -0.64253326 75 4.28842708 1.58949908 76 1.05638197 4.28842708 77 2.78737193 1.05638197 78 -0.44139978 2.78737193 79 4.68317252 -0.44139978 80 0.25453940 4.68317252 81 2.37093493 0.25453940 82 -2.20893678 2.37093493 83 3.12234508 -2.20893678 84 -1.40111557 3.12234508 85 1.13935162 -1.40111557 86 -0.04912816 1.13935162 87 0.04806211 -0.04912816 88 -2.13319938 0.04806211 89 1.05256050 -2.13319938 90 -1.60584798 1.05256050 91 0.48489295 -1.60584798 92 -1.32970131 0.48489295 93 -0.12673831 -1.32970131 94 -0.25244910 -0.12673831 95 1.28674033 -0.25244910 96 1.59933923 1.28674033 97 2.69170164 1.59933923 98 1.93460232 2.69170164 99 -1.17943768 1.93460232 100 0.54361487 -1.17943768 101 1.27479680 0.54361487 102 -0.50408050 1.27479680 103 1.53880853 -0.50408050 104 -0.95552945 1.53880853 105 2.36997198 -0.95552945 106 -2.37949509 2.36997198 107 -1.41682796 -2.37949509 108 -0.14453165 -1.41682796 109 0.71402412 -0.14453165 110 0.96469315 0.71402412 111 0.30478273 0.96469315 112 2.04097314 0.30478273 113 0.10209796 2.04097314 114 2.53315009 0.10209796 115 -2.09980105 2.53315009 116 2.49220979 -2.09980105 117 -2.55375220 2.49220979 118 -3.50783592 -2.55375220 119 0.62925702 -3.50783592 120 3.64460371 0.62925702 121 -1.50446405 3.64460371 122 0.05296401 -1.50446405 123 -2.77321022 0.05296401 124 -1.02778143 -2.77321022 125 0.18037220 -1.02778143 126 2.10238512 0.18037220 127 -0.89956755 2.10238512 128 1.10662053 -0.89956755 129 1.57165503 1.10662053 130 -1.69431206 1.57165503 131 -0.20049794 -1.69431206 132 -1.98761360 -0.20049794 133 0.49969924 -1.98761360 134 1.22725711 0.49969924 135 -2.90776846 1.22725711 136 -0.84600080 -2.90776846 > 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/rcomp/tmp/7urcg1290350865.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/rcomp/tmp/85it11290350865.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/rcomp/tmp/95it11290350865.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/rcomp/tmp/105it11290350865.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/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/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/rcomp/tmp/118ia71290350865.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/rcomp/tmp/12u18v1290350865.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/rcomp/tmp/13buq21290350866.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/rcomp/tmp/14eupp1290350866.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/rcomp/tmp/15iv5d1290350866.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/rcomp/tmp/163dm11290350866.tab") + } > > try(system("convert tmp/198et1290350865.ps tmp/198et1290350865.png",intern=TRUE)) character(0) > try(system("convert tmp/298et1290350865.ps tmp/298et1290350865.png",intern=TRUE)) character(0) > try(system("convert tmp/398et1290350865.ps tmp/398et1290350865.png",intern=TRUE)) character(0) > try(system("convert tmp/42zdv1290350865.ps tmp/42zdv1290350865.png",intern=TRUE)) character(0) > try(system("convert tmp/52zdv1290350865.ps tmp/52zdv1290350865.png",intern=TRUE)) character(0) > try(system("convert tmp/62zdv1290350865.ps tmp/62zdv1290350865.png",intern=TRUE)) character(0) > try(system("convert tmp/7urcg1290350865.ps tmp/7urcg1290350865.png",intern=TRUE)) character(0) > try(system("convert tmp/85it11290350865.ps tmp/85it11290350865.png",intern=TRUE)) character(0) > try(system("convert tmp/95it11290350865.ps tmp/95it11290350865.png",intern=TRUE)) character(0) > try(system("convert tmp/105it11290350865.ps tmp/105it11290350865.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 5.160 2.200 7.352