R version 2.12.1 (2010-12-16) Copyright (C) 2010 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i486-pc-linux-gnu (32-bit) 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(14 + ,13 + ,41 + ,12 + ,53 + ,18 + ,16 + ,39 + ,11 + ,86 + ,11 + ,19 + ,30 + ,14 + ,66 + ,12 + ,15 + ,31 + ,12 + ,67 + ,16 + ,14 + ,34 + ,21 + ,76 + ,18 + ,13 + ,35 + ,12 + ,78 + ,14 + ,19 + ,39 + ,22 + ,53 + ,14 + ,15 + ,34 + ,11 + ,80 + ,15 + ,14 + ,36 + ,10 + ,74 + ,15 + ,15 + ,37 + ,13 + ,76 + ,17 + ,16 + ,38 + ,10 + ,79 + ,19 + ,16 + ,36 + ,8 + ,54 + ,10 + ,16 + ,38 + ,15 + ,67 + ,16 + ,16 + ,39 + ,14 + ,54 + ,18 + ,17 + ,33 + ,10 + ,87 + ,14 + ,15 + ,32 + ,14 + ,58 + ,14 + ,15 + ,36 + ,14 + ,75 + ,17 + ,20 + ,38 + ,11 + ,88 + ,14 + ,18 + ,39 + ,10 + ,64 + ,16 + ,16 + ,32 + ,13 + ,57 + ,18 + ,16 + ,32 + ,7 + ,66 + ,11 + ,16 + ,31 + ,14 + ,68 + ,14 + ,19 + ,39 + ,12 + ,54 + ,12 + ,16 + ,37 + ,14 + ,56 + ,17 + ,17 + ,39 + ,11 + ,86 + ,9 + ,17 + ,41 + ,9 + ,80 + ,16 + ,16 + ,36 + ,11 + ,76 + ,14 + ,15 + ,33 + ,15 + ,69 + ,15 + ,16 + ,33 + ,14 + ,78 + ,11 + ,14 + ,34 + ,13 + ,67 + ,16 + ,15 + ,31 + ,9 + ,80 + ,13 + ,12 + ,27 + ,15 + ,54 + ,17 + ,14 + ,37 + ,10 + ,71 + ,15 + ,16 + ,34 + ,11 + ,84 + ,14 + ,14 + ,34 + ,13 + ,74 + ,16 + ,7 + ,32 + ,8 + ,71 + ,9 + ,10 + ,29 + ,20 + ,63 + ,15 + ,14 + ,36 + ,12 + ,71 + ,17 + ,16 + ,29 + ,10 + ,76 + ,13 + ,16 + ,35 + ,10 + ,69 + ,15 + ,16 + ,37 + ,9 + ,74 + ,16 + ,14 + ,34 + ,14 + ,75 + ,16 + ,20 + ,38 + ,8 + ,54 + ,12 + ,14 + ,35 + ,14 + ,52 + ,12 + ,14 + ,38 + ,11 + ,69 + ,11 + ,11 + ,37 + ,13 + ,68 + ,15 + ,14 + ,38 + ,9 + ,65 + ,15 + ,15 + ,33 + ,11 + ,75 + ,17 + ,16 + ,36 + ,15 + ,74 + ,13 + ,14 + ,38 + ,11 + ,75 + ,16 + ,16 + ,32 + ,10 + ,72 + ,14 + ,14 + ,32 + ,14 + ,67 + ,11 + ,12 + ,32 + ,18 + ,63 + ,12 + ,16 + ,34 + ,14 + ,62 + ,12 + ,9 + ,32 + ,11 + ,63 + ,15 + ,14 + ,37 + ,12 + ,76 + ,16 + ,16 + ,39 + ,13 + ,74 + ,15 + ,16 + ,29 + ,9 + ,67 + ,12 + ,15 + ,37 + ,10 + ,73 + ,12 + ,16 + ,35 + ,15 + ,70 + ,8 + ,12 + ,30 + ,20 + ,53 + ,13 + ,16 + ,38 + ,12 + ,77 + ,11 + ,16 + ,34 + ,12 + ,77 + ,14 + ,14 + ,31 + ,14 + ,52 + ,15 + ,16 + ,34 + ,13 + ,54 + ,10 + ,17 + ,35 + ,11 + ,80 + ,11 + ,18 + ,36 + ,17 + ,66 + ,12 + ,18 + ,30 + ,12 + ,73 + ,15 + ,12 + ,39 + ,13 + ,63 + ,15 + ,16 + ,35 + ,14 + ,69 + ,14 + ,10 + ,38 + ,13 + ,67 + ,16 + ,14 + ,31 + ,15 + ,54 + ,15 + ,18 + ,34 + ,13 + ,81 + ,15 + ,18 + ,38 + ,10 + ,69 + ,13 + ,16 + ,34 + ,11 + ,84 + ,12 + ,17 + ,39 + ,19 + ,80 + ,17 + ,16 + ,37 + ,13 + ,70 + ,13 + ,16 + ,34 + ,17 + ,69 + ,15 + ,13 + ,28 + ,13 + ,77 + ,13 + ,16 + ,37 + ,9 + ,54 + ,15 + ,16 + ,33 + ,11 + ,79 + ,16 + ,20 + ,37 + ,10 + ,30 + ,15 + ,16 + ,35 + ,9 + ,71 + ,16 + ,15 + ,37 + ,12 + ,73 + ,15 + ,15 + ,32 + ,12 + ,72 + ,14 + ,16 + ,33 + ,13 + ,77 + ,15 + ,14 + ,38 + ,13 + ,75 + ,14 + ,16 + ,33 + ,12 + ,69 + ,13 + ,16 + ,29 + ,15 + ,54 + ,7 + ,15 + ,33 + ,22 + ,70 + ,17 + ,12 + ,31 + ,13 + ,73 + ,13 + ,17 + ,36 + ,15 + ,54 + ,15 + ,16 + ,35 + ,13 + ,77 + ,14 + ,15 + ,32 + ,15 + ,82 + ,13 + ,13 + ,29 + ,10 + ,80 + ,16 + ,16 + ,39 + ,11 + ,80 + ,12 + ,16 + ,37 + ,16 + ,69 + ,14 + ,16 + ,35 + ,11 + ,78 + ,17 + ,16 + ,37 + ,11 + ,81 + ,15 + ,14 + ,32 + ,10 + ,76 + ,17 + ,16 + ,38 + ,10 + ,76 + ,12 + ,16 + ,37 + ,16 + ,73 + ,16 + ,20 + ,36 + ,12 + ,85 + ,11 + ,15 + ,32 + ,11 + ,66 + ,15 + ,16 + ,33 + ,16 + ,79 + ,9 + ,13 + ,40 + ,19 + ,68 + ,16 + ,17 + ,38 + ,11 + ,76 + ,15 + ,16 + ,41 + ,16 + ,71 + ,10 + ,16 + ,36 + ,15 + ,54 + ,10 + ,12 + ,43 + ,24 + ,46 + ,15 + ,16 + ,30 + ,14 + ,82 + ,11 + ,16 + ,31 + ,15 + ,74 + ,13 + ,17 + ,32 + ,11 + ,88 + ,14 + ,13 + ,32 + ,15 + ,38 + ,18 + ,12 + ,37 + ,12 + ,76 + ,16 + ,18 + ,37 + ,10 + ,86 + ,14 + ,14 + ,33 + ,14 + ,54 + ,14 + ,14 + ,34 + ,13 + ,70 + ,14 + ,13 + ,33 + ,9 + ,69 + ,14 + ,16 + ,38 + ,15 + ,90 + ,12 + ,13 + ,33 + ,15 + ,54 + ,14 + ,16 + ,31 + ,14 + ,76 + ,15 + ,13 + ,38 + ,11 + ,89 + ,15 + ,16 + ,37 + ,8 + ,76 + ,15 + ,15 + ,33 + ,11 + ,73 + ,13 + ,16 + ,31 + ,11 + ,79 + ,17 + ,15 + ,39 + ,8 + ,90 + ,17 + ,17 + ,44 + ,10 + ,74 + ,19 + ,15 + ,33 + ,11 + ,81 + ,15 + ,12 + ,35 + ,13 + ,72 + ,13 + ,16 + ,32 + ,11 + ,71 + ,9 + ,10 + ,28 + ,20 + ,66 + ,15 + ,16 + ,40 + ,10 + ,77 + ,15 + ,12 + ,27 + ,15 + ,65 + ,15 + ,14 + ,37 + ,12 + ,74 + ,16 + ,15 + ,32 + ,14 + ,82 + ,11 + ,13 + ,28 + ,23 + ,54 + ,14 + ,15 + ,34 + ,14 + ,63 + ,11 + ,11 + ,30 + ,16 + ,54 + ,15 + ,12 + ,35 + ,11 + ,64 + ,13 + ,8 + ,31 + ,12 + ,69 + ,15 + ,16 + ,32 + ,10 + ,54 + ,16 + ,15 + ,30 + ,14 + ,84 + ,14 + ,17 + ,30 + ,12 + ,86 + ,15 + ,16 + ,31 + ,12 + ,77 + ,16 + ,10 + ,40 + ,11 + ,89 + ,16 + ,18 + ,32 + ,12 + ,76 + ,11 + ,13 + ,36 + ,13 + ,60 + ,12 + ,16 + ,32 + ,11 + ,75 + ,9 + ,13 + ,35 + ,19 + ,73 + ,16 + ,10 + ,38 + ,12 + ,85 + ,13 + ,15 + ,42 + ,17 + ,79 + ,16 + ,16 + ,34 + ,9 + ,71 + ,12 + ,16 + ,35 + ,12 + ,72 + ,9 + ,14 + ,35 + ,19 + ,69 + ,13 + ,10 + ,33 + ,18 + ,78 + ,13 + ,17 + ,36 + ,15 + ,54 + ,14 + ,13 + ,32 + ,14 + ,69 + ,19 + ,15 + ,33 + ,11 + ,81 + ,13 + ,16 + ,34 + ,9 + ,84 + ,12 + ,12 + ,32 + ,18 + ,84 + ,13 + ,13 + ,34 + ,16 + ,69) + ,dim=c(5 + ,162) + ,dimnames=list(c('Happiness' + ,'Learning' + ,'Connected' + ,'Depression' + ,'Belonging ') + ,1:162)) > y <- array(NA,dim=c(5,162),dimnames=list(c('Happiness','Learning','Connected','Depression','Belonging '),1:162)) > 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 > 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 Learning Connected Depression Belonging\r M1 M2 M3 M4 M5 M6 M7 M8 1 14 13 41 12 53 1 0 0 0 0 0 0 0 2 18 16 39 11 86 0 1 0 0 0 0 0 0 3 11 19 30 14 66 0 0 1 0 0 0 0 0 4 12 15 31 12 67 0 0 0 1 0 0 0 0 5 16 14 34 21 76 0 0 0 0 1 0 0 0 6 18 13 35 12 78 0 0 0 0 0 1 0 0 7 14 19 39 22 53 0 0 0 0 0 0 1 0 8 14 15 34 11 80 0 0 0 0 0 0 0 1 9 15 14 36 10 74 0 0 0 0 0 0 0 0 10 15 15 37 13 76 0 0 0 0 0 0 0 0 11 17 16 38 10 79 0 0 0 0 0 0 0 0 12 19 16 36 8 54 0 0 0 0 0 0 0 0 13 10 16 38 15 67 1 0 0 0 0 0 0 0 14 16 16 39 14 54 0 1 0 0 0 0 0 0 15 18 17 33 10 87 0 0 1 0 0 0 0 0 16 14 15 32 14 58 0 0 0 1 0 0 0 0 17 14 15 36 14 75 0 0 0 0 1 0 0 0 18 17 20 38 11 88 0 0 0 0 0 1 0 0 19 14 18 39 10 64 0 0 0 0 0 0 1 0 20 16 16 32 13 57 0 0 0 0 0 0 0 1 21 18 16 32 7 66 0 0 0 0 0 0 0 0 22 11 16 31 14 68 0 0 0 0 0 0 0 0 23 14 19 39 12 54 0 0 0 0 0 0 0 0 24 12 16 37 14 56 0 0 0 0 0 0 0 0 25 17 17 39 11 86 1 0 0 0 0 0 0 0 26 9 17 41 9 80 0 1 0 0 0 0 0 0 27 16 16 36 11 76 0 0 1 0 0 0 0 0 28 14 15 33 15 69 0 0 0 1 0 0 0 0 29 15 16 33 14 78 0 0 0 0 1 0 0 0 30 11 14 34 13 67 0 0 0 0 0 1 0 0 31 16 15 31 9 80 0 0 0 0 0 0 1 0 32 13 12 27 15 54 0 0 0 0 0 0 0 1 33 17 14 37 10 71 0 0 0 0 0 0 0 0 34 15 16 34 11 84 0 0 0 0 0 0 0 0 35 14 14 34 13 74 0 0 0 0 0 0 0 0 36 16 7 32 8 71 0 0 0 0 0 0 0 0 37 9 10 29 20 63 1 0 0 0 0 0 0 0 38 15 14 36 12 71 0 1 0 0 0 0 0 0 39 17 16 29 10 76 0 0 1 0 0 0 0 0 40 13 16 35 10 69 0 0 0 1 0 0 0 0 41 15 16 37 9 74 0 0 0 0 1 0 0 0 42 16 14 34 14 75 0 0 0 0 0 1 0 0 43 16 20 38 8 54 0 0 0 0 0 0 1 0 44 12 14 35 14 52 0 0 0 0 0 0 0 1 45 12 14 38 11 69 0 0 0 0 0 0 0 0 46 11 11 37 13 68 0 0 0 0 0 0 0 0 47 15 14 38 9 65 0 0 0 0 0 0 0 0 48 15 15 33 11 75 0 0 0 0 0 0 0 0 49 17 16 36 15 74 1 0 0 0 0 0 0 0 50 13 14 38 11 75 0 1 0 0 0 0 0 0 51 16 16 32 10 72 0 0 1 0 0 0 0 0 52 14 14 32 14 67 0 0 0 1 0 0 0 0 53 11 12 32 18 63 0 0 0 0 1 0 0 0 54 12 16 34 14 62 0 0 0 0 0 1 0 0 55 12 9 32 11 63 0 0 0 0 0 0 1 0 56 15 14 37 12 76 0 0 0 0 0 0 0 1 57 16 16 39 13 74 0 0 0 0 0 0 0 0 58 15 16 29 9 67 0 0 0 0 0 0 0 0 59 12 15 37 10 73 0 0 0 0 0 0 0 0 60 12 16 35 15 70 0 0 0 0 0 0 0 0 61 8 12 30 20 53 1 0 0 0 0 0 0 0 62 13 16 38 12 77 0 1 0 0 0 0 0 0 63 11 16 34 12 77 0 0 1 0 0 0 0 0 64 14 14 31 14 52 0 0 0 1 0 0 0 0 65 15 16 34 13 54 0 0 0 0 1 0 0 0 66 10 17 35 11 80 0 0 0 0 0 1 0 0 67 11 18 36 17 66 0 0 0 0 0 0 1 0 68 12 18 30 12 73 0 0 0 0 0 0 0 1 69 15 12 39 13 63 0 0 0 0 0 0 0 0 70 15 16 35 14 69 0 0 0 0 0 0 0 0 71 14 10 38 13 67 0 0 0 0 0 0 0 0 72 16 14 31 15 54 0 0 0 0 0 0 0 0 73 15 18 34 13 81 1 0 0 0 0 0 0 0 74 15 18 38 10 69 0 1 0 0 0 0 0 0 75 13 16 34 11 84 0 0 1 0 0 0 0 0 76 12 17 39 19 80 0 0 0 1 0 0 0 0 77 17 16 37 13 70 0 0 0 0 1 0 0 0 78 13 16 34 17 69 0 0 0 0 0 1 0 0 79 15 13 28 13 77 0 0 0 0 0 0 1 0 80 13 16 37 9 54 0 0 0 0 0 0 0 1 81 15 16 33 11 79 0 0 0 0 0 0 0 0 82 16 20 37 10 30 0 0 0 0 0 0 0 0 83 15 16 35 9 71 0 0 0 0 0 0 0 0 84 16 15 37 12 73 0 0 0 0 0 0 0 0 85 15 15 32 12 72 1 0 0 0 0 0 0 0 86 14 16 33 13 77 0 1 0 0 0 0 0 0 87 15 14 38 13 75 0 0 1 0 0 0 0 0 88 14 16 33 12 69 0 0 0 1 0 0 0 0 89 13 16 29 15 54 0 0 0 0 1 0 0 0 90 7 15 33 22 70 0 0 0 0 0 1 0 0 91 17 12 31 13 73 0 0 0 0 0 0 1 0 92 13 17 36 15 54 0 0 0 0 0 0 0 1 93 15 16 35 13 77 0 0 0 0 0 0 0 0 94 14 15 32 15 82 0 0 0 0 0 0 0 0 95 13 13 29 10 80 0 0 0 0 0 0 0 0 96 16 16 39 11 80 0 0 0 0 0 0 0 0 97 12 16 37 16 69 1 0 0 0 0 0 0 0 98 14 16 35 11 78 0 1 0 0 0 0 0 0 99 17 16 37 11 81 0 0 1 0 0 0 0 0 100 15 14 32 10 76 0 0 0 1 0 0 0 0 101 17 16 38 10 76 0 0 0 0 1 0 0 0 102 12 16 37 16 73 0 0 0 0 0 1 0 0 103 16 20 36 12 85 0 0 0 0 0 0 1 0 104 11 15 32 11 66 0 0 0 0 0 0 0 1 105 15 16 33 16 79 0 0 0 0 0 0 0 0 106 9 13 40 19 68 0 0 0 0 0 0 0 0 107 16 17 38 11 76 0 0 0 0 0 0 0 0 108 15 16 41 16 71 0 0 0 0 0 0 0 0 109 10 16 36 15 54 1 0 0 0 0 0 0 0 110 10 12 43 24 46 0 1 0 0 0 0 0 0 111 15 16 30 14 82 0 0 1 0 0 0 0 0 112 11 16 31 15 74 0 0 0 1 0 0 0 0 113 13 17 32 11 88 0 0 0 0 1 0 0 0 114 14 13 32 15 38 0 0 0 0 0 1 0 0 115 18 12 37 12 76 0 0 0 0 0 0 1 0 116 16 18 37 10 86 0 0 0 0 0 0 0 1 117 14 14 33 14 54 0 0 0 0 0 0 0 0 118 14 14 34 13 70 0 0 0 0 0 0 0 0 119 14 13 33 9 69 0 0 0 0 0 0 0 0 120 14 16 38 15 90 0 0 0 0 0 0 0 0 121 12 13 33 15 54 1 0 0 0 0 0 0 0 122 14 16 31 14 76 0 1 0 0 0 0 0 0 123 15 13 38 11 89 0 0 1 0 0 0 0 0 124 15 16 37 8 76 0 0 0 1 0 0 0 0 125 15 15 33 11 73 0 0 0 0 1 0 0 0 126 13 16 31 11 79 0 0 0 0 0 1 0 0 127 17 15 39 8 90 0 0 0 0 0 0 1 0 128 17 17 44 10 74 0 0 0 0 0 0 0 1 129 19 15 33 11 81 0 0 0 0 0 0 0 0 130 15 12 35 13 72 0 0 0 0 0 0 0 0 131 13 16 32 11 71 0 0 0 0 0 0 0 0 132 9 10 28 20 66 0 0 0 0 0 0 0 0 133 15 16 40 10 77 1 0 0 0 0 0 0 0 134 15 12 27 15 65 0 1 0 0 0 0 0 0 135 15 14 37 12 74 0 0 1 0 0 0 0 0 136 16 15 32 14 82 0 0 0 1 0 0 0 0 137 11 13 28 23 54 0 0 0 0 1 0 0 0 138 14 15 34 14 63 0 0 0 0 0 1 0 0 139 11 11 30 16 54 0 0 0 0 0 0 1 0 140 15 12 35 11 64 0 0 0 0 0 0 0 1 141 13 8 31 12 69 0 0 0 0 0 0 0 0 142 15 16 32 10 54 0 0 0 0 0 0 0 0 143 16 15 30 14 84 0 0 0 0 0 0 0 0 144 14 17 30 12 86 0 0 0 0 0 0 0 0 145 15 16 31 12 77 1 0 0 0 0 0 0 0 146 16 10 40 11 89 0 1 0 0 0 0 0 0 147 16 18 32 12 76 0 0 1 0 0 0 0 0 148 11 13 36 13 60 0 0 0 1 0 0 0 0 149 12 16 32 11 75 0 0 0 0 1 0 0 0 150 9 13 35 19 73 0 0 0 0 0 1 0 0 151 16 10 38 12 85 0 0 0 0 0 0 1 0 152 13 15 42 17 79 0 0 0 0 0 0 0 1 153 16 16 34 9 71 0 0 0 0 0 0 0 0 154 12 16 35 12 72 0 0 0 0 0 0 0 0 155 9 14 35 19 69 0 0 0 0 0 0 0 0 156 13 10 33 18 78 0 0 0 0 0 0 0 0 157 13 17 36 15 54 1 0 0 0 0 0 0 0 158 14 13 32 14 69 0 1 0 0 0 0 0 0 159 19 15 33 11 81 0 0 1 0 0 0 0 0 160 13 16 34 9 84 0 0 0 1 0 0 0 0 161 12 12 32 18 84 0 0 0 0 1 0 0 0 162 13 13 34 16 69 0 0 0 0 0 1 0 0 M9 M10 M11 t 1 0 0 0 1 2 0 0 0 2 3 0 0 0 3 4 0 0 0 4 5 0 0 0 5 6 0 0 0 6 7 0 0 0 7 8 0 0 0 8 9 1 0 0 9 10 0 1 0 10 11 0 0 1 11 12 0 0 0 12 13 0 0 0 13 14 0 0 0 14 15 0 0 0 15 16 0 0 0 16 17 0 0 0 17 18 0 0 0 18 19 0 0 0 19 20 0 0 0 20 21 1 0 0 21 22 0 1 0 22 23 0 0 1 23 24 0 0 0 24 25 0 0 0 25 26 0 0 0 26 27 0 0 0 27 28 0 0 0 28 29 0 0 0 29 30 0 0 0 30 31 0 0 0 31 32 0 0 0 32 33 1 0 0 33 34 0 1 0 34 35 0 0 1 35 36 0 0 0 36 37 0 0 0 37 38 0 0 0 38 39 0 0 0 39 40 0 0 0 40 41 0 0 0 41 42 0 0 0 42 43 0 0 0 43 44 0 0 0 44 45 1 0 0 45 46 0 1 0 46 47 0 0 1 47 48 0 0 0 48 49 0 0 0 49 50 0 0 0 50 51 0 0 0 51 52 0 0 0 52 53 0 0 0 53 54 0 0 0 54 55 0 0 0 55 56 0 0 0 56 57 1 0 0 57 58 0 1 0 58 59 0 0 1 59 60 0 0 0 60 61 0 0 0 61 62 0 0 0 62 63 0 0 0 63 64 0 0 0 64 65 0 0 0 65 66 0 0 0 66 67 0 0 0 67 68 0 0 0 68 69 1 0 0 69 70 0 1 0 70 71 0 0 1 71 72 0 0 0 72 73 0 0 0 73 74 0 0 0 74 75 0 0 0 75 76 0 0 0 76 77 0 0 0 77 78 0 0 0 78 79 0 0 0 79 80 0 0 0 80 81 1 0 0 81 82 0 1 0 82 83 0 0 1 83 84 0 0 0 84 85 0 0 0 85 86 0 0 0 86 87 0 0 0 87 88 0 0 0 88 89 0 0 0 89 90 0 0 0 90 91 0 0 0 91 92 0 0 0 92 93 1 0 0 93 94 0 1 0 94 95 0 0 1 95 96 0 0 0 96 97 0 0 0 97 98 0 0 0 98 99 0 0 0 99 100 0 0 0 100 101 0 0 0 101 102 0 0 0 102 103 0 0 0 103 104 0 0 0 104 105 1 0 0 105 106 0 1 0 106 107 0 0 1 107 108 0 0 0 108 109 0 0 0 109 110 0 0 0 110 111 0 0 0 111 112 0 0 0 112 113 0 0 0 113 114 0 0 0 114 115 0 0 0 115 116 0 0 0 116 117 1 0 0 117 118 0 1 0 118 119 0 0 1 119 120 0 0 0 120 121 0 0 0 121 122 0 0 0 122 123 0 0 0 123 124 0 0 0 124 125 0 0 0 125 126 0 0 0 126 127 0 0 0 127 128 0 0 0 128 129 1 0 0 129 130 0 1 0 130 131 0 0 1 131 132 0 0 0 132 133 0 0 0 133 134 0 0 0 134 135 0 0 0 135 136 0 0 0 136 137 0 0 0 137 138 0 0 0 138 139 0 0 0 139 140 0 0 0 140 141 1 0 0 141 142 0 1 0 142 143 0 0 1 143 144 0 0 0 144 145 0 0 0 145 146 0 0 0 146 147 0 0 0 147 148 0 0 0 148 149 0 0 0 149 150 0 0 0 150 151 0 0 0 151 152 0 0 0 152 153 1 0 0 153 154 0 1 0 154 155 0 0 1 155 156 0 0 0 156 157 0 0 0 157 158 0 0 0 158 159 0 0 0 159 160 0 0 0 160 161 0 0 0 161 162 0 0 0 162 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) Learning Connected Depression `Belonging\r` 14.814254 0.056293 0.047890 -0.341951 0.026415 M1 M2 M3 M4 M5 -1.049469 -0.724722 0.002541 -1.166967 -0.065593 M6 M7 M8 M9 M10 -1.209914 0.095210 -0.923234 0.306605 -0.964929 M11 t -1.117100 -0.001886 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -6.9966 -1.3045 0.2459 1.1115 4.0420 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 14.814254 2.401578 6.169 6.51e-09 *** Learning 0.056293 0.073854 0.762 0.4472 Connected 0.047890 0.048585 0.986 0.3259 Depression -0.341951 0.055195 -6.195 5.69e-09 *** `Belonging\r` 0.026415 0.015697 1.683 0.0946 . M1 -1.049469 0.754703 -1.391 0.1665 M2 -0.724722 0.752213 -0.963 0.3369 M3 0.002541 0.768175 0.003 0.9974 M4 -1.166967 0.754424 -1.547 0.1241 M5 -0.065593 0.755473 -0.087 0.9309 M6 -1.209914 0.754338 -1.604 0.1109 M7 0.095210 0.763110 0.125 0.9009 M8 -0.923234 0.770852 -1.198 0.2330 M9 0.306605 0.767553 0.399 0.6901 M10 -0.964929 0.766731 -1.258 0.2102 M11 -1.117100 0.767795 -1.455 0.1478 t -0.001886 0.003412 -0.553 0.5812 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 1.94 on 145 degrees of freedom Multiple R-squared: 0.38, Adjusted R-squared: 0.3116 F-statistic: 5.554 on 16 and 145 DF, p-value: 3.637e-09 > 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.8078531 0.3842937749 1.921469e-01 [2,] 0.9429387 0.1141226421 5.706132e-02 [3,] 0.9320190 0.1359620405 6.798102e-02 [4,] 0.9001485 0.1997030126 9.985151e-02 [5,] 0.9817914 0.0364171630 1.820858e-02 [6,] 0.9920334 0.0159331108 7.966555e-03 [7,] 0.9999476 0.0001048703 5.243513e-05 [8,] 0.9999163 0.0001673846 8.369228e-05 [9,] 0.9998666 0.0002668952 1.334476e-04 [10,] 0.9997446 0.0005107274 2.553637e-04 [11,] 0.9998863 0.0002273193 1.136597e-04 [12,] 0.9997885 0.0004229203 2.114601e-04 [13,] 0.9996338 0.0007324147 3.662074e-04 [14,] 0.9994325 0.0011350664 5.675332e-04 [15,] 0.9991616 0.0016767430 8.383715e-04 [16,] 0.9986537 0.0026925707 1.346285e-03 [17,] 0.9978075 0.0043849090 2.192455e-03 [18,] 0.9966269 0.0067461606 3.373080e-03 [19,] 0.9960734 0.0078532721 3.926636e-03 [20,] 0.9963012 0.0073976889 3.698844e-03 [21,] 0.9945555 0.0108889495 5.444475e-03 [22,] 0.9918943 0.0162114975 8.105749e-03 [23,] 0.9937470 0.0125059368 6.252968e-03 [24,] 0.9917253 0.0165493231 8.274662e-03 [25,] 0.9883904 0.0232191980 1.160960e-02 [26,] 0.9925017 0.0149965713 7.498286e-03 [27,] 0.9910472 0.0179056453 8.952823e-03 [28,] 0.9872646 0.0254708886 1.273544e-02 [29,] 0.9818210 0.0363580764 1.817904e-02 [30,] 0.9960318 0.0079364761 3.968238e-03 [31,] 0.9947854 0.0104292803 5.214640e-03 [32,] 0.9930878 0.0138244898 6.912245e-03 [33,] 0.9921219 0.0157561945 7.878097e-03 [34,] 0.9896753 0.0206493147 1.032466e-02 [35,] 0.9864735 0.0270529368 1.352647e-02 [36,] 0.9869625 0.0260750603 1.303753e-02 [37,] 0.9836808 0.0326383072 1.631915e-02 [38,] 0.9797101 0.0405797111 2.028986e-02 [39,] 0.9765124 0.0469751157 2.348756e-02 [40,] 0.9795025 0.0409949467 2.049747e-02 [41,] 0.9788519 0.0422961953 2.114810e-02 [42,] 0.9767743 0.0464513009 2.322565e-02 [43,] 0.9720826 0.0558348218 2.791741e-02 [44,] 0.9858931 0.0282137785 1.410689e-02 [45,] 0.9873175 0.0253649672 1.268248e-02 [46,] 0.9852821 0.0294357632 1.471788e-02 [47,] 0.9955397 0.0089206705 4.460335e-03 [48,] 0.9959523 0.0080954161 4.047708e-03 [49,] 0.9954150 0.0091699566 4.584978e-03 [50,] 0.9943756 0.0112487178 5.624359e-03 [51,] 0.9952383 0.0095234910 4.761746e-03 [52,] 0.9940065 0.0119870962 5.993548e-03 [53,] 0.9963385 0.0073230931 3.661547e-03 [54,] 0.9958770 0.0082459409 4.122970e-03 [55,] 0.9949402 0.0101195103 5.059755e-03 [56,] 0.9963313 0.0073374231 3.668712e-03 [57,] 0.9948676 0.0102647681 5.132384e-03 [58,] 0.9964770 0.0070459328 3.522966e-03 [59,] 0.9957299 0.0085402292 4.270115e-03 [60,] 0.9945811 0.0108377374 5.418869e-03 [61,] 0.9942766 0.0114468715 5.723436e-03 [62,] 0.9924586 0.0150828436 7.541422e-03 [63,] 0.9925118 0.0149764989 7.488249e-03 [64,] 0.9895229 0.0209541625 1.047708e-02 [65,] 0.9869026 0.0261947185 1.309736e-02 [66,] 0.9852259 0.0295482829 1.477414e-02 [67,] 0.9806590 0.0386819248 1.934096e-02 [68,] 0.9765459 0.0469082214 2.345411e-02 [69,] 0.9696300 0.0607399526 3.036998e-02 [70,] 0.9608613 0.0782773635 3.913868e-02 [71,] 0.9721148 0.0557703175 2.788516e-02 [72,] 0.9793483 0.0413034685 2.065173e-02 [73,] 0.9725841 0.0548317463 2.741587e-02 [74,] 0.9640665 0.0718670238 3.593351e-02 [75,] 0.9577654 0.0844692732 4.223464e-02 [76,] 0.9495696 0.1008608101 5.043041e-02 [77,] 0.9352659 0.1294681619 6.473408e-02 [78,] 0.9171926 0.1656147197 8.280736e-02 [79,] 0.9109222 0.1781556346 8.907782e-02 [80,] 0.8986790 0.2026420104 1.013210e-01 [81,] 0.8814715 0.2370570335 1.185285e-01 [82,] 0.8770314 0.2459371464 1.229686e-01 [83,] 0.8498122 0.3003756724 1.501878e-01 [84,] 0.8184754 0.3630492221 1.815246e-01 [85,] 0.8848717 0.2302565444 1.151283e-01 [86,] 0.8612277 0.2775446092 1.387723e-01 [87,] 0.8736228 0.2527544816 1.263772e-01 [88,] 0.8629828 0.2740344720 1.370172e-01 [89,] 0.8667798 0.2664404788 1.332202e-01 [90,] 0.8857135 0.2285729893 1.142865e-01 [91,] 0.8605298 0.2789404238 1.394702e-01 [92,] 0.8350813 0.3298374092 1.649187e-01 [93,] 0.8324668 0.3350664116 1.675332e-01 [94,] 0.8481600 0.3036799033 1.518400e-01 [95,] 0.8870555 0.2258890456 1.129445e-01 [96,] 0.9216392 0.1567216287 7.836081e-02 [97,] 0.9112977 0.1774046134 8.870231e-02 [98,] 0.8833651 0.2332697986 1.166349e-01 [99,] 0.8505918 0.2988163120 1.494082e-01 [100,] 0.8107246 0.3785508535 1.892754e-01 [101,] 0.7668713 0.4662573444 2.331287e-01 [102,] 0.7179308 0.5641383785 2.820692e-01 [103,] 0.7110196 0.5779607703 2.889804e-01 [104,] 0.7295129 0.5409742111 2.704871e-01 [105,] 0.6693500 0.6613000199 3.306500e-01 [106,] 0.6183455 0.7633090623 3.816545e-01 [107,] 0.6363337 0.7273325901 3.636663e-01 [108,] 0.5706515 0.8586970454 4.293485e-01 [109,] 0.5320366 0.9359268605 4.679634e-01 [110,] 0.5819600 0.8360799252 4.180400e-01 [111,] 0.5324033 0.9351933291 4.675967e-01 [112,] 0.4663207 0.9326414526 5.336793e-01 [113,] 0.4832154 0.9664307010 5.167846e-01 [114,] 0.3992287 0.7984573895 6.007713e-01 [115,] 0.3364759 0.6729518986 6.635241e-01 [116,] 0.3043953 0.6087906587 6.956047e-01 [117,] 0.3889042 0.7778084905 6.110958e-01 [118,] 0.5639307 0.8721385455 4.360693e-01 [119,] 0.5725024 0.8549952756 4.274976e-01 [120,] 0.4657180 0.9314359391 5.342820e-01 [121,] 0.4185835 0.8371669957 5.814165e-01 [122,] 0.6519833 0.6960333257 3.480167e-01 [123,] 0.5112050 0.9775899677 4.887950e-01 > postscript(file="/var/www/rcomp/tmp/1f8v81322159630.ps",horizontal=F,onefile=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/2fcla1322159630.ps",horizontal=F,onefile=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/3gr8v1322159630.ps",horizontal=F,onefile=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/40jcc1322159630.ps",horizontal=F,onefile=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/5q7fd1322159630.ps",horizontal=F,onefile=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 = 162 Frequency = 1 1 2 3 4 5 6 0.245207770 2.635593378 -3.273498186 -1.635136403 4.017821283 4.042043265 7 8 9 10 11 12 2.289376170 -0.700342509 -1.151240492 0.991018702 1.935794665 2.892839048 13 14 15 16 17 18 -3.101326271 2.529370657 1.795532658 1.261249830 -0.478856325 1.920853310 19 20 21 22 23 24 -2.025672375 2.653232984 1.135837980 -2.202025794 0.085944136 -2.133538351 25 26 27 28 29 30 1.947434322 -6.996616157 0.363312150 1.287380546 0.551911168 -2.288567687 31 32 33 34 35 36 -0.215630700 0.903640807 0.925389540 0.228445221 0.443144227 0.187254974 37 38 39 40 41 42 -1.471866895 0.697940531 1.379227215 -1.551810354 -1.221105052 2.864698560 43 44 45 46 47 48 -0.464844925 -0.858548323 -3.705081786 -2.504574314 0.144155113 -0.368153519 49 50 51 52 53 54 3.877458129 -1.822813943 0.363855681 1.147717546 -1.365718637 -0.881853319 55 56 57 58 59 60 -2.747524747 0.750441688 0.708904328 0.278325589 -2.710982260 -1.997709576 61 62 63 64 65 66 -2.322917205 -1.623643266 -4.157461118 1.614472904 0.863947107 -4.464726531 67 68 69 70 71 72 -2.450628120 -2.037620466 0.247282797 1.670547984 0.729576594 2.751717487 73 74 75 76 77 78 1.037116561 -0.186173216 -2.661681579 0.055239290 2.320271024 1.004367189 79 80 81 82 83 84 0.578223724 -1.761588948 -0.774460460 2.034621519 0.084657653 0.902979809 85 86 87 88 89 90 1.220199836 0.003031138 0.203622045 0.318419671 -0.167427522 -3.185472788 91 92 93 94 95 96 2.619145657 0.304350336 -0.110870667 0.914338202 -1.332271840 0.246686186 97 98 99 100 101 102 -0.605856219 -0.780428621 1.319168758 0.632725025 1.133311107 -0.541640033 103 104 105 106 107 108 0.293052084 -3.053652839 0.980568575 -2.595939492 1.481794639 1.121035474 109 110 111 112 113 114 -2.481051828 0.374913420 0.676472466 -1.646749671 -2.588037937 2.471908698 115 116 117 118 119 120 2.955884119 0.690399104 0.092271359 0.553206966 -0.529940499 -0.556498173 121 122 123 124 125 126 -0.145864785 0.535088324 -0.725888310 -0.357938885 -0.104475340 -1.077272952 127 128 129 130 131 132 -0.023755933 1.751083466 3.319550948 1.587710697 -0.997222473 -2.373481500 133 134 135 136 137 138 0.055357911 2.606977152 0.026524548 2.853655360 0.875498862 1.306484613 139 140 141 142 143 144 -1.658380409 1.092299771 -1.509044292 0.978464662 2.859942734 -1.104590654 145 146 147 148 149 150 1.192905573 1.117863837 1.010606562 -1.963495962 -3.120435216 -2.160578639 151 152 153 154 155 156 0.850755455 0.266304928 -0.159107830 -1.934139942 -2.194592690 0.431458796 157 158 159 160 161 162 0.553203100 0.908896767 3.680207110 -2.015728897 -0.716704524 0.989756315 > postscript(file="/var/www/rcomp/tmp/6z6ap1322159630.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > dum <- cbind(lag(myerror,k=1),myerror) > dum Time Series: Start = 0 End = 162 Frequency = 1 lag(myerror, k = 1) myerror 0 0.245207770 NA 1 2.635593378 0.245207770 2 -3.273498186 2.635593378 3 -1.635136403 -3.273498186 4 4.017821283 -1.635136403 5 4.042043265 4.017821283 6 2.289376170 4.042043265 7 -0.700342509 2.289376170 8 -1.151240492 -0.700342509 9 0.991018702 -1.151240492 10 1.935794665 0.991018702 11 2.892839048 1.935794665 12 -3.101326271 2.892839048 13 2.529370657 -3.101326271 14 1.795532658 2.529370657 15 1.261249830 1.795532658 16 -0.478856325 1.261249830 17 1.920853310 -0.478856325 18 -2.025672375 1.920853310 19 2.653232984 -2.025672375 20 1.135837980 2.653232984 21 -2.202025794 1.135837980 22 0.085944136 -2.202025794 23 -2.133538351 0.085944136 24 1.947434322 -2.133538351 25 -6.996616157 1.947434322 26 0.363312150 -6.996616157 27 1.287380546 0.363312150 28 0.551911168 1.287380546 29 -2.288567687 0.551911168 30 -0.215630700 -2.288567687 31 0.903640807 -0.215630700 32 0.925389540 0.903640807 33 0.228445221 0.925389540 34 0.443144227 0.228445221 35 0.187254974 0.443144227 36 -1.471866895 0.187254974 37 0.697940531 -1.471866895 38 1.379227215 0.697940531 39 -1.551810354 1.379227215 40 -1.221105052 -1.551810354 41 2.864698560 -1.221105052 42 -0.464844925 2.864698560 43 -0.858548323 -0.464844925 44 -3.705081786 -0.858548323 45 -2.504574314 -3.705081786 46 0.144155113 -2.504574314 47 -0.368153519 0.144155113 48 3.877458129 -0.368153519 49 -1.822813943 3.877458129 50 0.363855681 -1.822813943 51 1.147717546 0.363855681 52 -1.365718637 1.147717546 53 -0.881853319 -1.365718637 54 -2.747524747 -0.881853319 55 0.750441688 -2.747524747 56 0.708904328 0.750441688 57 0.278325589 0.708904328 58 -2.710982260 0.278325589 59 -1.997709576 -2.710982260 60 -2.322917205 -1.997709576 61 -1.623643266 -2.322917205 62 -4.157461118 -1.623643266 63 1.614472904 -4.157461118 64 0.863947107 1.614472904 65 -4.464726531 0.863947107 66 -2.450628120 -4.464726531 67 -2.037620466 -2.450628120 68 0.247282797 -2.037620466 69 1.670547984 0.247282797 70 0.729576594 1.670547984 71 2.751717487 0.729576594 72 1.037116561 2.751717487 73 -0.186173216 1.037116561 74 -2.661681579 -0.186173216 75 0.055239290 -2.661681579 76 2.320271024 0.055239290 77 1.004367189 2.320271024 78 0.578223724 1.004367189 79 -1.761588948 0.578223724 80 -0.774460460 -1.761588948 81 2.034621519 -0.774460460 82 0.084657653 2.034621519 83 0.902979809 0.084657653 84 1.220199836 0.902979809 85 0.003031138 1.220199836 86 0.203622045 0.003031138 87 0.318419671 0.203622045 88 -0.167427522 0.318419671 89 -3.185472788 -0.167427522 90 2.619145657 -3.185472788 91 0.304350336 2.619145657 92 -0.110870667 0.304350336 93 0.914338202 -0.110870667 94 -1.332271840 0.914338202 95 0.246686186 -1.332271840 96 -0.605856219 0.246686186 97 -0.780428621 -0.605856219 98 1.319168758 -0.780428621 99 0.632725025 1.319168758 100 1.133311107 0.632725025 101 -0.541640033 1.133311107 102 0.293052084 -0.541640033 103 -3.053652839 0.293052084 104 0.980568575 -3.053652839 105 -2.595939492 0.980568575 106 1.481794639 -2.595939492 107 1.121035474 1.481794639 108 -2.481051828 1.121035474 109 0.374913420 -2.481051828 110 0.676472466 0.374913420 111 -1.646749671 0.676472466 112 -2.588037937 -1.646749671 113 2.471908698 -2.588037937 114 2.955884119 2.471908698 115 0.690399104 2.955884119 116 0.092271359 0.690399104 117 0.553206966 0.092271359 118 -0.529940499 0.553206966 119 -0.556498173 -0.529940499 120 -0.145864785 -0.556498173 121 0.535088324 -0.145864785 122 -0.725888310 0.535088324 123 -0.357938885 -0.725888310 124 -0.104475340 -0.357938885 125 -1.077272952 -0.104475340 126 -0.023755933 -1.077272952 127 1.751083466 -0.023755933 128 3.319550948 1.751083466 129 1.587710697 3.319550948 130 -0.997222473 1.587710697 131 -2.373481500 -0.997222473 132 0.055357911 -2.373481500 133 2.606977152 0.055357911 134 0.026524548 2.606977152 135 2.853655360 0.026524548 136 0.875498862 2.853655360 137 1.306484613 0.875498862 138 -1.658380409 1.306484613 139 1.092299771 -1.658380409 140 -1.509044292 1.092299771 141 0.978464662 -1.509044292 142 2.859942734 0.978464662 143 -1.104590654 2.859942734 144 1.192905573 -1.104590654 145 1.117863837 1.192905573 146 1.010606562 1.117863837 147 -1.963495962 1.010606562 148 -3.120435216 -1.963495962 149 -2.160578639 -3.120435216 150 0.850755455 -2.160578639 151 0.266304928 0.850755455 152 -0.159107830 0.266304928 153 -1.934139942 -0.159107830 154 -2.194592690 -1.934139942 155 0.431458796 -2.194592690 156 0.553203100 0.431458796 157 0.908896767 0.553203100 158 3.680207110 0.908896767 159 -2.015728897 3.680207110 160 -0.716704524 -2.015728897 161 0.989756315 -0.716704524 162 NA 0.989756315 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 2.635593378 0.245207770 [2,] -3.273498186 2.635593378 [3,] -1.635136403 -3.273498186 [4,] 4.017821283 -1.635136403 [5,] 4.042043265 4.017821283 [6,] 2.289376170 4.042043265 [7,] -0.700342509 2.289376170 [8,] -1.151240492 -0.700342509 [9,] 0.991018702 -1.151240492 [10,] 1.935794665 0.991018702 [11,] 2.892839048 1.935794665 [12,] -3.101326271 2.892839048 [13,] 2.529370657 -3.101326271 [14,] 1.795532658 2.529370657 [15,] 1.261249830 1.795532658 [16,] -0.478856325 1.261249830 [17,] 1.920853310 -0.478856325 [18,] -2.025672375 1.920853310 [19,] 2.653232984 -2.025672375 [20,] 1.135837980 2.653232984 [21,] -2.202025794 1.135837980 [22,] 0.085944136 -2.202025794 [23,] -2.133538351 0.085944136 [24,] 1.947434322 -2.133538351 [25,] -6.996616157 1.947434322 [26,] 0.363312150 -6.996616157 [27,] 1.287380546 0.363312150 [28,] 0.551911168 1.287380546 [29,] -2.288567687 0.551911168 [30,] -0.215630700 -2.288567687 [31,] 0.903640807 -0.215630700 [32,] 0.925389540 0.903640807 [33,] 0.228445221 0.925389540 [34,] 0.443144227 0.228445221 [35,] 0.187254974 0.443144227 [36,] -1.471866895 0.187254974 [37,] 0.697940531 -1.471866895 [38,] 1.379227215 0.697940531 [39,] -1.551810354 1.379227215 [40,] -1.221105052 -1.551810354 [41,] 2.864698560 -1.221105052 [42,] -0.464844925 2.864698560 [43,] -0.858548323 -0.464844925 [44,] -3.705081786 -0.858548323 [45,] -2.504574314 -3.705081786 [46,] 0.144155113 -2.504574314 [47,] -0.368153519 0.144155113 [48,] 3.877458129 -0.368153519 [49,] -1.822813943 3.877458129 [50,] 0.363855681 -1.822813943 [51,] 1.147717546 0.363855681 [52,] -1.365718637 1.147717546 [53,] -0.881853319 -1.365718637 [54,] -2.747524747 -0.881853319 [55,] 0.750441688 -2.747524747 [56,] 0.708904328 0.750441688 [57,] 0.278325589 0.708904328 [58,] -2.710982260 0.278325589 [59,] -1.997709576 -2.710982260 [60,] -2.322917205 -1.997709576 [61,] -1.623643266 -2.322917205 [62,] -4.157461118 -1.623643266 [63,] 1.614472904 -4.157461118 [64,] 0.863947107 1.614472904 [65,] -4.464726531 0.863947107 [66,] -2.450628120 -4.464726531 [67,] -2.037620466 -2.450628120 [68,] 0.247282797 -2.037620466 [69,] 1.670547984 0.247282797 [70,] 0.729576594 1.670547984 [71,] 2.751717487 0.729576594 [72,] 1.037116561 2.751717487 [73,] -0.186173216 1.037116561 [74,] -2.661681579 -0.186173216 [75,] 0.055239290 -2.661681579 [76,] 2.320271024 0.055239290 [77,] 1.004367189 2.320271024 [78,] 0.578223724 1.004367189 [79,] -1.761588948 0.578223724 [80,] -0.774460460 -1.761588948 [81,] 2.034621519 -0.774460460 [82,] 0.084657653 2.034621519 [83,] 0.902979809 0.084657653 [84,] 1.220199836 0.902979809 [85,] 0.003031138 1.220199836 [86,] 0.203622045 0.003031138 [87,] 0.318419671 0.203622045 [88,] -0.167427522 0.318419671 [89,] -3.185472788 -0.167427522 [90,] 2.619145657 -3.185472788 [91,] 0.304350336 2.619145657 [92,] -0.110870667 0.304350336 [93,] 0.914338202 -0.110870667 [94,] -1.332271840 0.914338202 [95,] 0.246686186 -1.332271840 [96,] -0.605856219 0.246686186 [97,] -0.780428621 -0.605856219 [98,] 1.319168758 -0.780428621 [99,] 0.632725025 1.319168758 [100,] 1.133311107 0.632725025 [101,] -0.541640033 1.133311107 [102,] 0.293052084 -0.541640033 [103,] -3.053652839 0.293052084 [104,] 0.980568575 -3.053652839 [105,] -2.595939492 0.980568575 [106,] 1.481794639 -2.595939492 [107,] 1.121035474 1.481794639 [108,] -2.481051828 1.121035474 [109,] 0.374913420 -2.481051828 [110,] 0.676472466 0.374913420 [111,] -1.646749671 0.676472466 [112,] -2.588037937 -1.646749671 [113,] 2.471908698 -2.588037937 [114,] 2.955884119 2.471908698 [115,] 0.690399104 2.955884119 [116,] 0.092271359 0.690399104 [117,] 0.553206966 0.092271359 [118,] -0.529940499 0.553206966 [119,] -0.556498173 -0.529940499 [120,] -0.145864785 -0.556498173 [121,] 0.535088324 -0.145864785 [122,] -0.725888310 0.535088324 [123,] -0.357938885 -0.725888310 [124,] -0.104475340 -0.357938885 [125,] -1.077272952 -0.104475340 [126,] -0.023755933 -1.077272952 [127,] 1.751083466 -0.023755933 [128,] 3.319550948 1.751083466 [129,] 1.587710697 3.319550948 [130,] -0.997222473 1.587710697 [131,] -2.373481500 -0.997222473 [132,] 0.055357911 -2.373481500 [133,] 2.606977152 0.055357911 [134,] 0.026524548 2.606977152 [135,] 2.853655360 0.026524548 [136,] 0.875498862 2.853655360 [137,] 1.306484613 0.875498862 [138,] -1.658380409 1.306484613 [139,] 1.092299771 -1.658380409 [140,] -1.509044292 1.092299771 [141,] 0.978464662 -1.509044292 [142,] 2.859942734 0.978464662 [143,] -1.104590654 2.859942734 [144,] 1.192905573 -1.104590654 [145,] 1.117863837 1.192905573 [146,] 1.010606562 1.117863837 [147,] -1.963495962 1.010606562 [148,] -3.120435216 -1.963495962 [149,] -2.160578639 -3.120435216 [150,] 0.850755455 -2.160578639 [151,] 0.266304928 0.850755455 [152,] -0.159107830 0.266304928 [153,] -1.934139942 -0.159107830 [154,] -2.194592690 -1.934139942 [155,] 0.431458796 -2.194592690 [156,] 0.553203100 0.431458796 [157,] 0.908896767 0.553203100 [158,] 3.680207110 0.908896767 [159,] -2.015728897 3.680207110 [160,] -0.716704524 -2.015728897 [161,] 0.989756315 -0.716704524 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 2.635593378 0.245207770 2 -3.273498186 2.635593378 3 -1.635136403 -3.273498186 4 4.017821283 -1.635136403 5 4.042043265 4.017821283 6 2.289376170 4.042043265 7 -0.700342509 2.289376170 8 -1.151240492 -0.700342509 9 0.991018702 -1.151240492 10 1.935794665 0.991018702 11 2.892839048 1.935794665 12 -3.101326271 2.892839048 13 2.529370657 -3.101326271 14 1.795532658 2.529370657 15 1.261249830 1.795532658 16 -0.478856325 1.261249830 17 1.920853310 -0.478856325 18 -2.025672375 1.920853310 19 2.653232984 -2.025672375 20 1.135837980 2.653232984 21 -2.202025794 1.135837980 22 0.085944136 -2.202025794 23 -2.133538351 0.085944136 24 1.947434322 -2.133538351 25 -6.996616157 1.947434322 26 0.363312150 -6.996616157 27 1.287380546 0.363312150 28 0.551911168 1.287380546 29 -2.288567687 0.551911168 30 -0.215630700 -2.288567687 31 0.903640807 -0.215630700 32 0.925389540 0.903640807 33 0.228445221 0.925389540 34 0.443144227 0.228445221 35 0.187254974 0.443144227 36 -1.471866895 0.187254974 37 0.697940531 -1.471866895 38 1.379227215 0.697940531 39 -1.551810354 1.379227215 40 -1.221105052 -1.551810354 41 2.864698560 -1.221105052 42 -0.464844925 2.864698560 43 -0.858548323 -0.464844925 44 -3.705081786 -0.858548323 45 -2.504574314 -3.705081786 46 0.144155113 -2.504574314 47 -0.368153519 0.144155113 48 3.877458129 -0.368153519 49 -1.822813943 3.877458129 50 0.363855681 -1.822813943 51 1.147717546 0.363855681 52 -1.365718637 1.147717546 53 -0.881853319 -1.365718637 54 -2.747524747 -0.881853319 55 0.750441688 -2.747524747 56 0.708904328 0.750441688 57 0.278325589 0.708904328 58 -2.710982260 0.278325589 59 -1.997709576 -2.710982260 60 -2.322917205 -1.997709576 61 -1.623643266 -2.322917205 62 -4.157461118 -1.623643266 63 1.614472904 -4.157461118 64 0.863947107 1.614472904 65 -4.464726531 0.863947107 66 -2.450628120 -4.464726531 67 -2.037620466 -2.450628120 68 0.247282797 -2.037620466 69 1.670547984 0.247282797 70 0.729576594 1.670547984 71 2.751717487 0.729576594 72 1.037116561 2.751717487 73 -0.186173216 1.037116561 74 -2.661681579 -0.186173216 75 0.055239290 -2.661681579 76 2.320271024 0.055239290 77 1.004367189 2.320271024 78 0.578223724 1.004367189 79 -1.761588948 0.578223724 80 -0.774460460 -1.761588948 81 2.034621519 -0.774460460 82 0.084657653 2.034621519 83 0.902979809 0.084657653 84 1.220199836 0.902979809 85 0.003031138 1.220199836 86 0.203622045 0.003031138 87 0.318419671 0.203622045 88 -0.167427522 0.318419671 89 -3.185472788 -0.167427522 90 2.619145657 -3.185472788 91 0.304350336 2.619145657 92 -0.110870667 0.304350336 93 0.914338202 -0.110870667 94 -1.332271840 0.914338202 95 0.246686186 -1.332271840 96 -0.605856219 0.246686186 97 -0.780428621 -0.605856219 98 1.319168758 -0.780428621 99 0.632725025 1.319168758 100 1.133311107 0.632725025 101 -0.541640033 1.133311107 102 0.293052084 -0.541640033 103 -3.053652839 0.293052084 104 0.980568575 -3.053652839 105 -2.595939492 0.980568575 106 1.481794639 -2.595939492 107 1.121035474 1.481794639 108 -2.481051828 1.121035474 109 0.374913420 -2.481051828 110 0.676472466 0.374913420 111 -1.646749671 0.676472466 112 -2.588037937 -1.646749671 113 2.471908698 -2.588037937 114 2.955884119 2.471908698 115 0.690399104 2.955884119 116 0.092271359 0.690399104 117 0.553206966 0.092271359 118 -0.529940499 0.553206966 119 -0.556498173 -0.529940499 120 -0.145864785 -0.556498173 121 0.535088324 -0.145864785 122 -0.725888310 0.535088324 123 -0.357938885 -0.725888310 124 -0.104475340 -0.357938885 125 -1.077272952 -0.104475340 126 -0.023755933 -1.077272952 127 1.751083466 -0.023755933 128 3.319550948 1.751083466 129 1.587710697 3.319550948 130 -0.997222473 1.587710697 131 -2.373481500 -0.997222473 132 0.055357911 -2.373481500 133 2.606977152 0.055357911 134 0.026524548 2.606977152 135 2.853655360 0.026524548 136 0.875498862 2.853655360 137 1.306484613 0.875498862 138 -1.658380409 1.306484613 139 1.092299771 -1.658380409 140 -1.509044292 1.092299771 141 0.978464662 -1.509044292 142 2.859942734 0.978464662 143 -1.104590654 2.859942734 144 1.192905573 -1.104590654 145 1.117863837 1.192905573 146 1.010606562 1.117863837 147 -1.963495962 1.010606562 148 -3.120435216 -1.963495962 149 -2.160578639 -3.120435216 150 0.850755455 -2.160578639 151 0.266304928 0.850755455 152 -0.159107830 0.266304928 153 -1.934139942 -0.159107830 154 -2.194592690 -1.934139942 155 0.431458796 -2.194592690 156 0.553203100 0.431458796 157 0.908896767 0.553203100 158 3.680207110 0.908896767 159 -2.015728897 3.680207110 160 -0.716704524 -2.015728897 161 0.989756315 -0.716704524 > 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/7ny6t1322159630.ps",horizontal=F,onefile=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/8118h1322159630.ps",horizontal=F,onefile=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/994qo1322159630.ps",horizontal=F,onefile=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/10hczy1322159630.ps",horizontal=F,onefile=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/1137t41322159630.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/12r6hh1322159630.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/13ewvd1322159630.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/14353q1322159630.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/1539k51322159630.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/16atmk1322159630.tab") + } > > try(system("convert tmp/1f8v81322159630.ps tmp/1f8v81322159630.png",intern=TRUE)) character(0) > try(system("convert tmp/2fcla1322159630.ps tmp/2fcla1322159630.png",intern=TRUE)) character(0) > try(system("convert tmp/3gr8v1322159630.ps tmp/3gr8v1322159630.png",intern=TRUE)) character(0) > try(system("convert tmp/40jcc1322159630.ps tmp/40jcc1322159630.png",intern=TRUE)) character(0) > try(system("convert tmp/5q7fd1322159630.ps tmp/5q7fd1322159630.png",intern=TRUE)) character(0) > try(system("convert tmp/6z6ap1322159630.ps tmp/6z6ap1322159630.png",intern=TRUE)) character(0) > try(system("convert tmp/7ny6t1322159630.ps tmp/7ny6t1322159630.png",intern=TRUE)) character(0) > try(system("convert tmp/8118h1322159630.ps tmp/8118h1322159630.png",intern=TRUE)) character(0) > try(system("convert tmp/994qo1322159630.ps tmp/994qo1322159630.png",intern=TRUE)) character(0) > try(system("convert tmp/10hczy1322159630.ps tmp/10hczy1322159630.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 6.756 0.692 7.477