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(2000 + ,41 + ,38 + ,13 + ,12 + ,14 + ,12 + ,53 + ,2000 + ,39 + ,32 + ,16 + ,11 + ,18 + ,11 + ,86 + ,2000 + ,30 + ,35 + ,19 + ,15 + ,11 + ,14 + ,66 + ,2000 + ,31 + ,33 + ,15 + ,6 + ,12 + ,12 + ,67 + ,2000 + ,34 + ,37 + ,14 + ,13 + ,16 + ,21 + ,76 + ,2000 + ,35 + ,29 + ,13 + ,10 + ,18 + ,12 + ,78 + ,2000 + ,39 + ,31 + ,19 + ,12 + ,14 + ,22 + ,53 + ,2000 + ,34 + ,36 + ,15 + ,14 + ,14 + ,11 + ,80 + ,2000 + ,36 + ,35 + ,14 + ,12 + ,15 + ,10 + ,74 + ,2000 + ,37 + ,38 + ,15 + ,6 + ,15 + ,13 + ,76 + ,2000 + ,38 + ,31 + ,16 + ,10 + ,17 + ,10 + ,79 + ,2000 + ,36 + ,34 + ,16 + ,12 + ,19 + ,8 + ,54 + ,2000 + ,38 + ,35 + ,16 + ,12 + ,10 + ,15 + ,67 + ,2001 + ,39 + ,38 + ,16 + ,11 + ,16 + ,14 + ,54 + ,2001 + ,33 + ,37 + ,17 + ,15 + ,18 + ,10 + ,87 + ,2001 + ,32 + ,33 + ,15 + ,12 + ,14 + ,14 + ,58 + ,2001 + ,36 + ,32 + ,15 + ,10 + ,14 + ,14 + ,75 + ,2001 + ,38 + ,38 + ,20 + ,12 + ,17 + ,11 + ,88 + ,2001 + ,39 + ,38 + ,18 + ,11 + ,14 + ,10 + ,64 + ,2001 + ,32 + ,32 + ,16 + ,12 + ,16 + ,13 + ,57 + ,2001 + ,32 + ,33 + ,16 + ,11 + ,18 + ,7 + ,66 + ,2001 + ,31 + ,31 + ,16 + ,12 + ,11 + ,14 + ,68 + ,2001 + ,39 + ,38 + ,19 + ,13 + ,14 + ,12 + ,54 + ,2001 + ,37 + ,39 + ,16 + ,11 + ,12 + ,14 + ,56 + ,2001 + ,39 + ,32 + ,17 + ,9 + ,17 + ,11 + ,86 + ,2001 + ,41 + ,32 + ,17 + ,13 + ,9 + ,9 + ,80 + ,2002 + ,36 + ,35 + ,16 + ,10 + ,16 + ,11 + ,76 + ,2002 + ,33 + ,37 + ,15 + ,14 + ,14 + ,15 + ,69 + ,2002 + ,33 + ,33 + ,16 + ,12 + ,15 + ,14 + ,78 + ,2002 + ,34 + ,33 + ,14 + ,10 + ,11 + ,13 + ,67 + ,2002 + ,31 + ,28 + ,15 + ,12 + ,16 + ,9 + ,80 + ,2002 + ,27 + ,32 + ,12 + ,8 + ,13 + ,15 + ,54 + ,2002 + ,37 + ,31 + ,14 + ,10 + ,17 + ,10 + ,71 + ,2002 + ,34 + ,37 + ,16 + ,12 + ,15 + ,11 + ,84 + ,2002 + ,34 + ,30 + ,14 + ,12 + ,14 + ,13 + ,74 + ,2002 + ,32 + ,33 + ,7 + ,7 + ,16 + ,8 + ,71 + ,2002 + ,29 + ,31 + ,10 + ,6 + ,9 + ,20 + ,63 + ,2002 + ,36 + ,33 + ,14 + ,12 + ,15 + ,12 + ,71 + ,2002 + ,29 + ,31 + ,16 + ,10 + ,17 + ,10 + ,76 + ,2003 + ,35 + ,33 + ,16 + ,10 + ,13 + ,10 + ,69 + ,2003 + ,37 + ,32 + ,16 + ,10 + ,15 + ,9 + ,74 + ,2003 + ,34 + ,33 + ,14 + ,12 + ,16 + ,14 + ,75 + ,2003 + ,38 + ,32 + ,20 + ,15 + ,16 + ,8 + ,54 + ,2003 + ,35 + ,33 + ,14 + ,10 + ,12 + ,14 + ,52 + ,2003 + ,38 + ,28 + ,14 + ,10 + ,12 + ,11 + ,69 + ,2003 + ,37 + ,35 + ,11 + ,12 + ,11 + ,13 + ,68 + ,2003 + ,38 + ,39 + ,14 + ,13 + ,15 + ,9 + ,65 + ,2003 + ,33 + ,34 + ,15 + ,11 + ,15 + ,11 + ,75 + ,2003 + ,36 + ,38 + ,16 + ,11 + ,17 + ,15 + ,74 + ,2003 + ,38 + ,32 + ,14 + ,12 + ,13 + ,11 + ,75 + ,2003 + ,32 + ,38 + ,16 + ,14 + ,16 + ,10 + ,72 + ,2003 + ,32 + ,30 + ,14 + ,10 + ,14 + ,14 + ,67 + ,2004 + ,32 + ,33 + ,12 + ,12 + ,11 + ,18 + ,63 + ,2004 + ,34 + ,38 + ,16 + ,13 + ,12 + ,14 + ,62 + ,2004 + ,32 + ,32 + ,9 + ,5 + ,12 + ,11 + ,63 + ,2004 + ,37 + ,32 + ,14 + ,6 + ,15 + ,12 + ,76 + ,2004 + ,39 + ,34 + ,16 + ,12 + ,16 + ,13 + ,74 + ,2004 + ,29 + ,34 + ,16 + ,12 + ,15 + ,9 + ,67 + ,2004 + ,37 + ,36 + ,15 + ,11 + ,12 + ,10 + ,73 + ,2004 + ,35 + ,34 + ,16 + ,10 + ,12 + ,15 + ,70 + ,2004 + ,30 + ,28 + ,12 + ,7 + ,8 + ,20 + ,53 + ,2004 + ,38 + ,34 + ,16 + ,12 + ,13 + ,12 + ,77 + ,2004 + ,34 + ,35 + ,16 + ,14 + ,11 + ,12 + ,77 + ,2004 + ,31 + ,35 + ,14 + ,11 + ,14 + ,14 + ,52 + ,2004 + ,34 + ,31 + ,16 + ,12 + ,15 + ,13 + ,54 + ,2004 + ,35 + ,37 + ,17 + ,13 + ,10 + ,11 + ,80 + ,2005 + ,36 + ,35 + ,18 + ,14 + ,11 + ,17 + ,66 + ,2005 + ,30 + ,27 + ,18 + ,11 + ,12 + ,12 + ,73 + ,2005 + ,39 + ,40 + ,12 + ,12 + ,15 + ,13 + ,63 + ,2005 + ,35 + ,37 + ,16 + ,12 + ,15 + ,14 + ,69 + ,2005 + ,38 + ,36 + ,10 + ,8 + ,14 + ,13 + ,67 + ,2005 + ,31 + ,38 + ,14 + ,11 + ,16 + ,15 + ,54 + ,2005 + ,34 + ,39 + ,18 + ,14 + ,15 + ,13 + ,81 + ,2005 + ,38 + ,41 + ,18 + ,14 + ,15 + ,10 + ,69 + ,2005 + ,34 + ,27 + ,16 + ,12 + ,13 + ,11 + ,84 + ,2005 + ,39 + ,30 + ,17 + ,9 + ,12 + ,19 + ,80 + ,2005 + ,37 + ,37 + ,16 + ,13 + ,17 + ,13 + ,70 + ,2005 + ,34 + ,31 + ,16 + ,11 + ,13 + ,17 + ,69 + ,2005 + ,28 + ,31 + ,13 + ,12 + ,15 + ,13 + ,77 + ,2005 + ,37 + ,27 + ,16 + ,12 + ,13 + ,9 + ,54 + ,2006 + ,33 + ,36 + ,16 + ,12 + ,15 + ,11 + ,79 + ,2006 + ,37 + ,38 + ,20 + ,12 + ,16 + ,10 + ,30 + ,2006 + ,35 + ,37 + ,16 + ,12 + ,15 + ,9 + ,71 + ,2006 + ,37 + ,33 + ,15 + ,12 + ,16 + ,12 + ,73 + ,2006 + ,32 + ,34 + ,15 + ,11 + ,15 + ,12 + ,72 + ,2006 + ,33 + ,31 + ,16 + ,10 + ,14 + ,13 + ,77 + ,2006 + ,38 + ,39 + ,14 + ,9 + ,15 + ,13 + ,75 + ,2006 + ,33 + ,34 + ,16 + ,12 + ,14 + ,12 + ,69 + ,2006 + ,29 + ,32 + ,16 + ,12 + ,13 + ,15 + ,54 + ,2006 + ,33 + ,33 + ,15 + ,12 + ,7 + ,22 + ,70 + ,2006 + ,31 + ,36 + ,12 + ,9 + ,17 + ,13 + ,73 + ,2006 + ,36 + ,32 + ,17 + ,15 + ,13 + ,15 + ,54 + ,2006 + ,35 + ,41 + ,16 + ,12 + ,15 + ,13 + ,77 + ,2006 + ,32 + ,28 + ,15 + ,12 + ,14 + ,15 + ,82 + ,2007 + ,29 + ,30 + ,13 + ,12 + ,13 + ,10 + ,80 + ,2007 + ,39 + ,36 + ,16 + ,10 + ,16 + ,11 + ,80 + ,2007 + ,37 + ,35 + ,16 + ,13 + ,12 + ,16 + ,69 + ,2007 + ,35 + ,31 + ,16 + ,9 + ,14 + ,11 + ,78 + ,2007 + ,37 + ,34 + ,16 + ,12 + ,17 + ,11 + ,81 + ,2007 + ,32 + ,36 + ,14 + ,10 + ,15 + ,10 + ,76 + ,2007 + ,38 + ,36 + ,16 + ,14 + ,17 + ,10 + ,76 + ,2007 + ,37 + ,35 + ,16 + ,11 + ,12 + ,16 + ,73 + ,2007 + ,36 + ,37 + ,20 + ,15 + ,16 + ,12 + ,85 + ,2007 + ,32 + ,28 + ,15 + ,11 + ,11 + ,11 + ,66 + ,2007 + ,33 + ,39 + ,16 + ,11 + ,15 + ,16 + ,79 + ,2007 + ,40 + ,32 + ,13 + ,12 + ,9 + ,19 + ,68 + ,2007 + ,38 + ,35 + ,17 + ,12 + ,16 + ,11 + ,76 + ,2007 + ,41 + ,39 + ,16 + ,12 + ,15 + ,16 + ,71 + ,2008 + ,36 + ,35 + ,16 + ,11 + ,10 + ,15 + ,54 + ,2008 + ,43 + ,42 + ,12 + ,7 + ,10 + ,24 + ,46 + ,2008 + ,30 + ,34 + ,16 + ,12 + ,15 + ,14 + ,82 + ,2008 + ,31 + ,33 + ,16 + ,14 + ,11 + ,15 + ,74 + ,2008 + ,32 + ,41 + ,17 + ,11 + ,13 + ,11 + ,88 + ,2008 + ,32 + ,33 + ,13 + ,11 + ,14 + ,15 + ,38 + ,2008 + ,37 + ,34 + ,12 + ,10 + ,18 + ,12 + ,76 + ,2008 + ,37 + ,32 + ,18 + ,13 + ,16 + ,10 + ,86 + ,2008 + ,33 + ,40 + ,14 + ,13 + ,14 + ,14 + ,54 + ,2008 + ,34 + ,40 + ,14 + ,8 + ,14 + ,13 + ,70 + ,2008 + ,33 + ,35 + ,13 + ,11 + ,14 + ,9 + ,69 + ,2008 + ,38 + ,36 + ,16 + ,12 + ,14 + ,15 + ,90 + ,2008 + ,33 + ,37 + ,13 + ,11 + ,12 + ,15 + ,54 + ,2008 + ,31 + ,27 + ,16 + ,13 + ,14 + ,14 + ,76 + ,2009 + ,38 + ,39 + ,13 + ,12 + ,15 + ,11 + ,89 + ,2009 + ,37 + ,38 + ,16 + ,14 + ,15 + ,8 + ,76 + ,2009 + ,33 + ,31 + ,15 + ,13 + ,15 + ,11 + ,73 + ,2009 + ,31 + ,33 + ,16 + ,15 + ,13 + ,11 + ,79 + ,2009 + ,39 + ,32 + ,15 + ,10 + ,17 + ,8 + ,90 + ,2009 + ,44 + ,39 + ,17 + ,11 + ,17 + ,10 + ,74 + ,2009 + ,33 + ,36 + ,15 + ,9 + ,19 + ,11 + ,81 + ,2009 + ,35 + ,33 + ,12 + ,11 + ,15 + ,13 + ,72 + ,2009 + ,32 + ,33 + ,16 + ,10 + ,13 + ,11 + ,71 + ,2009 + ,28 + ,32 + ,10 + ,11 + ,9 + ,20 + ,66 + ,2009 + ,40 + ,37 + ,16 + ,8 + ,15 + ,10 + ,77 + ,2009 + ,27 + ,30 + ,12 + ,11 + ,15 + ,15 + ,65 + ,2009 + ,37 + ,38 + ,14 + ,12 + ,15 + ,12 + ,74 + ,2009 + ,32 + ,29 + ,15 + ,12 + ,16 + ,14 + ,82 + ,2010 + ,28 + ,22 + ,13 + ,9 + ,11 + ,23 + ,54 + ,2010 + ,34 + ,35 + ,15 + ,11 + ,14 + ,14 + ,63 + ,2010 + ,30 + ,35 + ,11 + ,10 + ,11 + ,16 + ,54 + ,2010 + ,35 + ,34 + ,12 + ,8 + ,15 + ,11 + ,64 + ,2010 + ,31 + ,35 + ,8 + ,9 + ,13 + ,12 + ,69 + ,2010 + ,32 + ,34 + ,16 + ,8 + ,15 + ,10 + ,54 + ,2010 + ,30 + ,34 + ,15 + ,9 + ,16 + ,14 + ,84 + ,2010 + ,30 + ,35 + ,17 + ,15 + ,14 + ,12 + ,86 + ,2010 + ,31 + ,23 + ,16 + ,11 + ,15 + ,12 + ,77 + ,2010 + ,40 + ,31 + ,10 + ,8 + ,16 + ,11 + ,89 + ,2010 + ,32 + ,27 + ,18 + ,13 + ,16 + ,12 + ,76 + ,2010 + ,36 + ,36 + ,13 + ,12 + ,11 + ,13 + ,60 + ,2010 + ,32 + ,31 + ,16 + ,12 + ,12 + ,11 + ,75 + ,2010 + ,35 + ,32 + ,13 + ,9 + ,9 + ,19 + ,73 + ,2011 + ,38 + ,39 + ,10 + ,7 + ,16 + ,12 + ,85 + ,2011 + ,42 + ,37 + ,15 + ,13 + ,13 + ,17 + ,79 + ,2011 + ,34 + ,38 + ,16 + ,9 + ,16 + ,9 + ,71 + ,2011 + ,35 + ,39 + ,16 + ,6 + ,12 + ,12 + ,72 + ,2011 + ,35 + ,34 + ,14 + ,8 + ,9 + ,19 + ,69 + ,2011 + ,33 + ,31 + ,10 + ,8 + ,13 + ,18 + ,78 + ,2011 + ,36 + ,32 + ,17 + ,15 + ,13 + ,15 + ,54 + ,2011 + ,32 + ,37 + ,13 + ,6 + ,14 + ,14 + ,69 + ,2011 + ,33 + ,36 + ,15 + ,9 + ,19 + ,11 + ,81 + ,2011 + ,34 + ,32 + ,16 + ,11 + ,13 + ,9 + ,84 + ,2011 + ,32 + ,35 + ,12 + ,8 + ,12 + ,18 + ,84 + ,2011 + ,34 + ,36 + ,13 + ,8 + ,13 + ,16 + ,69) + ,dim=c(8 + ,162) + ,dimnames=list(c('Jaar' + ,'Connected' + ,'Separate' + ,'Learning' + ,'Software' + ,'Happiness' + ,'Depression' + ,'Belonging ') + ,1:162)) > y <- array(NA,dim=c(8,162),dimnames=list(c('Jaar','Connected','Separate','Learning','Software','Happiness','Depression','Belonging '),1:162)) > for (i in 1:dim(x)[1]) + { + for (j in 1:dim(x)[2]) + { + y[i,j] <- as.numeric(x[i,j]) + } + } > par3 = 'No Linear Trend' > par2 = 'Do not include Seasonal Dummies' > par1 = '4' > par3 <- 'No Linear Trend' > par2 <- 'Do not include Seasonal Dummies' > par1 <- '4' > #'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 Jaar Connected Separate Software Happiness Depression Belonging\r 1 13 2000 41 38 12 14 12 53 2 16 2000 39 32 11 18 11 86 3 19 2000 30 35 15 11 14 66 4 15 2000 31 33 6 12 12 67 5 14 2000 34 37 13 16 21 76 6 13 2000 35 29 10 18 12 78 7 19 2000 39 31 12 14 22 53 8 15 2000 34 36 14 14 11 80 9 14 2000 36 35 12 15 10 74 10 15 2000 37 38 6 15 13 76 11 16 2000 38 31 10 17 10 79 12 16 2000 36 34 12 19 8 54 13 16 2000 38 35 12 10 15 67 14 16 2001 39 38 11 16 14 54 15 17 2001 33 37 15 18 10 87 16 15 2001 32 33 12 14 14 58 17 15 2001 36 32 10 14 14 75 18 20 2001 38 38 12 17 11 88 19 18 2001 39 38 11 14 10 64 20 16 2001 32 32 12 16 13 57 21 16 2001 32 33 11 18 7 66 22 16 2001 31 31 12 11 14 68 23 19 2001 39 38 13 14 12 54 24 16 2001 37 39 11 12 14 56 25 17 2001 39 32 9 17 11 86 26 17 2001 41 32 13 9 9 80 27 16 2002 36 35 10 16 11 76 28 15 2002 33 37 14 14 15 69 29 16 2002 33 33 12 15 14 78 30 14 2002 34 33 10 11 13 67 31 15 2002 31 28 12 16 9 80 32 12 2002 27 32 8 13 15 54 33 14 2002 37 31 10 17 10 71 34 16 2002 34 37 12 15 11 84 35 14 2002 34 30 12 14 13 74 36 7 2002 32 33 7 16 8 71 37 10 2002 29 31 6 9 20 63 38 14 2002 36 33 12 15 12 71 39 16 2002 29 31 10 17 10 76 40 16 2003 35 33 10 13 10 69 41 16 2003 37 32 10 15 9 74 42 14 2003 34 33 12 16 14 75 43 20 2003 38 32 15 16 8 54 44 14 2003 35 33 10 12 14 52 45 14 2003 38 28 10 12 11 69 46 11 2003 37 35 12 11 13 68 47 14 2003 38 39 13 15 9 65 48 15 2003 33 34 11 15 11 75 49 16 2003 36 38 11 17 15 74 50 14 2003 38 32 12 13 11 75 51 16 2003 32 38 14 16 10 72 52 14 2003 32 30 10 14 14 67 53 12 2004 32 33 12 11 18 63 54 16 2004 34 38 13 12 14 62 55 9 2004 32 32 5 12 11 63 56 14 2004 37 32 6 15 12 76 57 16 2004 39 34 12 16 13 74 58 16 2004 29 34 12 15 9 67 59 15 2004 37 36 11 12 10 73 60 16 2004 35 34 10 12 15 70 61 12 2004 30 28 7 8 20 53 62 16 2004 38 34 12 13 12 77 63 16 2004 34 35 14 11 12 77 64 14 2004 31 35 11 14 14 52 65 16 2004 34 31 12 15 13 54 66 17 2004 35 37 13 10 11 80 67 18 2005 36 35 14 11 17 66 68 18 2005 30 27 11 12 12 73 69 12 2005 39 40 12 15 13 63 70 16 2005 35 37 12 15 14 69 71 10 2005 38 36 8 14 13 67 72 14 2005 31 38 11 16 15 54 73 18 2005 34 39 14 15 13 81 74 18 2005 38 41 14 15 10 69 75 16 2005 34 27 12 13 11 84 76 17 2005 39 30 9 12 19 80 77 16 2005 37 37 13 17 13 70 78 16 2005 34 31 11 13 17 69 79 13 2005 28 31 12 15 13 77 80 16 2005 37 27 12 13 9 54 81 16 2006 33 36 12 15 11 79 82 20 2006 37 38 12 16 10 30 83 16 2006 35 37 12 15 9 71 84 15 2006 37 33 12 16 12 73 85 15 2006 32 34 11 15 12 72 86 16 2006 33 31 10 14 13 77 87 14 2006 38 39 9 15 13 75 88 16 2006 33 34 12 14 12 69 89 16 2006 29 32 12 13 15 54 90 15 2006 33 33 12 7 22 70 91 12 2006 31 36 9 17 13 73 92 17 2006 36 32 15 13 15 54 93 16 2006 35 41 12 15 13 77 94 15 2006 32 28 12 14 15 82 95 13 2007 29 30 12 13 10 80 96 16 2007 39 36 10 16 11 80 97 16 2007 37 35 13 12 16 69 98 16 2007 35 31 9 14 11 78 99 16 2007 37 34 12 17 11 81 100 14 2007 32 36 10 15 10 76 101 16 2007 38 36 14 17 10 76 102 16 2007 37 35 11 12 16 73 103 20 2007 36 37 15 16 12 85 104 15 2007 32 28 11 11 11 66 105 16 2007 33 39 11 15 16 79 106 13 2007 40 32 12 9 19 68 107 17 2007 38 35 12 16 11 76 108 16 2007 41 39 12 15 16 71 109 16 2008 36 35 11 10 15 54 110 12 2008 43 42 7 10 24 46 111 16 2008 30 34 12 15 14 82 112 16 2008 31 33 14 11 15 74 113 17 2008 32 41 11 13 11 88 114 13 2008 32 33 11 14 15 38 115 12 2008 37 34 10 18 12 76 116 18 2008 37 32 13 16 10 86 117 14 2008 33 40 13 14 14 54 118 14 2008 34 40 8 14 13 70 119 13 2008 33 35 11 14 9 69 120 16 2008 38 36 12 14 15 90 121 13 2008 33 37 11 12 15 54 122 16 2008 31 27 13 14 14 76 123 13 2009 38 39 12 15 11 89 124 16 2009 37 38 14 15 8 76 125 15 2009 33 31 13 15 11 73 126 16 2009 31 33 15 13 11 79 127 15 2009 39 32 10 17 8 90 128 17 2009 44 39 11 17 10 74 129 15 2009 33 36 9 19 11 81 130 12 2009 35 33 11 15 13 72 131 16 2009 32 33 10 13 11 71 132 10 2009 28 32 11 9 20 66 133 16 2009 40 37 8 15 10 77 134 12 2009 27 30 11 15 15 65 135 14 2009 37 38 12 15 12 74 136 15 2009 32 29 12 16 14 82 137 13 2010 28 22 9 11 23 54 138 15 2010 34 35 11 14 14 63 139 11 2010 30 35 10 11 16 54 140 12 2010 35 34 8 15 11 64 141 8 2010 31 35 9 13 12 69 142 16 2010 32 34 8 15 10 54 143 15 2010 30 34 9 16 14 84 144 17 2010 30 35 15 14 12 86 145 16 2010 31 23 11 15 12 77 146 10 2010 40 31 8 16 11 89 147 18 2010 32 27 13 16 12 76 148 13 2010 36 36 12 11 13 60 149 16 2010 32 31 12 12 11 75 150 13 2010 35 32 9 9 19 73 151 10 2011 38 39 7 16 12 85 152 15 2011 42 37 13 13 17 79 153 16 2011 34 38 9 16 9 71 154 16 2011 35 39 6 12 12 72 155 14 2011 35 34 8 9 19 69 156 10 2011 33 31 8 13 18 78 157 17 2011 36 32 15 13 15 54 158 13 2011 32 37 6 14 14 69 159 15 2011 33 36 9 19 11 81 160 16 2011 34 32 11 13 9 84 161 12 2011 32 35 8 12 18 84 162 13 2011 34 36 8 13 16 69 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) Jaar Connected Separate Software 118.587702 -0.056289 0.107232 -0.017332 0.533475 Happiness Depression `Belonging\\r` 0.055998 -0.070137 0.004976 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -6.1799 -1.1097 0.2409 1.1220 4.2727 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 118.587702 89.533399 1.325 0.1873 Jaar -0.056289 0.044646 -1.261 0.2093 Connected 0.107232 0.047160 2.274 0.0244 * Separate -0.017332 0.044810 -0.387 0.6995 Software 0.533475 0.069310 7.697 1.56e-12 *** Happiness 0.055998 0.076251 0.734 0.4638 Depression -0.070137 0.055997 -1.253 0.2123 `Belonging\\r` 0.004976 0.014654 0.340 0.7347 --- 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.3315 F-statistic: 12.4 on 7 and 154 DF, p-value: 1.53e-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.44856451 0.89712903 0.55143549 [2,] 0.90467547 0.19064906 0.09532453 [3,] 0.84539413 0.30921173 0.15460587 [4,] 0.76221550 0.47556899 0.23778450 [5,] 0.68586932 0.62826135 0.31413068 [6,] 0.74730031 0.50539937 0.25269969 [7,] 0.68284052 0.63431897 0.31715948 [8,] 0.88608547 0.22782907 0.11391453 [9,] 0.86546522 0.26906956 0.13453478 [10,] 0.81536919 0.36926161 0.18463081 [11,] 0.75771876 0.48456248 0.24228124 [12,] 0.70886917 0.58226166 0.29113083 [13,] 0.69760189 0.60479622 0.30239811 [14,] 0.65296050 0.69407899 0.34703950 [15,] 0.60053180 0.79893640 0.39946820 [16,] 0.55054988 0.89890023 0.44945012 [17,] 0.51802406 0.96395187 0.48197594 [18,] 0.56259977 0.87480046 0.43740023 [19,] 0.50240473 0.99519055 0.49759527 [20,] 0.51020178 0.97959643 0.48979822 [21,] 0.45280734 0.90561468 0.54719266 [22,] 0.43917929 0.87835859 0.56082071 [23,] 0.41689799 0.83379597 0.58310201 [24,] 0.35789678 0.71579355 0.64210322 [25,] 0.33802689 0.67605377 0.66197311 [26,] 0.83753697 0.32492606 0.16246303 [27,] 0.82271086 0.35457828 0.17728914 [28,] 0.81059372 0.37881256 0.18940628 [29,] 0.83416239 0.33167522 0.16583761 [30,] 0.82567865 0.34864269 0.17432135 [31,] 0.80072132 0.39855736 0.19927868 [32,] 0.77966298 0.44067404 0.22033702 [33,] 0.79809885 0.40380229 0.20190115 [34,] 0.76061952 0.47876095 0.23938048 [35,] 0.72821286 0.54357427 0.27178714 [36,] 0.88709039 0.22581922 0.11290961 [37,] 0.89825416 0.20349168 0.10174584 [38,] 0.87663984 0.24672032 0.12336016 [39,] 0.85938481 0.28123037 0.14061519 [40,] 0.85483157 0.29033686 0.14516843 [41,] 0.82653272 0.34693456 0.17346728 [42,] 0.79418026 0.41163948 0.20581974 [43,] 0.80454897 0.39090207 0.19545103 [44,] 0.78020578 0.43958845 0.21979422 [45,] 0.79661547 0.40676906 0.20338453 [46,] 0.78971672 0.42056656 0.21028328 [47,] 0.75428832 0.49142337 0.24571168 [48,] 0.74258506 0.51482988 0.25741494 [49,] 0.70759214 0.58481572 0.29240786 [50,] 0.71335367 0.57329266 0.28664633 [51,] 0.67796788 0.64406423 0.32203212 [52,] 0.63652597 0.72694805 0.36347403 [53,] 0.59662588 0.80674825 0.40337412 [54,] 0.55336260 0.89327480 0.44663740 [55,] 0.51392560 0.97214880 0.48607440 [56,] 0.48673383 0.97346766 0.51326617 [57,] 0.48561105 0.97122209 0.51438895 [58,] 0.60919102 0.78161797 0.39080898 [59,] 0.73377031 0.53245938 0.26622969 [60,] 0.70032583 0.59934834 0.29967417 [61,] 0.80305157 0.39389686 0.19694843 [62,] 0.77326177 0.45347646 0.22673823 [63,] 0.76466434 0.47067131 0.23533566 [64,] 0.74186242 0.51627516 0.25813758 [65,] 0.70305082 0.59389836 0.29694918 [66,] 0.75229817 0.49540365 0.24770183 [67,] 0.71556601 0.56886799 0.28443399 [68,] 0.69344766 0.61310469 0.30655234 [69,] 0.70157484 0.59685032 0.29842516 [70,] 0.66332095 0.67335810 0.33667905 [71,] 0.62482583 0.75034833 0.37517417 [72,] 0.78910146 0.42179708 0.21089854 [73,] 0.75456311 0.49087378 0.24543689 [74,] 0.72712258 0.54575483 0.27287742 [75,] 0.68752498 0.62495004 0.31247502 [76,] 0.67360958 0.65278084 0.32639042 [77,] 0.63139984 0.73720032 0.36860016 [78,] 0.58975746 0.82048508 0.41024254 [79,] 0.56610541 0.86778917 0.43389459 [80,] 0.52781892 0.94436215 0.47218108 [81,] 0.52006324 0.95987353 0.47993676 [82,] 0.47911181 0.95822363 0.52088819 [83,] 0.43562497 0.87124993 0.56437503 [84,] 0.39063538 0.78127075 0.60936462 [85,] 0.41423077 0.82846154 0.58576923 [86,] 0.37695668 0.75391336 0.62304332 [87,] 0.33514619 0.67029237 0.66485381 [88,] 0.32806453 0.65612907 0.67193547 [89,] 0.28581408 0.57162815 0.71418592 [90,] 0.25134590 0.50269180 0.74865410 [91,] 0.22848911 0.45697822 0.77151089 [92,] 0.20810734 0.41621468 0.79189266 [93,] 0.25034453 0.50068907 0.74965547 [94,] 0.21337430 0.42674860 0.78662570 [95,] 0.20592115 0.41184230 0.79407885 [96,] 0.21758668 0.43517336 0.78241332 [97,] 0.19534382 0.39068764 0.80465618 [98,] 0.17405977 0.34811954 0.82594023 [99,] 0.16907583 0.33815166 0.83092417 [100,] 0.16443265 0.32886531 0.83556735 [101,] 0.14914779 0.29829557 0.85085221 [102,] 0.12693336 0.25386671 0.87306664 [103,] 0.15998773 0.31997546 0.84001227 [104,] 0.13743665 0.27487330 0.86256335 [105,] 0.15917855 0.31835709 0.84082145 [106,] 0.15920552 0.31841105 0.84079448 [107,] 0.13617757 0.27235515 0.86382243 [108,] 0.13122485 0.26244970 0.86877515 [109,] 0.12258262 0.24516525 0.87741738 [110,] 0.13602503 0.27205006 0.86397497 [111,] 0.11220773 0.22441546 0.88779227 [112,] 0.10172289 0.20344577 0.89827711 [113,] 0.10146992 0.20293984 0.89853008 [114,] 0.08077705 0.16155410 0.91922295 [115,] 0.06391353 0.12782706 0.93608647 [116,] 0.04834892 0.09669785 0.95165108 [117,] 0.03563036 0.07126072 0.96436964 [118,] 0.03523792 0.07047584 0.96476208 [119,] 0.03304171 0.06608341 0.96695829 [120,] 0.03374159 0.06748319 0.96625841 [121,] 0.03657729 0.07315458 0.96342271 [122,] 0.03886152 0.07772303 0.96113848 [123,] 0.09051908 0.18103816 0.90948092 [124,] 0.08373383 0.16746765 0.91626617 [125,] 0.06963233 0.13926466 0.93036767 [126,] 0.06146945 0.12293889 0.93853055 [127,] 0.04417369 0.08834739 0.95582631 [128,] 0.03600232 0.07200463 0.96399768 [129,] 0.04361490 0.08722981 0.95638510 [130,] 0.03126021 0.06252043 0.96873979 [131,] 0.49244757 0.98489515 0.50755243 [132,] 0.44400403 0.88800806 0.55599597 [133,] 0.42654113 0.85308225 0.57345887 [134,] 0.34122335 0.68244671 0.65877665 [135,] 0.27603125 0.55206250 0.72396875 [136,] 0.24631868 0.49263735 0.75368132 [137,] 0.38151753 0.76303507 0.61848247 [138,] 0.69400748 0.61198505 0.30599252 [139,] 0.61406156 0.77187688 0.38593844 [140,] 0.46668283 0.93336567 0.53331717 [141,] 0.70594139 0.58811723 0.29405861 > postscript(file="/var/wessaorg/rcomp/tmp/1zvvi1355680853.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/2qb6w1355680853.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/3s4a61355680853.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/4ln6y1355680853.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/508n21355680853.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.356142995 -0.170517999 2.414571606 2.872702713 -1.751525104 -2.150169015 7 8 9 10 11 12 3.438374289 -1.911613038 -2.172739899 2.173334080 0.473546592 -0.454826450 13 14 15 16 17 18 0.278303230 0.471387289 -0.593194630 -0.306030519 0.230076219 3.609563447 19 20 21 22 23 24 2.253077294 0.499480105 0.472685393 0.884775930 2.376158331 0.917222741 25 26 27 28 29 30 2.008718413 -0.002082411 1.010975516 -1.339191169 0.487516672 -0.344179277 31 32 33 34 35 36 -0.801314515 -0.450977794 -1.266839867 0.209345262 -1.665946833 -6.179870832 37 38 39 40 41 42 -1.085923770 -1.939624076 1.566135215 1.272518105 0.833711923 -1.604497546 43 44 45 46 47 48 2.032481994 -0.306348905 -1.009699157 -4.646847904 -2.707843237 -0.100873958 49 50 51 52 53 54 0.820287088 -2.093174264 -0.635949549 -0.223278480 -2.713498850 0.293648428 55 56 57 58 59 60 -2.543466314 1.224361562 -0.132197444 0.750395951 -0.331041214 1.747848111 61 62 63 64 65 66 0.439706019 0.057963773 -0.450732107 -0.431941505 0.507475782 0.981108008 67 68 69 70 71 72 1.796512215 3.460159699 -3.861190012 0.556025765 -3.653289316 -0.375467808 73 74 75 76 77 78 1.501126067 0.956157276 0.316891296 3.070152942 -0.379021422 1.415151339 79 80 81 82 83 84 -1.907284441 0.004189141 0.549277649 4.272682766 0.251675686 -0.887650472 85 86 87 88 89 90 0.260287718 1.735793823 -0.174283645 0.690505880 1.425813579 0.761559369 91 92 93 94 95 96 -1.577701654 0.074767370 0.571698390 -0.160522068 -2.032613812 0.968152787 97 98 99 100 101 102 0.194270480 1.965843503 0.020029506 -0.275462987 -1.164748405 1.241317983 103 104 105 106 107 108 2.685064114 0.396294780 1.541723357 -2.262562228 1.011005348 0.190200114 109 110 111 112 113 114 1.541232840 -0.283125672 1.144372312 0.286793286 2.456434805 -1.208886125 115 116 117 118 119 120 -2.817714534 1.469162535 -1.411493623 0.998902463 -1.856522932 0.407513127 121 122 123 124 125 126 -1.214405047 0.468196295 -2.815775940 -0.938555553 -0.872135787 -0.607816907 127 128 129 130 131 132 -0.304762643 0.966809678 1.084625234 -2.839735463 1.992130861 -3.249641875 133 134 135 136 137 138 2.058567001 -1.858772987 -1.581104512 -0.156458130 0.858404618 0.529363657 139 140 141 142 143 144 -2.155185719 -1.266160772 -5.196122175 3.035152528 1.791425163 0.569676853 145 146 147 148 149 150 1.377148549 -4.034701341 2.221270949 -2.088459839 0.982902044 0.018008543 151 152 153 154 155 156 -3.001782178 -1.117686536 2.202108689 4.142062138 1.662337561 -2.514103500 157 158 159 160 161 162 0.356210329 1.472299760 1.197202417 1.134480609 -0.311401205 0.369828017 > postscript(file="/var/wessaorg/rcomp/tmp/6ijwf1355680853.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.356142995 NA 1 -0.170517999 -3.356142995 2 2.414571606 -0.170517999 3 2.872702713 2.414571606 4 -1.751525104 2.872702713 5 -2.150169015 -1.751525104 6 3.438374289 -2.150169015 7 -1.911613038 3.438374289 8 -2.172739899 -1.911613038 9 2.173334080 -2.172739899 10 0.473546592 2.173334080 11 -0.454826450 0.473546592 12 0.278303230 -0.454826450 13 0.471387289 0.278303230 14 -0.593194630 0.471387289 15 -0.306030519 -0.593194630 16 0.230076219 -0.306030519 17 3.609563447 0.230076219 18 2.253077294 3.609563447 19 0.499480105 2.253077294 20 0.472685393 0.499480105 21 0.884775930 0.472685393 22 2.376158331 0.884775930 23 0.917222741 2.376158331 24 2.008718413 0.917222741 25 -0.002082411 2.008718413 26 1.010975516 -0.002082411 27 -1.339191169 1.010975516 28 0.487516672 -1.339191169 29 -0.344179277 0.487516672 30 -0.801314515 -0.344179277 31 -0.450977794 -0.801314515 32 -1.266839867 -0.450977794 33 0.209345262 -1.266839867 34 -1.665946833 0.209345262 35 -6.179870832 -1.665946833 36 -1.085923770 -6.179870832 37 -1.939624076 -1.085923770 38 1.566135215 -1.939624076 39 1.272518105 1.566135215 40 0.833711923 1.272518105 41 -1.604497546 0.833711923 42 2.032481994 -1.604497546 43 -0.306348905 2.032481994 44 -1.009699157 -0.306348905 45 -4.646847904 -1.009699157 46 -2.707843237 -4.646847904 47 -0.100873958 -2.707843237 48 0.820287088 -0.100873958 49 -2.093174264 0.820287088 50 -0.635949549 -2.093174264 51 -0.223278480 -0.635949549 52 -2.713498850 -0.223278480 53 0.293648428 -2.713498850 54 -2.543466314 0.293648428 55 1.224361562 -2.543466314 56 -0.132197444 1.224361562 57 0.750395951 -0.132197444 58 -0.331041214 0.750395951 59 1.747848111 -0.331041214 60 0.439706019 1.747848111 61 0.057963773 0.439706019 62 -0.450732107 0.057963773 63 -0.431941505 -0.450732107 64 0.507475782 -0.431941505 65 0.981108008 0.507475782 66 1.796512215 0.981108008 67 3.460159699 1.796512215 68 -3.861190012 3.460159699 69 0.556025765 -3.861190012 70 -3.653289316 0.556025765 71 -0.375467808 -3.653289316 72 1.501126067 -0.375467808 73 0.956157276 1.501126067 74 0.316891296 0.956157276 75 3.070152942 0.316891296 76 -0.379021422 3.070152942 77 1.415151339 -0.379021422 78 -1.907284441 1.415151339 79 0.004189141 -1.907284441 80 0.549277649 0.004189141 81 4.272682766 0.549277649 82 0.251675686 4.272682766 83 -0.887650472 0.251675686 84 0.260287718 -0.887650472 85 1.735793823 0.260287718 86 -0.174283645 1.735793823 87 0.690505880 -0.174283645 88 1.425813579 0.690505880 89 0.761559369 1.425813579 90 -1.577701654 0.761559369 91 0.074767370 -1.577701654 92 0.571698390 0.074767370 93 -0.160522068 0.571698390 94 -2.032613812 -0.160522068 95 0.968152787 -2.032613812 96 0.194270480 0.968152787 97 1.965843503 0.194270480 98 0.020029506 1.965843503 99 -0.275462987 0.020029506 100 -1.164748405 -0.275462987 101 1.241317983 -1.164748405 102 2.685064114 1.241317983 103 0.396294780 2.685064114 104 1.541723357 0.396294780 105 -2.262562228 1.541723357 106 1.011005348 -2.262562228 107 0.190200114 1.011005348 108 1.541232840 0.190200114 109 -0.283125672 1.541232840 110 1.144372312 -0.283125672 111 0.286793286 1.144372312 112 2.456434805 0.286793286 113 -1.208886125 2.456434805 114 -2.817714534 -1.208886125 115 1.469162535 -2.817714534 116 -1.411493623 1.469162535 117 0.998902463 -1.411493623 118 -1.856522932 0.998902463 119 0.407513127 -1.856522932 120 -1.214405047 0.407513127 121 0.468196295 -1.214405047 122 -2.815775940 0.468196295 123 -0.938555553 -2.815775940 124 -0.872135787 -0.938555553 125 -0.607816907 -0.872135787 126 -0.304762643 -0.607816907 127 0.966809678 -0.304762643 128 1.084625234 0.966809678 129 -2.839735463 1.084625234 130 1.992130861 -2.839735463 131 -3.249641875 1.992130861 132 2.058567001 -3.249641875 133 -1.858772987 2.058567001 134 -1.581104512 -1.858772987 135 -0.156458130 -1.581104512 136 0.858404618 -0.156458130 137 0.529363657 0.858404618 138 -2.155185719 0.529363657 139 -1.266160772 -2.155185719 140 -5.196122175 -1.266160772 141 3.035152528 -5.196122175 142 1.791425163 3.035152528 143 0.569676853 1.791425163 144 1.377148549 0.569676853 145 -4.034701341 1.377148549 146 2.221270949 -4.034701341 147 -2.088459839 2.221270949 148 0.982902044 -2.088459839 149 0.018008543 0.982902044 150 -3.001782178 0.018008543 151 -1.117686536 -3.001782178 152 2.202108689 -1.117686536 153 4.142062138 2.202108689 154 1.662337561 4.142062138 155 -2.514103500 1.662337561 156 0.356210329 -2.514103500 157 1.472299760 0.356210329 158 1.197202417 1.472299760 159 1.134480609 1.197202417 160 -0.311401205 1.134480609 161 0.369828017 -0.311401205 162 NA 0.369828017 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -0.170517999 -3.356142995 [2,] 2.414571606 -0.170517999 [3,] 2.872702713 2.414571606 [4,] -1.751525104 2.872702713 [5,] -2.150169015 -1.751525104 [6,] 3.438374289 -2.150169015 [7,] -1.911613038 3.438374289 [8,] -2.172739899 -1.911613038 [9,] 2.173334080 -2.172739899 [10,] 0.473546592 2.173334080 [11,] -0.454826450 0.473546592 [12,] 0.278303230 -0.454826450 [13,] 0.471387289 0.278303230 [14,] -0.593194630 0.471387289 [15,] -0.306030519 -0.593194630 [16,] 0.230076219 -0.306030519 [17,] 3.609563447 0.230076219 [18,] 2.253077294 3.609563447 [19,] 0.499480105 2.253077294 [20,] 0.472685393 0.499480105 [21,] 0.884775930 0.472685393 [22,] 2.376158331 0.884775930 [23,] 0.917222741 2.376158331 [24,] 2.008718413 0.917222741 [25,] -0.002082411 2.008718413 [26,] 1.010975516 -0.002082411 [27,] -1.339191169 1.010975516 [28,] 0.487516672 -1.339191169 [29,] -0.344179277 0.487516672 [30,] -0.801314515 -0.344179277 [31,] -0.450977794 -0.801314515 [32,] -1.266839867 -0.450977794 [33,] 0.209345262 -1.266839867 [34,] -1.665946833 0.209345262 [35,] -6.179870832 -1.665946833 [36,] -1.085923770 -6.179870832 [37,] -1.939624076 -1.085923770 [38,] 1.566135215 -1.939624076 [39,] 1.272518105 1.566135215 [40,] 0.833711923 1.272518105 [41,] -1.604497546 0.833711923 [42,] 2.032481994 -1.604497546 [43,] -0.306348905 2.032481994 [44,] -1.009699157 -0.306348905 [45,] -4.646847904 -1.009699157 [46,] -2.707843237 -4.646847904 [47,] -0.100873958 -2.707843237 [48,] 0.820287088 -0.100873958 [49,] -2.093174264 0.820287088 [50,] -0.635949549 -2.093174264 [51,] -0.223278480 -0.635949549 [52,] -2.713498850 -0.223278480 [53,] 0.293648428 -2.713498850 [54,] -2.543466314 0.293648428 [55,] 1.224361562 -2.543466314 [56,] -0.132197444 1.224361562 [57,] 0.750395951 -0.132197444 [58,] -0.331041214 0.750395951 [59,] 1.747848111 -0.331041214 [60,] 0.439706019 1.747848111 [61,] 0.057963773 0.439706019 [62,] -0.450732107 0.057963773 [63,] -0.431941505 -0.450732107 [64,] 0.507475782 -0.431941505 [65,] 0.981108008 0.507475782 [66,] 1.796512215 0.981108008 [67,] 3.460159699 1.796512215 [68,] -3.861190012 3.460159699 [69,] 0.556025765 -3.861190012 [70,] -3.653289316 0.556025765 [71,] -0.375467808 -3.653289316 [72,] 1.501126067 -0.375467808 [73,] 0.956157276 1.501126067 [74,] 0.316891296 0.956157276 [75,] 3.070152942 0.316891296 [76,] -0.379021422 3.070152942 [77,] 1.415151339 -0.379021422 [78,] -1.907284441 1.415151339 [79,] 0.004189141 -1.907284441 [80,] 0.549277649 0.004189141 [81,] 4.272682766 0.549277649 [82,] 0.251675686 4.272682766 [83,] -0.887650472 0.251675686 [84,] 0.260287718 -0.887650472 [85,] 1.735793823 0.260287718 [86,] -0.174283645 1.735793823 [87,] 0.690505880 -0.174283645 [88,] 1.425813579 0.690505880 [89,] 0.761559369 1.425813579 [90,] -1.577701654 0.761559369 [91,] 0.074767370 -1.577701654 [92,] 0.571698390 0.074767370 [93,] -0.160522068 0.571698390 [94,] -2.032613812 -0.160522068 [95,] 0.968152787 -2.032613812 [96,] 0.194270480 0.968152787 [97,] 1.965843503 0.194270480 [98,] 0.020029506 1.965843503 [99,] -0.275462987 0.020029506 [100,] -1.164748405 -0.275462987 [101,] 1.241317983 -1.164748405 [102,] 2.685064114 1.241317983 [103,] 0.396294780 2.685064114 [104,] 1.541723357 0.396294780 [105,] -2.262562228 1.541723357 [106,] 1.011005348 -2.262562228 [107,] 0.190200114 1.011005348 [108,] 1.541232840 0.190200114 [109,] -0.283125672 1.541232840 [110,] 1.144372312 -0.283125672 [111,] 0.286793286 1.144372312 [112,] 2.456434805 0.286793286 [113,] -1.208886125 2.456434805 [114,] -2.817714534 -1.208886125 [115,] 1.469162535 -2.817714534 [116,] -1.411493623 1.469162535 [117,] 0.998902463 -1.411493623 [118,] -1.856522932 0.998902463 [119,] 0.407513127 -1.856522932 [120,] -1.214405047 0.407513127 [121,] 0.468196295 -1.214405047 [122,] -2.815775940 0.468196295 [123,] -0.938555553 -2.815775940 [124,] -0.872135787 -0.938555553 [125,] -0.607816907 -0.872135787 [126,] -0.304762643 -0.607816907 [127,] 0.966809678 -0.304762643 [128,] 1.084625234 0.966809678 [129,] -2.839735463 1.084625234 [130,] 1.992130861 -2.839735463 [131,] -3.249641875 1.992130861 [132,] 2.058567001 -3.249641875 [133,] -1.858772987 2.058567001 [134,] -1.581104512 -1.858772987 [135,] -0.156458130 -1.581104512 [136,] 0.858404618 -0.156458130 [137,] 0.529363657 0.858404618 [138,] -2.155185719 0.529363657 [139,] -1.266160772 -2.155185719 [140,] -5.196122175 -1.266160772 [141,] 3.035152528 -5.196122175 [142,] 1.791425163 3.035152528 [143,] 0.569676853 1.791425163 [144,] 1.377148549 0.569676853 [145,] -4.034701341 1.377148549 [146,] 2.221270949 -4.034701341 [147,] -2.088459839 2.221270949 [148,] 0.982902044 -2.088459839 [149,] 0.018008543 0.982902044 [150,] -3.001782178 0.018008543 [151,] -1.117686536 -3.001782178 [152,] 2.202108689 -1.117686536 [153,] 4.142062138 2.202108689 [154,] 1.662337561 4.142062138 [155,] -2.514103500 1.662337561 [156,] 0.356210329 -2.514103500 [157,] 1.472299760 0.356210329 [158,] 1.197202417 1.472299760 [159,] 1.134480609 1.197202417 [160,] -0.311401205 1.134480609 [161,] 0.369828017 -0.311401205 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -0.170517999 -3.356142995 2 2.414571606 -0.170517999 3 2.872702713 2.414571606 4 -1.751525104 2.872702713 5 -2.150169015 -1.751525104 6 3.438374289 -2.150169015 7 -1.911613038 3.438374289 8 -2.172739899 -1.911613038 9 2.173334080 -2.172739899 10 0.473546592 2.173334080 11 -0.454826450 0.473546592 12 0.278303230 -0.454826450 13 0.471387289 0.278303230 14 -0.593194630 0.471387289 15 -0.306030519 -0.593194630 16 0.230076219 -0.306030519 17 3.609563447 0.230076219 18 2.253077294 3.609563447 19 0.499480105 2.253077294 20 0.472685393 0.499480105 21 0.884775930 0.472685393 22 2.376158331 0.884775930 23 0.917222741 2.376158331 24 2.008718413 0.917222741 25 -0.002082411 2.008718413 26 1.010975516 -0.002082411 27 -1.339191169 1.010975516 28 0.487516672 -1.339191169 29 -0.344179277 0.487516672 30 -0.801314515 -0.344179277 31 -0.450977794 -0.801314515 32 -1.266839867 -0.450977794 33 0.209345262 -1.266839867 34 -1.665946833 0.209345262 35 -6.179870832 -1.665946833 36 -1.085923770 -6.179870832 37 -1.939624076 -1.085923770 38 1.566135215 -1.939624076 39 1.272518105 1.566135215 40 0.833711923 1.272518105 41 -1.604497546 0.833711923 42 2.032481994 -1.604497546 43 -0.306348905 2.032481994 44 -1.009699157 -0.306348905 45 -4.646847904 -1.009699157 46 -2.707843237 -4.646847904 47 -0.100873958 -2.707843237 48 0.820287088 -0.100873958 49 -2.093174264 0.820287088 50 -0.635949549 -2.093174264 51 -0.223278480 -0.635949549 52 -2.713498850 -0.223278480 53 0.293648428 -2.713498850 54 -2.543466314 0.293648428 55 1.224361562 -2.543466314 56 -0.132197444 1.224361562 57 0.750395951 -0.132197444 58 -0.331041214 0.750395951 59 1.747848111 -0.331041214 60 0.439706019 1.747848111 61 0.057963773 0.439706019 62 -0.450732107 0.057963773 63 -0.431941505 -0.450732107 64 0.507475782 -0.431941505 65 0.981108008 0.507475782 66 1.796512215 0.981108008 67 3.460159699 1.796512215 68 -3.861190012 3.460159699 69 0.556025765 -3.861190012 70 -3.653289316 0.556025765 71 -0.375467808 -3.653289316 72 1.501126067 -0.375467808 73 0.956157276 1.501126067 74 0.316891296 0.956157276 75 3.070152942 0.316891296 76 -0.379021422 3.070152942 77 1.415151339 -0.379021422 78 -1.907284441 1.415151339 79 0.004189141 -1.907284441 80 0.549277649 0.004189141 81 4.272682766 0.549277649 82 0.251675686 4.272682766 83 -0.887650472 0.251675686 84 0.260287718 -0.887650472 85 1.735793823 0.260287718 86 -0.174283645 1.735793823 87 0.690505880 -0.174283645 88 1.425813579 0.690505880 89 0.761559369 1.425813579 90 -1.577701654 0.761559369 91 0.074767370 -1.577701654 92 0.571698390 0.074767370 93 -0.160522068 0.571698390 94 -2.032613812 -0.160522068 95 0.968152787 -2.032613812 96 0.194270480 0.968152787 97 1.965843503 0.194270480 98 0.020029506 1.965843503 99 -0.275462987 0.020029506 100 -1.164748405 -0.275462987 101 1.241317983 -1.164748405 102 2.685064114 1.241317983 103 0.396294780 2.685064114 104 1.541723357 0.396294780 105 -2.262562228 1.541723357 106 1.011005348 -2.262562228 107 0.190200114 1.011005348 108 1.541232840 0.190200114 109 -0.283125672 1.541232840 110 1.144372312 -0.283125672 111 0.286793286 1.144372312 112 2.456434805 0.286793286 113 -1.208886125 2.456434805 114 -2.817714534 -1.208886125 115 1.469162535 -2.817714534 116 -1.411493623 1.469162535 117 0.998902463 -1.411493623 118 -1.856522932 0.998902463 119 0.407513127 -1.856522932 120 -1.214405047 0.407513127 121 0.468196295 -1.214405047 122 -2.815775940 0.468196295 123 -0.938555553 -2.815775940 124 -0.872135787 -0.938555553 125 -0.607816907 -0.872135787 126 -0.304762643 -0.607816907 127 0.966809678 -0.304762643 128 1.084625234 0.966809678 129 -2.839735463 1.084625234 130 1.992130861 -2.839735463 131 -3.249641875 1.992130861 132 2.058567001 -3.249641875 133 -1.858772987 2.058567001 134 -1.581104512 -1.858772987 135 -0.156458130 -1.581104512 136 0.858404618 -0.156458130 137 0.529363657 0.858404618 138 -2.155185719 0.529363657 139 -1.266160772 -2.155185719 140 -5.196122175 -1.266160772 141 3.035152528 -5.196122175 142 1.791425163 3.035152528 143 0.569676853 1.791425163 144 1.377148549 0.569676853 145 -4.034701341 1.377148549 146 2.221270949 -4.034701341 147 -2.088459839 2.221270949 148 0.982902044 -2.088459839 149 0.018008543 0.982902044 150 -3.001782178 0.018008543 151 -1.117686536 -3.001782178 152 2.202108689 -1.117686536 153 4.142062138 2.202108689 154 1.662337561 4.142062138 155 -2.514103500 1.662337561 156 0.356210329 -2.514103500 157 1.472299760 0.356210329 158 1.197202417 1.472299760 159 1.134480609 1.197202417 160 -0.311401205 1.134480609 161 0.369828017 -0.311401205 > 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/7b9cz1355680853.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/8kd3q1355680853.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/94wqa1355680853.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/10pt5k1355680853.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/1140711355680853.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/129zdw1355680853.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/13zwbj1355680853.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/14g4jy1355680853.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/15gk4a1355680853.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/160c3m1355680853.tab") + } > > try(system("convert tmp/1zvvi1355680853.ps tmp/1zvvi1355680853.png",intern=TRUE)) character(0) > try(system("convert tmp/2qb6w1355680853.ps tmp/2qb6w1355680853.png",intern=TRUE)) character(0) > try(system("convert tmp/3s4a61355680853.ps tmp/3s4a61355680853.png",intern=TRUE)) character(0) > try(system("convert tmp/4ln6y1355680853.ps tmp/4ln6y1355680853.png",intern=TRUE)) character(0) > try(system("convert tmp/508n21355680853.ps tmp/508n21355680853.png",intern=TRUE)) character(0) > try(system("convert tmp/6ijwf1355680853.ps tmp/6ijwf1355680853.png",intern=TRUE)) character(0) > try(system("convert tmp/7b9cz1355680853.ps tmp/7b9cz1355680853.png",intern=TRUE)) character(0) > try(system("convert tmp/8kd3q1355680853.ps tmp/8kd3q1355680853.png",intern=TRUE)) character(0) > try(system("convert tmp/94wqa1355680853.ps tmp/94wqa1355680853.png",intern=TRUE)) character(0) > try(system("convert tmp/10pt5k1355680853.ps tmp/10pt5k1355680853.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 8.350 0.887 9.382