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(13 + ,12 + ,14 + ,12 + ,53 + ,32 + ,41 + ,38 + ,16 + ,11 + ,18 + ,11 + ,86 + ,51 + ,39 + ,32 + ,19 + ,15 + ,11 + ,14 + ,66 + ,42 + ,30 + ,35 + ,15 + ,6 + ,12 + ,12 + ,67 + ,41 + ,31 + ,33 + ,14 + ,13 + ,16 + ,21 + ,76 + ,46 + ,34 + ,37 + ,13 + ,10 + ,18 + ,12 + ,78 + ,47 + ,35 + ,29 + ,19 + ,12 + ,14 + ,22 + ,53 + ,37 + ,39 + ,31 + ,15 + ,14 + ,14 + ,11 + ,80 + ,49 + ,34 + ,36 + ,14 + ,12 + ,15 + ,10 + ,74 + ,45 + ,36 + ,35 + ,15 + ,6 + ,15 + ,13 + ,76 + ,47 + ,37 + ,38 + ,16 + ,10 + ,17 + ,10 + ,79 + ,49 + ,38 + ,31 + ,16 + ,12 + ,19 + ,8 + ,54 + ,33 + ,36 + ,34 + ,16 + ,12 + ,10 + ,15 + ,67 + ,42 + ,38 + ,35 + ,16 + ,11 + ,16 + ,14 + ,54 + ,33 + ,39 + ,38 + ,17 + ,15 + ,18 + ,10 + ,87 + ,53 + ,33 + ,37 + ,15 + ,12 + ,14 + ,14 + ,58 + ,36 + ,32 + ,33 + ,15 + ,10 + ,14 + ,14 + ,75 + ,45 + ,36 + ,32 + ,20 + ,12 + ,17 + ,11 + ,88 + ,54 + ,38 + ,38 + ,18 + ,11 + ,14 + ,10 + ,64 + ,41 + ,39 + ,38 + ,16 + ,12 + ,16 + ,13 + ,57 + ,36 + ,32 + ,32 + ,16 + ,11 + ,18 + ,7 + ,66 + ,41 + ,32 + ,33 + ,16 + ,12 + ,11 + ,14 + ,68 + ,44 + ,31 + ,31 + ,19 + ,13 + ,14 + ,12 + ,54 + ,33 + ,39 + ,38 + ,16 + ,11 + ,12 + ,14 + ,56 + ,37 + ,37 + ,39 + ,17 + ,9 + ,17 + ,11 + ,86 + ,52 + ,39 + ,32 + ,17 + ,13 + ,9 + ,9 + ,80 + ,47 + ,41 + ,32 + ,16 + ,10 + ,16 + ,11 + ,76 + ,43 + ,36 + ,35 + ,15 + ,14 + ,14 + ,15 + ,69 + ,44 + ,33 + ,37 + ,16 + ,12 + ,15 + ,14 + ,78 + ,45 + ,33 + ,33 + ,14 + ,10 + ,11 + ,13 + ,67 + ,44 + ,34 + ,33 + ,15 + ,12 + ,16 + ,9 + ,80 + ,49 + ,31 + ,28 + ,12 + ,8 + ,13 + ,15 + ,54 + ,33 + ,27 + ,32 + ,14 + ,10 + ,17 + ,10 + ,71 + ,43 + ,37 + ,31 + ,16 + ,12 + ,15 + ,11 + ,84 + ,54 + ,34 + ,37 + ,14 + ,12 + ,14 + ,13 + ,74 + ,42 + ,34 + ,30 + ,7 + ,7 + ,16 + ,8 + ,71 + ,44 + ,32 + ,33 + ,10 + ,6 + ,9 + ,20 + ,63 + ,37 + ,29 + ,31 + ,14 + ,12 + ,15 + ,12 + ,71 + ,43 + ,36 + ,33 + ,16 + ,10 + ,17 + ,10 + ,76 + ,46 + ,29 + ,31 + ,16 + ,10 + ,13 + ,10 + ,69 + ,42 + ,35 + ,33 + ,16 + ,10 + ,15 + ,9 + ,74 + ,45 + ,37 + ,32 + ,14 + ,12 + ,16 + ,14 + ,75 + ,44 + ,34 + ,33 + ,20 + ,15 + ,16 + ,8 + ,54 + ,33 + ,38 + ,32 + ,14 + ,10 + ,12 + ,14 + ,52 + ,31 + ,35 + ,33 + ,14 + ,10 + ,12 + ,11 + ,69 + ,42 + ,38 + ,28 + ,11 + ,12 + ,11 + ,13 + ,68 + ,40 + ,37 + ,35 + ,14 + ,13 + ,15 + ,9 + ,65 + ,43 + ,38 + ,39 + ,15 + ,11 + ,15 + ,11 + ,75 + ,46 + ,33 + ,34 + ,16 + ,11 + ,17 + ,15 + ,74 + ,42 + ,36 + ,38 + ,14 + ,12 + ,13 + ,11 + ,75 + ,45 + ,38 + ,32 + ,16 + ,14 + ,16 + ,10 + ,72 + ,44 + ,32 + ,38 + ,14 + ,10 + ,14 + ,14 + ,67 + ,40 + ,32 + ,30 + ,12 + ,12 + ,11 + ,18 + ,63 + ,37 + ,32 + ,33 + ,16 + ,13 + ,12 + ,14 + ,62 + ,46 + ,34 + ,38 + ,9 + ,5 + ,12 + ,11 + ,63 + ,36 + ,32 + ,32 + ,14 + ,6 + ,15 + ,12 + ,76 + ,47 + ,37 + ,32 + ,16 + ,12 + ,16 + ,13 + ,74 + ,45 + ,39 + ,34 + ,16 + ,12 + ,15 + ,9 + ,67 + ,42 + ,29 + ,34 + ,15 + ,11 + ,12 + ,10 + ,73 + ,43 + ,37 + ,36 + ,16 + ,10 + ,12 + ,15 + ,70 + ,43 + ,35 + ,34 + ,12 + ,7 + ,8 + ,20 + ,53 + ,32 + ,30 + ,28 + ,16 + ,12 + ,13 + ,12 + ,77 + ,45 + ,38 + ,34 + ,16 + ,14 + ,11 + ,12 + ,77 + ,45 + ,34 + ,35 + ,14 + ,11 + ,14 + ,14 + ,52 + ,31 + ,31 + ,35 + ,16 + ,12 + ,15 + ,13 + ,54 + ,33 + ,34 + ,31 + ,17 + ,13 + ,10 + ,11 + ,80 + ,49 + ,35 + ,37 + ,18 + ,14 + ,11 + ,17 + ,66 + ,42 + ,36 + ,35 + ,18 + ,11 + ,12 + ,12 + ,73 + ,41 + ,30 + ,27 + ,12 + ,12 + ,15 + ,13 + ,63 + ,38 + ,39 + ,40 + ,16 + ,12 + ,15 + ,14 + ,69 + ,42 + ,35 + ,37 + ,10 + ,8 + ,14 + ,13 + ,67 + ,44 + ,38 + ,36 + ,14 + ,11 + ,16 + ,15 + ,54 + ,33 + ,31 + ,38 + ,18 + ,14 + ,15 + ,13 + ,81 + ,48 + ,34 + ,39 + ,18 + ,14 + ,15 + ,10 + ,69 + ,40 + ,38 + ,41 + ,16 + ,12 + ,13 + ,11 + ,84 + ,50 + ,34 + ,27 + ,17 + ,9 + ,12 + ,19 + ,80 + ,49 + ,39 + ,30 + ,16 + ,13 + ,17 + ,13 + ,70 + ,43 + ,37 + ,37 + ,16 + ,11 + ,13 + ,17 + ,69 + ,44 + ,34 + ,31 + ,13 + ,12 + ,15 + ,13 + ,77 + ,47 + ,28 + ,31 + ,16 + ,12 + ,13 + ,9 + ,54 + ,33 + ,37 + ,27 + ,16 + ,12 + ,15 + ,11 + ,79 + ,46 + ,33 + ,36 + ,20 + ,12 + ,16 + ,10 + ,30 + ,0 + ,37 + ,38 + ,16 + ,12 + ,15 + ,9 + ,71 + ,45 + ,35 + ,37 + ,15 + ,12 + ,16 + ,12 + ,73 + ,43 + ,37 + ,33 + ,15 + ,11 + ,15 + ,12 + ,72 + ,44 + ,32 + ,34 + ,16 + ,10 + ,14 + ,13 + ,77 + ,47 + ,33 + ,31 + ,14 + ,9 + ,15 + ,13 + ,75 + ,45 + ,38 + ,39 + ,16 + ,12 + ,14 + ,12 + ,69 + ,42 + ,33 + ,34 + ,16 + ,12 + ,13 + ,15 + ,54 + ,33 + ,29 + ,32 + ,15 + ,12 + ,7 + ,22 + ,70 + ,43 + ,33 + ,33 + ,12 + ,9 + ,17 + ,13 + ,73 + ,46 + ,31 + ,36 + ,17 + ,15 + ,13 + ,15 + ,54 + ,33 + ,36 + ,32 + ,16 + ,12 + ,15 + ,13 + ,77 + ,46 + ,35 + ,41 + ,15 + ,12 + ,14 + ,15 + ,82 + ,48 + ,32 + ,28 + ,13 + ,12 + ,13 + ,10 + ,80 + ,47 + ,29 + ,30 + ,16 + ,10 + ,16 + ,11 + ,80 + ,47 + ,39 + ,36 + ,16 + ,13 + ,12 + ,16 + ,69 + ,43 + ,37 + ,35 + ,16 + ,9 + ,14 + ,11 + ,78 + ,46 + ,35 + ,31 + ,16 + ,12 + ,17 + ,11 + ,81 + ,48 + ,37 + ,34 + ,14 + ,10 + ,15 + ,10 + ,76 + ,46 + ,32 + ,36 + ,16 + ,14 + ,17 + ,10 + ,76 + ,45 + ,38 + ,36 + ,16 + ,11 + ,12 + ,16 + ,73 + ,45 + ,37 + ,35 + ,20 + ,15 + ,16 + ,12 + ,85 + ,52 + ,36 + ,37 + ,15 + ,11 + ,11 + ,11 + ,66 + ,42 + ,32 + ,28 + ,16 + ,11 + ,15 + ,16 + ,79 + ,47 + ,33 + ,39 + ,13 + ,12 + ,9 + ,19 + ,68 + ,41 + ,40 + ,32 + ,17 + ,12 + ,16 + ,11 + ,76 + ,47 + ,38 + ,35 + ,16 + ,12 + ,15 + ,16 + ,71 + ,43 + ,41 + ,39 + ,16 + ,11 + ,10 + ,15 + ,54 + ,33 + ,36 + ,35 + ,12 + ,7 + ,10 + ,24 + ,46 + ,30 + ,43 + ,42 + ,16 + ,12 + ,15 + ,14 + ,82 + ,49 + ,30 + ,34 + ,16 + ,14 + ,11 + ,15 + ,74 + ,44 + ,31 + ,33 + ,17 + ,11 + ,13 + ,11 + ,88 + ,55 + ,32 + ,41 + ,13 + ,11 + ,14 + ,15 + ,38 + ,11 + ,32 + ,33 + ,12 + ,10 + ,18 + ,12 + ,76 + ,47 + ,37 + ,34 + ,18 + ,13 + ,16 + ,10 + ,86 + ,53 + ,37 + ,32 + ,14 + ,13 + ,14 + ,14 + ,54 + ,33 + ,33 + ,40 + ,14 + ,8 + ,14 + ,13 + ,70 + ,44 + ,34 + ,40 + ,13 + ,11 + ,14 + ,9 + ,69 + ,42 + ,33 + ,35 + ,16 + ,12 + ,14 + ,15 + ,90 + ,55 + ,38 + ,36 + ,13 + ,11 + ,12 + ,15 + ,54 + ,33 + ,33 + ,37 + ,16 + ,13 + ,14 + ,14 + ,76 + ,46 + ,31 + ,27 + ,13 + ,12 + ,15 + ,11 + ,89 + ,54 + ,38 + ,39 + ,16 + ,14 + ,15 + ,8 + ,76 + ,47 + ,37 + ,38 + ,15 + ,13 + ,15 + ,11 + ,73 + ,45 + ,33 + ,31 + ,16 + ,15 + ,13 + ,11 + ,79 + ,47 + ,31 + ,33 + ,15 + ,10 + ,17 + ,8 + ,90 + ,55 + ,39 + ,32 + ,17 + ,11 + ,17 + ,10 + ,74 + ,44 + ,44 + ,39 + ,15 + ,9 + ,19 + ,11 + ,81 + ,53 + ,33 + ,36 + ,12 + ,11 + ,15 + ,13 + ,72 + ,44 + ,35 + ,33 + ,16 + ,10 + ,13 + ,11 + ,71 + ,42 + ,32 + ,33 + ,10 + ,11 + ,9 + ,20 + ,66 + ,40 + ,28 + ,32 + ,16 + ,8 + ,15 + ,10 + ,77 + ,46 + ,40 + ,37 + ,12 + ,11 + ,15 + ,15 + ,65 + ,40 + ,27 + ,30 + ,14 + ,12 + ,15 + ,12 + ,74 + ,46 + ,37 + ,38 + ,15 + ,12 + ,16 + ,14 + ,82 + ,53 + ,32 + ,29 + ,13 + ,9 + ,11 + ,23 + ,54 + ,33 + ,28 + ,22 + ,15 + ,11 + ,14 + ,14 + ,63 + ,42 + ,34 + ,35 + ,11 + ,10 + ,11 + ,16 + ,54 + ,35 + ,30 + ,35 + ,12 + ,8 + ,15 + ,11 + ,64 + ,40 + ,35 + ,34 + ,8 + ,9 + ,13 + ,12 + ,69 + ,41 + ,31 + ,35 + ,16 + ,8 + ,15 + ,10 + ,54 + ,33 + ,32 + ,34 + ,15 + ,9 + ,16 + ,14 + ,84 + ,51 + ,30 + ,34 + ,17 + ,15 + ,14 + ,12 + ,86 + ,53 + ,30 + ,35 + ,16 + ,11 + ,15 + ,12 + ,77 + ,46 + ,31 + ,23 + ,10 + ,8 + ,16 + ,11 + ,89 + ,55 + ,40 + ,31 + ,18 + ,13 + ,16 + ,12 + ,76 + ,47 + ,32 + ,27 + ,13 + ,12 + ,11 + ,13 + ,60 + ,38 + ,36 + ,36 + ,16 + ,12 + ,12 + ,11 + ,75 + ,46 + ,32 + ,31 + ,13 + ,9 + ,9 + ,19 + ,73 + ,46 + ,35 + ,32 + ,10 + ,7 + ,16 + ,12 + ,85 + ,53 + ,38 + ,39 + ,15 + ,13 + ,13 + ,17 + ,79 + ,47 + ,42 + ,37 + ,16 + ,9 + ,16 + ,9 + ,71 + ,41 + ,34 + ,38 + ,16 + ,6 + ,12 + ,12 + ,72 + ,44 + ,35 + ,39 + ,14 + ,8 + ,9 + ,19 + ,69 + ,43 + ,35 + ,34 + ,10 + ,8 + ,13 + ,18 + ,78 + ,51 + ,33 + ,31 + ,17 + ,15 + ,13 + ,15 + ,54 + ,33 + ,36 + ,32 + ,13 + ,6 + ,14 + ,14 + ,69 + ,43 + ,32 + ,37 + ,15 + ,9 + ,19 + ,11 + ,81 + ,53 + ,33 + ,36 + ,16 + ,11 + ,13 + ,9 + ,84 + ,51 + ,34 + ,32 + ,12 + ,8 + ,12 + ,18 + ,84 + ,50 + ,32 + ,35 + ,13 + ,8 + ,13 + ,16 + ,69 + ,46 + ,34 + ,36) + ,dim=c(8 + ,162) + ,dimnames=list(c('' + ,'Software' + ,'Happiness' + ,'Depression' + ,'Belonging' + ,'Belonging_Final' + ,'Connected' + ,'Seperate') + ,1:162)) > y <- array(NA,dim=c(8,162),dimnames=list(c('','Software','Happiness','Depression','Belonging','Belonging_Final','Connected','Seperate'),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 = '1' > par3 <- 'No Linear Trend' > par2 <- 'Do not include Seasonal Dummies' > par1 <- '1' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Prof. Dr. P. Wessa > #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/ > #Source of accompanying publication: Office for Research, Development, and Education > #Technical description: Write here your technical program description (don't use hard returns!) > library(lattice) > library(lmtest) Loading required package: zoo 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 Software Happiness Depression Belonging Belonging_Final Connected 1 13 12 14 12 53 32 41 2 16 11 18 11 86 51 39 3 19 15 11 14 66 42 30 4 15 6 12 12 67 41 31 5 14 13 16 21 76 46 34 6 13 10 18 12 78 47 35 7 19 12 14 22 53 37 39 8 15 14 14 11 80 49 34 9 14 12 15 10 74 45 36 10 15 6 15 13 76 47 37 11 16 10 17 10 79 49 38 12 16 12 19 8 54 33 36 13 16 12 10 15 67 42 38 14 16 11 16 14 54 33 39 15 17 15 18 10 87 53 33 16 15 12 14 14 58 36 32 17 15 10 14 14 75 45 36 18 20 12 17 11 88 54 38 19 18 11 14 10 64 41 39 20 16 12 16 13 57 36 32 21 16 11 18 7 66 41 32 22 16 12 11 14 68 44 31 23 19 13 14 12 54 33 39 24 16 11 12 14 56 37 37 25 17 9 17 11 86 52 39 26 17 13 9 9 80 47 41 27 16 10 16 11 76 43 36 28 15 14 14 15 69 44 33 29 16 12 15 14 78 45 33 30 14 10 11 13 67 44 34 31 15 12 16 9 80 49 31 32 12 8 13 15 54 33 27 33 14 10 17 10 71 43 37 34 16 12 15 11 84 54 34 35 14 12 14 13 74 42 34 36 7 7 16 8 71 44 32 37 10 6 9 20 63 37 29 38 14 12 15 12 71 43 36 39 16 10 17 10 76 46 29 40 16 10 13 10 69 42 35 41 16 10 15 9 74 45 37 42 14 12 16 14 75 44 34 43 20 15 16 8 54 33 38 44 14 10 12 14 52 31 35 45 14 10 12 11 69 42 38 46 11 12 11 13 68 40 37 47 14 13 15 9 65 43 38 48 15 11 15 11 75 46 33 49 16 11 17 15 74 42 36 50 14 12 13 11 75 45 38 51 16 14 16 10 72 44 32 52 14 10 14 14 67 40 32 53 12 12 11 18 63 37 32 54 16 13 12 14 62 46 34 55 9 5 12 11 63 36 32 56 14 6 15 12 76 47 37 57 16 12 16 13 74 45 39 58 16 12 15 9 67 42 29 59 15 11 12 10 73 43 37 60 16 10 12 15 70 43 35 61 12 7 8 20 53 32 30 62 16 12 13 12 77 45 38 63 16 14 11 12 77 45 34 64 14 11 14 14 52 31 31 65 16 12 15 13 54 33 34 66 17 13 10 11 80 49 35 67 18 14 11 17 66 42 36 68 18 11 12 12 73 41 30 69 12 12 15 13 63 38 39 70 16 12 15 14 69 42 35 71 10 8 14 13 67 44 38 72 14 11 16 15 54 33 31 73 18 14 15 13 81 48 34 74 18 14 15 10 69 40 38 75 16 12 13 11 84 50 34 76 17 9 12 19 80 49 39 77 16 13 17 13 70 43 37 78 16 11 13 17 69 44 34 79 13 12 15 13 77 47 28 80 16 12 13 9 54 33 37 81 16 12 15 11 79 46 33 82 20 12 16 10 30 0 37 83 16 12 15 9 71 45 35 84 15 12 16 12 73 43 37 85 15 11 15 12 72 44 32 86 16 10 14 13 77 47 33 87 14 9 15 13 75 45 38 88 16 12 14 12 69 42 33 89 16 12 13 15 54 33 29 90 15 12 7 22 70 43 33 91 12 9 17 13 73 46 31 92 17 15 13 15 54 33 36 93 16 12 15 13 77 46 35 94 15 12 14 15 82 48 32 95 13 12 13 10 80 47 29 96 16 10 16 11 80 47 39 97 16 13 12 16 69 43 37 98 16 9 14 11 78 46 35 99 16 12 17 11 81 48 37 100 14 10 15 10 76 46 32 101 16 14 17 10 76 45 38 102 16 11 12 16 73 45 37 103 20 15 16 12 85 52 36 104 15 11 11 11 66 42 32 105 16 11 15 16 79 47 33 106 13 12 9 19 68 41 40 107 17 12 16 11 76 47 38 108 16 12 15 16 71 43 41 109 16 11 10 15 54 33 36 110 12 7 10 24 46 30 43 111 16 12 15 14 82 49 30 112 16 14 11 15 74 44 31 113 17 11 13 11 88 55 32 114 13 11 14 15 38 11 32 115 12 10 18 12 76 47 37 116 18 13 16 10 86 53 37 117 14 13 14 14 54 33 33 118 14 8 14 13 70 44 34 119 13 11 14 9 69 42 33 120 16 12 14 15 90 55 38 121 13 11 12 15 54 33 33 122 16 13 14 14 76 46 31 123 13 12 15 11 89 54 38 124 16 14 15 8 76 47 37 125 15 13 15 11 73 45 33 126 16 15 13 11 79 47 31 127 15 10 17 8 90 55 39 128 17 11 17 10 74 44 44 129 15 9 19 11 81 53 33 130 12 11 15 13 72 44 35 131 16 10 13 11 71 42 32 132 10 11 9 20 66 40 28 133 16 8 15 10 77 46 40 134 12 11 15 15 65 40 27 135 14 12 15 12 74 46 37 136 15 12 16 14 82 53 32 137 13 9 11 23 54 33 28 138 15 11 14 14 63 42 34 139 11 10 11 16 54 35 30 140 12 8 15 11 64 40 35 141 8 9 13 12 69 41 31 142 16 8 15 10 54 33 32 143 15 9 16 14 84 51 30 144 17 15 14 12 86 53 30 145 16 11 15 12 77 46 31 146 10 8 16 11 89 55 40 147 18 13 16 12 76 47 32 148 13 12 11 13 60 38 36 149 16 12 12 11 75 46 32 150 13 9 9 19 73 46 35 151 10 7 16 12 85 53 38 152 15 13 13 17 79 47 42 153 16 9 16 9 71 41 34 154 16 6 12 12 72 44 35 155 14 8 9 19 69 43 35 156 10 8 13 18 78 51 33 157 17 15 13 15 54 33 36 158 13 6 14 14 69 43 32 159 15 9 19 11 81 53 33 160 16 11 13 9 84 51 34 161 12 8 12 18 84 50 32 162 13 8 13 16 69 46 34 Seperate 1 38 2 32 3 35 4 33 5 37 6 29 7 31 8 36 9 35 10 38 11 31 12 34 13 35 14 38 15 37 16 33 17 32 18 38 19 38 20 32 21 33 22 31 23 38 24 39 25 32 26 32 27 35 28 37 29 33 30 33 31 28 32 32 33 31 34 37 35 30 36 33 37 31 38 33 39 31 40 33 41 32 42 33 43 32 44 33 45 28 46 35 47 39 48 34 49 38 50 32 51 38 52 30 53 33 54 38 55 32 56 32 57 34 58 34 59 36 60 34 61 28 62 34 63 35 64 35 65 31 66 37 67 35 68 27 69 40 70 37 71 36 72 38 73 39 74 41 75 27 76 30 77 37 78 31 79 31 80 27 81 36 82 38 83 37 84 33 85 34 86 31 87 39 88 34 89 32 90 33 91 36 92 32 93 41 94 28 95 30 96 36 97 35 98 31 99 34 100 36 101 36 102 35 103 37 104 28 105 39 106 32 107 35 108 39 109 35 110 42 111 34 112 33 113 41 114 33 115 34 116 32 117 40 118 40 119 35 120 36 121 37 122 27 123 39 124 38 125 31 126 33 127 32 128 39 129 36 130 33 131 33 132 32 133 37 134 30 135 38 136 29 137 22 138 35 139 35 140 34 141 35 142 34 143 34 144 35 145 23 146 31 147 27 148 36 149 31 150 32 151 39 152 37 153 38 154 39 155 34 156 31 157 32 158 37 159 36 160 32 161 35 162 36 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) Software Happiness Depression 5.51005 0.54256 0.05971 -0.07116 Belonging Belonging_Final Connected Seperate 0.03576 -0.05223 0.11405 -0.02067 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -5.9026 -1.0985 0.1985 1.1037 3.9386 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 5.51005 2.59687 2.122 0.0355 * Software 0.54256 0.06895 7.869 5.9e-13 *** Happiness 0.05971 0.07638 0.782 0.4356 Depression -0.07116 0.05634 -1.263 0.2085 Belonging 0.03576 0.04453 0.803 0.4232 Belonging_Final -0.05223 0.06396 -0.817 0.4154 Connected 0.11405 0.04689 2.432 0.0161 * Seperate -0.02067 0.04481 -0.461 0.6453 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 1.85 on 154 degrees of freedom Multiple R-squared: 0.3567, Adjusted R-squared: 0.3275 F-statistic: 12.2 on 7 and 154 DF, p-value: 2.357e-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.39159274 0.78318547 0.60840726 [2,] 0.62549432 0.74901135 0.37450568 [3,] 0.48670911 0.97341822 0.51329089 [4,] 0.46037903 0.92075807 0.53962097 [5,] 0.35164038 0.70328077 0.64835962 [6,] 0.26714594 0.53429188 0.73285406 [7,] 0.21797197 0.43594394 0.78202803 [8,] 0.41923109 0.83846217 0.58076891 [9,] 0.34207776 0.68415551 0.65792224 [10,] 0.26286710 0.52573420 0.73713290 [11,] 0.20332055 0.40664111 0.79667945 [12,] 0.18552385 0.37104770 0.81447615 [13,] 0.37000980 0.74001961 0.62999020 [14,] 0.40633422 0.81266845 0.59366578 [15,] 0.39534637 0.79069273 0.60465363 [16,] 0.35780658 0.71561317 0.64219342 [17,] 0.41748068 0.83496136 0.58251932 [18,] 0.42373791 0.84747582 0.57626209 [19,] 0.40499458 0.80998916 0.59500542 [20,] 0.44697981 0.89395962 0.55302019 [21,] 0.38896039 0.77792078 0.61103961 [22,] 0.34245154 0.68490307 0.65754846 [23,] 0.31917191 0.63834383 0.68082809 [24,] 0.28603986 0.57207972 0.71396014 [25,] 0.24507328 0.49014656 0.75492672 [26,] 0.82914093 0.34171814 0.17085907 [27,] 0.80277845 0.39444309 0.19722155 [28,] 0.79678649 0.40642701 0.20321351 [29,] 0.81823558 0.36352883 0.18176442 [30,] 0.79979375 0.40041250 0.20020625 [31,] 0.76696936 0.46606127 0.23303064 [32,] 0.74189201 0.51621597 0.25810799 [33,] 0.76721351 0.46557298 0.23278649 [34,] 0.72447243 0.55105513 0.27552757 [35,] 0.69584575 0.60830851 0.30415425 [36,] 0.86170785 0.27658431 0.13829215 [37,] 0.90959795 0.18080410 0.09040205 [38,] 0.88662233 0.22675534 0.11337767 [39,] 0.87065954 0.25868093 0.12934046 [40,] 0.86968555 0.26062891 0.13031445 [41,] 0.84142878 0.31714244 0.15857122 [42,] 0.80892453 0.38215094 0.19107547 [43,] 0.82610056 0.34779888 0.17389944 [44,] 0.81311457 0.37377086 0.18688543 [45,] 0.82701302 0.34597397 0.17298698 [46,] 0.80170663 0.39658675 0.19829337 [47,] 0.76747248 0.46505503 0.23252752 [48,] 0.74405610 0.51188780 0.25594390 [49,] 0.70627687 0.58744626 0.29372313 [50,] 0.70259845 0.59480310 0.29740155 [51,] 0.66452297 0.67095405 0.33547703 [52,] 0.62191824 0.75616353 0.37808176 [53,] 0.58218328 0.83563345 0.41781672 [54,] 0.53472523 0.93054954 0.46527477 [55,] 0.49584330 0.99168661 0.50415670 [56,] 0.46667406 0.93334812 0.53332594 [57,] 0.46372115 0.92744229 0.53627885 [58,] 0.61347894 0.77304212 0.38652106 [59,] 0.72935834 0.54128333 0.27064166 [60,] 0.69440388 0.61119224 0.30559612 [61,] 0.80262952 0.39474095 0.19737048 [62,] 0.76821289 0.46357421 0.23178711 [63,] 0.75866737 0.48266525 0.24133263 [64,] 0.73901560 0.52196879 0.26098440 [65,] 0.69957099 0.60085802 0.30042901 [66,] 0.75085640 0.49828719 0.24914360 [67,] 0.71368595 0.57262810 0.28631405 [68,] 0.70049648 0.59900705 0.29950352 [69,] 0.70634683 0.58730635 0.29365317 [70,] 0.66478008 0.67043984 0.33521992 [71,] 0.62547243 0.74905514 0.37452757 [72,] 0.74964020 0.50071961 0.25035980 [73,] 0.71257853 0.57484295 0.28742147 [74,] 0.68280185 0.63439631 0.31719815 [75,] 0.64073672 0.71852655 0.35926328 [76,] 0.63433147 0.73133706 0.36566853 [77,] 0.58950032 0.82099936 0.41049968 [78,] 0.54961569 0.90076863 0.45038431 [79,] 0.53296106 0.93407788 0.46703894 [80,] 0.49894954 0.99789908 0.50105046 [81,] 0.48002794 0.96005588 0.51997206 [82,] 0.44178065 0.88356129 0.55821935 [83,] 0.39973765 0.79947530 0.60026235 [84,] 0.35767207 0.71534414 0.64232793 [85,] 0.37383999 0.74767999 0.62616001 [86,] 0.33894948 0.67789897 0.66105052 [87,] 0.30119431 0.60238862 0.69880569 [88,] 0.29987885 0.59975770 0.70012115 [89,] 0.26002036 0.52004072 0.73997964 [90,] 0.22445621 0.44891242 0.77554379 [91,] 0.20285474 0.40570947 0.79714526 [92,] 0.18812218 0.37624436 0.81187782 [93,] 0.23142939 0.46285879 0.76857061 [94,] 0.19737412 0.39474824 0.80262588 [95,] 0.19107205 0.38214410 0.80892795 [96,] 0.20360493 0.40720987 0.79639507 [97,] 0.18369426 0.36738852 0.81630574 [98,] 0.16340521 0.32681042 0.83659479 [99,] 0.15704365 0.31408729 0.84295635 [100,] 0.14758145 0.29516290 0.85241855 [101,] 0.13003758 0.26007515 0.86996242 [102,] 0.10807782 0.21615563 0.89192218 [103,] 0.12620747 0.25241495 0.87379253 [104,] 0.11611181 0.23222362 0.88388819 [105,] 0.14804638 0.29609276 0.85195362 [106,] 0.14101835 0.28203670 0.85898165 [107,] 0.12219812 0.24439624 0.87780188 [108,] 0.10584694 0.21169388 0.89415306 [109,] 0.10860531 0.21721063 0.89139469 [110,] 0.10073982 0.20147965 0.89926018 [111,] 0.08513099 0.17026199 0.91486901 [112,] 0.06771939 0.13543877 0.93228061 [113,] 0.07688771 0.15377542 0.92311229 [114,] 0.06138552 0.12277104 0.93861448 [115,] 0.04937173 0.09874346 0.95062827 [116,] 0.03763532 0.07527063 0.96236468 [117,] 0.02818619 0.05637238 0.97181381 [118,] 0.02220529 0.04441057 0.97779471 [119,] 0.01767669 0.03535338 0.98232331 [120,] 0.02474693 0.04949386 0.97525307 [121,] 0.02052937 0.04105874 0.97947063 [122,] 0.03231400 0.06462800 0.96768600 [123,] 0.03349234 0.06698469 0.96650766 [124,] 0.04501108 0.09002216 0.95498892 [125,] 0.03571833 0.07143666 0.96428167 [126,] 0.02452083 0.04904166 0.97547917 [127,] 0.01644191 0.03288382 0.98355809 [128,] 0.01145134 0.02290268 0.98854866 [129,] 0.01871416 0.03742831 0.98128584 [130,] 0.01567360 0.03134719 0.98432640 [131,] 0.61609964 0.76780072 0.38390036 [132,] 0.55528297 0.88943406 0.44471703 [133,] 0.47194886 0.94389773 0.52805114 [134,] 0.39183591 0.78367181 0.60816409 [135,] 0.30519025 0.61038051 0.69480975 [136,] 0.35044474 0.70088948 0.64955526 [137,] 0.30988329 0.61976659 0.69011671 [138,] 0.72321234 0.55357531 0.27678766 [139,] 0.68231323 0.63537353 0.31768677 [140,] 0.54094773 0.91810455 0.45905227 [141,] 0.74596135 0.50807731 0.25403865 > postscript(file="/var/wessaorg/rcomp/tmp/1hafo1351956811.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/2fwiw1351956811.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/3avry1351956811.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/4j5561351956811.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/581u81351956811.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.117601011 0.031409542 2.826208692 3.263872656 -1.452637097 -1.883489323 7 8 9 10 11 12 3.938638684 -1.594411390 -1.883298629 2.566461096 0.801769700 -0.196710791 13 14 15 16 17 18 0.636573306 0.692451452 -0.353645490 -0.021982012 0.448428914 3.871783141 19 20 21 22 23 24 2.587482548 0.802533083 0.758692721 1.290129671 2.584417168 1.317476987 25 26 27 28 29 30 2.228481186 0.118860325 1.037292647 -1.042840712 0.559138014 0.039024333 31 32 33 34 35 36 -0.594186433 -0.184903151 -1.111490636 0.569799207 -1.642024303 -5.902573456 37 38 39 40 41 42 -0.866817165 -1.779490672 1.778844077 1.416075093 0.954616002 -1.559576607 43 44 45 46 47 48 2.085282872 -0.206202870 -0.898546595 -4.591634126 -2.425089799 0.068399177 49 50 51 52 53 54 0.800952617 -2.018586087 -0.490631866 -0.111764506 -2.684778008 0.809386322 55 56 57 58 59 60 -2.517571084 1.371304878 -0.092351762 0.916882834 -0.323702883 1.868732899 61 62 63 64 65 66 0.570716868 0.022385148 -0.466440278 -0.370634890 0.564048311 1.093600353 67 68 69 70 71 72 1.897930322 3.326545364 -3.880914238 0.578839151 -3.449196578 -0.323948286 73 74 75 76 77 78 1.462205539 0.845093066 0.273624586 3.112856240 -0.365942088 1.548836272 79 80 81 82 83 84 -1.842852459 -0.026008619 0.424121949 3.227893717 0.308208809 -1.024776775 85 86 87 88 89 90 0.256431299 1.731711306 -0.223327636 0.662336718 1.416730228 0.787728045 91 92 93 94 95 96 -1.482603395 -0.009346032 0.513187104 -0.285606992 -2.178923984 0.781685537 97 98 99 100 101 102 0.140519351 1.815846911 -0.159901088 -0.340573484 -1.366811481 1.187071465 103 104 105 106 107 108 2.585220688 0.410210238 1.436727372 -2.397171216 0.932990453 0.058877693 109 110 111 112 113 114 1.402035548 -0.311586001 0.987859590 0.102928012 2.451743724 -1.998883265 115 116 117 118 119 120 -2.936748200 1.327114786 -1.547598713 0.982402073 -1.987919366 0.274939017 121 122 123 124 125 126 -1.333886989 0.304154405 -3.023893971 -1.129863105 -1.059438245 -0.865806131 127 128 129 130 131 132 -0.513911570 0.657837937 1.107093822 -3.035236727 1.757879269 -3.395499358 133 134 135 136 137 138 1.817021409 -2.001079808 -1.740798301 -0.194351716 0.640535211 0.468402482 139 140 141 142 143 144 -2.255150678 -1.452049433 -5.453720060 2.810925984 1.588789011 0.364109135 145 146 147 148 149 150 1.068825869 -4.254547241 1.980591286 -2.275292865 0.757020012 -0.116840102 151 152 153 154 155 156 -3.208809380 -1.525645289 1.801977048 3.909544202 1.453398005 -2.594466136 157 158 159 160 161 162 -0.009346032 1.288332196 1.107093822 0.829427294 -0.604839935 0.313163501 > postscript(file="/var/wessaorg/rcomp/tmp/6iabp1351956811.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.117601011 NA 1 0.031409542 -3.117601011 2 2.826208692 0.031409542 3 3.263872656 2.826208692 4 -1.452637097 3.263872656 5 -1.883489323 -1.452637097 6 3.938638684 -1.883489323 7 -1.594411390 3.938638684 8 -1.883298629 -1.594411390 9 2.566461096 -1.883298629 10 0.801769700 2.566461096 11 -0.196710791 0.801769700 12 0.636573306 -0.196710791 13 0.692451452 0.636573306 14 -0.353645490 0.692451452 15 -0.021982012 -0.353645490 16 0.448428914 -0.021982012 17 3.871783141 0.448428914 18 2.587482548 3.871783141 19 0.802533083 2.587482548 20 0.758692721 0.802533083 21 1.290129671 0.758692721 22 2.584417168 1.290129671 23 1.317476987 2.584417168 24 2.228481186 1.317476987 25 0.118860325 2.228481186 26 1.037292647 0.118860325 27 -1.042840712 1.037292647 28 0.559138014 -1.042840712 29 0.039024333 0.559138014 30 -0.594186433 0.039024333 31 -0.184903151 -0.594186433 32 -1.111490636 -0.184903151 33 0.569799207 -1.111490636 34 -1.642024303 0.569799207 35 -5.902573456 -1.642024303 36 -0.866817165 -5.902573456 37 -1.779490672 -0.866817165 38 1.778844077 -1.779490672 39 1.416075093 1.778844077 40 0.954616002 1.416075093 41 -1.559576607 0.954616002 42 2.085282872 -1.559576607 43 -0.206202870 2.085282872 44 -0.898546595 -0.206202870 45 -4.591634126 -0.898546595 46 -2.425089799 -4.591634126 47 0.068399177 -2.425089799 48 0.800952617 0.068399177 49 -2.018586087 0.800952617 50 -0.490631866 -2.018586087 51 -0.111764506 -0.490631866 52 -2.684778008 -0.111764506 53 0.809386322 -2.684778008 54 -2.517571084 0.809386322 55 1.371304878 -2.517571084 56 -0.092351762 1.371304878 57 0.916882834 -0.092351762 58 -0.323702883 0.916882834 59 1.868732899 -0.323702883 60 0.570716868 1.868732899 61 0.022385148 0.570716868 62 -0.466440278 0.022385148 63 -0.370634890 -0.466440278 64 0.564048311 -0.370634890 65 1.093600353 0.564048311 66 1.897930322 1.093600353 67 3.326545364 1.897930322 68 -3.880914238 3.326545364 69 0.578839151 -3.880914238 70 -3.449196578 0.578839151 71 -0.323948286 -3.449196578 72 1.462205539 -0.323948286 73 0.845093066 1.462205539 74 0.273624586 0.845093066 75 3.112856240 0.273624586 76 -0.365942088 3.112856240 77 1.548836272 -0.365942088 78 -1.842852459 1.548836272 79 -0.026008619 -1.842852459 80 0.424121949 -0.026008619 81 3.227893717 0.424121949 82 0.308208809 3.227893717 83 -1.024776775 0.308208809 84 0.256431299 -1.024776775 85 1.731711306 0.256431299 86 -0.223327636 1.731711306 87 0.662336718 -0.223327636 88 1.416730228 0.662336718 89 0.787728045 1.416730228 90 -1.482603395 0.787728045 91 -0.009346032 -1.482603395 92 0.513187104 -0.009346032 93 -0.285606992 0.513187104 94 -2.178923984 -0.285606992 95 0.781685537 -2.178923984 96 0.140519351 0.781685537 97 1.815846911 0.140519351 98 -0.159901088 1.815846911 99 -0.340573484 -0.159901088 100 -1.366811481 -0.340573484 101 1.187071465 -1.366811481 102 2.585220688 1.187071465 103 0.410210238 2.585220688 104 1.436727372 0.410210238 105 -2.397171216 1.436727372 106 0.932990453 -2.397171216 107 0.058877693 0.932990453 108 1.402035548 0.058877693 109 -0.311586001 1.402035548 110 0.987859590 -0.311586001 111 0.102928012 0.987859590 112 2.451743724 0.102928012 113 -1.998883265 2.451743724 114 -2.936748200 -1.998883265 115 1.327114786 -2.936748200 116 -1.547598713 1.327114786 117 0.982402073 -1.547598713 118 -1.987919366 0.982402073 119 0.274939017 -1.987919366 120 -1.333886989 0.274939017 121 0.304154405 -1.333886989 122 -3.023893971 0.304154405 123 -1.129863105 -3.023893971 124 -1.059438245 -1.129863105 125 -0.865806131 -1.059438245 126 -0.513911570 -0.865806131 127 0.657837937 -0.513911570 128 1.107093822 0.657837937 129 -3.035236727 1.107093822 130 1.757879269 -3.035236727 131 -3.395499358 1.757879269 132 1.817021409 -3.395499358 133 -2.001079808 1.817021409 134 -1.740798301 -2.001079808 135 -0.194351716 -1.740798301 136 0.640535211 -0.194351716 137 0.468402482 0.640535211 138 -2.255150678 0.468402482 139 -1.452049433 -2.255150678 140 -5.453720060 -1.452049433 141 2.810925984 -5.453720060 142 1.588789011 2.810925984 143 0.364109135 1.588789011 144 1.068825869 0.364109135 145 -4.254547241 1.068825869 146 1.980591286 -4.254547241 147 -2.275292865 1.980591286 148 0.757020012 -2.275292865 149 -0.116840102 0.757020012 150 -3.208809380 -0.116840102 151 -1.525645289 -3.208809380 152 1.801977048 -1.525645289 153 3.909544202 1.801977048 154 1.453398005 3.909544202 155 -2.594466136 1.453398005 156 -0.009346032 -2.594466136 157 1.288332196 -0.009346032 158 1.107093822 1.288332196 159 0.829427294 1.107093822 160 -0.604839935 0.829427294 161 0.313163501 -0.604839935 162 NA 0.313163501 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 0.031409542 -3.117601011 [2,] 2.826208692 0.031409542 [3,] 3.263872656 2.826208692 [4,] -1.452637097 3.263872656 [5,] -1.883489323 -1.452637097 [6,] 3.938638684 -1.883489323 [7,] -1.594411390 3.938638684 [8,] -1.883298629 -1.594411390 [9,] 2.566461096 -1.883298629 [10,] 0.801769700 2.566461096 [11,] -0.196710791 0.801769700 [12,] 0.636573306 -0.196710791 [13,] 0.692451452 0.636573306 [14,] -0.353645490 0.692451452 [15,] -0.021982012 -0.353645490 [16,] 0.448428914 -0.021982012 [17,] 3.871783141 0.448428914 [18,] 2.587482548 3.871783141 [19,] 0.802533083 2.587482548 [20,] 0.758692721 0.802533083 [21,] 1.290129671 0.758692721 [22,] 2.584417168 1.290129671 [23,] 1.317476987 2.584417168 [24,] 2.228481186 1.317476987 [25,] 0.118860325 2.228481186 [26,] 1.037292647 0.118860325 [27,] -1.042840712 1.037292647 [28,] 0.559138014 -1.042840712 [29,] 0.039024333 0.559138014 [30,] -0.594186433 0.039024333 [31,] -0.184903151 -0.594186433 [32,] -1.111490636 -0.184903151 [33,] 0.569799207 -1.111490636 [34,] -1.642024303 0.569799207 [35,] -5.902573456 -1.642024303 [36,] -0.866817165 -5.902573456 [37,] -1.779490672 -0.866817165 [38,] 1.778844077 -1.779490672 [39,] 1.416075093 1.778844077 [40,] 0.954616002 1.416075093 [41,] -1.559576607 0.954616002 [42,] 2.085282872 -1.559576607 [43,] -0.206202870 2.085282872 [44,] -0.898546595 -0.206202870 [45,] -4.591634126 -0.898546595 [46,] -2.425089799 -4.591634126 [47,] 0.068399177 -2.425089799 [48,] 0.800952617 0.068399177 [49,] -2.018586087 0.800952617 [50,] -0.490631866 -2.018586087 [51,] -0.111764506 -0.490631866 [52,] -2.684778008 -0.111764506 [53,] 0.809386322 -2.684778008 [54,] -2.517571084 0.809386322 [55,] 1.371304878 -2.517571084 [56,] -0.092351762 1.371304878 [57,] 0.916882834 -0.092351762 [58,] -0.323702883 0.916882834 [59,] 1.868732899 -0.323702883 [60,] 0.570716868 1.868732899 [61,] 0.022385148 0.570716868 [62,] -0.466440278 0.022385148 [63,] -0.370634890 -0.466440278 [64,] 0.564048311 -0.370634890 [65,] 1.093600353 0.564048311 [66,] 1.897930322 1.093600353 [67,] 3.326545364 1.897930322 [68,] -3.880914238 3.326545364 [69,] 0.578839151 -3.880914238 [70,] -3.449196578 0.578839151 [71,] -0.323948286 -3.449196578 [72,] 1.462205539 -0.323948286 [73,] 0.845093066 1.462205539 [74,] 0.273624586 0.845093066 [75,] 3.112856240 0.273624586 [76,] -0.365942088 3.112856240 [77,] 1.548836272 -0.365942088 [78,] -1.842852459 1.548836272 [79,] -0.026008619 -1.842852459 [80,] 0.424121949 -0.026008619 [81,] 3.227893717 0.424121949 [82,] 0.308208809 3.227893717 [83,] -1.024776775 0.308208809 [84,] 0.256431299 -1.024776775 [85,] 1.731711306 0.256431299 [86,] -0.223327636 1.731711306 [87,] 0.662336718 -0.223327636 [88,] 1.416730228 0.662336718 [89,] 0.787728045 1.416730228 [90,] -1.482603395 0.787728045 [91,] -0.009346032 -1.482603395 [92,] 0.513187104 -0.009346032 [93,] -0.285606992 0.513187104 [94,] -2.178923984 -0.285606992 [95,] 0.781685537 -2.178923984 [96,] 0.140519351 0.781685537 [97,] 1.815846911 0.140519351 [98,] -0.159901088 1.815846911 [99,] -0.340573484 -0.159901088 [100,] -1.366811481 -0.340573484 [101,] 1.187071465 -1.366811481 [102,] 2.585220688 1.187071465 [103,] 0.410210238 2.585220688 [104,] 1.436727372 0.410210238 [105,] -2.397171216 1.436727372 [106,] 0.932990453 -2.397171216 [107,] 0.058877693 0.932990453 [108,] 1.402035548 0.058877693 [109,] -0.311586001 1.402035548 [110,] 0.987859590 -0.311586001 [111,] 0.102928012 0.987859590 [112,] 2.451743724 0.102928012 [113,] -1.998883265 2.451743724 [114,] -2.936748200 -1.998883265 [115,] 1.327114786 -2.936748200 [116,] -1.547598713 1.327114786 [117,] 0.982402073 -1.547598713 [118,] -1.987919366 0.982402073 [119,] 0.274939017 -1.987919366 [120,] -1.333886989 0.274939017 [121,] 0.304154405 -1.333886989 [122,] -3.023893971 0.304154405 [123,] -1.129863105 -3.023893971 [124,] -1.059438245 -1.129863105 [125,] -0.865806131 -1.059438245 [126,] -0.513911570 -0.865806131 [127,] 0.657837937 -0.513911570 [128,] 1.107093822 0.657837937 [129,] -3.035236727 1.107093822 [130,] 1.757879269 -3.035236727 [131,] -3.395499358 1.757879269 [132,] 1.817021409 -3.395499358 [133,] -2.001079808 1.817021409 [134,] -1.740798301 -2.001079808 [135,] -0.194351716 -1.740798301 [136,] 0.640535211 -0.194351716 [137,] 0.468402482 0.640535211 [138,] -2.255150678 0.468402482 [139,] -1.452049433 -2.255150678 [140,] -5.453720060 -1.452049433 [141,] 2.810925984 -5.453720060 [142,] 1.588789011 2.810925984 [143,] 0.364109135 1.588789011 [144,] 1.068825869 0.364109135 [145,] -4.254547241 1.068825869 [146,] 1.980591286 -4.254547241 [147,] -2.275292865 1.980591286 [148,] 0.757020012 -2.275292865 [149,] -0.116840102 0.757020012 [150,] -3.208809380 -0.116840102 [151,] -1.525645289 -3.208809380 [152,] 1.801977048 -1.525645289 [153,] 3.909544202 1.801977048 [154,] 1.453398005 3.909544202 [155,] -2.594466136 1.453398005 [156,] -0.009346032 -2.594466136 [157,] 1.288332196 -0.009346032 [158,] 1.107093822 1.288332196 [159,] 0.829427294 1.107093822 [160,] -0.604839935 0.829427294 [161,] 0.313163501 -0.604839935 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 0.031409542 -3.117601011 2 2.826208692 0.031409542 3 3.263872656 2.826208692 4 -1.452637097 3.263872656 5 -1.883489323 -1.452637097 6 3.938638684 -1.883489323 7 -1.594411390 3.938638684 8 -1.883298629 -1.594411390 9 2.566461096 -1.883298629 10 0.801769700 2.566461096 11 -0.196710791 0.801769700 12 0.636573306 -0.196710791 13 0.692451452 0.636573306 14 -0.353645490 0.692451452 15 -0.021982012 -0.353645490 16 0.448428914 -0.021982012 17 3.871783141 0.448428914 18 2.587482548 3.871783141 19 0.802533083 2.587482548 20 0.758692721 0.802533083 21 1.290129671 0.758692721 22 2.584417168 1.290129671 23 1.317476987 2.584417168 24 2.228481186 1.317476987 25 0.118860325 2.228481186 26 1.037292647 0.118860325 27 -1.042840712 1.037292647 28 0.559138014 -1.042840712 29 0.039024333 0.559138014 30 -0.594186433 0.039024333 31 -0.184903151 -0.594186433 32 -1.111490636 -0.184903151 33 0.569799207 -1.111490636 34 -1.642024303 0.569799207 35 -5.902573456 -1.642024303 36 -0.866817165 -5.902573456 37 -1.779490672 -0.866817165 38 1.778844077 -1.779490672 39 1.416075093 1.778844077 40 0.954616002 1.416075093 41 -1.559576607 0.954616002 42 2.085282872 -1.559576607 43 -0.206202870 2.085282872 44 -0.898546595 -0.206202870 45 -4.591634126 -0.898546595 46 -2.425089799 -4.591634126 47 0.068399177 -2.425089799 48 0.800952617 0.068399177 49 -2.018586087 0.800952617 50 -0.490631866 -2.018586087 51 -0.111764506 -0.490631866 52 -2.684778008 -0.111764506 53 0.809386322 -2.684778008 54 -2.517571084 0.809386322 55 1.371304878 -2.517571084 56 -0.092351762 1.371304878 57 0.916882834 -0.092351762 58 -0.323702883 0.916882834 59 1.868732899 -0.323702883 60 0.570716868 1.868732899 61 0.022385148 0.570716868 62 -0.466440278 0.022385148 63 -0.370634890 -0.466440278 64 0.564048311 -0.370634890 65 1.093600353 0.564048311 66 1.897930322 1.093600353 67 3.326545364 1.897930322 68 -3.880914238 3.326545364 69 0.578839151 -3.880914238 70 -3.449196578 0.578839151 71 -0.323948286 -3.449196578 72 1.462205539 -0.323948286 73 0.845093066 1.462205539 74 0.273624586 0.845093066 75 3.112856240 0.273624586 76 -0.365942088 3.112856240 77 1.548836272 -0.365942088 78 -1.842852459 1.548836272 79 -0.026008619 -1.842852459 80 0.424121949 -0.026008619 81 3.227893717 0.424121949 82 0.308208809 3.227893717 83 -1.024776775 0.308208809 84 0.256431299 -1.024776775 85 1.731711306 0.256431299 86 -0.223327636 1.731711306 87 0.662336718 -0.223327636 88 1.416730228 0.662336718 89 0.787728045 1.416730228 90 -1.482603395 0.787728045 91 -0.009346032 -1.482603395 92 0.513187104 -0.009346032 93 -0.285606992 0.513187104 94 -2.178923984 -0.285606992 95 0.781685537 -2.178923984 96 0.140519351 0.781685537 97 1.815846911 0.140519351 98 -0.159901088 1.815846911 99 -0.340573484 -0.159901088 100 -1.366811481 -0.340573484 101 1.187071465 -1.366811481 102 2.585220688 1.187071465 103 0.410210238 2.585220688 104 1.436727372 0.410210238 105 -2.397171216 1.436727372 106 0.932990453 -2.397171216 107 0.058877693 0.932990453 108 1.402035548 0.058877693 109 -0.311586001 1.402035548 110 0.987859590 -0.311586001 111 0.102928012 0.987859590 112 2.451743724 0.102928012 113 -1.998883265 2.451743724 114 -2.936748200 -1.998883265 115 1.327114786 -2.936748200 116 -1.547598713 1.327114786 117 0.982402073 -1.547598713 118 -1.987919366 0.982402073 119 0.274939017 -1.987919366 120 -1.333886989 0.274939017 121 0.304154405 -1.333886989 122 -3.023893971 0.304154405 123 -1.129863105 -3.023893971 124 -1.059438245 -1.129863105 125 -0.865806131 -1.059438245 126 -0.513911570 -0.865806131 127 0.657837937 -0.513911570 128 1.107093822 0.657837937 129 -3.035236727 1.107093822 130 1.757879269 -3.035236727 131 -3.395499358 1.757879269 132 1.817021409 -3.395499358 133 -2.001079808 1.817021409 134 -1.740798301 -2.001079808 135 -0.194351716 -1.740798301 136 0.640535211 -0.194351716 137 0.468402482 0.640535211 138 -2.255150678 0.468402482 139 -1.452049433 -2.255150678 140 -5.453720060 -1.452049433 141 2.810925984 -5.453720060 142 1.588789011 2.810925984 143 0.364109135 1.588789011 144 1.068825869 0.364109135 145 -4.254547241 1.068825869 146 1.980591286 -4.254547241 147 -2.275292865 1.980591286 148 0.757020012 -2.275292865 149 -0.116840102 0.757020012 150 -3.208809380 -0.116840102 151 -1.525645289 -3.208809380 152 1.801977048 -1.525645289 153 3.909544202 1.801977048 154 1.453398005 3.909544202 155 -2.594466136 1.453398005 156 -0.009346032 -2.594466136 157 1.288332196 -0.009346032 158 1.107093822 1.288332196 159 0.829427294 1.107093822 160 -0.604839935 0.829427294 161 0.313163501 -0.604839935 > 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/7eghz1351956811.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/8mwmx1351956811.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/9iptd1351956811.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/10j0xk1351956811.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/117izu1351956811.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/12ieuw1351956811.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/13bxog1351956811.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/141nby1351956811.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/15u8ol1351956811.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/162pt51351956811.tab") + } > > try(system("convert tmp/1hafo1351956811.ps tmp/1hafo1351956811.png",intern=TRUE)) character(0) > try(system("convert tmp/2fwiw1351956811.ps tmp/2fwiw1351956811.png",intern=TRUE)) character(0) > try(system("convert tmp/3avry1351956811.ps tmp/3avry1351956811.png",intern=TRUE)) character(0) > try(system("convert tmp/4j5561351956811.ps tmp/4j5561351956811.png",intern=TRUE)) character(0) > try(system("convert tmp/581u81351956811.ps tmp/581u81351956811.png",intern=TRUE)) character(0) > try(system("convert tmp/6iabp1351956811.ps tmp/6iabp1351956811.png",intern=TRUE)) character(0) > try(system("convert tmp/7eghz1351956811.ps tmp/7eghz1351956811.png",intern=TRUE)) character(0) > try(system("convert tmp/8mwmx1351956811.ps tmp/8mwmx1351956811.png",intern=TRUE)) character(0) > try(system("convert tmp/9iptd1351956811.ps tmp/9iptd1351956811.png",intern=TRUE)) character(0) > try(system("convert tmp/10j0xk1351956811.ps tmp/10j0xk1351956811.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 9.108 1.297 10.472