R version 2.15.1 (2012-06-22) -- "Roasted Marshmallows" 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(1 + ,41 + ,38 + ,12 + ,14 + ,12 + ,53 + ,13 + ,2 + ,39 + ,32 + ,11 + ,18 + ,11 + ,86 + ,16 + ,3 + ,30 + ,35 + ,15 + ,11 + ,14 + ,66 + ,19 + ,4 + ,31 + ,33 + ,6 + ,12 + ,12 + ,67 + ,15 + ,5 + ,34 + ,37 + ,13 + ,16 + ,21 + ,76 + ,14 + ,6 + ,35 + ,29 + ,10 + ,18 + ,12 + ,78 + ,13 + ,7 + ,39 + ,31 + ,12 + ,14 + ,22 + ,53 + ,19 + ,8 + ,34 + ,36 + ,14 + ,14 + ,11 + ,80 + ,15 + ,9 + ,36 + ,35 + ,12 + ,15 + ,10 + ,74 + ,14 + ,10 + ,37 + ,38 + ,6 + ,15 + ,13 + ,76 + ,15 + ,11 + ,38 + ,31 + ,10 + ,17 + ,10 + ,79 + ,16 + ,12 + ,36 + ,34 + ,12 + ,19 + ,8 + ,54 + ,16 + ,13 + ,38 + ,35 + ,12 + ,10 + ,15 + ,67 + ,16 + ,14 + ,39 + ,38 + ,11 + ,16 + ,14 + ,54 + ,16 + ,15 + ,33 + ,37 + ,15 + ,18 + ,10 + ,87 + ,17 + ,16 + ,32 + ,33 + ,12 + ,14 + ,14 + ,58 + ,15 + ,17 + ,36 + ,32 + ,10 + ,14 + ,14 + ,75 + ,15 + ,18 + ,38 + ,38 + ,12 + ,17 + ,11 + ,88 + ,20 + ,19 + ,39 + ,38 + ,11 + ,14 + ,10 + ,64 + ,18 + ,20 + ,32 + ,32 + ,12 + ,16 + ,13 + ,57 + ,16 + ,21 + ,32 + ,33 + ,11 + ,18 + ,7 + ,66 + ,16 + ,22 + ,31 + ,31 + ,12 + ,11 + ,14 + ,68 + ,16 + ,23 + ,39 + ,38 + ,13 + ,14 + ,12 + ,54 + ,19 + ,24 + ,37 + ,39 + ,11 + ,12 + ,14 + ,56 + ,16 + ,25 + ,39 + ,32 + ,9 + ,17 + ,11 + ,86 + ,17 + ,26 + ,41 + ,32 + ,13 + ,9 + ,9 + ,80 + ,17 + ,27 + ,36 + ,35 + ,10 + ,16 + ,11 + ,76 + ,16 + ,28 + ,33 + ,37 + ,14 + ,14 + ,15 + ,69 + ,15 + ,29 + ,33 + ,33 + ,12 + ,15 + ,14 + ,78 + ,16 + ,30 + ,34 + ,33 + ,10 + ,11 + ,13 + ,67 + ,14 + ,31 + ,31 + ,28 + ,12 + ,16 + ,9 + ,80 + ,15 + ,32 + ,27 + ,32 + ,8 + ,13 + ,15 + ,54 + ,12 + ,33 + ,37 + ,31 + ,10 + ,17 + ,10 + ,71 + ,14 + ,34 + ,34 + ,37 + ,12 + ,15 + ,11 + ,84 + ,16 + ,35 + ,34 + ,30 + ,12 + ,14 + ,13 + ,74 + ,14 + ,36 + ,32 + ,33 + ,7 + ,16 + ,8 + ,71 + ,7 + ,37 + ,29 + ,31 + ,6 + ,9 + ,20 + ,63 + ,10 + ,38 + ,36 + ,33 + ,12 + ,15 + ,12 + ,71 + ,14 + ,39 + ,29 + ,31 + ,10 + ,17 + ,10 + ,76 + ,16 + ,40 + ,35 + ,33 + ,10 + ,13 + ,10 + ,69 + ,16 + ,41 + ,37 + ,32 + ,10 + ,15 + ,9 + ,74 + ,16 + ,42 + ,34 + ,33 + ,12 + ,16 + ,14 + ,75 + ,14 + ,43 + ,38 + ,32 + ,15 + ,16 + ,8 + ,54 + ,20 + ,44 + ,35 + ,33 + ,10 + ,12 + ,14 + ,52 + ,14 + ,45 + ,38 + ,28 + ,10 + ,12 + ,11 + ,69 + ,14 + ,46 + ,37 + ,35 + ,12 + ,11 + ,13 + ,68 + ,11 + ,47 + ,38 + ,39 + ,13 + ,15 + ,9 + ,65 + ,14 + ,48 + ,33 + ,34 + ,11 + ,15 + ,11 + ,75 + ,15 + ,49 + ,36 + ,38 + ,11 + ,17 + ,15 + ,74 + ,16 + ,50 + ,38 + ,32 + ,12 + ,13 + ,11 + ,75 + ,14 + ,51 + ,32 + ,38 + ,14 + ,16 + ,10 + ,72 + ,16 + ,52 + ,32 + ,30 + ,10 + ,14 + ,14 + ,67 + ,14 + ,53 + ,32 + ,33 + ,12 + ,11 + ,18 + ,63 + ,12 + ,54 + ,34 + ,38 + ,13 + ,12 + ,14 + ,62 + ,16 + ,55 + ,32 + ,32 + ,5 + ,12 + ,11 + ,63 + ,9 + ,56 + ,37 + ,32 + ,6 + ,15 + ,12 + ,76 + ,14 + ,57 + ,39 + ,34 + ,12 + ,16 + ,13 + ,74 + ,16 + ,58 + ,29 + ,34 + ,12 + ,15 + ,9 + ,67 + ,16 + ,59 + ,37 + ,36 + ,11 + ,12 + ,10 + ,73 + ,15 + ,60 + ,35 + ,34 + ,10 + ,12 + ,15 + ,70 + ,16 + ,61 + ,30 + ,28 + ,7 + ,8 + ,20 + ,53 + ,12 + ,62 + ,38 + ,34 + ,12 + ,13 + ,12 + ,77 + ,16 + ,63 + ,34 + ,35 + ,14 + ,11 + ,12 + ,77 + ,16 + ,64 + ,31 + ,35 + ,11 + ,14 + ,14 + ,52 + ,14 + ,65 + ,34 + ,31 + ,12 + ,15 + ,13 + ,54 + ,16 + ,66 + ,35 + ,37 + ,13 + ,10 + ,11 + ,80 + ,17 + ,67 + ,36 + ,35 + ,14 + ,11 + ,17 + ,66 + ,18 + ,68 + ,30 + ,27 + ,11 + ,12 + ,12 + ,73 + ,18 + ,69 + ,39 + ,40 + ,12 + ,15 + ,13 + ,63 + ,12 + ,70 + ,35 + ,37 + ,12 + ,15 + ,14 + ,69 + ,16 + ,71 + ,38 + ,36 + ,8 + ,14 + ,13 + ,67 + ,10 + ,72 + ,31 + ,38 + ,11 + ,16 + ,15 + ,54 + ,14 + ,73 + ,34 + ,39 + ,14 + ,15 + ,13 + ,81 + ,18 + ,74 + ,38 + ,41 + ,14 + ,15 + ,10 + ,69 + ,18 + ,75 + ,34 + ,27 + ,12 + ,13 + ,11 + ,84 + ,16 + ,76 + ,39 + ,30 + ,9 + ,12 + ,19 + ,80 + ,17 + ,77 + ,37 + ,37 + ,13 + ,17 + ,13 + ,70 + ,16 + ,78 + ,34 + ,31 + ,11 + ,13 + ,17 + ,69 + ,16 + ,79 + ,28 + ,31 + ,12 + ,15 + ,13 + ,77 + ,13 + ,80 + ,37 + ,27 + ,12 + ,13 + ,9 + ,54 + ,16 + ,81 + ,33 + ,36 + ,12 + ,15 + ,11 + ,79 + ,16 + ,82 + ,37 + ,38 + ,12 + ,16 + ,10 + ,30 + ,20 + ,83 + ,35 + ,37 + ,12 + ,15 + ,9 + ,71 + ,16 + ,84 + ,37 + ,33 + ,12 + ,16 + ,12 + ,73 + ,15 + ,85 + ,32 + ,34 + ,11 + ,15 + ,12 + ,72 + ,15 + ,86 + ,33 + ,31 + ,10 + ,14 + ,13 + ,77 + ,16 + ,87 + ,38 + ,39 + ,9 + ,15 + ,13 + ,75 + ,14 + ,88 + ,33 + ,34 + ,12 + ,14 + ,12 + ,69 + ,16 + ,89 + ,29 + ,32 + ,12 + ,13 + ,15 + ,54 + ,16 + ,90 + ,33 + ,33 + ,12 + ,7 + ,22 + ,70 + ,15 + ,91 + ,31 + ,36 + ,9 + ,17 + ,13 + ,73 + ,12 + ,92 + ,36 + ,32 + ,15 + ,13 + ,15 + ,54 + ,17 + ,93 + ,35 + ,41 + ,12 + ,15 + ,13 + ,77 + ,16 + ,94 + ,32 + ,28 + ,12 + ,14 + ,15 + ,82 + ,15 + ,95 + ,29 + ,30 + ,12 + ,13 + ,10 + ,80 + ,13 + ,96 + ,39 + ,36 + ,10 + ,16 + ,11 + ,80 + ,16 + ,97 + ,37 + ,35 + ,13 + ,12 + ,16 + ,69 + ,16 + ,98 + ,35 + ,31 + ,9 + ,14 + ,11 + ,78 + ,16 + ,99 + ,37 + ,34 + ,12 + ,17 + ,11 + ,81 + ,16 + ,100 + ,32 + ,36 + ,10 + ,15 + ,10 + ,76 + ,14 + ,101 + ,38 + ,36 + ,14 + ,17 + ,10 + ,76 + ,16 + ,102 + ,37 + ,35 + ,11 + ,12 + ,16 + ,73 + ,16 + ,103 + ,36 + ,37 + ,15 + ,16 + ,12 + ,85 + ,20 + ,104 + ,32 + ,28 + ,11 + ,11 + ,11 + ,66 + ,15 + ,105 + ,33 + ,39 + ,11 + ,15 + ,16 + ,79 + ,16 + ,106 + ,40 + ,32 + ,12 + ,9 + ,19 + ,68 + ,13 + ,107 + ,38 + ,35 + ,12 + ,16 + ,11 + ,76 + ,17 + ,108 + ,41 + ,39 + ,12 + ,15 + ,16 + ,71 + ,16 + ,109 + ,36 + ,35 + ,11 + ,10 + ,15 + ,54 + ,16 + ,110 + ,43 + ,42 + ,7 + ,10 + ,24 + ,46 + ,12 + ,111 + ,30 + ,34 + ,12 + ,15 + ,14 + ,82 + ,16 + ,112 + ,31 + ,33 + ,14 + ,11 + ,15 + ,74 + ,16 + ,113 + ,32 + ,41 + ,11 + ,13 + ,11 + ,88 + ,17 + ,114 + ,32 + ,33 + ,11 + ,14 + ,15 + ,38 + ,13 + ,115 + ,37 + ,34 + ,10 + ,18 + ,12 + ,76 + ,12 + ,116 + ,37 + ,32 + ,13 + ,16 + ,10 + ,86 + ,18 + ,117 + ,33 + ,40 + ,13 + ,14 + ,14 + ,54 + ,14 + ,118 + ,34 + ,40 + ,8 + ,14 + ,13 + ,70 + ,14 + ,119 + ,33 + ,35 + ,11 + ,14 + ,9 + ,69 + ,13 + ,120 + ,38 + ,36 + ,12 + ,14 + ,15 + ,90 + ,16 + ,121 + ,33 + ,37 + ,11 + ,12 + ,15 + ,54 + ,13 + ,122 + ,31 + ,27 + ,13 + ,14 + ,14 + ,76 + ,16 + ,123 + ,38 + ,39 + ,12 + ,15 + ,11 + ,89 + ,13 + ,124 + ,37 + ,38 + ,14 + ,15 + ,8 + ,76 + ,16 + ,125 + ,33 + ,31 + ,13 + ,15 + ,11 + ,73 + ,15 + ,126 + ,31 + ,33 + ,15 + ,13 + ,11 + ,79 + ,16 + ,127 + ,39 + ,32 + ,10 + ,17 + ,8 + ,90 + ,15 + ,128 + ,44 + ,39 + ,11 + ,17 + ,10 + ,74 + ,17 + ,129 + ,33 + ,36 + ,9 + ,19 + ,11 + ,81 + ,15 + ,130 + ,35 + ,33 + ,11 + ,15 + ,13 + ,72 + ,12 + ,131 + ,32 + ,33 + ,10 + ,13 + ,11 + ,71 + ,16 + ,132 + ,28 + ,32 + ,11 + ,9 + ,20 + ,66 + ,10 + ,133 + ,40 + ,37 + ,8 + ,15 + ,10 + ,77 + ,16 + ,134 + ,27 + ,30 + ,11 + ,15 + ,15 + ,65 + ,12 + ,135 + ,37 + ,38 + ,12 + ,15 + ,12 + ,74 + ,14 + ,136 + ,32 + ,29 + ,12 + ,16 + ,14 + ,82 + ,15 + ,137 + ,28 + ,22 + ,9 + ,11 + ,23 + ,54 + ,13 + ,138 + ,34 + ,35 + ,11 + ,14 + ,14 + ,63 + ,15 + ,139 + ,30 + ,35 + ,10 + ,11 + ,16 + ,54 + ,11 + ,140 + ,35 + ,34 + ,8 + ,15 + ,11 + ,64 + ,12 + ,141 + ,31 + ,35 + ,9 + ,13 + ,12 + ,69 + ,8 + ,142 + ,32 + ,34 + ,8 + ,15 + ,10 + ,54 + ,16 + ,143 + ,30 + ,34 + ,9 + ,16 + ,14 + ,84 + ,15 + ,144 + ,30 + ,35 + ,15 + ,14 + ,12 + ,86 + ,17 + ,145 + ,31 + ,23 + ,11 + ,15 + ,12 + ,77 + ,16 + ,146 + ,40 + ,31 + ,8 + ,16 + ,11 + ,89 + ,10 + ,147 + ,32 + ,27 + ,13 + ,16 + ,12 + ,76 + ,18 + ,148 + ,36 + ,36 + ,12 + ,11 + ,13 + ,60 + ,13 + ,149 + ,32 + ,31 + ,12 + ,12 + ,11 + ,75 + ,16 + ,150 + ,35 + ,32 + ,9 + ,9 + ,19 + ,73 + ,13 + ,151 + ,38 + ,39 + ,7 + ,16 + ,12 + ,85 + ,10 + ,152 + ,42 + ,37 + ,13 + ,13 + ,17 + ,79 + ,15 + ,153 + ,34 + ,38 + ,9 + ,16 + ,9 + ,71 + ,16 + ,154 + ,35 + ,39 + ,6 + ,12 + ,12 + ,72 + ,16 + ,155 + ,35 + ,34 + ,8 + ,9 + ,19 + ,69 + ,14 + ,156 + ,33 + ,31 + ,8 + ,13 + ,18 + ,78 + ,10 + ,157 + ,36 + ,32 + ,15 + ,13 + ,15 + ,54 + ,17 + ,158 + ,32 + ,37 + ,6 + ,14 + ,14 + ,69 + ,13 + ,159 + ,33 + ,36 + ,9 + ,19 + ,11 + ,81 + ,15 + ,160 + ,34 + ,32 + ,11 + ,13 + ,9 + ,84 + ,16 + ,161 + ,32 + ,35 + ,8 + ,12 + ,18 + ,84 + ,12 + ,162 + ,34 + ,36 + ,8 + ,13 + ,16 + ,69 + ,13) + ,dim=c(8 + ,162) + ,dimnames=list(c('t' + ,'Connected' + ,'Separate' + ,'Software' + ,'Happiness' + ,'Depression' + ,'Belonging' + ,'Learning') + ,1:162)) > y <- array(NA,dim=c(8,162),dimnames=list(c('t','Connected','Separate','Software','Happiness','Depression','Belonging','Learning'),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 = '8' > par3 <- 'No Linear Trend' > par2 <- 'Do not include Seasonal Dummies' > par1 <- '8' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Prof. Dr. P. Wessa > #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/ > #Source of accompanying publication: Office for Research, Development, and Education > #Technical description: Write here your technical program description (don't use hard returns!) > library(lattice) > library(lmtest) Loading required package: zoo Attaching package: 'zoo' The following object(s) are masked from 'package:base': as.Date, 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 Learning t Connected Separate Software Happiness Depression Belonging 1 13 1 41 38 12 14 12 53 2 16 2 39 32 11 18 11 86 3 19 3 30 35 15 11 14 66 4 15 4 31 33 6 12 12 67 5 14 5 34 37 13 16 21 76 6 13 6 35 29 10 18 12 78 7 19 7 39 31 12 14 22 53 8 15 8 34 36 14 14 11 80 9 14 9 36 35 12 15 10 74 10 15 10 37 38 6 15 13 76 11 16 11 38 31 10 17 10 79 12 16 12 36 34 12 19 8 54 13 16 13 38 35 12 10 15 67 14 16 14 39 38 11 16 14 54 15 17 15 33 37 15 18 10 87 16 15 16 32 33 12 14 14 58 17 15 17 36 32 10 14 14 75 18 20 18 38 38 12 17 11 88 19 18 19 39 38 11 14 10 64 20 16 20 32 32 12 16 13 57 21 16 21 32 33 11 18 7 66 22 16 22 31 31 12 11 14 68 23 19 23 39 38 13 14 12 54 24 16 24 37 39 11 12 14 56 25 17 25 39 32 9 17 11 86 26 17 26 41 32 13 9 9 80 27 16 27 36 35 10 16 11 76 28 15 28 33 37 14 14 15 69 29 16 29 33 33 12 15 14 78 30 14 30 34 33 10 11 13 67 31 15 31 31 28 12 16 9 80 32 12 32 27 32 8 13 15 54 33 14 33 37 31 10 17 10 71 34 16 34 34 37 12 15 11 84 35 14 35 34 30 12 14 13 74 36 7 36 32 33 7 16 8 71 37 10 37 29 31 6 9 20 63 38 14 38 36 33 12 15 12 71 39 16 39 29 31 10 17 10 76 40 16 40 35 33 10 13 10 69 41 16 41 37 32 10 15 9 74 42 14 42 34 33 12 16 14 75 43 20 43 38 32 15 16 8 54 44 14 44 35 33 10 12 14 52 45 14 45 38 28 10 12 11 69 46 11 46 37 35 12 11 13 68 47 14 47 38 39 13 15 9 65 48 15 48 33 34 11 15 11 75 49 16 49 36 38 11 17 15 74 50 14 50 38 32 12 13 11 75 51 16 51 32 38 14 16 10 72 52 14 52 32 30 10 14 14 67 53 12 53 32 33 12 11 18 63 54 16 54 34 38 13 12 14 62 55 9 55 32 32 5 12 11 63 56 14 56 37 32 6 15 12 76 57 16 57 39 34 12 16 13 74 58 16 58 29 34 12 15 9 67 59 15 59 37 36 11 12 10 73 60 16 60 35 34 10 12 15 70 61 12 61 30 28 7 8 20 53 62 16 62 38 34 12 13 12 77 63 16 63 34 35 14 11 12 77 64 14 64 31 35 11 14 14 52 65 16 65 34 31 12 15 13 54 66 17 66 35 37 13 10 11 80 67 18 67 36 35 14 11 17 66 68 18 68 30 27 11 12 12 73 69 12 69 39 40 12 15 13 63 70 16 70 35 37 12 15 14 69 71 10 71 38 36 8 14 13 67 72 14 72 31 38 11 16 15 54 73 18 73 34 39 14 15 13 81 74 18 74 38 41 14 15 10 69 75 16 75 34 27 12 13 11 84 76 17 76 39 30 9 12 19 80 77 16 77 37 37 13 17 13 70 78 16 78 34 31 11 13 17 69 79 13 79 28 31 12 15 13 77 80 16 80 37 27 12 13 9 54 81 16 81 33 36 12 15 11 79 82 20 82 37 38 12 16 10 30 83 16 83 35 37 12 15 9 71 84 15 84 37 33 12 16 12 73 85 15 85 32 34 11 15 12 72 86 16 86 33 31 10 14 13 77 87 14 87 38 39 9 15 13 75 88 16 88 33 34 12 14 12 69 89 16 89 29 32 12 13 15 54 90 15 90 33 33 12 7 22 70 91 12 91 31 36 9 17 13 73 92 17 92 36 32 15 13 15 54 93 16 93 35 41 12 15 13 77 94 15 94 32 28 12 14 15 82 95 13 95 29 30 12 13 10 80 96 16 96 39 36 10 16 11 80 97 16 97 37 35 13 12 16 69 98 16 98 35 31 9 14 11 78 99 16 99 37 34 12 17 11 81 100 14 100 32 36 10 15 10 76 101 16 101 38 36 14 17 10 76 102 16 102 37 35 11 12 16 73 103 20 103 36 37 15 16 12 85 104 15 104 32 28 11 11 11 66 105 16 105 33 39 11 15 16 79 106 13 106 40 32 12 9 19 68 107 17 107 38 35 12 16 11 76 108 16 108 41 39 12 15 16 71 109 16 109 36 35 11 10 15 54 110 12 110 43 42 7 10 24 46 111 16 111 30 34 12 15 14 82 112 16 112 31 33 14 11 15 74 113 17 113 32 41 11 13 11 88 114 13 114 32 33 11 14 15 38 115 12 115 37 34 10 18 12 76 116 18 116 37 32 13 16 10 86 117 14 117 33 40 13 14 14 54 118 14 118 34 40 8 14 13 70 119 13 119 33 35 11 14 9 69 120 16 120 38 36 12 14 15 90 121 13 121 33 37 11 12 15 54 122 16 122 31 27 13 14 14 76 123 13 123 38 39 12 15 11 89 124 16 124 37 38 14 15 8 76 125 15 125 33 31 13 15 11 73 126 16 126 31 33 15 13 11 79 127 15 127 39 32 10 17 8 90 128 17 128 44 39 11 17 10 74 129 15 129 33 36 9 19 11 81 130 12 130 35 33 11 15 13 72 131 16 131 32 33 10 13 11 71 132 10 132 28 32 11 9 20 66 133 16 133 40 37 8 15 10 77 134 12 134 27 30 11 15 15 65 135 14 135 37 38 12 15 12 74 136 15 136 32 29 12 16 14 82 137 13 137 28 22 9 11 23 54 138 15 138 34 35 11 14 14 63 139 11 139 30 35 10 11 16 54 140 12 140 35 34 8 15 11 64 141 8 141 31 35 9 13 12 69 142 16 142 32 34 8 15 10 54 143 15 143 30 34 9 16 14 84 144 17 144 30 35 15 14 12 86 145 16 145 31 23 11 15 12 77 146 10 146 40 31 8 16 11 89 147 18 147 32 27 13 16 12 76 148 13 148 36 36 12 11 13 60 149 16 149 32 31 12 12 11 75 150 13 150 35 32 9 9 19 73 151 10 151 38 39 7 16 12 85 152 15 152 42 37 13 13 17 79 153 16 153 34 38 9 16 9 71 154 16 154 35 39 6 12 12 72 155 14 155 35 34 8 9 19 69 156 10 156 33 31 8 13 18 78 157 17 157 36 32 15 13 15 54 158 13 158 32 37 6 14 14 69 159 15 159 33 36 9 19 11 81 160 16 160 34 32 11 13 9 84 161 12 161 32 35 8 12 18 84 162 13 162 34 36 8 13 16 69 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) t Connected Separate Software Happiness 6.037403 -0.004092 0.107298 -0.017986 0.533734 0.055902 Depression Belonging -0.069897 0.005127 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -6.1655 -1.1215 0.2265 1.1144 4.2575 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 6.037403 2.582313 2.338 0.0207 * t -0.004092 0.003249 -1.260 0.2097 Connected 0.107298 0.047155 2.275 0.0243 * Separate -0.017986 0.044755 -0.402 0.6883 Software 0.533734 0.069284 7.704 1.51e-12 *** Happiness 0.055902 0.076258 0.733 0.4646 Depression -0.069897 0.056017 -1.248 0.2140 Belonging 0.005127 0.014678 0.349 0.7274 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 1.845 on 154 degrees of freedom Multiple R-squared: 0.3605, Adjusted R-squared: 0.3314 F-statistic: 12.4 on 7 and 154 DF, p-value: 1.532e-12 > 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.44860666 0.89721332 0.5513933 [2,] 0.85555007 0.28889985 0.1444499 [3,] 0.82706996 0.34586008 0.1729300 [4,] 0.74718132 0.50563735 0.2528187 [5,] 0.69785587 0.60428826 0.3021441 [6,] 0.73384143 0.53231713 0.2661586 [7,] 0.67250466 0.65499068 0.3274953 [8,] 0.87019777 0.25960446 0.1298022 [9,] 0.84371312 0.31257376 0.1562869 [10,] 0.79302343 0.41395313 0.2069766 [11,] 0.72974027 0.54051945 0.2702597 [12,] 0.69013687 0.61972626 0.3098631 [13,] 0.65697716 0.68604569 0.3430228 [14,] 0.63321105 0.73357790 0.3667890 [15,] 0.57602054 0.84795892 0.4239795 [16,] 0.52726159 0.94547682 0.4727384 [17,] 0.47673413 0.95346826 0.5232659 [18,] 0.52686614 0.94626772 0.4731339 [19,] 0.46835334 0.93670667 0.5316467 [20,] 0.48184198 0.96368397 0.5181580 [21,] 0.42809432 0.85618863 0.5719057 [22,] 0.42602270 0.85204540 0.5739773 [23,] 0.41244333 0.82488665 0.5875567 [24,] 0.35449061 0.70898122 0.6455094 [25,] 0.33977208 0.67954417 0.6602279 [26,] 0.83893199 0.32213602 0.1610680 [27,] 0.82200224 0.35599552 0.1779978 [28,] 0.80590352 0.38819295 0.1940965 [29,] 0.83792177 0.32415646 0.1620782 [30,] 0.82465570 0.35068861 0.1753443 [31,] 0.79847356 0.40305288 0.2015264 [32,] 0.77709221 0.44581559 0.2229078 [33,] 0.79631435 0.40737130 0.2036856 [34,] 0.75838420 0.48323161 0.2416158 [35,] 0.72592417 0.54815166 0.2740758 [36,] 0.88327852 0.23344297 0.1167215 [37,] 0.89175186 0.21649628 0.1082481 [38,] 0.87066703 0.25866594 0.1293330 [39,] 0.85617198 0.28765603 0.1438280 [40,] 0.84933516 0.30132967 0.1506648 [41,] 0.82112363 0.35775275 0.1788764 [42,] 0.78948140 0.42103720 0.2105186 [43,] 0.80478450 0.39043101 0.1952155 [44,] 0.77827450 0.44345099 0.2217255 [45,] 0.79878124 0.40243752 0.2012188 [46,] 0.78915197 0.42169605 0.2108480 [47,] 0.75368317 0.49263366 0.2463168 [48,] 0.74206541 0.51586918 0.2579346 [49,] 0.70724869 0.58550263 0.2927513 [50,] 0.71447752 0.57104497 0.2855225 [51,] 0.67989394 0.64021212 0.3201061 [52,] 0.63900355 0.72199290 0.3609964 [53,] 0.59931132 0.80137737 0.4006887 [54,] 0.55585460 0.88829080 0.4441454 [55,] 0.51794245 0.96411511 0.4820576 [56,] 0.49267118 0.98534236 0.5073288 [57,] 0.48729993 0.97459987 0.5127001 [58,] 0.60662033 0.78675934 0.3933797 [59,] 0.73302875 0.53394250 0.2669712 [60,] 0.69928488 0.60143023 0.3007151 [61,] 0.80317245 0.39365510 0.1968276 [62,] 0.77367271 0.45265458 0.2263273 [63,] 0.76524591 0.46950818 0.2347541 [64,] 0.74289998 0.51420004 0.2571000 [65,] 0.70422411 0.59155178 0.2957759 [66,] 0.75390644 0.49218712 0.2460936 [67,] 0.71706177 0.56587647 0.2829382 [68,] 0.69570606 0.60858789 0.3042939 [69,] 0.70199891 0.59600219 0.2980011 [70,] 0.66310526 0.67378948 0.3368947 [71,] 0.62391384 0.75217232 0.3760862 [72,] 0.78674980 0.42650040 0.2132502 [73,] 0.75203154 0.49593692 0.2479685 [74,] 0.72473013 0.55053975 0.2752699 [75,] 0.68501293 0.62997413 0.3149871 [76,] 0.67111170 0.65777661 0.3288883 [77,] 0.62863826 0.74272347 0.3713617 [78,] 0.58710790 0.82578420 0.4128921 [79,] 0.56406365 0.87187270 0.4359364 [80,] 0.52623315 0.94753370 0.4737668 [81,] 0.51660959 0.96678082 0.4833904 [82,] 0.47608404 0.95216808 0.5239160 [83,] 0.43321803 0.86643606 0.5667820 [84,] 0.38807899 0.77615798 0.6119210 [85,] 0.41413121 0.82826242 0.5858688 [86,] 0.37615390 0.75230781 0.6238461 [87,] 0.33397561 0.66795121 0.6660244 [88,] 0.32643501 0.65287001 0.6735650 [89,] 0.28427336 0.56854672 0.7157266 [90,] 0.24980769 0.49961538 0.7501923 [91,] 0.22700758 0.45401517 0.7729924 [92,] 0.20694084 0.41388168 0.7930592 [93,] 0.24953917 0.49907834 0.7504608 [94,] 0.21272627 0.42545255 0.7872737 [95,] 0.20581223 0.41162447 0.7941878 [96,] 0.21702148 0.43404297 0.7829785 [97,] 0.19529693 0.39059385 0.8047031 [98,] 0.17392925 0.34785851 0.8260707 [99,] 0.16938126 0.33876252 0.8306187 [100,] 0.16591584 0.33183168 0.8340842 [101,] 0.15237090 0.30474180 0.8476291 [102,] 0.13140839 0.26281678 0.8685916 [103,] 0.17286779 0.34573558 0.8271322 [104,] 0.14859264 0.29718527 0.8514074 [105,] 0.16826740 0.33653481 0.8317326 [106,] 0.17217409 0.34434818 0.8278259 [107,] 0.14767683 0.29535366 0.8523232 [108,] 0.14530754 0.29061508 0.8546925 [109,] 0.13516554 0.27033109 0.8648345 [110,] 0.15134919 0.30269837 0.8486508 [111,] 0.12514400 0.25028801 0.8748560 [112,] 0.11165419 0.22330839 0.8883458 [113,] 0.10756286 0.21512573 0.8924371 [114,] 0.08514807 0.17029614 0.9148519 [115,] 0.06662188 0.13324376 0.9333781 [116,] 0.05090346 0.10180693 0.9490965 [117,] 0.03751936 0.07503871 0.9624806 [118,] 0.03830487 0.07660975 0.9616951 [119,] 0.03726502 0.07453004 0.9627350 [120,] 0.03696441 0.07392881 0.9630356 [121,] 0.04241924 0.08483848 0.9575808 [122,] 0.04382966 0.08765933 0.9561703 [123,] 0.09727011 0.19454023 0.9027299 [124,] 0.09826125 0.19652250 0.9017387 [125,] 0.07749329 0.15498658 0.9225067 [126,] 0.05966367 0.11932735 0.9403363 [127,] 0.04620191 0.09240382 0.9537981 [128,] 0.04233600 0.08467201 0.9576640 [129,] 0.04138385 0.08276769 0.9586162 [130,] 0.02885386 0.05770772 0.9711461 [131,] 0.44403876 0.88807751 0.5559612 [132,] 0.39089260 0.78178519 0.6091074 [133,] 0.34648445 0.69296890 0.6535155 [134,] 0.27520414 0.55040828 0.7247959 [135,] 0.22691400 0.45382800 0.7730860 [136,] 0.22266735 0.44533470 0.7773326 [137,] 0.33267554 0.66535108 0.6673245 [138,] 0.70472390 0.59055220 0.2952761 [139,] 0.60948262 0.78103477 0.3905174 [140,] 0.46728579 0.93457159 0.5327142 [141,] 0.70590224 0.58819551 0.2940978 > postscript(file="/var/fisher/rcomp/tmp/17kgv1351951357.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/fisher/rcomp/tmp/29gwx1351951357.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/fisher/rcomp/tmp/3rifc1351951357.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/fisher/rcomp/tmp/4vicd1351951357.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/fisher/rcomp/tmp/54rqt1351951357.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 -3.369468601 -0.187649987 2.404686983 2.868292674 -1.754381453 -2.151399873 7 8 9 10 11 12 3.442748163 -1.901495356 -2.157554874 2.195036744 0.494120240 -0.424127057 13 14 15 16 17 18 0.309097822 0.454925544 -0.610690014 -0.318169270 0.219055867 3.604954972 19 20 21 22 23 24 2.256335375 0.503641044 0.482127982 0.894147980 2.396298735 0.941784334 25 26 27 28 29 30 2.029843465 0.022584623 0.987316552 -1.358382275 0.469294576 -0.356338320 31 32 33 34 35 36 -0.813492435 -0.452945003 -1.267535215 0.213950297 -1.660894839 -6.165485305 37 38 39 40 41 42 -1.070649047 -1.919674601 1.589770584 1.245539737 0.809715513 -1.625324325 43 44 45 46 47 48 2.018670753 -0.315446113 -1.020024118 -4.649378466 -2.702187903 -0.095540727 49 50 51 52 53 54 0.831510670 -2.081749505 -0.615641664 -0.203476078 -2.745094784 0.270234725 55 56 57 58 59 60 -2.563937232 1.205472832 -0.147214360 0.742063036 -0.335684210 1.745630920 61 62 63 64 65 66 0.439747589 0.062973389 -0.441419948 -0.413971792 0.526496460 1.003888907 67 68 69 70 71 72 1.766231749 3.430155351 -3.877894228 0.540569215 -3.664024724 -0.379435770 73 74 75 76 77 78 1.497229603 0.959932591 0.313681308 3.072024505 -0.365941648 1.427918519 79 80 81 82 83 84 -1.890338519 0.026260001 0.521237125 4.257524849 0.234032454 -0.904880275 85 86 87 88 89 90 0.248451536 1.725186206 -0.175239918 0.690978602 1.430786577 0.766329459 91 92 93 94 95 96 -1.563290080 0.090774202 0.595725159 -0.142042921 -2.063412397 0.945272202 97 98 99 100 101 102 0.174258902 1.948511522 0.007677681 -0.280758442 -1.167194524 1.241681110 103 104 105 106 107 108 2.689392151 0.402761987 1.556628475 -2.248506345 1.032639915 0.217800385 109 110 111 112 113 114 1.516942297 -0.299131271 1.124240154 0.270098674 2.448815404 -1.210952004 115 116 117 118 119 120 -2.819747725 1.467912712 -1.399466188 1.014071378 -1.840129062 0.423440748 121 122 123 124 125 126 -1.187886474 0.488985543 -2.840686362 -0.957790723 -0.891601802 -0.623366789 127 128 129 130 131 132 -0.316668670 0.964922350 1.085011116 -2.837376751 1.999480968 -3.240642183 133 134 135 136 137 138 2.076229902 -1.840897717 -1.555466550 -0.133878600 0.826837723 0.510571876 139 140 141 142 143 144 -2.168768934 -1.276044437 -5.202441329 3.035406626 1.790241619 0.571672564 145 146 147 148 149 150 1.377811982 -4.026011704 2.232399178 -2.065660403 1.005097985 0.043615623 151 152 153 154 155 156 -3.022928713 -1.138454893 2.191080825 4.135232515 1.654290316 -2.520623342 157 158 159 160 161 162 0.356776682 1.480895519 1.207781491 1.145400440 -0.295779324 0.392909849 > postscript(file="/var/fisher/rcomp/tmp/62dkc1351951357.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 -3.369468601 NA 1 -0.187649987 -3.369468601 2 2.404686983 -0.187649987 3 2.868292674 2.404686983 4 -1.754381453 2.868292674 5 -2.151399873 -1.754381453 6 3.442748163 -2.151399873 7 -1.901495356 3.442748163 8 -2.157554874 -1.901495356 9 2.195036744 -2.157554874 10 0.494120240 2.195036744 11 -0.424127057 0.494120240 12 0.309097822 -0.424127057 13 0.454925544 0.309097822 14 -0.610690014 0.454925544 15 -0.318169270 -0.610690014 16 0.219055867 -0.318169270 17 3.604954972 0.219055867 18 2.256335375 3.604954972 19 0.503641044 2.256335375 20 0.482127982 0.503641044 21 0.894147980 0.482127982 22 2.396298735 0.894147980 23 0.941784334 2.396298735 24 2.029843465 0.941784334 25 0.022584623 2.029843465 26 0.987316552 0.022584623 27 -1.358382275 0.987316552 28 0.469294576 -1.358382275 29 -0.356338320 0.469294576 30 -0.813492435 -0.356338320 31 -0.452945003 -0.813492435 32 -1.267535215 -0.452945003 33 0.213950297 -1.267535215 34 -1.660894839 0.213950297 35 -6.165485305 -1.660894839 36 -1.070649047 -6.165485305 37 -1.919674601 -1.070649047 38 1.589770584 -1.919674601 39 1.245539737 1.589770584 40 0.809715513 1.245539737 41 -1.625324325 0.809715513 42 2.018670753 -1.625324325 43 -0.315446113 2.018670753 44 -1.020024118 -0.315446113 45 -4.649378466 -1.020024118 46 -2.702187903 -4.649378466 47 -0.095540727 -2.702187903 48 0.831510670 -0.095540727 49 -2.081749505 0.831510670 50 -0.615641664 -2.081749505 51 -0.203476078 -0.615641664 52 -2.745094784 -0.203476078 53 0.270234725 -2.745094784 54 -2.563937232 0.270234725 55 1.205472832 -2.563937232 56 -0.147214360 1.205472832 57 0.742063036 -0.147214360 58 -0.335684210 0.742063036 59 1.745630920 -0.335684210 60 0.439747589 1.745630920 61 0.062973389 0.439747589 62 -0.441419948 0.062973389 63 -0.413971792 -0.441419948 64 0.526496460 -0.413971792 65 1.003888907 0.526496460 66 1.766231749 1.003888907 67 3.430155351 1.766231749 68 -3.877894228 3.430155351 69 0.540569215 -3.877894228 70 -3.664024724 0.540569215 71 -0.379435770 -3.664024724 72 1.497229603 -0.379435770 73 0.959932591 1.497229603 74 0.313681308 0.959932591 75 3.072024505 0.313681308 76 -0.365941648 3.072024505 77 1.427918519 -0.365941648 78 -1.890338519 1.427918519 79 0.026260001 -1.890338519 80 0.521237125 0.026260001 81 4.257524849 0.521237125 82 0.234032454 4.257524849 83 -0.904880275 0.234032454 84 0.248451536 -0.904880275 85 1.725186206 0.248451536 86 -0.175239918 1.725186206 87 0.690978602 -0.175239918 88 1.430786577 0.690978602 89 0.766329459 1.430786577 90 -1.563290080 0.766329459 91 0.090774202 -1.563290080 92 0.595725159 0.090774202 93 -0.142042921 0.595725159 94 -2.063412397 -0.142042921 95 0.945272202 -2.063412397 96 0.174258902 0.945272202 97 1.948511522 0.174258902 98 0.007677681 1.948511522 99 -0.280758442 0.007677681 100 -1.167194524 -0.280758442 101 1.241681110 -1.167194524 102 2.689392151 1.241681110 103 0.402761987 2.689392151 104 1.556628475 0.402761987 105 -2.248506345 1.556628475 106 1.032639915 -2.248506345 107 0.217800385 1.032639915 108 1.516942297 0.217800385 109 -0.299131271 1.516942297 110 1.124240154 -0.299131271 111 0.270098674 1.124240154 112 2.448815404 0.270098674 113 -1.210952004 2.448815404 114 -2.819747725 -1.210952004 115 1.467912712 -2.819747725 116 -1.399466188 1.467912712 117 1.014071378 -1.399466188 118 -1.840129062 1.014071378 119 0.423440748 -1.840129062 120 -1.187886474 0.423440748 121 0.488985543 -1.187886474 122 -2.840686362 0.488985543 123 -0.957790723 -2.840686362 124 -0.891601802 -0.957790723 125 -0.623366789 -0.891601802 126 -0.316668670 -0.623366789 127 0.964922350 -0.316668670 128 1.085011116 0.964922350 129 -2.837376751 1.085011116 130 1.999480968 -2.837376751 131 -3.240642183 1.999480968 132 2.076229902 -3.240642183 133 -1.840897717 2.076229902 134 -1.555466550 -1.840897717 135 -0.133878600 -1.555466550 136 0.826837723 -0.133878600 137 0.510571876 0.826837723 138 -2.168768934 0.510571876 139 -1.276044437 -2.168768934 140 -5.202441329 -1.276044437 141 3.035406626 -5.202441329 142 1.790241619 3.035406626 143 0.571672564 1.790241619 144 1.377811982 0.571672564 145 -4.026011704 1.377811982 146 2.232399178 -4.026011704 147 -2.065660403 2.232399178 148 1.005097985 -2.065660403 149 0.043615623 1.005097985 150 -3.022928713 0.043615623 151 -1.138454893 -3.022928713 152 2.191080825 -1.138454893 153 4.135232515 2.191080825 154 1.654290316 4.135232515 155 -2.520623342 1.654290316 156 0.356776682 -2.520623342 157 1.480895519 0.356776682 158 1.207781491 1.480895519 159 1.145400440 1.207781491 160 -0.295779324 1.145400440 161 0.392909849 -0.295779324 162 NA 0.392909849 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -0.187649987 -3.369468601 [2,] 2.404686983 -0.187649987 [3,] 2.868292674 2.404686983 [4,] -1.754381453 2.868292674 [5,] -2.151399873 -1.754381453 [6,] 3.442748163 -2.151399873 [7,] -1.901495356 3.442748163 [8,] -2.157554874 -1.901495356 [9,] 2.195036744 -2.157554874 [10,] 0.494120240 2.195036744 [11,] -0.424127057 0.494120240 [12,] 0.309097822 -0.424127057 [13,] 0.454925544 0.309097822 [14,] -0.610690014 0.454925544 [15,] -0.318169270 -0.610690014 [16,] 0.219055867 -0.318169270 [17,] 3.604954972 0.219055867 [18,] 2.256335375 3.604954972 [19,] 0.503641044 2.256335375 [20,] 0.482127982 0.503641044 [21,] 0.894147980 0.482127982 [22,] 2.396298735 0.894147980 [23,] 0.941784334 2.396298735 [24,] 2.029843465 0.941784334 [25,] 0.022584623 2.029843465 [26,] 0.987316552 0.022584623 [27,] -1.358382275 0.987316552 [28,] 0.469294576 -1.358382275 [29,] -0.356338320 0.469294576 [30,] -0.813492435 -0.356338320 [31,] -0.452945003 -0.813492435 [32,] -1.267535215 -0.452945003 [33,] 0.213950297 -1.267535215 [34,] -1.660894839 0.213950297 [35,] -6.165485305 -1.660894839 [36,] -1.070649047 -6.165485305 [37,] -1.919674601 -1.070649047 [38,] 1.589770584 -1.919674601 [39,] 1.245539737 1.589770584 [40,] 0.809715513 1.245539737 [41,] -1.625324325 0.809715513 [42,] 2.018670753 -1.625324325 [43,] -0.315446113 2.018670753 [44,] -1.020024118 -0.315446113 [45,] -4.649378466 -1.020024118 [46,] -2.702187903 -4.649378466 [47,] -0.095540727 -2.702187903 [48,] 0.831510670 -0.095540727 [49,] -2.081749505 0.831510670 [50,] -0.615641664 -2.081749505 [51,] -0.203476078 -0.615641664 [52,] -2.745094784 -0.203476078 [53,] 0.270234725 -2.745094784 [54,] -2.563937232 0.270234725 [55,] 1.205472832 -2.563937232 [56,] -0.147214360 1.205472832 [57,] 0.742063036 -0.147214360 [58,] -0.335684210 0.742063036 [59,] 1.745630920 -0.335684210 [60,] 0.439747589 1.745630920 [61,] 0.062973389 0.439747589 [62,] -0.441419948 0.062973389 [63,] -0.413971792 -0.441419948 [64,] 0.526496460 -0.413971792 [65,] 1.003888907 0.526496460 [66,] 1.766231749 1.003888907 [67,] 3.430155351 1.766231749 [68,] -3.877894228 3.430155351 [69,] 0.540569215 -3.877894228 [70,] -3.664024724 0.540569215 [71,] -0.379435770 -3.664024724 [72,] 1.497229603 -0.379435770 [73,] 0.959932591 1.497229603 [74,] 0.313681308 0.959932591 [75,] 3.072024505 0.313681308 [76,] -0.365941648 3.072024505 [77,] 1.427918519 -0.365941648 [78,] -1.890338519 1.427918519 [79,] 0.026260001 -1.890338519 [80,] 0.521237125 0.026260001 [81,] 4.257524849 0.521237125 [82,] 0.234032454 4.257524849 [83,] -0.904880275 0.234032454 [84,] 0.248451536 -0.904880275 [85,] 1.725186206 0.248451536 [86,] -0.175239918 1.725186206 [87,] 0.690978602 -0.175239918 [88,] 1.430786577 0.690978602 [89,] 0.766329459 1.430786577 [90,] -1.563290080 0.766329459 [91,] 0.090774202 -1.563290080 [92,] 0.595725159 0.090774202 [93,] -0.142042921 0.595725159 [94,] -2.063412397 -0.142042921 [95,] 0.945272202 -2.063412397 [96,] 0.174258902 0.945272202 [97,] 1.948511522 0.174258902 [98,] 0.007677681 1.948511522 [99,] -0.280758442 0.007677681 [100,] -1.167194524 -0.280758442 [101,] 1.241681110 -1.167194524 [102,] 2.689392151 1.241681110 [103,] 0.402761987 2.689392151 [104,] 1.556628475 0.402761987 [105,] -2.248506345 1.556628475 [106,] 1.032639915 -2.248506345 [107,] 0.217800385 1.032639915 [108,] 1.516942297 0.217800385 [109,] -0.299131271 1.516942297 [110,] 1.124240154 -0.299131271 [111,] 0.270098674 1.124240154 [112,] 2.448815404 0.270098674 [113,] -1.210952004 2.448815404 [114,] -2.819747725 -1.210952004 [115,] 1.467912712 -2.819747725 [116,] -1.399466188 1.467912712 [117,] 1.014071378 -1.399466188 [118,] -1.840129062 1.014071378 [119,] 0.423440748 -1.840129062 [120,] -1.187886474 0.423440748 [121,] 0.488985543 -1.187886474 [122,] -2.840686362 0.488985543 [123,] -0.957790723 -2.840686362 [124,] -0.891601802 -0.957790723 [125,] -0.623366789 -0.891601802 [126,] -0.316668670 -0.623366789 [127,] 0.964922350 -0.316668670 [128,] 1.085011116 0.964922350 [129,] -2.837376751 1.085011116 [130,] 1.999480968 -2.837376751 [131,] -3.240642183 1.999480968 [132,] 2.076229902 -3.240642183 [133,] -1.840897717 2.076229902 [134,] -1.555466550 -1.840897717 [135,] -0.133878600 -1.555466550 [136,] 0.826837723 -0.133878600 [137,] 0.510571876 0.826837723 [138,] -2.168768934 0.510571876 [139,] -1.276044437 -2.168768934 [140,] -5.202441329 -1.276044437 [141,] 3.035406626 -5.202441329 [142,] 1.790241619 3.035406626 [143,] 0.571672564 1.790241619 [144,] 1.377811982 0.571672564 [145,] -4.026011704 1.377811982 [146,] 2.232399178 -4.026011704 [147,] -2.065660403 2.232399178 [148,] 1.005097985 -2.065660403 [149,] 0.043615623 1.005097985 [150,] -3.022928713 0.043615623 [151,] -1.138454893 -3.022928713 [152,] 2.191080825 -1.138454893 [153,] 4.135232515 2.191080825 [154,] 1.654290316 4.135232515 [155,] -2.520623342 1.654290316 [156,] 0.356776682 -2.520623342 [157,] 1.480895519 0.356776682 [158,] 1.207781491 1.480895519 [159,] 1.145400440 1.207781491 [160,] -0.295779324 1.145400440 [161,] 0.392909849 -0.295779324 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -0.187649987 -3.369468601 2 2.404686983 -0.187649987 3 2.868292674 2.404686983 4 -1.754381453 2.868292674 5 -2.151399873 -1.754381453 6 3.442748163 -2.151399873 7 -1.901495356 3.442748163 8 -2.157554874 -1.901495356 9 2.195036744 -2.157554874 10 0.494120240 2.195036744 11 -0.424127057 0.494120240 12 0.309097822 -0.424127057 13 0.454925544 0.309097822 14 -0.610690014 0.454925544 15 -0.318169270 -0.610690014 16 0.219055867 -0.318169270 17 3.604954972 0.219055867 18 2.256335375 3.604954972 19 0.503641044 2.256335375 20 0.482127982 0.503641044 21 0.894147980 0.482127982 22 2.396298735 0.894147980 23 0.941784334 2.396298735 24 2.029843465 0.941784334 25 0.022584623 2.029843465 26 0.987316552 0.022584623 27 -1.358382275 0.987316552 28 0.469294576 -1.358382275 29 -0.356338320 0.469294576 30 -0.813492435 -0.356338320 31 -0.452945003 -0.813492435 32 -1.267535215 -0.452945003 33 0.213950297 -1.267535215 34 -1.660894839 0.213950297 35 -6.165485305 -1.660894839 36 -1.070649047 -6.165485305 37 -1.919674601 -1.070649047 38 1.589770584 -1.919674601 39 1.245539737 1.589770584 40 0.809715513 1.245539737 41 -1.625324325 0.809715513 42 2.018670753 -1.625324325 43 -0.315446113 2.018670753 44 -1.020024118 -0.315446113 45 -4.649378466 -1.020024118 46 -2.702187903 -4.649378466 47 -0.095540727 -2.702187903 48 0.831510670 -0.095540727 49 -2.081749505 0.831510670 50 -0.615641664 -2.081749505 51 -0.203476078 -0.615641664 52 -2.745094784 -0.203476078 53 0.270234725 -2.745094784 54 -2.563937232 0.270234725 55 1.205472832 -2.563937232 56 -0.147214360 1.205472832 57 0.742063036 -0.147214360 58 -0.335684210 0.742063036 59 1.745630920 -0.335684210 60 0.439747589 1.745630920 61 0.062973389 0.439747589 62 -0.441419948 0.062973389 63 -0.413971792 -0.441419948 64 0.526496460 -0.413971792 65 1.003888907 0.526496460 66 1.766231749 1.003888907 67 3.430155351 1.766231749 68 -3.877894228 3.430155351 69 0.540569215 -3.877894228 70 -3.664024724 0.540569215 71 -0.379435770 -3.664024724 72 1.497229603 -0.379435770 73 0.959932591 1.497229603 74 0.313681308 0.959932591 75 3.072024505 0.313681308 76 -0.365941648 3.072024505 77 1.427918519 -0.365941648 78 -1.890338519 1.427918519 79 0.026260001 -1.890338519 80 0.521237125 0.026260001 81 4.257524849 0.521237125 82 0.234032454 4.257524849 83 -0.904880275 0.234032454 84 0.248451536 -0.904880275 85 1.725186206 0.248451536 86 -0.175239918 1.725186206 87 0.690978602 -0.175239918 88 1.430786577 0.690978602 89 0.766329459 1.430786577 90 -1.563290080 0.766329459 91 0.090774202 -1.563290080 92 0.595725159 0.090774202 93 -0.142042921 0.595725159 94 -2.063412397 -0.142042921 95 0.945272202 -2.063412397 96 0.174258902 0.945272202 97 1.948511522 0.174258902 98 0.007677681 1.948511522 99 -0.280758442 0.007677681 100 -1.167194524 -0.280758442 101 1.241681110 -1.167194524 102 2.689392151 1.241681110 103 0.402761987 2.689392151 104 1.556628475 0.402761987 105 -2.248506345 1.556628475 106 1.032639915 -2.248506345 107 0.217800385 1.032639915 108 1.516942297 0.217800385 109 -0.299131271 1.516942297 110 1.124240154 -0.299131271 111 0.270098674 1.124240154 112 2.448815404 0.270098674 113 -1.210952004 2.448815404 114 -2.819747725 -1.210952004 115 1.467912712 -2.819747725 116 -1.399466188 1.467912712 117 1.014071378 -1.399466188 118 -1.840129062 1.014071378 119 0.423440748 -1.840129062 120 -1.187886474 0.423440748 121 0.488985543 -1.187886474 122 -2.840686362 0.488985543 123 -0.957790723 -2.840686362 124 -0.891601802 -0.957790723 125 -0.623366789 -0.891601802 126 -0.316668670 -0.623366789 127 0.964922350 -0.316668670 128 1.085011116 0.964922350 129 -2.837376751 1.085011116 130 1.999480968 -2.837376751 131 -3.240642183 1.999480968 132 2.076229902 -3.240642183 133 -1.840897717 2.076229902 134 -1.555466550 -1.840897717 135 -0.133878600 -1.555466550 136 0.826837723 -0.133878600 137 0.510571876 0.826837723 138 -2.168768934 0.510571876 139 -1.276044437 -2.168768934 140 -5.202441329 -1.276044437 141 3.035406626 -5.202441329 142 1.790241619 3.035406626 143 0.571672564 1.790241619 144 1.377811982 0.571672564 145 -4.026011704 1.377811982 146 2.232399178 -4.026011704 147 -2.065660403 2.232399178 148 1.005097985 -2.065660403 149 0.043615623 1.005097985 150 -3.022928713 0.043615623 151 -1.138454893 -3.022928713 152 2.191080825 -1.138454893 153 4.135232515 2.191080825 154 1.654290316 4.135232515 155 -2.520623342 1.654290316 156 0.356776682 -2.520623342 157 1.480895519 0.356776682 158 1.207781491 1.480895519 159 1.145400440 1.207781491 160 -0.295779324 1.145400440 161 0.392909849 -0.295779324 > 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/fisher/rcomp/tmp/7jpsv1351951357.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/fisher/rcomp/tmp/860b71351951357.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/fisher/rcomp/tmp/9i1ex1351951357.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/fisher/rcomp/tmp/10tgrq1351951357.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/fisher/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/fisher/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/fisher/rcomp/tmp/11xxn71351951357.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/fisher/rcomp/tmp/128da01351951357.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/fisher/rcomp/tmp/134jfk1351951357.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/fisher/rcomp/tmp/148gw11351951357.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/fisher/rcomp/tmp/15pa481351951357.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/fisher/rcomp/tmp/16s0wr1351951357.tab") + } > > try(system("convert tmp/17kgv1351951357.ps tmp/17kgv1351951357.png",intern=TRUE)) character(0) > try(system("convert tmp/29gwx1351951357.ps tmp/29gwx1351951357.png",intern=TRUE)) character(0) > try(system("convert tmp/3rifc1351951357.ps tmp/3rifc1351951357.png",intern=TRUE)) character(0) > try(system("convert tmp/4vicd1351951357.ps tmp/4vicd1351951357.png",intern=TRUE)) character(0) > try(system("convert tmp/54rqt1351951357.ps tmp/54rqt1351951357.png",intern=TRUE)) character(0) > try(system("convert tmp/62dkc1351951357.ps tmp/62dkc1351951357.png",intern=TRUE)) character(0) > try(system("convert tmp/7jpsv1351951357.ps tmp/7jpsv1351951357.png",intern=TRUE)) character(0) > try(system("convert tmp/860b71351951357.ps tmp/860b71351951357.png",intern=TRUE)) character(0) > try(system("convert tmp/9i1ex1351951357.ps tmp/9i1ex1351951357.png",intern=TRUE)) character(0) > try(system("convert tmp/10tgrq1351951357.ps tmp/10tgrq1351951357.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 8.246 1.167 9.415