R version 2.15.2 (2012-10-26) -- "Trick or Treat" Copyright (C) 2012 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i686-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(41 + ,38 + ,13 + ,12 + ,14 + ,12 + ,53 + ,32 + ,39 + ,32 + ,16 + ,11 + ,18 + ,11 + ,86 + ,51 + ,30 + ,35 + ,19 + ,15 + ,11 + ,14 + ,66 + ,42 + ,31 + ,33 + ,15 + ,6 + ,12 + ,12 + ,67 + ,41 + ,34 + ,37 + ,14 + ,13 + ,16 + ,21 + ,76 + ,46 + ,35 + ,29 + ,13 + ,10 + ,18 + ,12 + ,78 + ,47 + ,39 + ,31 + ,19 + ,12 + ,14 + ,22 + ,53 + ,37 + ,34 + ,36 + ,15 + ,14 + ,14 + ,11 + ,80 + ,49 + ,36 + ,35 + ,14 + ,12 + ,15 + ,10 + ,74 + ,45 + ,37 + ,38 + ,15 + ,6 + ,15 + ,13 + ,76 + ,47 + ,38 + ,31 + ,16 + ,10 + ,17 + ,10 + ,79 + ,49 + ,36 + ,34 + ,16 + ,12 + ,19 + ,8 + ,54 + ,33 + ,38 + ,35 + ,16 + ,12 + ,10 + ,15 + ,67 + ,42 + ,39 + ,38 + ,16 + ,11 + ,16 + ,14 + ,54 + ,33 + ,33 + ,37 + ,17 + ,15 + ,18 + ,10 + ,87 + ,53 + ,32 + ,33 + ,15 + ,12 + ,14 + ,14 + ,58 + ,36 + ,36 + ,32 + ,15 + ,10 + ,14 + ,14 + ,75 + ,45 + ,38 + ,38 + ,20 + ,12 + ,17 + ,11 + ,88 + ,54 + ,39 + ,38 + ,18 + ,11 + ,14 + ,10 + ,64 + ,41 + ,32 + ,32 + ,16 + ,12 + ,16 + ,13 + ,57 + ,36 + ,32 + ,33 + ,16 + ,11 + ,18 + ,7 + ,66 + ,41 + ,31 + ,31 + ,16 + ,12 + ,11 + ,14 + ,68 + ,44 + ,39 + ,38 + ,19 + ,13 + ,14 + ,12 + ,54 + ,33 + ,37 + ,39 + ,16 + ,11 + ,12 + ,14 + ,56 + ,37 + ,39 + ,32 + ,17 + ,9 + ,17 + ,11 + ,86 + ,52 + ,41 + ,32 + ,17 + ,13 + ,9 + ,9 + ,80 + ,47 + ,36 + ,35 + ,16 + ,10 + ,16 + ,11 + ,76 + ,43 + ,33 + ,37 + ,15 + ,14 + ,14 + ,15 + ,69 + ,44 + ,33 + ,33 + ,16 + ,12 + ,15 + ,14 + ,78 + ,45 + ,34 + ,33 + ,14 + ,10 + ,11 + ,13 + ,67 + ,44 + ,31 + ,28 + ,15 + ,12 + ,16 + ,9 + ,80 + ,49 + ,27 + ,32 + ,12 + ,8 + ,13 + ,15 + ,54 + ,33 + ,37 + ,31 + ,14 + ,10 + ,17 + ,10 + ,71 + ,43 + ,34 + ,37 + ,16 + ,12 + ,15 + ,11 + ,84 + ,54 + ,34 + ,30 + ,14 + ,12 + ,14 + ,13 + ,74 + ,42 + ,32 + ,33 + ,7 + ,7 + ,16 + ,8 + ,71 + ,44 + ,29 + ,31 + ,10 + ,6 + ,9 + ,20 + ,63 + ,37 + ,36 + ,33 + ,14 + ,12 + ,15 + ,12 + ,71 + ,43 + ,29 + ,31 + ,16 + ,10 + ,17 + ,10 + ,76 + ,46 + ,35 + ,33 + ,16 + ,10 + ,13 + ,10 + ,69 + ,42 + ,37 + ,32 + ,16 + ,10 + ,15 + ,9 + ,74 + ,45 + ,34 + ,33 + ,14 + ,12 + ,16 + ,14 + ,75 + ,44 + ,38 + ,32 + ,20 + ,15 + ,16 + ,8 + ,54 + ,33 + ,35 + ,33 + ,14 + ,10 + ,12 + ,14 + ,52 + ,31 + ,38 + ,28 + ,14 + ,10 + ,12 + ,11 + ,69 + ,42 + ,37 + ,35 + ,11 + ,12 + ,11 + ,13 + ,68 + ,40 + ,38 + ,39 + ,14 + ,13 + ,15 + ,9 + ,65 + ,43 + ,33 + ,34 + ,15 + ,11 + ,15 + ,11 + ,75 + ,46 + ,36 + ,38 + ,16 + ,11 + ,17 + ,15 + ,74 + ,42 + ,38 + ,32 + ,14 + ,12 + ,13 + ,11 + ,75 + ,45 + ,32 + ,38 + ,16 + ,14 + ,16 + ,10 + ,72 + ,44 + ,32 + ,30 + ,14 + ,10 + ,14 + ,14 + ,67 + ,40 + ,32 + ,33 + ,12 + ,12 + ,11 + ,18 + ,63 + ,37 + ,34 + ,38 + ,16 + ,13 + ,12 + ,14 + ,62 + ,46 + ,32 + ,32 + ,9 + ,5 + ,12 + ,11 + ,63 + ,36 + ,37 + ,32 + ,14 + ,6 + ,15 + ,12 + ,76 + ,47 + ,39 + ,34 + ,16 + ,12 + ,16 + ,13 + ,74 + ,45 + ,29 + ,34 + ,16 + ,12 + ,15 + ,9 + ,67 + ,42 + ,37 + ,36 + ,15 + ,11 + ,12 + ,10 + ,73 + ,43 + ,35 + ,34 + ,16 + ,10 + ,12 + ,15 + ,70 + ,43 + ,30 + ,28 + ,12 + ,7 + ,8 + ,20 + ,53 + ,32 + ,38 + ,34 + ,16 + ,12 + ,13 + ,12 + ,77 + ,45 + ,34 + ,35 + ,16 + ,14 + ,11 + ,12 + ,77 + ,45 + ,31 + ,35 + ,14 + ,11 + ,14 + ,14 + ,52 + ,31 + ,34 + ,31 + ,16 + ,12 + ,15 + ,13 + ,54 + ,33 + ,35 + ,37 + ,17 + ,13 + ,10 + ,11 + ,80 + ,49 + ,36 + ,35 + ,18 + ,14 + ,11 + ,17 + ,66 + ,42 + ,30 + ,27 + ,18 + ,11 + ,12 + ,12 + ,73 + ,41 + ,39 + ,40 + ,12 + ,12 + ,15 + ,13 + ,63 + ,38 + ,35 + ,37 + ,16 + ,12 + ,15 + ,14 + ,69 + ,42 + ,38 + ,36 + ,10 + ,8 + ,14 + ,13 + ,67 + ,44 + ,31 + ,38 + ,14 + ,11 + ,16 + ,15 + ,54 + ,33 + ,34 + ,39 + ,18 + ,14 + ,15 + ,13 + ,81 + ,48 + ,38 + ,41 + ,18 + ,14 + ,15 + ,10 + ,69 + ,40 + ,34 + ,27 + ,16 + ,12 + ,13 + ,11 + ,84 + ,50 + ,39 + ,30 + ,17 + ,9 + ,12 + ,19 + ,80 + ,49 + ,37 + ,37 + ,16 + ,13 + ,17 + ,13 + ,70 + ,43 + ,34 + ,31 + ,16 + ,11 + ,13 + ,17 + ,69 + ,44 + ,28 + ,31 + ,13 + ,12 + ,15 + ,13 + ,77 + ,47 + ,37 + ,27 + ,16 + ,12 + ,13 + ,9 + ,54 + ,33 + ,33 + ,36 + ,16 + ,12 + ,15 + ,11 + ,79 + ,46 + ,37 + ,38 + ,20 + ,12 + ,16 + ,10 + ,30 + ,0 + ,35 + ,37 + ,16 + ,12 + ,15 + ,9 + ,71 + ,45 + ,37 + ,33 + ,15 + ,12 + ,16 + ,12 + ,73 + ,43 + ,32 + ,34 + ,15 + ,11 + ,15 + ,12 + ,72 + ,44 + ,33 + ,31 + ,16 + ,10 + ,14 + ,13 + ,77 + ,47 + ,38 + ,39 + ,14 + ,9 + ,15 + ,13 + ,75 + ,45 + ,33 + ,34 + ,16 + ,12 + ,14 + ,12 + ,69 + ,42 + ,29 + ,32 + ,16 + ,12 + ,13 + ,15 + ,54 + ,33 + ,33 + ,33 + ,15 + ,12 + ,7 + ,22 + ,70 + ,43 + ,31 + ,36 + ,12 + ,9 + ,17 + ,13 + ,73 + ,46 + ,36 + ,32 + ,17 + ,15 + ,13 + ,15 + ,54 + ,33 + ,35 + ,41 + ,16 + ,12 + ,15 + ,13 + ,77 + ,46 + ,32 + ,28 + ,15 + ,12 + ,14 + ,15 + ,82 + ,48 + ,29 + ,30 + ,13 + ,12 + ,13 + ,10 + ,80 + ,47 + ,39 + ,36 + ,16 + ,10 + ,16 + ,11 + ,80 + ,47 + ,37 + ,35 + ,16 + ,13 + ,12 + ,16 + ,69 + ,43 + ,35 + ,31 + ,16 + ,9 + ,14 + ,11 + ,78 + ,46 + ,37 + ,34 + ,16 + ,12 + ,17 + ,11 + ,81 + ,48 + ,32 + ,36 + ,14 + ,10 + ,15 + ,10 + ,76 + ,46 + ,38 + ,36 + ,16 + ,14 + ,17 + ,10 + ,76 + ,45 + ,37 + ,35 + ,16 + ,11 + ,12 + ,16 + ,73 + ,45 + ,36 + ,37 + ,20 + ,15 + ,16 + ,12 + ,85 + ,52 + ,32 + ,28 + ,15 + ,11 + ,11 + ,11 + ,66 + ,42 + ,33 + ,39 + ,16 + ,11 + ,15 + ,16 + ,79 + ,47 + ,40 + ,32 + ,13 + ,12 + ,9 + ,19 + ,68 + ,41 + ,38 + ,35 + ,17 + ,12 + ,16 + ,11 + ,76 + ,47 + ,41 + ,39 + ,16 + ,12 + ,15 + ,16 + ,71 + ,43 + ,36 + ,35 + ,16 + ,11 + ,10 + ,15 + ,54 + ,33 + ,43 + ,42 + ,12 + ,7 + ,10 + ,24 + ,46 + ,30 + ,30 + ,34 + ,16 + ,12 + ,15 + ,14 + ,82 + ,49 + ,31 + ,33 + ,16 + ,14 + ,11 + ,15 + ,74 + ,44 + ,32 + ,41 + ,17 + ,11 + ,13 + ,11 + ,88 + ,55 + ,32 + ,33 + ,13 + ,11 + ,14 + ,15 + ,38 + ,11 + ,37 + ,34 + ,12 + ,10 + ,18 + ,12 + ,76 + ,47 + ,37 + ,32 + ,18 + ,13 + ,16 + ,10 + ,86 + ,53 + ,33 + ,40 + ,14 + ,13 + ,14 + ,14 + ,54 + ,33 + ,34 + ,40 + ,14 + ,8 + ,14 + ,13 + ,70 + ,44 + ,33 + ,35 + ,13 + ,11 + ,14 + ,9 + ,69 + ,42 + ,38 + ,36 + ,16 + ,12 + ,14 + ,15 + ,90 + ,55 + ,33 + ,37 + ,13 + ,11 + ,12 + ,15 + ,54 + ,33 + ,31 + ,27 + ,16 + ,13 + ,14 + ,14 + ,76 + ,46 + ,38 + ,39 + ,13 + ,12 + ,15 + ,11 + ,89 + ,54 + ,37 + ,38 + ,16 + ,14 + ,15 + ,8 + ,76 + ,47 + ,33 + ,31 + ,15 + ,13 + ,15 + ,11 + ,73 + ,45 + ,31 + ,33 + ,16 + ,15 + ,13 + ,11 + ,79 + ,47 + ,39 + ,32 + ,15 + ,10 + ,17 + ,8 + ,90 + ,55 + ,44 + ,39 + ,17 + ,11 + ,17 + ,10 + ,74 + ,44 + ,33 + ,36 + ,15 + ,9 + ,19 + ,11 + ,81 + ,53 + ,35 + ,33 + ,12 + ,11 + ,15 + ,13 + ,72 + ,44 + ,32 + ,33 + ,16 + ,10 + ,13 + ,11 + ,71 + ,42 + ,28 + ,32 + ,10 + ,11 + ,9 + ,20 + ,66 + ,40 + ,40 + ,37 + ,16 + ,8 + ,15 + ,10 + ,77 + ,46 + ,27 + ,30 + ,12 + ,11 + ,15 + ,15 + ,65 + ,40 + ,37 + ,38 + ,14 + ,12 + ,15 + ,12 + ,74 + ,46 + ,32 + ,29 + ,15 + ,12 + ,16 + ,14 + ,82 + ,53 + ,28 + ,22 + ,13 + ,9 + ,11 + ,23 + ,54 + ,33 + ,34 + ,35 + ,15 + ,11 + ,14 + ,14 + ,63 + ,42 + ,30 + ,35 + ,11 + ,10 + ,11 + ,16 + ,54 + ,35 + ,35 + ,34 + ,12 + ,8 + ,15 + ,11 + ,64 + ,40 + ,31 + ,35 + ,8 + ,9 + ,13 + ,12 + ,69 + ,41 + ,32 + ,34 + ,16 + ,8 + ,15 + ,10 + ,54 + ,33 + ,30 + ,34 + ,15 + ,9 + ,16 + ,14 + ,84 + ,51 + ,30 + ,35 + ,17 + ,15 + ,14 + ,12 + ,86 + ,53 + ,31 + ,23 + ,16 + ,11 + ,15 + ,12 + ,77 + ,46 + ,40 + ,31 + ,10 + ,8 + ,16 + ,11 + ,89 + ,55 + ,32 + ,27 + ,18 + ,13 + ,16 + ,12 + ,76 + ,47 + ,36 + ,36 + ,13 + ,12 + ,11 + ,13 + ,60 + ,38 + ,32 + ,31 + ,16 + ,12 + ,12 + ,11 + ,75 + ,46 + ,35 + ,32 + ,13 + ,9 + ,9 + ,19 + ,73 + ,46 + ,38 + ,39 + ,10 + ,7 + ,16 + ,12 + ,85 + ,53 + ,42 + ,37 + ,15 + ,13 + ,13 + ,17 + ,79 + ,47 + ,34 + ,38 + ,16 + ,9 + ,16 + ,9 + ,71 + ,41 + ,35 + ,39 + ,16 + ,6 + ,12 + ,12 + ,72 + ,44 + ,35 + ,34 + ,14 + ,8 + ,9 + ,19 + ,69 + ,43 + ,33 + ,31 + ,10 + ,8 + ,13 + ,18 + ,78 + ,51 + ,36 + ,32 + ,17 + ,15 + ,13 + ,15 + ,54 + ,33 + ,32 + ,37 + ,13 + ,6 + ,14 + ,14 + ,69 + ,43 + ,33 + ,36 + ,15 + ,9 + ,19 + ,11 + ,81 + ,53 + ,34 + ,32 + ,16 + ,11 + ,13 + ,9 + ,84 + ,51 + ,32 + ,35 + ,12 + ,8 + ,12 + ,18 + ,84 + ,50 + ,34 + ,36 + ,13 + ,8 + ,13 + ,16 + ,69 + ,46) + ,dim=c(8 + ,162) + ,dimnames=list(c('Connected' + ,'Separate' + ,'Learning' + ,'Software' + ,'Happiness' + ,'Depression' + ,'Belonging' + ,'Belonging_Final') + ,1:162)) > y <- array(NA,dim=c(8,162),dimnames=list(c('Connected','Separate','Learning','Software','Happiness','Depression','Belonging','Belonging_Final'),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 = 'No Linear Trend' > par2 = 'Do not include Seasonal Dummies' > par1 = '6' > library(lattice) > library(lmtest) Loading required package: zoo Attaching package: 'zoo' The following object(s) are masked from 'package:base': as.Date, as.Date.numeric > n25 <- 25 #minimum number of obs. for Goldfeld-Quandt test > par1 <- as.numeric(par1) > x <- t(y) > k <- length(x[1,]) > n <- length(x[,1]) > x1 <- cbind(x[,par1], x[,1:k!=par1]) > mycolnames <- c(colnames(x)[par1], colnames(x)[1:k!=par1]) > colnames(x1) <- mycolnames #colnames(x)[par1] > x <- x1 > if (par3 == 'First Differences'){ + x2 <- array(0, dim=c(n-1,k), dimnames=list(1:(n-1), paste('(1-B)',colnames(x),sep=''))) + for (i in 1:n-1) { + for (j in 1:k) { + x2[i,j] <- x[i+1,j] - x[i,j] + } + } + x <- x2 + } > if (par2 == 'Include Monthly Dummies'){ + x2 <- array(0, dim=c(n,11), dimnames=list(1:n, paste('M', seq(1:11), sep =''))) + for (i in 1:11){ + x2[seq(i,n,12),i] <- 1 + } + x <- cbind(x, x2) + } > if (par2 == 'Include Quarterly Dummies'){ + x2 <- array(0, dim=c(n,3), dimnames=list(1:n, paste('Q', seq(1:3), sep =''))) + for (i in 1:3){ + x2[seq(i,n,4),i] <- 1 + } + x <- cbind(x, x2) + } > k <- length(x[1,]) > if (par3 == 'Linear Trend'){ + x <- cbind(x, c(1:n)) + colnames(x)[k+1] <- 't' + } > x Depression Connected Separate Learning Software Happiness Belonging 1 12 41 38 13 12 14 53 2 11 39 32 16 11 18 86 3 14 30 35 19 15 11 66 4 12 31 33 15 6 12 67 5 21 34 37 14 13 16 76 6 12 35 29 13 10 18 78 7 22 39 31 19 12 14 53 8 11 34 36 15 14 14 80 9 10 36 35 14 12 15 74 10 13 37 38 15 6 15 76 11 10 38 31 16 10 17 79 12 8 36 34 16 12 19 54 13 15 38 35 16 12 10 67 14 14 39 38 16 11 16 54 15 10 33 37 17 15 18 87 16 14 32 33 15 12 14 58 17 14 36 32 15 10 14 75 18 11 38 38 20 12 17 88 19 10 39 38 18 11 14 64 20 13 32 32 16 12 16 57 21 7 32 33 16 11 18 66 22 14 31 31 16 12 11 68 23 12 39 38 19 13 14 54 24 14 37 39 16 11 12 56 25 11 39 32 17 9 17 86 26 9 41 32 17 13 9 80 27 11 36 35 16 10 16 76 28 15 33 37 15 14 14 69 29 14 33 33 16 12 15 78 30 13 34 33 14 10 11 67 31 9 31 28 15 12 16 80 32 15 27 32 12 8 13 54 33 10 37 31 14 10 17 71 34 11 34 37 16 12 15 84 35 13 34 30 14 12 14 74 36 8 32 33 7 7 16 71 37 20 29 31 10 6 9 63 38 12 36 33 14 12 15 71 39 10 29 31 16 10 17 76 40 10 35 33 16 10 13 69 41 9 37 32 16 10 15 74 42 14 34 33 14 12 16 75 43 8 38 32 20 15 16 54 44 14 35 33 14 10 12 52 45 11 38 28 14 10 12 69 46 13 37 35 11 12 11 68 47 9 38 39 14 13 15 65 48 11 33 34 15 11 15 75 49 15 36 38 16 11 17 74 50 11 38 32 14 12 13 75 51 10 32 38 16 14 16 72 52 14 32 30 14 10 14 67 53 18 32 33 12 12 11 63 54 14 34 38 16 13 12 62 55 11 32 32 9 5 12 63 56 12 37 32 14 6 15 76 57 13 39 34 16 12 16 74 58 9 29 34 16 12 15 67 59 10 37 36 15 11 12 73 60 15 35 34 16 10 12 70 61 20 30 28 12 7 8 53 62 12 38 34 16 12 13 77 63 12 34 35 16 14 11 77 64 14 31 35 14 11 14 52 65 13 34 31 16 12 15 54 66 11 35 37 17 13 10 80 67 17 36 35 18 14 11 66 68 12 30 27 18 11 12 73 69 13 39 40 12 12 15 63 70 14 35 37 16 12 15 69 71 13 38 36 10 8 14 67 72 15 31 38 14 11 16 54 73 13 34 39 18 14 15 81 74 10 38 41 18 14 15 69 75 11 34 27 16 12 13 84 76 19 39 30 17 9 12 80 77 13 37 37 16 13 17 70 78 17 34 31 16 11 13 69 79 13 28 31 13 12 15 77 80 9 37 27 16 12 13 54 81 11 33 36 16 12 15 79 82 10 37 38 20 12 16 30 83 9 35 37 16 12 15 71 84 12 37 33 15 12 16 73 85 12 32 34 15 11 15 72 86 13 33 31 16 10 14 77 87 13 38 39 14 9 15 75 88 12 33 34 16 12 14 69 89 15 29 32 16 12 13 54 90 22 33 33 15 12 7 70 91 13 31 36 12 9 17 73 92 15 36 32 17 15 13 54 93 13 35 41 16 12 15 77 94 15 32 28 15 12 14 82 95 10 29 30 13 12 13 80 96 11 39 36 16 10 16 80 97 16 37 35 16 13 12 69 98 11 35 31 16 9 14 78 99 11 37 34 16 12 17 81 100 10 32 36 14 10 15 76 101 10 38 36 16 14 17 76 102 16 37 35 16 11 12 73 103 12 36 37 20 15 16 85 104 11 32 28 15 11 11 66 105 16 33 39 16 11 15 79 106 19 40 32 13 12 9 68 107 11 38 35 17 12 16 76 108 16 41 39 16 12 15 71 109 15 36 35 16 11 10 54 110 24 43 42 12 7 10 46 111 14 30 34 16 12 15 82 112 15 31 33 16 14 11 74 113 11 32 41 17 11 13 88 114 15 32 33 13 11 14 38 115 12 37 34 12 10 18 76 116 10 37 32 18 13 16 86 117 14 33 40 14 13 14 54 118 13 34 40 14 8 14 70 119 9 33 35 13 11 14 69 120 15 38 36 16 12 14 90 121 15 33 37 13 11 12 54 122 14 31 27 16 13 14 76 123 11 38 39 13 12 15 89 124 8 37 38 16 14 15 76 125 11 33 31 15 13 15 73 126 11 31 33 16 15 13 79 127 8 39 32 15 10 17 90 128 10 44 39 17 11 17 74 129 11 33 36 15 9 19 81 130 13 35 33 12 11 15 72 131 11 32 33 16 10 13 71 132 20 28 32 10 11 9 66 133 10 40 37 16 8 15 77 134 15 27 30 12 11 15 65 135 12 37 38 14 12 15 74 136 14 32 29 15 12 16 82 137 23 28 22 13 9 11 54 138 14 34 35 15 11 14 63 139 16 30 35 11 10 11 54 140 11 35 34 12 8 15 64 141 12 31 35 8 9 13 69 142 10 32 34 16 8 15 54 143 14 30 34 15 9 16 84 144 12 30 35 17 15 14 86 145 12 31 23 16 11 15 77 146 11 40 31 10 8 16 89 147 12 32 27 18 13 16 76 148 13 36 36 13 12 11 60 149 11 32 31 16 12 12 75 150 19 35 32 13 9 9 73 151 12 38 39 10 7 16 85 152 17 42 37 15 13 13 79 153 9 34 38 16 9 16 71 154 12 35 39 16 6 12 72 155 19 35 34 14 8 9 69 156 18 33 31 10 8 13 78 157 15 36 32 17 15 13 54 158 14 32 37 13 6 14 69 159 11 33 36 15 9 19 81 160 9 34 32 16 11 13 84 161 18 32 35 12 8 12 84 162 16 34 36 13 8 13 69 Belonging_Final 1 32 2 51 3 42 4 41 5 46 6 47 7 37 8 49 9 45 10 47 11 49 12 33 13 42 14 33 15 53 16 36 17 45 18 54 19 41 20 36 21 41 22 44 23 33 24 37 25 52 26 47 27 43 28 44 29 45 30 44 31 49 32 33 33 43 34 54 35 42 36 44 37 37 38 43 39 46 40 42 41 45 42 44 43 33 44 31 45 42 46 40 47 43 48 46 49 42 50 45 51 44 52 40 53 37 54 46 55 36 56 47 57 45 58 42 59 43 60 43 61 32 62 45 63 45 64 31 65 33 66 49 67 42 68 41 69 38 70 42 71 44 72 33 73 48 74 40 75 50 76 49 77 43 78 44 79 47 80 33 81 46 82 0 83 45 84 43 85 44 86 47 87 45 88 42 89 33 90 43 91 46 92 33 93 46 94 48 95 47 96 47 97 43 98 46 99 48 100 46 101 45 102 45 103 52 104 42 105 47 106 41 107 47 108 43 109 33 110 30 111 49 112 44 113 55 114 11 115 47 116 53 117 33 118 44 119 42 120 55 121 33 122 46 123 54 124 47 125 45 126 47 127 55 128 44 129 53 130 44 131 42 132 40 133 46 134 40 135 46 136 53 137 33 138 42 139 35 140 40 141 41 142 33 143 51 144 53 145 46 146 55 147 47 148 38 149 46 150 46 151 53 152 47 153 41 154 44 155 43 156 51 157 33 158 43 159 53 160 51 161 50 162 46 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) Connected Separate Learning 28.031925 -0.016276 0.003053 -0.144083 Software Happiness Belonging Belonging_Final -0.046614 -0.641378 -0.121881 0.130909 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -6.0368 -1.8069 -0.0352 1.6838 9.5348 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 28.031925 2.991789 9.370 < 2e-16 *** Connected -0.016276 0.067978 -0.239 0.8111 Separate 0.003053 0.063806 0.048 0.9619 Learning -0.144083 0.114073 -1.263 0.2085 Software -0.046614 0.116114 -0.401 0.6886 Happiness -0.641378 0.095854 -6.691 3.87e-10 *** Belonging -0.121881 0.062732 -1.943 0.0539 . Belonging_Final 0.130909 0.090592 1.445 0.1505 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 2.633 on 154 degrees of freedom Multiple R-squared: 0.3386, Adjusted R-squared: 0.3085 F-statistic: 11.26 on 7 and 154 DF, p-value: 1.769e-11 > 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.8429695 0.314060987 0.157030493 [2,] 0.9982685 0.003462990 0.001731495 [3,] 0.9960036 0.007992896 0.003996448 [4,] 0.9942481 0.011503780 0.005751890 [5,] 0.9923293 0.015341428 0.007670714 [6,] 0.9860333 0.027933306 0.013966653 [7,] 0.9850719 0.029856105 0.014928053 [8,] 0.9753405 0.049318982 0.024659491 [9,] 0.9850690 0.029862042 0.014931021 [10,] 0.9764225 0.047154930 0.023577465 [11,] 0.9855059 0.028988254 0.014494127 [12,] 0.9823493 0.035301432 0.017650716 [13,] 0.9731634 0.053673168 0.026836584 [14,] 0.9648011 0.070397724 0.035198862 [15,] 0.9495258 0.100948445 0.050474222 [16,] 0.9638277 0.072344620 0.036172310 [17,] 0.9652104 0.069579151 0.034789575 [18,] 0.9525961 0.094807887 0.047403944 [19,] 0.9642074 0.071585188 0.035792594 [20,] 0.9620004 0.075999261 0.037999631 [21,] 0.9611136 0.077772812 0.038886406 [22,] 0.9507950 0.098409921 0.049204960 [23,] 0.9379145 0.124171055 0.062085527 [24,] 0.9279386 0.144122730 0.072061365 [25,] 0.9129192 0.174161642 0.087080821 [26,] 0.9368604 0.126279283 0.063139642 [27,] 0.9656379 0.068724121 0.034362060 [28,] 0.9535170 0.092965923 0.046482962 [29,] 0.9416055 0.116788936 0.058394468 [30,] 0.9468938 0.106212394 0.053106197 [31,] 0.9464375 0.107124952 0.053562476 [32,] 0.9450534 0.109893292 0.054946646 [33,] 0.9555605 0.088879089 0.044439544 [34,] 0.9429196 0.114160850 0.057080425 [35,] 0.9415232 0.116953646 0.058476823 [36,] 0.9314911 0.137017727 0.068508864 [37,] 0.9461189 0.107762266 0.053881133 [38,] 0.9332672 0.133465553 0.066732777 [39,] 0.9525845 0.094830997 0.047415499 [40,] 0.9459995 0.108000957 0.054000479 [41,] 0.9386117 0.122776637 0.061388318 [42,] 0.9246481 0.150703704 0.075351852 [43,] 0.9289935 0.142012982 0.071006491 [44,] 0.9156465 0.168707074 0.084353537 [45,] 0.9364431 0.127113842 0.063556921 [46,] 0.9219699 0.156060264 0.078030132 [47,] 0.9126689 0.174662193 0.087331096 [48,] 0.9279433 0.144113379 0.072056690 [49,] 0.9422182 0.115563580 0.057781790 [50,] 0.9309102 0.138179587 0.069089794 [51,] 0.9317394 0.136521232 0.068260616 [52,] 0.9162765 0.167447024 0.083723512 [53,] 0.9077137 0.184572579 0.092286289 [54,] 0.8862470 0.227505912 0.113752956 [55,] 0.8615221 0.276955787 0.138477894 [56,] 0.8825301 0.234939821 0.117469911 [57,] 0.8814814 0.237037185 0.118518593 [58,] 0.8658716 0.268256877 0.134128438 [59,] 0.8400033 0.319993309 0.159996654 [60,] 0.8243124 0.351375185 0.175687593 [61,] 0.8030483 0.393903371 0.196951685 [62,] 0.7956671 0.408665785 0.204332892 [63,] 0.7782267 0.443546666 0.221773333 [64,] 0.7576778 0.484644374 0.242322187 [65,] 0.7382565 0.523486909 0.261743455 [66,] 0.8509820 0.298036047 0.149018023 [67,] 0.8436907 0.312618594 0.156309297 [68,] 0.8594681 0.281063819 0.140531909 [69,] 0.8338610 0.332277954 0.166138977 [70,] 0.9082399 0.183520136 0.091760068 [71,] 0.8882488 0.223502411 0.111751205 [72,] 0.8656182 0.268763661 0.134381830 [73,] 0.8809250 0.238149996 0.119074998 [74,] 0.8578452 0.284309624 0.142154812 [75,] 0.8299357 0.340128566 0.170064283 [76,] 0.7988317 0.402336540 0.201168270 [77,] 0.7671779 0.465644147 0.232822074 [78,] 0.7339556 0.532088820 0.266044410 [79,] 0.6974654 0.605069296 0.302534648 [80,] 0.7707010 0.458597904 0.229298952 [81,] 0.7441069 0.511786201 0.255893100 [82,] 0.7123360 0.575327981 0.287663990 [83,] 0.6842856 0.631428822 0.315714411 [84,] 0.6864534 0.627093103 0.313546552 [85,] 0.7109046 0.578190788 0.289095394 [86,] 0.6684081 0.663183790 0.331591895 [87,] 0.6431014 0.713797208 0.356898604 [88,] 0.6143586 0.771282899 0.385641449 [89,] 0.5715814 0.856837251 0.428418626 [90,] 0.5567378 0.886524348 0.443262174 [91,] 0.5084962 0.983007683 0.491503842 [92,] 0.4824684 0.964936857 0.517531572 [93,] 0.4710203 0.942040574 0.528979713 [94,] 0.5947369 0.810526236 0.405263118 [95,] 0.7142465 0.571506976 0.285753488 [96,] 0.7029623 0.594075454 0.297037727 [97,] 0.6579519 0.684096209 0.342048104 [98,] 0.7372016 0.525596875 0.262798438 [99,] 0.7127890 0.574422066 0.287211033 [100,] 0.8946273 0.210745352 0.105372676 [101,] 0.8964738 0.207052476 0.103526238 [102,] 0.8723905 0.255219027 0.127609514 [103,] 0.8511604 0.297679264 0.148839632 [104,] 0.8819857 0.236028669 0.118014335 [105,] 0.8664385 0.267122959 0.133561480 [106,] 0.8358811 0.328237711 0.164118855 [107,] 0.8305923 0.338815464 0.169407732 [108,] 0.7961744 0.407651255 0.203825628 [109,] 0.8446049 0.310790138 0.155395069 [110,] 0.8683857 0.263228523 0.131614261 [111,] 0.8371806 0.325638866 0.162819433 [112,] 0.8067545 0.386490966 0.193245483 [113,] 0.7668956 0.466208787 0.233104393 [114,] 0.7774376 0.445124797 0.222562399 [115,] 0.7450423 0.509915406 0.254957703 [116,] 0.7169580 0.566083901 0.283041950 [117,] 0.7156906 0.568618867 0.284309433 [118,] 0.6982627 0.603474698 0.301737349 [119,] 0.6543831 0.691233854 0.345616927 [120,] 0.5946558 0.810688397 0.405344198 [121,] 0.5724743 0.855051431 0.427525716 [122,] 0.5346530 0.930693973 0.465346987 [123,] 0.4758667 0.951733448 0.524133276 [124,] 0.4321976 0.864395245 0.567802377 [125,] 0.3696321 0.739264185 0.630367908 [126,] 0.3190934 0.638186877 0.680906561 [127,] 0.6230210 0.753958067 0.376979034 [128,] 0.5487709 0.902458116 0.451229058 [129,] 0.4731250 0.946250091 0.526874955 [130,] 0.4178878 0.835775598 0.582112201 [131,] 0.4062899 0.812579736 0.593710132 [132,] 0.3592433 0.718486538 0.640756731 [133,] 0.3687994 0.737598845 0.631200578 [134,] 0.2867187 0.573437314 0.713281343 [135,] 0.2143192 0.428638477 0.785680762 [136,] 0.3105507 0.621101445 0.689449278 [137,] 0.2256918 0.451383552 0.774308224 [138,] 0.4501917 0.900383483 0.549808259 [139,] 0.5280081 0.943983863 0.471991932 [140,] 0.3891580 0.778316079 0.610841961 [141,] 0.5446222 0.910755524 0.455377762 > postscript(file="/var/wessaorg/rcomp/tmp/1x5jp1356212668.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/wessaorg/rcomp/tmp/268hf1356212668.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/wessaorg/rcomp/tmp/3ewyt1356212668.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/wessaorg/rcomp/tmp/4wvs21356212668.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/wessaorg/rcomp/tmp/5zzqv1356212668.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 -1.79827545 1.67342169 -0.61259807 -2.69190297 9.53481943 1.68720253 7 8 9 10 11 12 8.40049381 -1.45939306 -2.22736592 0.62609693 -0.61913991 -2.23733401 13 14 15 16 17 18 -0.57397443 1.82853596 0.75109839 0.44443233 1.31315094 1.47143045 19 20 21 22 23 24 -2.99452241 0.75244438 -3.57208615 -1.17425870 -0.92874355 -1.05245933 25 26 27 28 29 30 0.95199021 -6.03676625 0.11453219 1.83513719 2.50559953 -2.63480919 31 32 33 34 35 36 -2.29427100 0.01122554 -1.11317212 -0.93723554 0.50669475 -5.12137188 37 38 39 40 41 42 2.67321275 -0.32508366 -0.73854218 -3.54202917 -3.00699159 2.64035501 43 44 45 46 47 48 -3.40663647 -1.10354235 -3.40748095 -2.28558981 -3.99551774 -1.18470158 49 50 51 52 53 54 4.68051385 -2.34653064 -1.39171000 0.78956868 2.56654136 -1.45190954 55 56 57 58 59 60 -4.41666304 -0.49966992 1.75406132 -3.51051852 -3.90086921 0.80451103 61 62 63 64 65 66 1.82778959 -0.82070808 -2.07839635 0.15461637 0.17375796 -3.77012946 67 68 69 70 71 72 2.29436400 -1.29326107 0.09371144 1.82174357 -1.32428697 2.41015732 73 74 75 76 77 78 1.85786714 -1.49842534 -1.66582705 5.41264821 2.17463803 3.23259456 79 80 81 82 83 84 0.61437302 -5.04795820 -0.51258744 -0.18619604 -3.32722329 0.72041587 85 86 87 88 89 90 -0.30480131 0.39340010 0.77501611 -0.84302949 0.80656610 4.51726294 91 92 93 94 95 96 1.29015807 1.20442555 1.26094043 2.81391964 -3.28341232 0.12419402 97 98 99 100 101 102 1.85197123 -1.36787036 0.82332323 -2.27589978 -0.28995388 1.98444806 103 104 105 106 107 108 1.83656929 -4.32146341 4.30073135 2.64689855 -0.13924203 4.02614900 109 110 111 112 113 114 -1.05940521 6.68805617 2.41760241 0.64414702 -1.81067304 1.94477362 115 116 117 118 119 120 1.31664706 -0.52231297 0.24707527 -0.45962851 -4.32494582 3.08991957 121 122 123 124 125 126 -0.26383357 1.52192748 -0.70108166 -3.85691134 -1.19516820 -1.80980759 127 128 129 130 131 132 -2.19476841 -0.31006243 1.09639736 0.31483089 -2.34709728 2.85986508 133 134 135 136 137 138 -1.83192030 1.86425002 -0.35115708 2.43907648 6.96596978 0.24821324 139 140 141 142 143 144 -0.54453493 -2.27947036 -2.68161153 -3.05440747 2.75699929 0.02098043 145 146 147 148 149 150 0.20417039 -0.75234200 0.97821790 -2.72997905 -2.92525790 2.38053181 151 152 153 154 155 156 -0.08163446 4.11971241 -2.32137721 -2.28435495 2.37710159 3.39253767 157 158 159 160 161 162 1.20442555 0.28869503 1.09639736 -3.85861376 3.87303207 1.38342131 > postscript(file="/var/wessaorg/rcomp/tmp/6ihbf1356212668.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 -1.79827545 NA 1 1.67342169 -1.79827545 2 -0.61259807 1.67342169 3 -2.69190297 -0.61259807 4 9.53481943 -2.69190297 5 1.68720253 9.53481943 6 8.40049381 1.68720253 7 -1.45939306 8.40049381 8 -2.22736592 -1.45939306 9 0.62609693 -2.22736592 10 -0.61913991 0.62609693 11 -2.23733401 -0.61913991 12 -0.57397443 -2.23733401 13 1.82853596 -0.57397443 14 0.75109839 1.82853596 15 0.44443233 0.75109839 16 1.31315094 0.44443233 17 1.47143045 1.31315094 18 -2.99452241 1.47143045 19 0.75244438 -2.99452241 20 -3.57208615 0.75244438 21 -1.17425870 -3.57208615 22 -0.92874355 -1.17425870 23 -1.05245933 -0.92874355 24 0.95199021 -1.05245933 25 -6.03676625 0.95199021 26 0.11453219 -6.03676625 27 1.83513719 0.11453219 28 2.50559953 1.83513719 29 -2.63480919 2.50559953 30 -2.29427100 -2.63480919 31 0.01122554 -2.29427100 32 -1.11317212 0.01122554 33 -0.93723554 -1.11317212 34 0.50669475 -0.93723554 35 -5.12137188 0.50669475 36 2.67321275 -5.12137188 37 -0.32508366 2.67321275 38 -0.73854218 -0.32508366 39 -3.54202917 -0.73854218 40 -3.00699159 -3.54202917 41 2.64035501 -3.00699159 42 -3.40663647 2.64035501 43 -1.10354235 -3.40663647 44 -3.40748095 -1.10354235 45 -2.28558981 -3.40748095 46 -3.99551774 -2.28558981 47 -1.18470158 -3.99551774 48 4.68051385 -1.18470158 49 -2.34653064 4.68051385 50 -1.39171000 -2.34653064 51 0.78956868 -1.39171000 52 2.56654136 0.78956868 53 -1.45190954 2.56654136 54 -4.41666304 -1.45190954 55 -0.49966992 -4.41666304 56 1.75406132 -0.49966992 57 -3.51051852 1.75406132 58 -3.90086921 -3.51051852 59 0.80451103 -3.90086921 60 1.82778959 0.80451103 61 -0.82070808 1.82778959 62 -2.07839635 -0.82070808 63 0.15461637 -2.07839635 64 0.17375796 0.15461637 65 -3.77012946 0.17375796 66 2.29436400 -3.77012946 67 -1.29326107 2.29436400 68 0.09371144 -1.29326107 69 1.82174357 0.09371144 70 -1.32428697 1.82174357 71 2.41015732 -1.32428697 72 1.85786714 2.41015732 73 -1.49842534 1.85786714 74 -1.66582705 -1.49842534 75 5.41264821 -1.66582705 76 2.17463803 5.41264821 77 3.23259456 2.17463803 78 0.61437302 3.23259456 79 -5.04795820 0.61437302 80 -0.51258744 -5.04795820 81 -0.18619604 -0.51258744 82 -3.32722329 -0.18619604 83 0.72041587 -3.32722329 84 -0.30480131 0.72041587 85 0.39340010 -0.30480131 86 0.77501611 0.39340010 87 -0.84302949 0.77501611 88 0.80656610 -0.84302949 89 4.51726294 0.80656610 90 1.29015807 4.51726294 91 1.20442555 1.29015807 92 1.26094043 1.20442555 93 2.81391964 1.26094043 94 -3.28341232 2.81391964 95 0.12419402 -3.28341232 96 1.85197123 0.12419402 97 -1.36787036 1.85197123 98 0.82332323 -1.36787036 99 -2.27589978 0.82332323 100 -0.28995388 -2.27589978 101 1.98444806 -0.28995388 102 1.83656929 1.98444806 103 -4.32146341 1.83656929 104 4.30073135 -4.32146341 105 2.64689855 4.30073135 106 -0.13924203 2.64689855 107 4.02614900 -0.13924203 108 -1.05940521 4.02614900 109 6.68805617 -1.05940521 110 2.41760241 6.68805617 111 0.64414702 2.41760241 112 -1.81067304 0.64414702 113 1.94477362 -1.81067304 114 1.31664706 1.94477362 115 -0.52231297 1.31664706 116 0.24707527 -0.52231297 117 -0.45962851 0.24707527 118 -4.32494582 -0.45962851 119 3.08991957 -4.32494582 120 -0.26383357 3.08991957 121 1.52192748 -0.26383357 122 -0.70108166 1.52192748 123 -3.85691134 -0.70108166 124 -1.19516820 -3.85691134 125 -1.80980759 -1.19516820 126 -2.19476841 -1.80980759 127 -0.31006243 -2.19476841 128 1.09639736 -0.31006243 129 0.31483089 1.09639736 130 -2.34709728 0.31483089 131 2.85986508 -2.34709728 132 -1.83192030 2.85986508 133 1.86425002 -1.83192030 134 -0.35115708 1.86425002 135 2.43907648 -0.35115708 136 6.96596978 2.43907648 137 0.24821324 6.96596978 138 -0.54453493 0.24821324 139 -2.27947036 -0.54453493 140 -2.68161153 -2.27947036 141 -3.05440747 -2.68161153 142 2.75699929 -3.05440747 143 0.02098043 2.75699929 144 0.20417039 0.02098043 145 -0.75234200 0.20417039 146 0.97821790 -0.75234200 147 -2.72997905 0.97821790 148 -2.92525790 -2.72997905 149 2.38053181 -2.92525790 150 -0.08163446 2.38053181 151 4.11971241 -0.08163446 152 -2.32137721 4.11971241 153 -2.28435495 -2.32137721 154 2.37710159 -2.28435495 155 3.39253767 2.37710159 156 1.20442555 3.39253767 157 0.28869503 1.20442555 158 1.09639736 0.28869503 159 -3.85861376 1.09639736 160 3.87303207 -3.85861376 161 1.38342131 3.87303207 162 NA 1.38342131 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 1.67342169 -1.79827545 [2,] -0.61259807 1.67342169 [3,] -2.69190297 -0.61259807 [4,] 9.53481943 -2.69190297 [5,] 1.68720253 9.53481943 [6,] 8.40049381 1.68720253 [7,] -1.45939306 8.40049381 [8,] -2.22736592 -1.45939306 [9,] 0.62609693 -2.22736592 [10,] -0.61913991 0.62609693 [11,] -2.23733401 -0.61913991 [12,] -0.57397443 -2.23733401 [13,] 1.82853596 -0.57397443 [14,] 0.75109839 1.82853596 [15,] 0.44443233 0.75109839 [16,] 1.31315094 0.44443233 [17,] 1.47143045 1.31315094 [18,] -2.99452241 1.47143045 [19,] 0.75244438 -2.99452241 [20,] -3.57208615 0.75244438 [21,] -1.17425870 -3.57208615 [22,] -0.92874355 -1.17425870 [23,] -1.05245933 -0.92874355 [24,] 0.95199021 -1.05245933 [25,] -6.03676625 0.95199021 [26,] 0.11453219 -6.03676625 [27,] 1.83513719 0.11453219 [28,] 2.50559953 1.83513719 [29,] -2.63480919 2.50559953 [30,] -2.29427100 -2.63480919 [31,] 0.01122554 -2.29427100 [32,] -1.11317212 0.01122554 [33,] -0.93723554 -1.11317212 [34,] 0.50669475 -0.93723554 [35,] -5.12137188 0.50669475 [36,] 2.67321275 -5.12137188 [37,] -0.32508366 2.67321275 [38,] -0.73854218 -0.32508366 [39,] -3.54202917 -0.73854218 [40,] -3.00699159 -3.54202917 [41,] 2.64035501 -3.00699159 [42,] -3.40663647 2.64035501 [43,] -1.10354235 -3.40663647 [44,] -3.40748095 -1.10354235 [45,] -2.28558981 -3.40748095 [46,] -3.99551774 -2.28558981 [47,] -1.18470158 -3.99551774 [48,] 4.68051385 -1.18470158 [49,] -2.34653064 4.68051385 [50,] -1.39171000 -2.34653064 [51,] 0.78956868 -1.39171000 [52,] 2.56654136 0.78956868 [53,] -1.45190954 2.56654136 [54,] -4.41666304 -1.45190954 [55,] -0.49966992 -4.41666304 [56,] 1.75406132 -0.49966992 [57,] -3.51051852 1.75406132 [58,] -3.90086921 -3.51051852 [59,] 0.80451103 -3.90086921 [60,] 1.82778959 0.80451103 [61,] -0.82070808 1.82778959 [62,] -2.07839635 -0.82070808 [63,] 0.15461637 -2.07839635 [64,] 0.17375796 0.15461637 [65,] -3.77012946 0.17375796 [66,] 2.29436400 -3.77012946 [67,] -1.29326107 2.29436400 [68,] 0.09371144 -1.29326107 [69,] 1.82174357 0.09371144 [70,] -1.32428697 1.82174357 [71,] 2.41015732 -1.32428697 [72,] 1.85786714 2.41015732 [73,] -1.49842534 1.85786714 [74,] -1.66582705 -1.49842534 [75,] 5.41264821 -1.66582705 [76,] 2.17463803 5.41264821 [77,] 3.23259456 2.17463803 [78,] 0.61437302 3.23259456 [79,] -5.04795820 0.61437302 [80,] -0.51258744 -5.04795820 [81,] -0.18619604 -0.51258744 [82,] -3.32722329 -0.18619604 [83,] 0.72041587 -3.32722329 [84,] -0.30480131 0.72041587 [85,] 0.39340010 -0.30480131 [86,] 0.77501611 0.39340010 [87,] -0.84302949 0.77501611 [88,] 0.80656610 -0.84302949 [89,] 4.51726294 0.80656610 [90,] 1.29015807 4.51726294 [91,] 1.20442555 1.29015807 [92,] 1.26094043 1.20442555 [93,] 2.81391964 1.26094043 [94,] -3.28341232 2.81391964 [95,] 0.12419402 -3.28341232 [96,] 1.85197123 0.12419402 [97,] -1.36787036 1.85197123 [98,] 0.82332323 -1.36787036 [99,] -2.27589978 0.82332323 [100,] -0.28995388 -2.27589978 [101,] 1.98444806 -0.28995388 [102,] 1.83656929 1.98444806 [103,] -4.32146341 1.83656929 [104,] 4.30073135 -4.32146341 [105,] 2.64689855 4.30073135 [106,] -0.13924203 2.64689855 [107,] 4.02614900 -0.13924203 [108,] -1.05940521 4.02614900 [109,] 6.68805617 -1.05940521 [110,] 2.41760241 6.68805617 [111,] 0.64414702 2.41760241 [112,] -1.81067304 0.64414702 [113,] 1.94477362 -1.81067304 [114,] 1.31664706 1.94477362 [115,] -0.52231297 1.31664706 [116,] 0.24707527 -0.52231297 [117,] -0.45962851 0.24707527 [118,] -4.32494582 -0.45962851 [119,] 3.08991957 -4.32494582 [120,] -0.26383357 3.08991957 [121,] 1.52192748 -0.26383357 [122,] -0.70108166 1.52192748 [123,] -3.85691134 -0.70108166 [124,] -1.19516820 -3.85691134 [125,] -1.80980759 -1.19516820 [126,] -2.19476841 -1.80980759 [127,] -0.31006243 -2.19476841 [128,] 1.09639736 -0.31006243 [129,] 0.31483089 1.09639736 [130,] -2.34709728 0.31483089 [131,] 2.85986508 -2.34709728 [132,] -1.83192030 2.85986508 [133,] 1.86425002 -1.83192030 [134,] -0.35115708 1.86425002 [135,] 2.43907648 -0.35115708 [136,] 6.96596978 2.43907648 [137,] 0.24821324 6.96596978 [138,] -0.54453493 0.24821324 [139,] -2.27947036 -0.54453493 [140,] -2.68161153 -2.27947036 [141,] -3.05440747 -2.68161153 [142,] 2.75699929 -3.05440747 [143,] 0.02098043 2.75699929 [144,] 0.20417039 0.02098043 [145,] -0.75234200 0.20417039 [146,] 0.97821790 -0.75234200 [147,] -2.72997905 0.97821790 [148,] -2.92525790 -2.72997905 [149,] 2.38053181 -2.92525790 [150,] -0.08163446 2.38053181 [151,] 4.11971241 -0.08163446 [152,] -2.32137721 4.11971241 [153,] -2.28435495 -2.32137721 [154,] 2.37710159 -2.28435495 [155,] 3.39253767 2.37710159 [156,] 1.20442555 3.39253767 [157,] 0.28869503 1.20442555 [158,] 1.09639736 0.28869503 [159,] -3.85861376 1.09639736 [160,] 3.87303207 -3.85861376 [161,] 1.38342131 3.87303207 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 1.67342169 -1.79827545 2 -0.61259807 1.67342169 3 -2.69190297 -0.61259807 4 9.53481943 -2.69190297 5 1.68720253 9.53481943 6 8.40049381 1.68720253 7 -1.45939306 8.40049381 8 -2.22736592 -1.45939306 9 0.62609693 -2.22736592 10 -0.61913991 0.62609693 11 -2.23733401 -0.61913991 12 -0.57397443 -2.23733401 13 1.82853596 -0.57397443 14 0.75109839 1.82853596 15 0.44443233 0.75109839 16 1.31315094 0.44443233 17 1.47143045 1.31315094 18 -2.99452241 1.47143045 19 0.75244438 -2.99452241 20 -3.57208615 0.75244438 21 -1.17425870 -3.57208615 22 -0.92874355 -1.17425870 23 -1.05245933 -0.92874355 24 0.95199021 -1.05245933 25 -6.03676625 0.95199021 26 0.11453219 -6.03676625 27 1.83513719 0.11453219 28 2.50559953 1.83513719 29 -2.63480919 2.50559953 30 -2.29427100 -2.63480919 31 0.01122554 -2.29427100 32 -1.11317212 0.01122554 33 -0.93723554 -1.11317212 34 0.50669475 -0.93723554 35 -5.12137188 0.50669475 36 2.67321275 -5.12137188 37 -0.32508366 2.67321275 38 -0.73854218 -0.32508366 39 -3.54202917 -0.73854218 40 -3.00699159 -3.54202917 41 2.64035501 -3.00699159 42 -3.40663647 2.64035501 43 -1.10354235 -3.40663647 44 -3.40748095 -1.10354235 45 -2.28558981 -3.40748095 46 -3.99551774 -2.28558981 47 -1.18470158 -3.99551774 48 4.68051385 -1.18470158 49 -2.34653064 4.68051385 50 -1.39171000 -2.34653064 51 0.78956868 -1.39171000 52 2.56654136 0.78956868 53 -1.45190954 2.56654136 54 -4.41666304 -1.45190954 55 -0.49966992 -4.41666304 56 1.75406132 -0.49966992 57 -3.51051852 1.75406132 58 -3.90086921 -3.51051852 59 0.80451103 -3.90086921 60 1.82778959 0.80451103 61 -0.82070808 1.82778959 62 -2.07839635 -0.82070808 63 0.15461637 -2.07839635 64 0.17375796 0.15461637 65 -3.77012946 0.17375796 66 2.29436400 -3.77012946 67 -1.29326107 2.29436400 68 0.09371144 -1.29326107 69 1.82174357 0.09371144 70 -1.32428697 1.82174357 71 2.41015732 -1.32428697 72 1.85786714 2.41015732 73 -1.49842534 1.85786714 74 -1.66582705 -1.49842534 75 5.41264821 -1.66582705 76 2.17463803 5.41264821 77 3.23259456 2.17463803 78 0.61437302 3.23259456 79 -5.04795820 0.61437302 80 -0.51258744 -5.04795820 81 -0.18619604 -0.51258744 82 -3.32722329 -0.18619604 83 0.72041587 -3.32722329 84 -0.30480131 0.72041587 85 0.39340010 -0.30480131 86 0.77501611 0.39340010 87 -0.84302949 0.77501611 88 0.80656610 -0.84302949 89 4.51726294 0.80656610 90 1.29015807 4.51726294 91 1.20442555 1.29015807 92 1.26094043 1.20442555 93 2.81391964 1.26094043 94 -3.28341232 2.81391964 95 0.12419402 -3.28341232 96 1.85197123 0.12419402 97 -1.36787036 1.85197123 98 0.82332323 -1.36787036 99 -2.27589978 0.82332323 100 -0.28995388 -2.27589978 101 1.98444806 -0.28995388 102 1.83656929 1.98444806 103 -4.32146341 1.83656929 104 4.30073135 -4.32146341 105 2.64689855 4.30073135 106 -0.13924203 2.64689855 107 4.02614900 -0.13924203 108 -1.05940521 4.02614900 109 6.68805617 -1.05940521 110 2.41760241 6.68805617 111 0.64414702 2.41760241 112 -1.81067304 0.64414702 113 1.94477362 -1.81067304 114 1.31664706 1.94477362 115 -0.52231297 1.31664706 116 0.24707527 -0.52231297 117 -0.45962851 0.24707527 118 -4.32494582 -0.45962851 119 3.08991957 -4.32494582 120 -0.26383357 3.08991957 121 1.52192748 -0.26383357 122 -0.70108166 1.52192748 123 -3.85691134 -0.70108166 124 -1.19516820 -3.85691134 125 -1.80980759 -1.19516820 126 -2.19476841 -1.80980759 127 -0.31006243 -2.19476841 128 1.09639736 -0.31006243 129 0.31483089 1.09639736 130 -2.34709728 0.31483089 131 2.85986508 -2.34709728 132 -1.83192030 2.85986508 133 1.86425002 -1.83192030 134 -0.35115708 1.86425002 135 2.43907648 -0.35115708 136 6.96596978 2.43907648 137 0.24821324 6.96596978 138 -0.54453493 0.24821324 139 -2.27947036 -0.54453493 140 -2.68161153 -2.27947036 141 -3.05440747 -2.68161153 142 2.75699929 -3.05440747 143 0.02098043 2.75699929 144 0.20417039 0.02098043 145 -0.75234200 0.20417039 146 0.97821790 -0.75234200 147 -2.72997905 0.97821790 148 -2.92525790 -2.72997905 149 2.38053181 -2.92525790 150 -0.08163446 2.38053181 151 4.11971241 -0.08163446 152 -2.32137721 4.11971241 153 -2.28435495 -2.32137721 154 2.37710159 -2.28435495 155 3.39253767 2.37710159 156 1.20442555 3.39253767 157 0.28869503 1.20442555 158 1.09639736 0.28869503 159 -3.85861376 1.09639736 160 3.87303207 -3.85861376 161 1.38342131 3.87303207 > 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/wessaorg/rcomp/tmp/77pry1356212668.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/wessaorg/rcomp/tmp/8f2ai1356212668.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/wessaorg/rcomp/tmp/9edyg1356212668.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/wessaorg/rcomp/tmp/10zkkt1356212668.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/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/wessaorg/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/wessaorg/rcomp/tmp/11yufo1356212668.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/wessaorg/rcomp/tmp/1236oc1356212668.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/wessaorg/rcomp/tmp/137gjn1356212668.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/wessaorg/rcomp/tmp/14390c1356212668.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/wessaorg/rcomp/tmp/15d2z31356212668.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/wessaorg/rcomp/tmp/1670wl1356212668.tab") + } > > try(system("convert tmp/1x5jp1356212668.ps tmp/1x5jp1356212668.png",intern=TRUE)) character(0) > try(system("convert tmp/268hf1356212668.ps tmp/268hf1356212668.png",intern=TRUE)) character(0) > try(system("convert tmp/3ewyt1356212668.ps tmp/3ewyt1356212668.png",intern=TRUE)) character(0) > try(system("convert tmp/4wvs21356212668.ps tmp/4wvs21356212668.png",intern=TRUE)) character(0) > try(system("convert tmp/5zzqv1356212668.ps tmp/5zzqv1356212668.png",intern=TRUE)) character(0) > try(system("convert tmp/6ihbf1356212668.ps tmp/6ihbf1356212668.png",intern=TRUE)) character(0) > try(system("convert tmp/77pry1356212668.ps tmp/77pry1356212668.png",intern=TRUE)) character(0) > try(system("convert tmp/8f2ai1356212668.ps tmp/8f2ai1356212668.png",intern=TRUE)) character(0) > try(system("convert tmp/9edyg1356212668.ps tmp/9edyg1356212668.png",intern=TRUE)) character(0) > try(system("convert tmp/10zkkt1356212668.ps tmp/10zkkt1356212668.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 7.583 0.845 8.589