R version 2.15.2 (2012-10-26) -- "Trick or Treat" Copyright (C) 2012 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i686-pc-linux-gnu (32-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > x <- array(list(41 + ,38 + ,13 + ,12 + ,14 + ,12 + ,53 + ,32 + ,39 + ,32 + ,16 + ,11 + ,18 + ,11 + ,86 + ,51 + ,30 + ,35 + ,19 + ,15 + ,11 + ,14 + ,66 + ,42 + ,31 + ,33 + ,15 + ,6 + ,12 + ,12 + ,67 + ,41 + ,34 + ,37 + ,14 + ,13 + ,16 + ,21 + ,76 + ,46 + ,35 + ,29 + ,13 + ,10 + ,18 + ,12 + ,78 + ,47 + ,39 + ,31 + ,19 + ,12 + ,14 + ,22 + ,53 + ,37 + ,34 + ,36 + ,15 + ,14 + ,14 + ,11 + ,80 + ,49 + ,36 + ,35 + ,14 + ,12 + ,15 + ,10 + ,74 + ,45 + ,37 + ,38 + ,15 + ,6 + ,15 + ,13 + ,76 + ,47 + ,38 + ,31 + ,16 + ,10 + ,17 + ,10 + ,79 + ,49 + ,36 + ,34 + ,16 + ,12 + ,19 + ,8 + ,54 + ,33 + ,38 + ,35 + ,16 + ,12 + ,10 + ,15 + ,67 + ,42 + ,39 + ,38 + ,16 + ,11 + ,16 + ,14 + ,54 + ,33 + ,33 + ,37 + ,17 + ,15 + ,18 + ,10 + ,87 + ,53 + ,32 + ,33 + ,15 + ,12 + ,14 + ,14 + ,58 + ,36 + ,36 + ,32 + ,15 + ,10 + ,14 + ,14 + ,75 + ,45 + ,38 + ,38 + ,20 + ,12 + ,17 + ,11 + ,88 + ,54 + ,39 + ,38 + ,18 + ,11 + ,14 + ,10 + ,64 + ,41 + ,32 + ,32 + ,16 + ,12 + ,16 + ,13 + ,57 + ,36 + ,32 + ,33 + ,16 + ,11 + ,18 + ,7 + ,66 + ,41 + ,31 + ,31 + ,16 + ,12 + ,11 + ,14 + ,68 + ,44 + ,39 + ,38 + ,19 + ,13 + ,14 + ,12 + ,54 + ,33 + ,37 + ,39 + ,16 + ,11 + ,12 + ,14 + ,56 + ,37 + ,39 + ,32 + ,17 + ,9 + ,17 + ,11 + ,86 + ,52 + ,41 + ,32 + ,17 + ,13 + ,9 + ,9 + ,80 + ,47 + ,36 + ,35 + ,16 + ,10 + ,16 + ,11 + ,76 + ,43 + ,33 + ,37 + ,15 + ,14 + ,14 + ,15 + ,69 + ,44 + ,33 + ,33 + ,16 + ,12 + ,15 + ,14 + ,78 + ,45 + ,34 + ,33 + ,14 + ,10 + ,11 + ,13 + ,67 + ,44 + ,31 + ,28 + ,15 + ,12 + ,16 + ,9 + ,80 + ,49 + ,27 + ,32 + ,12 + ,8 + ,13 + ,15 + ,54 + ,33 + ,37 + ,31 + ,14 + ,10 + ,17 + ,10 + ,71 + ,43 + ,34 + ,37 + ,16 + ,12 + ,15 + ,11 + ,84 + ,54 + ,34 + ,30 + ,14 + ,12 + ,14 + ,13 + ,74 + ,42 + ,32 + ,33 + ,7 + ,7 + ,16 + ,8 + ,71 + ,44 + ,29 + ,31 + ,10 + ,6 + ,9 + ,20 + ,63 + ,37 + ,36 + ,33 + ,14 + ,12 + ,15 + ,12 + ,71 + ,43 + ,29 + ,31 + ,16 + ,10 + ,17 + ,10 + ,76 + ,46 + ,35 + ,33 + ,16 + ,10 + ,13 + ,10 + ,69 + ,42 + ,37 + ,32 + ,16 + ,10 + ,15 + ,9 + ,74 + ,45 + ,34 + ,33 + ,14 + ,12 + ,16 + ,14 + ,75 + ,44 + ,38 + ,32 + ,20 + ,15 + ,16 + ,8 + ,54 + ,33 + ,35 + ,33 + ,14 + ,10 + ,12 + ,14 + ,52 + ,31 + ,38 + ,28 + ,14 + ,10 + ,12 + ,11 + ,69 + ,42 + ,37 + ,35 + ,11 + ,12 + ,11 + ,13 + ,68 + ,40 + ,38 + ,39 + ,14 + ,13 + ,15 + ,9 + ,65 + ,43 + ,33 + ,34 + ,15 + ,11 + ,15 + ,11 + ,75 + ,46 + ,36 + ,38 + ,16 + ,11 + ,17 + ,15 + ,74 + ,42 + ,38 + ,32 + ,14 + ,12 + ,13 + ,11 + ,75 + ,45 + ,32 + ,38 + ,16 + ,14 + ,16 + ,10 + ,72 + ,44 + ,32 + ,30 + ,14 + ,10 + ,14 + ,14 + ,67 + ,40 + ,32 + ,33 + ,12 + ,12 + ,11 + ,18 + ,63 + ,37 + ,34 + ,38 + ,16 + ,13 + ,12 + ,14 + ,62 + ,46 + ,32 + ,32 + ,9 + ,5 + ,12 + ,11 + ,63 + ,36 + ,37 + ,32 + ,14 + ,6 + ,15 + ,12 + ,76 + ,47 + ,39 + ,34 + ,16 + ,12 + ,16 + ,13 + ,74 + ,45 + ,29 + ,34 + ,16 + ,12 + ,15 + ,9 + ,67 + ,42 + ,37 + ,36 + ,15 + ,11 + ,12 + ,10 + ,73 + ,43 + ,35 + ,34 + ,16 + ,10 + ,12 + ,15 + ,70 + ,43 + ,30 + ,28 + ,12 + ,7 + ,8 + ,20 + ,53 + ,32 + ,38 + ,34 + ,16 + ,12 + ,13 + ,12 + ,77 + ,45 + ,34 + ,35 + ,16 + ,14 + ,11 + ,12 + ,77 + ,45 + ,31 + ,35 + ,14 + ,11 + ,14 + ,14 + ,52 + ,31 + ,34 + ,31 + ,16 + ,12 + ,15 + ,13 + ,54 + ,33 + ,35 + ,37 + ,17 + ,13 + ,10 + ,11 + ,80 + ,49 + ,36 + ,35 + ,18 + ,14 + ,11 + ,17 + ,66 + ,42 + ,30 + ,27 + ,18 + ,11 + ,12 + ,12 + ,73 + ,41 + ,39 + ,40 + ,12 + ,12 + ,15 + ,13 + ,63 + ,38 + ,35 + ,37 + ,16 + ,12 + ,15 + ,14 + ,69 + ,42 + ,38 + ,36 + ,10 + ,8 + ,14 + ,13 + ,67 + ,44 + ,31 + ,38 + ,14 + ,11 + ,16 + ,15 + ,54 + ,33 + ,34 + ,39 + ,18 + ,14 + ,15 + ,13 + ,81 + ,48 + ,38 + ,41 + ,18 + ,14 + ,15 + ,10 + ,69 + ,40 + ,34 + ,27 + ,16 + ,12 + ,13 + ,11 + ,84 + ,50 + ,39 + ,30 + ,17 + ,9 + ,12 + ,19 + ,80 + ,49 + ,37 + ,37 + ,16 + ,13 + ,17 + ,13 + ,70 + ,43 + ,34 + ,31 + ,16 + ,11 + ,13 + ,17 + ,69 + ,44 + ,28 + ,31 + ,13 + ,12 + ,15 + ,13 + ,77 + ,47 + ,37 + ,27 + ,16 + ,12 + ,13 + ,9 + ,54 + ,33 + ,33 + ,36 + ,16 + ,12 + ,15 + ,11 + ,79 + ,46 + ,37 + ,38 + ,20 + ,12 + ,16 + ,10 + ,30 + ,0 + ,35 + ,37 + ,16 + ,12 + ,15 + ,9 + ,71 + ,45 + ,37 + ,33 + ,15 + ,12 + ,16 + ,12 + ,73 + ,43 + ,32 + ,34 + ,15 + ,11 + ,15 + ,12 + ,72 + ,44 + ,33 + ,31 + ,16 + ,10 + ,14 + ,13 + ,77 + ,47 + ,38 + ,39 + ,14 + ,9 + ,15 + ,13 + ,75 + ,45 + ,33 + ,34 + ,16 + ,12 + ,14 + ,12 + ,69 + ,42 + ,29 + ,32 + ,16 + ,12 + ,13 + ,15 + ,54 + ,33 + ,33 + ,33 + ,15 + ,12 + ,7 + ,22 + ,70 + ,43 + ,31 + ,36 + ,12 + ,9 + ,17 + ,13 + ,73 + ,46 + ,36 + ,32 + ,17 + ,15 + ,13 + ,15 + ,54 + ,33 + ,35 + ,41 + ,16 + ,12 + ,15 + ,13 + ,77 + ,46 + ,32 + ,28 + ,15 + ,12 + ,14 + ,15 + ,82 + ,48 + ,29 + ,30 + ,13 + ,12 + ,13 + ,10 + ,80 + ,47 + ,39 + ,36 + ,16 + ,10 + ,16 + ,11 + ,80 + ,47 + ,37 + ,35 + ,16 + ,13 + ,12 + ,16 + ,69 + ,43 + ,35 + ,31 + ,16 + ,9 + ,14 + ,11 + ,78 + ,46 + ,37 + ,34 + ,16 + ,12 + ,17 + ,11 + ,81 + ,48 + ,32 + ,36 + ,14 + ,10 + ,15 + ,10 + ,76 + ,46 + ,38 + ,36 + ,16 + ,14 + ,17 + ,10 + ,76 + ,45 + ,37 + ,35 + ,16 + ,11 + ,12 + ,16 + ,73 + ,45 + ,36 + ,37 + ,20 + ,15 + ,16 + ,12 + ,85 + ,52 + ,32 + ,28 + ,15 + ,11 + ,11 + ,11 + ,66 + ,42 + ,33 + ,39 + ,16 + ,11 + ,15 + ,16 + ,79 + ,47 + ,40 + ,32 + ,13 + ,12 + ,9 + ,19 + ,68 + ,41 + ,38 + ,35 + ,17 + ,12 + ,16 + ,11 + ,76 + ,47 + ,41 + ,39 + ,16 + ,12 + ,15 + ,16 + ,71 + ,43 + ,36 + ,35 + ,16 + ,11 + ,10 + ,15 + ,54 + ,33 + ,43 + ,42 + ,12 + ,7 + ,10 + ,24 + ,46 + ,30 + ,30 + ,34 + ,16 + ,12 + ,15 + ,14 + ,82 + ,49 + ,31 + ,33 + ,16 + ,14 + ,11 + ,15 + ,74 + ,44 + ,32 + ,41 + ,17 + ,11 + ,13 + ,11 + ,88 + ,55 + ,32 + ,33 + ,13 + ,11 + ,14 + ,15 + ,38 + ,11 + ,37 + ,34 + ,12 + ,10 + ,18 + ,12 + ,76 + ,47 + ,37 + ,32 + ,18 + ,13 + ,16 + ,10 + ,86 + ,53 + ,33 + ,40 + ,14 + ,13 + ,14 + ,14 + ,54 + ,33 + ,34 + ,40 + ,14 + ,8 + ,14 + ,13 + ,70 + ,44 + ,33 + ,35 + ,13 + ,11 + ,14 + ,9 + ,69 + ,42 + ,38 + ,36 + ,16 + ,12 + ,14 + ,15 + ,90 + ,55 + ,33 + ,37 + ,13 + ,11 + ,12 + ,15 + ,54 + ,33 + ,31 + ,27 + ,16 + ,13 + ,14 + ,14 + ,76 + ,46 + ,38 + ,39 + ,13 + ,12 + ,15 + ,11 + ,89 + ,54 + ,37 + ,38 + ,16 + ,14 + ,15 + ,8 + ,76 + ,47 + ,33 + ,31 + ,15 + ,13 + ,15 + ,11 + ,73 + ,45 + ,31 + ,33 + ,16 + ,15 + ,13 + ,11 + ,79 + ,47 + ,39 + ,32 + ,15 + ,10 + ,17 + ,8 + ,90 + ,55 + ,44 + ,39 + ,17 + ,11 + ,17 + ,10 + ,74 + ,44 + ,33 + ,36 + ,15 + ,9 + ,19 + ,11 + ,81 + ,53 + ,35 + ,33 + ,12 + ,11 + ,15 + ,13 + ,72 + ,44 + ,32 + ,33 + ,16 + ,10 + ,13 + ,11 + ,71 + ,42 + ,28 + ,32 + ,10 + ,11 + ,9 + ,20 + ,66 + ,40 + ,40 + ,37 + ,16 + ,8 + ,15 + ,10 + ,77 + ,46 + ,27 + ,30 + ,12 + ,11 + ,15 + ,15 + ,65 + ,40 + ,37 + ,38 + ,14 + ,12 + ,15 + ,12 + ,74 + ,46 + ,32 + ,29 + ,15 + ,12 + ,16 + ,14 + ,82 + ,53 + ,28 + ,22 + ,13 + ,9 + ,11 + ,23 + ,54 + ,33 + ,34 + ,35 + ,15 + ,11 + ,14 + ,14 + ,63 + ,42 + ,30 + ,35 + ,11 + ,10 + ,11 + ,16 + ,54 + ,35 + ,35 + ,34 + ,12 + ,8 + ,15 + ,11 + ,64 + ,40 + ,31 + ,35 + ,8 + ,9 + ,13 + ,12 + ,69 + ,41 + ,32 + ,34 + ,16 + ,8 + ,15 + ,10 + ,54 + ,33 + ,30 + ,34 + ,15 + ,9 + ,16 + ,14 + ,84 + ,51 + ,30 + ,35 + ,17 + ,15 + ,14 + ,12 + ,86 + ,53 + ,31 + ,23 + ,16 + ,11 + ,15 + ,12 + ,77 + ,46 + ,40 + ,31 + ,10 + ,8 + ,16 + ,11 + ,89 + ,55 + ,32 + ,27 + ,18 + ,13 + ,16 + ,12 + ,76 + ,47 + ,36 + ,36 + ,13 + ,12 + ,11 + ,13 + ,60 + ,38 + ,32 + ,31 + ,16 + ,12 + ,12 + ,11 + ,75 + ,46 + ,35 + ,32 + ,13 + ,9 + ,9 + ,19 + ,73 + ,46 + ,38 + ,39 + ,10 + ,7 + ,16 + ,12 + ,85 + ,53 + ,42 + ,37 + ,15 + ,13 + ,13 + ,17 + ,79 + ,47 + ,34 + ,38 + ,16 + ,9 + ,16 + ,9 + ,71 + ,41 + ,35 + ,39 + ,16 + ,6 + ,12 + ,12 + ,72 + ,44 + ,35 + ,34 + ,14 + ,8 + ,9 + ,19 + ,69 + ,43 + ,33 + ,31 + ,10 + ,8 + ,13 + ,18 + ,78 + ,51 + ,36 + ,32 + ,17 + ,15 + ,13 + ,15 + ,54 + ,33 + ,32 + ,37 + ,13 + ,6 + ,14 + ,14 + ,69 + ,43 + ,33 + ,36 + ,15 + ,9 + ,19 + ,11 + ,81 + ,53 + ,34 + ,32 + ,16 + ,11 + ,13 + ,9 + ,84 + ,51 + ,32 + ,35 + ,12 + ,8 + ,12 + ,18 + ,84 + ,50) + ,dim=c(8 + ,161) + ,dimnames=list(c('Connected' + ,'Separate' + ,'Learning' + ,'Software' + ,'Happiness' + ,'Depression' + ,'Belonging' + ,'Belonging_Final') + ,1:161)) > y <- array(NA,dim=c(8,161),dimnames=list(c('Connected','Separate','Learning','Software','Happiness','Depression','Belonging','Belonging_Final'),1:161)) > 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 = '3' > par3 <- 'No Linear Trend' > par2 <- 'Do not include Seasonal Dummies' > par1 <- '3' > #'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 Connected Separate Software Happiness Depression Belonging 1 13 41 38 12 14 12 53 2 16 39 32 11 18 11 86 3 19 30 35 15 11 14 66 4 15 31 33 6 12 12 67 5 14 34 37 13 16 21 76 6 13 35 29 10 18 12 78 7 19 39 31 12 14 22 53 8 15 34 36 14 14 11 80 9 14 36 35 12 15 10 74 10 15 37 38 6 15 13 76 11 16 38 31 10 17 10 79 12 16 36 34 12 19 8 54 13 16 38 35 12 10 15 67 14 16 39 38 11 16 14 54 15 17 33 37 15 18 10 87 16 15 32 33 12 14 14 58 17 15 36 32 10 14 14 75 18 20 38 38 12 17 11 88 19 18 39 38 11 14 10 64 20 16 32 32 12 16 13 57 21 16 32 33 11 18 7 66 22 16 31 31 12 11 14 68 23 19 39 38 13 14 12 54 24 16 37 39 11 12 14 56 25 17 39 32 9 17 11 86 26 17 41 32 13 9 9 80 27 16 36 35 10 16 11 76 28 15 33 37 14 14 15 69 29 16 33 33 12 15 14 78 30 14 34 33 10 11 13 67 31 15 31 28 12 16 9 80 32 12 27 32 8 13 15 54 33 14 37 31 10 17 10 71 34 16 34 37 12 15 11 84 35 14 34 30 12 14 13 74 36 7 32 33 7 16 8 71 37 10 29 31 6 9 20 63 38 14 36 33 12 15 12 71 39 16 29 31 10 17 10 76 40 16 35 33 10 13 10 69 41 16 37 32 10 15 9 74 42 14 34 33 12 16 14 75 43 20 38 32 15 16 8 54 44 14 35 33 10 12 14 52 45 14 38 28 10 12 11 69 46 11 37 35 12 11 13 68 47 14 38 39 13 15 9 65 48 15 33 34 11 15 11 75 49 16 36 38 11 17 15 74 50 14 38 32 12 13 11 75 51 16 32 38 14 16 10 72 52 14 32 30 10 14 14 67 53 12 32 33 12 11 18 63 54 16 34 38 13 12 14 62 55 9 32 32 5 12 11 63 56 14 37 32 6 15 12 76 57 16 39 34 12 16 13 74 58 16 29 34 12 15 9 67 59 15 37 36 11 12 10 73 60 16 35 34 10 12 15 70 61 12 30 28 7 8 20 53 62 16 38 34 12 13 12 77 63 16 34 35 14 11 12 77 64 14 31 35 11 14 14 52 65 16 34 31 12 15 13 54 66 17 35 37 13 10 11 80 67 18 36 35 14 11 17 66 68 18 30 27 11 12 12 73 69 12 39 40 12 15 13 63 70 16 35 37 12 15 14 69 71 10 38 36 8 14 13 67 72 14 31 38 11 16 15 54 73 18 34 39 14 15 13 81 74 18 38 41 14 15 10 69 75 16 34 27 12 13 11 84 76 17 39 30 9 12 19 80 77 16 37 37 13 17 13 70 78 16 34 31 11 13 17 69 79 13 28 31 12 15 13 77 80 16 37 27 12 13 9 54 81 16 33 36 12 15 11 79 82 20 37 38 12 16 10 30 83 16 35 37 12 15 9 71 84 15 37 33 12 16 12 73 85 15 32 34 11 15 12 72 86 16 33 31 10 14 13 77 87 14 38 39 9 15 13 75 88 16 33 34 12 14 12 69 89 16 29 32 12 13 15 54 90 15 33 33 12 7 22 70 91 12 31 36 9 17 13 73 92 17 36 32 15 13 15 54 93 16 35 41 12 15 13 77 94 15 32 28 12 14 15 82 95 13 29 30 12 13 10 80 96 16 39 36 10 16 11 80 97 16 37 35 13 12 16 69 98 16 35 31 9 14 11 78 99 16 37 34 12 17 11 81 100 14 32 36 10 15 10 76 101 16 38 36 14 17 10 76 102 16 37 35 11 12 16 73 103 20 36 37 15 16 12 85 104 15 32 28 11 11 11 66 105 16 33 39 11 15 16 79 106 13 40 32 12 9 19 68 107 17 38 35 12 16 11 76 108 16 41 39 12 15 16 71 109 16 36 35 11 10 15 54 110 12 43 42 7 10 24 46 111 16 30 34 12 15 14 82 112 16 31 33 14 11 15 74 113 17 32 41 11 13 11 88 114 13 32 33 11 14 15 38 115 12 37 34 10 18 12 76 116 18 37 32 13 16 10 86 117 14 33 40 13 14 14 54 118 14 34 40 8 14 13 70 119 13 33 35 11 14 9 69 120 16 38 36 12 14 15 90 121 13 33 37 11 12 15 54 122 16 31 27 13 14 14 76 123 13 38 39 12 15 11 89 124 16 37 38 14 15 8 76 125 15 33 31 13 15 11 73 126 16 31 33 15 13 11 79 127 15 39 32 10 17 8 90 128 17 44 39 11 17 10 74 129 15 33 36 9 19 11 81 130 12 35 33 11 15 13 72 131 16 32 33 10 13 11 71 132 10 28 32 11 9 20 66 133 16 40 37 8 15 10 77 134 12 27 30 11 15 15 65 135 14 37 38 12 15 12 74 136 15 32 29 12 16 14 82 137 13 28 22 9 11 23 54 138 15 34 35 11 14 14 63 139 11 30 35 10 11 16 54 140 12 35 34 8 15 11 64 141 8 31 35 9 13 12 69 142 16 32 34 8 15 10 54 143 15 30 34 9 16 14 84 144 17 30 35 15 14 12 86 145 16 31 23 11 15 12 77 146 10 40 31 8 16 11 89 147 18 32 27 13 16 12 76 148 13 36 36 12 11 13 60 149 16 32 31 12 12 11 75 150 13 35 32 9 9 19 73 151 10 38 39 7 16 12 85 152 15 42 37 13 13 17 79 153 16 34 38 9 16 9 71 154 16 35 39 6 12 12 72 155 14 35 34 8 9 19 69 156 10 33 31 8 13 18 78 157 17 36 32 15 13 15 54 158 13 32 37 6 14 14 69 159 15 33 36 9 19 11 81 160 16 34 32 11 13 9 84 161 12 32 35 8 12 18 84 Belonging_Final 1 32 2 51 3 42 4 41 5 46 6 47 7 37 8 49 9 45 10 47 11 49 12 33 13 42 14 33 15 53 16 36 17 45 18 54 19 41 20 36 21 41 22 44 23 33 24 37 25 52 26 47 27 43 28 44 29 45 30 44 31 49 32 33 33 43 34 54 35 42 36 44 37 37 38 43 39 46 40 42 41 45 42 44 43 33 44 31 45 42 46 40 47 43 48 46 49 42 50 45 51 44 52 40 53 37 54 46 55 36 56 47 57 45 58 42 59 43 60 43 61 32 62 45 63 45 64 31 65 33 66 49 67 42 68 41 69 38 70 42 71 44 72 33 73 48 74 40 75 50 76 49 77 43 78 44 79 47 80 33 81 46 82 0 83 45 84 43 85 44 86 47 87 45 88 42 89 33 90 43 91 46 92 33 93 46 94 48 95 47 96 47 97 43 98 46 99 48 100 46 101 45 102 45 103 52 104 42 105 47 106 41 107 47 108 43 109 33 110 30 111 49 112 44 113 55 114 11 115 47 116 53 117 33 118 44 119 42 120 55 121 33 122 46 123 54 124 47 125 45 126 47 127 55 128 44 129 53 130 44 131 42 132 40 133 46 134 40 135 46 136 53 137 33 138 42 139 35 140 40 141 41 142 33 143 51 144 53 145 46 146 55 147 47 148 38 149 46 150 46 151 53 152 47 153 41 154 44 155 43 156 51 157 33 158 43 159 53 160 51 161 50 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) Connected Separate Software 5.50659 0.11421 -0.02105 0.54377 Happiness Depression Belonging Belonging_Final 0.05963 -0.07157 0.03659 -0.05355 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -5.8966 -1.1111 0.1426 1.1166 3.9481 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 5.50659 2.60516 2.114 0.0362 * Connected 0.11421 0.04705 2.428 0.0164 * Separate -0.02105 0.04501 -0.468 0.6406 Software 0.54377 0.06952 7.821 7.94e-13 *** Happiness 0.05963 0.07662 0.778 0.4376 Depression -0.07157 0.05657 -1.265 0.2077 Belonging 0.03659 0.04493 0.814 0.4167 Belonging_Final -0.05355 0.06461 -0.829 0.4085 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 1.856 on 153 degrees of freedom Multiple R-squared: 0.3538, Adjusted R-squared: 0.3243 F-statistic: 11.97 on 7 and 153 DF, p-value: 3.999e-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.389151031 0.77830206 0.61084897 [2,] 0.622140028 0.75571994 0.37785997 [3,] 0.483033059 0.96606612 0.51696694 [4,] 0.456387390 0.91277478 0.54361261 [5,] 0.347784746 0.69556949 0.65221525 [6,] 0.263600614 0.52720123 0.73639939 [7,] 0.214652324 0.42930465 0.78534768 [8,] 0.414116625 0.82823325 0.58588337 [9,] 0.337270603 0.67454121 0.66272940 [10,] 0.258542229 0.51708446 0.74145777 [11,] 0.199499380 0.39899876 0.80050062 [12,] 0.181810432 0.36362086 0.81818957 [13,] 0.364158907 0.72831781 0.63584109 [14,] 0.400219057 0.80043811 0.59978094 [15,] 0.389138206 0.77827641 0.61086179 [16,] 0.351628403 0.70325681 0.64837160 [17,] 0.410639528 0.82127906 0.58936047 [18,] 0.416582672 0.83316534 0.58341733 [19,] 0.397714523 0.79542905 0.60228548 [20,] 0.439279806 0.87855961 0.56072019 [21,] 0.381431269 0.76286254 0.61856873 [22,] 0.335136234 0.67027247 0.66486377 [23,] 0.311901870 0.62380374 0.68809813 [24,] 0.279056086 0.55811217 0.72094391 [25,] 0.238671957 0.47734391 0.76132804 [26,] 0.822427491 0.35514502 0.17757251 [27,] 0.795239548 0.40952090 0.20476045 [28,] 0.788967979 0.42206404 0.21103202 [29,] 0.810757544 0.37848491 0.18924246 [30,] 0.791795061 0.41640988 0.20820494 [31,] 0.758168151 0.48366370 0.24183185 [32,] 0.732518816 0.53496237 0.26748118 [33,] 0.757936033 0.48412793 0.24206397 [34,] 0.714280356 0.57143929 0.28571964 [35,] 0.685051413 0.62989717 0.31494859 [36,] 0.854494660 0.29101068 0.14550534 [37,] 0.903951256 0.19209749 0.09604874 [38,] 0.879926283 0.24014743 0.12007372 [39,] 0.863242228 0.27351554 0.13675777 [40,] 0.862182932 0.27563414 0.13781707 [41,] 0.832815589 0.33436882 0.16718441 [42,] 0.799168663 0.40166267 0.20083134 [43,] 0.816639238 0.36672152 0.18336076 [44,] 0.803546565 0.39290687 0.19645344 [45,] 0.817396477 0.36520705 0.18260352 [46,] 0.791381927 0.41723615 0.20861807 [47,] 0.756078049 0.48784390 0.24392195 [48,] 0.732028190 0.53594362 0.26797181 [49,] 0.693329424 0.61334115 0.30667058 [50,] 0.689665087 0.62066983 0.31033491 [51,] 0.650943859 0.69811228 0.34905614 [52,] 0.607684557 0.78463089 0.39231544 [53,] 0.567620131 0.86475974 0.43237987 [54,] 0.519776502 0.96044700 0.48022350 [55,] 0.480843544 0.96168709 0.51915646 [56,] 0.451550593 0.90310119 0.54844941 [57,] 0.448713149 0.89742630 0.55128685 [58,] 0.597827976 0.80434405 0.40217202 [59,] 0.714897548 0.57020490 0.28510245 [60,] 0.679068582 0.64186284 0.32093142 [61,] 0.788914331 0.42217134 0.21108567 [62,] 0.753062784 0.49387443 0.24693722 [63,] 0.742878099 0.51424380 0.25712190 [64,] 0.722335860 0.55532828 0.27766414 [65,] 0.681603554 0.63679289 0.31839645 [66,] 0.734409257 0.53118149 0.26559074 [67,] 0.695949307 0.60810139 0.30405069 [68,] 0.682701126 0.63459775 0.31729887 [69,] 0.688375501 0.62324900 0.31162450 [70,] 0.645667743 0.70866451 0.35433226 [71,] 0.605446653 0.78910669 0.39455335 [72,] 0.729842656 0.54031469 0.27015734 [73,] 0.691288017 0.61742397 0.30871198 [74,] 0.660443711 0.67911258 0.33955629 [75,] 0.617199815 0.76560037 0.38280018 [76,] 0.610446712 0.77910658 0.38955329 [77,] 0.564709031 0.87058194 0.43529097 [78,] 0.524269687 0.95146063 0.47573031 [79,] 0.507439276 0.98512145 0.49256072 [80,] 0.473356449 0.94671290 0.52664355 [81,] 0.453806356 0.90761271 0.54619364 [82,] 0.415660272 0.83132054 0.58433973 [83,] 0.374058193 0.74811639 0.62594181 [84,] 0.332724002 0.66544800 0.66727600 [85,] 0.348396702 0.69679340 0.65160330 [86,] 0.314133713 0.62826743 0.68586629 [87,] 0.277525301 0.55505060 0.72247470 [88,] 0.275793340 0.55158668 0.72420666 [89,] 0.237431288 0.47486258 0.76256871 [90,] 0.203484227 0.40696845 0.79651577 [91,] 0.183032885 0.36606577 0.81696712 [92,] 0.169138322 0.33827664 0.83086168 [93,] 0.209156844 0.41831369 0.79084316 [94,] 0.177024659 0.35404932 0.82297534 [95,] 0.170892394 0.34178479 0.82910761 [96,] 0.182198546 0.36439709 0.81780145 [97,] 0.163441085 0.32688217 0.83655892 [98,] 0.144488549 0.28897710 0.85551145 [99,] 0.138613156 0.27722631 0.86138684 [100,] 0.131131324 0.26226265 0.86886868 [101,] 0.114623916 0.22924783 0.88537608 [102,] 0.094356591 0.18871318 0.90564341 [103,] 0.110763204 0.22152641 0.88923680 [104,] 0.103391747 0.20678349 0.89660825 [105,] 0.132559781 0.26511956 0.86744022 [106,] 0.125713269 0.25142654 0.87428673 [107,] 0.108119916 0.21623983 0.89188008 [108,] 0.093906518 0.18781304 0.90609348 [109,] 0.096207981 0.19241596 0.90379202 [110,] 0.089020070 0.17804014 0.91097993 [111,] 0.074376992 0.14875398 0.92562301 [112,] 0.058320188 0.11664038 0.94167981 [113,] 0.066296044 0.13259209 0.93370396 [114,] 0.052282286 0.10456457 0.94771771 [115,] 0.041646808 0.08329362 0.95835319 [116,] 0.031496727 0.06299345 0.96850327 [117,] 0.023339234 0.04667847 0.97666077 [118,] 0.018037772 0.03607554 0.98196223 [119,] 0.014576429 0.02915286 0.98542357 [120,] 0.020569593 0.04113919 0.97943041 [121,] 0.016659392 0.03331878 0.98334061 [122,] 0.026310932 0.05262186 0.97368907 [123,] 0.026869840 0.05373968 0.97313016 [124,] 0.036396292 0.07279258 0.96360371 [125,] 0.028247857 0.05649571 0.97175214 [126,] 0.019004510 0.03800902 0.98099549 [127,] 0.012436596 0.02487319 0.98756340 [128,] 0.008880797 0.01776159 0.99111920 [129,] 0.013122676 0.02624535 0.98687732 [130,] 0.010573701 0.02114740 0.98942630 [131,] 0.554083709 0.89183258 0.44591629 [132,] 0.487503328 0.97500666 0.51249667 [133,] 0.401658079 0.80331616 0.59834192 [134,] 0.321939186 0.64387837 0.67806081 [135,] 0.239550171 0.47910034 0.76044983 [136,] 0.294878452 0.58975690 0.70512155 [137,] 0.237363938 0.47472788 0.76263606 [138,] 0.738241860 0.52351628 0.26175814 [139,] 0.781658180 0.43668364 0.21834182 [140,] 0.624799516 0.75040097 0.37520048 > postscript(file="/var/wessaorg/rcomp/tmp/12ipo1352150119.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/2jh961352150119.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/31s641352150119.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/4qrzm1352150119.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/56a1r1352150119.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 = 161 Frequency = 1 1 2 3 4 5 6 -3.11637378 0.02920411 2.82725850 3.27196896 -1.44884429 -1.88321678 7 8 9 10 11 12 3.94810617 -1.59584553 -1.88360899 2.57658996 0.80325061 -0.19703448 13 14 15 16 17 18 0.63950141 0.69664690 -0.35642108 -0.01938934 0.45009567 3.87305260 19 20 21 22 23 24 2.59206963 0.80531204 0.75984121 1.29405231 2.58522867 1.32565192 25 26 27 28 29 30 2.22992569 0.11216971 1.03559481 -1.03950779 0.55682709 0.04609385 31 32 33 34 35 36 -0.59651237 -0.17736923 -1.11107281 0.57447646 -1.64675004 -5.89656195 37 38 39 40 41 42 -0.85806456 -1.77988902 1.78028404 1.41762791 0.95499033 -1.56078434 43 44 45 46 47 48 2.08002211 -0.20338452 -0.89906931 -4.59274728 -2.42091382 0.07026332 49 50 51 52 53 54 0.80127552 -2.02094723 -0.49114193 -0.11015915 -2.68362357 0.82204229 55 56 57 58 59 60 -2.51245333 1.37869473 -0.09221445 0.91874922 -0.32459341 1.87312273 61 62 63 64 65 66 0.57862192 0.01954659 -0.47083450 -0.36747273 0.56461101 1.09330208 67 68 69 70 71 72 1.90048060 3.32144264 -3.87855870 0.58131875 -3.43894196 -0.31809962 73 74 75 76 77 78 1.46068696 0.84198623 0.26901918 3.11746871 -0.36475725 1.55404653 79 80 81 82 83 84 -1.84211623 -0.02925351 0.42222972 3.20622521 0.31091632 -1.02691766 85 86 87 88 89 90 0.25873082 1.73400799 -0.21837926 0.66306857 1.41912473 0.79210855 91 92 93 94 95 96 -1.47460451 -0.01166158 0.51540633 -0.28876197 -2.18260481 0.78183051 97 98 99 100 101 102 0.14260558 1.81607857 -0.16207964 -0.33781038 -1.37096972 1.19086940 103 104 105 106 107 108 2.58299544 0.41183217 1.44056346 -2.39630302 0.93381444 0.06166729 109 110 111 112 113 114 1.40548538 -0.29528151 0.98832472 0.10063307 2.45732632 -2.01083890 115 116 117 118 119 120 -2.93318196 1.32486891 -1.54425949 0.99233778 -1.98681872 0.27648803 121 122 123 124 125 126 -1.32904180 0.30151610 -3.02321968 -1.13143533 -1.06080211 -0.87101385 127 128 129 130 131 132 -0.51429148 0.65788400 1.11664628 -3.03338330 1.75864459 -3.39079748 133 134 135 136 137 138 1.82051121 -1.99775594 -1.73796960 -0.19081635 0.64594197 0.47638099 139 140 141 142 143 144 -2.24645208 -1.44559924 -5.45005530 2.81656653 1.59391195 0.36236868 145 146 147 148 149 150 1.06547507 -4.25107475 1.97844347 -2.27183366 0.75643952 -0.10917159 151 152 153 154 155 156 -3.19960054 -1.52614309 1.80367864 3.91912628 1.46244100 -2.58337130 157 158 159 160 161 -0.01166158 1.29975670 1.11664628 0.82846476 -0.59841292 > postscript(file="/var/wessaorg/rcomp/tmp/61sc51352150119.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 = 161 Frequency = 1 lag(myerror, k = 1) myerror 0 -3.11637378 NA 1 0.02920411 -3.11637378 2 2.82725850 0.02920411 3 3.27196896 2.82725850 4 -1.44884429 3.27196896 5 -1.88321678 -1.44884429 6 3.94810617 -1.88321678 7 -1.59584553 3.94810617 8 -1.88360899 -1.59584553 9 2.57658996 -1.88360899 10 0.80325061 2.57658996 11 -0.19703448 0.80325061 12 0.63950141 -0.19703448 13 0.69664690 0.63950141 14 -0.35642108 0.69664690 15 -0.01938934 -0.35642108 16 0.45009567 -0.01938934 17 3.87305260 0.45009567 18 2.59206963 3.87305260 19 0.80531204 2.59206963 20 0.75984121 0.80531204 21 1.29405231 0.75984121 22 2.58522867 1.29405231 23 1.32565192 2.58522867 24 2.22992569 1.32565192 25 0.11216971 2.22992569 26 1.03559481 0.11216971 27 -1.03950779 1.03559481 28 0.55682709 -1.03950779 29 0.04609385 0.55682709 30 -0.59651237 0.04609385 31 -0.17736923 -0.59651237 32 -1.11107281 -0.17736923 33 0.57447646 -1.11107281 34 -1.64675004 0.57447646 35 -5.89656195 -1.64675004 36 -0.85806456 -5.89656195 37 -1.77988902 -0.85806456 38 1.78028404 -1.77988902 39 1.41762791 1.78028404 40 0.95499033 1.41762791 41 -1.56078434 0.95499033 42 2.08002211 -1.56078434 43 -0.20338452 2.08002211 44 -0.89906931 -0.20338452 45 -4.59274728 -0.89906931 46 -2.42091382 -4.59274728 47 0.07026332 -2.42091382 48 0.80127552 0.07026332 49 -2.02094723 0.80127552 50 -0.49114193 -2.02094723 51 -0.11015915 -0.49114193 52 -2.68362357 -0.11015915 53 0.82204229 -2.68362357 54 -2.51245333 0.82204229 55 1.37869473 -2.51245333 56 -0.09221445 1.37869473 57 0.91874922 -0.09221445 58 -0.32459341 0.91874922 59 1.87312273 -0.32459341 60 0.57862192 1.87312273 61 0.01954659 0.57862192 62 -0.47083450 0.01954659 63 -0.36747273 -0.47083450 64 0.56461101 -0.36747273 65 1.09330208 0.56461101 66 1.90048060 1.09330208 67 3.32144264 1.90048060 68 -3.87855870 3.32144264 69 0.58131875 -3.87855870 70 -3.43894196 0.58131875 71 -0.31809962 -3.43894196 72 1.46068696 -0.31809962 73 0.84198623 1.46068696 74 0.26901918 0.84198623 75 3.11746871 0.26901918 76 -0.36475725 3.11746871 77 1.55404653 -0.36475725 78 -1.84211623 1.55404653 79 -0.02925351 -1.84211623 80 0.42222972 -0.02925351 81 3.20622521 0.42222972 82 0.31091632 3.20622521 83 -1.02691766 0.31091632 84 0.25873082 -1.02691766 85 1.73400799 0.25873082 86 -0.21837926 1.73400799 87 0.66306857 -0.21837926 88 1.41912473 0.66306857 89 0.79210855 1.41912473 90 -1.47460451 0.79210855 91 -0.01166158 -1.47460451 92 0.51540633 -0.01166158 93 -0.28876197 0.51540633 94 -2.18260481 -0.28876197 95 0.78183051 -2.18260481 96 0.14260558 0.78183051 97 1.81607857 0.14260558 98 -0.16207964 1.81607857 99 -0.33781038 -0.16207964 100 -1.37096972 -0.33781038 101 1.19086940 -1.37096972 102 2.58299544 1.19086940 103 0.41183217 2.58299544 104 1.44056346 0.41183217 105 -2.39630302 1.44056346 106 0.93381444 -2.39630302 107 0.06166729 0.93381444 108 1.40548538 0.06166729 109 -0.29528151 1.40548538 110 0.98832472 -0.29528151 111 0.10063307 0.98832472 112 2.45732632 0.10063307 113 -2.01083890 2.45732632 114 -2.93318196 -2.01083890 115 1.32486891 -2.93318196 116 -1.54425949 1.32486891 117 0.99233778 -1.54425949 118 -1.98681872 0.99233778 119 0.27648803 -1.98681872 120 -1.32904180 0.27648803 121 0.30151610 -1.32904180 122 -3.02321968 0.30151610 123 -1.13143533 -3.02321968 124 -1.06080211 -1.13143533 125 -0.87101385 -1.06080211 126 -0.51429148 -0.87101385 127 0.65788400 -0.51429148 128 1.11664628 0.65788400 129 -3.03338330 1.11664628 130 1.75864459 -3.03338330 131 -3.39079748 1.75864459 132 1.82051121 -3.39079748 133 -1.99775594 1.82051121 134 -1.73796960 -1.99775594 135 -0.19081635 -1.73796960 136 0.64594197 -0.19081635 137 0.47638099 0.64594197 138 -2.24645208 0.47638099 139 -1.44559924 -2.24645208 140 -5.45005530 -1.44559924 141 2.81656653 -5.45005530 142 1.59391195 2.81656653 143 0.36236868 1.59391195 144 1.06547507 0.36236868 145 -4.25107475 1.06547507 146 1.97844347 -4.25107475 147 -2.27183366 1.97844347 148 0.75643952 -2.27183366 149 -0.10917159 0.75643952 150 -3.19960054 -0.10917159 151 -1.52614309 -3.19960054 152 1.80367864 -1.52614309 153 3.91912628 1.80367864 154 1.46244100 3.91912628 155 -2.58337130 1.46244100 156 -0.01166158 -2.58337130 157 1.29975670 -0.01166158 158 1.11664628 1.29975670 159 0.82846476 1.11664628 160 -0.59841292 0.82846476 161 NA -0.59841292 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 0.02920411 -3.11637378 [2,] 2.82725850 0.02920411 [3,] 3.27196896 2.82725850 [4,] -1.44884429 3.27196896 [5,] -1.88321678 -1.44884429 [6,] 3.94810617 -1.88321678 [7,] -1.59584553 3.94810617 [8,] -1.88360899 -1.59584553 [9,] 2.57658996 -1.88360899 [10,] 0.80325061 2.57658996 [11,] -0.19703448 0.80325061 [12,] 0.63950141 -0.19703448 [13,] 0.69664690 0.63950141 [14,] -0.35642108 0.69664690 [15,] -0.01938934 -0.35642108 [16,] 0.45009567 -0.01938934 [17,] 3.87305260 0.45009567 [18,] 2.59206963 3.87305260 [19,] 0.80531204 2.59206963 [20,] 0.75984121 0.80531204 [21,] 1.29405231 0.75984121 [22,] 2.58522867 1.29405231 [23,] 1.32565192 2.58522867 [24,] 2.22992569 1.32565192 [25,] 0.11216971 2.22992569 [26,] 1.03559481 0.11216971 [27,] -1.03950779 1.03559481 [28,] 0.55682709 -1.03950779 [29,] 0.04609385 0.55682709 [30,] -0.59651237 0.04609385 [31,] -0.17736923 -0.59651237 [32,] -1.11107281 -0.17736923 [33,] 0.57447646 -1.11107281 [34,] -1.64675004 0.57447646 [35,] -5.89656195 -1.64675004 [36,] -0.85806456 -5.89656195 [37,] -1.77988902 -0.85806456 [38,] 1.78028404 -1.77988902 [39,] 1.41762791 1.78028404 [40,] 0.95499033 1.41762791 [41,] -1.56078434 0.95499033 [42,] 2.08002211 -1.56078434 [43,] -0.20338452 2.08002211 [44,] -0.89906931 -0.20338452 [45,] -4.59274728 -0.89906931 [46,] -2.42091382 -4.59274728 [47,] 0.07026332 -2.42091382 [48,] 0.80127552 0.07026332 [49,] -2.02094723 0.80127552 [50,] -0.49114193 -2.02094723 [51,] -0.11015915 -0.49114193 [52,] -2.68362357 -0.11015915 [53,] 0.82204229 -2.68362357 [54,] -2.51245333 0.82204229 [55,] 1.37869473 -2.51245333 [56,] -0.09221445 1.37869473 [57,] 0.91874922 -0.09221445 [58,] -0.32459341 0.91874922 [59,] 1.87312273 -0.32459341 [60,] 0.57862192 1.87312273 [61,] 0.01954659 0.57862192 [62,] -0.47083450 0.01954659 [63,] -0.36747273 -0.47083450 [64,] 0.56461101 -0.36747273 [65,] 1.09330208 0.56461101 [66,] 1.90048060 1.09330208 [67,] 3.32144264 1.90048060 [68,] -3.87855870 3.32144264 [69,] 0.58131875 -3.87855870 [70,] -3.43894196 0.58131875 [71,] -0.31809962 -3.43894196 [72,] 1.46068696 -0.31809962 [73,] 0.84198623 1.46068696 [74,] 0.26901918 0.84198623 [75,] 3.11746871 0.26901918 [76,] -0.36475725 3.11746871 [77,] 1.55404653 -0.36475725 [78,] -1.84211623 1.55404653 [79,] -0.02925351 -1.84211623 [80,] 0.42222972 -0.02925351 [81,] 3.20622521 0.42222972 [82,] 0.31091632 3.20622521 [83,] -1.02691766 0.31091632 [84,] 0.25873082 -1.02691766 [85,] 1.73400799 0.25873082 [86,] -0.21837926 1.73400799 [87,] 0.66306857 -0.21837926 [88,] 1.41912473 0.66306857 [89,] 0.79210855 1.41912473 [90,] -1.47460451 0.79210855 [91,] -0.01166158 -1.47460451 [92,] 0.51540633 -0.01166158 [93,] -0.28876197 0.51540633 [94,] -2.18260481 -0.28876197 [95,] 0.78183051 -2.18260481 [96,] 0.14260558 0.78183051 [97,] 1.81607857 0.14260558 [98,] -0.16207964 1.81607857 [99,] -0.33781038 -0.16207964 [100,] -1.37096972 -0.33781038 [101,] 1.19086940 -1.37096972 [102,] 2.58299544 1.19086940 [103,] 0.41183217 2.58299544 [104,] 1.44056346 0.41183217 [105,] -2.39630302 1.44056346 [106,] 0.93381444 -2.39630302 [107,] 0.06166729 0.93381444 [108,] 1.40548538 0.06166729 [109,] -0.29528151 1.40548538 [110,] 0.98832472 -0.29528151 [111,] 0.10063307 0.98832472 [112,] 2.45732632 0.10063307 [113,] -2.01083890 2.45732632 [114,] -2.93318196 -2.01083890 [115,] 1.32486891 -2.93318196 [116,] -1.54425949 1.32486891 [117,] 0.99233778 -1.54425949 [118,] -1.98681872 0.99233778 [119,] 0.27648803 -1.98681872 [120,] -1.32904180 0.27648803 [121,] 0.30151610 -1.32904180 [122,] -3.02321968 0.30151610 [123,] -1.13143533 -3.02321968 [124,] -1.06080211 -1.13143533 [125,] -0.87101385 -1.06080211 [126,] -0.51429148 -0.87101385 [127,] 0.65788400 -0.51429148 [128,] 1.11664628 0.65788400 [129,] -3.03338330 1.11664628 [130,] 1.75864459 -3.03338330 [131,] -3.39079748 1.75864459 [132,] 1.82051121 -3.39079748 [133,] -1.99775594 1.82051121 [134,] -1.73796960 -1.99775594 [135,] -0.19081635 -1.73796960 [136,] 0.64594197 -0.19081635 [137,] 0.47638099 0.64594197 [138,] -2.24645208 0.47638099 [139,] -1.44559924 -2.24645208 [140,] -5.45005530 -1.44559924 [141,] 2.81656653 -5.45005530 [142,] 1.59391195 2.81656653 [143,] 0.36236868 1.59391195 [144,] 1.06547507 0.36236868 [145,] -4.25107475 1.06547507 [146,] 1.97844347 -4.25107475 [147,] -2.27183366 1.97844347 [148,] 0.75643952 -2.27183366 [149,] -0.10917159 0.75643952 [150,] -3.19960054 -0.10917159 [151,] -1.52614309 -3.19960054 [152,] 1.80367864 -1.52614309 [153,] 3.91912628 1.80367864 [154,] 1.46244100 3.91912628 [155,] -2.58337130 1.46244100 [156,] -0.01166158 -2.58337130 [157,] 1.29975670 -0.01166158 [158,] 1.11664628 1.29975670 [159,] 0.82846476 1.11664628 [160,] -0.59841292 0.82846476 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 0.02920411 -3.11637378 2 2.82725850 0.02920411 3 3.27196896 2.82725850 4 -1.44884429 3.27196896 5 -1.88321678 -1.44884429 6 3.94810617 -1.88321678 7 -1.59584553 3.94810617 8 -1.88360899 -1.59584553 9 2.57658996 -1.88360899 10 0.80325061 2.57658996 11 -0.19703448 0.80325061 12 0.63950141 -0.19703448 13 0.69664690 0.63950141 14 -0.35642108 0.69664690 15 -0.01938934 -0.35642108 16 0.45009567 -0.01938934 17 3.87305260 0.45009567 18 2.59206963 3.87305260 19 0.80531204 2.59206963 20 0.75984121 0.80531204 21 1.29405231 0.75984121 22 2.58522867 1.29405231 23 1.32565192 2.58522867 24 2.22992569 1.32565192 25 0.11216971 2.22992569 26 1.03559481 0.11216971 27 -1.03950779 1.03559481 28 0.55682709 -1.03950779 29 0.04609385 0.55682709 30 -0.59651237 0.04609385 31 -0.17736923 -0.59651237 32 -1.11107281 -0.17736923 33 0.57447646 -1.11107281 34 -1.64675004 0.57447646 35 -5.89656195 -1.64675004 36 -0.85806456 -5.89656195 37 -1.77988902 -0.85806456 38 1.78028404 -1.77988902 39 1.41762791 1.78028404 40 0.95499033 1.41762791 41 -1.56078434 0.95499033 42 2.08002211 -1.56078434 43 -0.20338452 2.08002211 44 -0.89906931 -0.20338452 45 -4.59274728 -0.89906931 46 -2.42091382 -4.59274728 47 0.07026332 -2.42091382 48 0.80127552 0.07026332 49 -2.02094723 0.80127552 50 -0.49114193 -2.02094723 51 -0.11015915 -0.49114193 52 -2.68362357 -0.11015915 53 0.82204229 -2.68362357 54 -2.51245333 0.82204229 55 1.37869473 -2.51245333 56 -0.09221445 1.37869473 57 0.91874922 -0.09221445 58 -0.32459341 0.91874922 59 1.87312273 -0.32459341 60 0.57862192 1.87312273 61 0.01954659 0.57862192 62 -0.47083450 0.01954659 63 -0.36747273 -0.47083450 64 0.56461101 -0.36747273 65 1.09330208 0.56461101 66 1.90048060 1.09330208 67 3.32144264 1.90048060 68 -3.87855870 3.32144264 69 0.58131875 -3.87855870 70 -3.43894196 0.58131875 71 -0.31809962 -3.43894196 72 1.46068696 -0.31809962 73 0.84198623 1.46068696 74 0.26901918 0.84198623 75 3.11746871 0.26901918 76 -0.36475725 3.11746871 77 1.55404653 -0.36475725 78 -1.84211623 1.55404653 79 -0.02925351 -1.84211623 80 0.42222972 -0.02925351 81 3.20622521 0.42222972 82 0.31091632 3.20622521 83 -1.02691766 0.31091632 84 0.25873082 -1.02691766 85 1.73400799 0.25873082 86 -0.21837926 1.73400799 87 0.66306857 -0.21837926 88 1.41912473 0.66306857 89 0.79210855 1.41912473 90 -1.47460451 0.79210855 91 -0.01166158 -1.47460451 92 0.51540633 -0.01166158 93 -0.28876197 0.51540633 94 -2.18260481 -0.28876197 95 0.78183051 -2.18260481 96 0.14260558 0.78183051 97 1.81607857 0.14260558 98 -0.16207964 1.81607857 99 -0.33781038 -0.16207964 100 -1.37096972 -0.33781038 101 1.19086940 -1.37096972 102 2.58299544 1.19086940 103 0.41183217 2.58299544 104 1.44056346 0.41183217 105 -2.39630302 1.44056346 106 0.93381444 -2.39630302 107 0.06166729 0.93381444 108 1.40548538 0.06166729 109 -0.29528151 1.40548538 110 0.98832472 -0.29528151 111 0.10063307 0.98832472 112 2.45732632 0.10063307 113 -2.01083890 2.45732632 114 -2.93318196 -2.01083890 115 1.32486891 -2.93318196 116 -1.54425949 1.32486891 117 0.99233778 -1.54425949 118 -1.98681872 0.99233778 119 0.27648803 -1.98681872 120 -1.32904180 0.27648803 121 0.30151610 -1.32904180 122 -3.02321968 0.30151610 123 -1.13143533 -3.02321968 124 -1.06080211 -1.13143533 125 -0.87101385 -1.06080211 126 -0.51429148 -0.87101385 127 0.65788400 -0.51429148 128 1.11664628 0.65788400 129 -3.03338330 1.11664628 130 1.75864459 -3.03338330 131 -3.39079748 1.75864459 132 1.82051121 -3.39079748 133 -1.99775594 1.82051121 134 -1.73796960 -1.99775594 135 -0.19081635 -1.73796960 136 0.64594197 -0.19081635 137 0.47638099 0.64594197 138 -2.24645208 0.47638099 139 -1.44559924 -2.24645208 140 -5.45005530 -1.44559924 141 2.81656653 -5.45005530 142 1.59391195 2.81656653 143 0.36236868 1.59391195 144 1.06547507 0.36236868 145 -4.25107475 1.06547507 146 1.97844347 -4.25107475 147 -2.27183366 1.97844347 148 0.75643952 -2.27183366 149 -0.10917159 0.75643952 150 -3.19960054 -0.10917159 151 -1.52614309 -3.19960054 152 1.80367864 -1.52614309 153 3.91912628 1.80367864 154 1.46244100 3.91912628 155 -2.58337130 1.46244100 156 -0.01166158 -2.58337130 157 1.29975670 -0.01166158 158 1.11664628 1.29975670 159 0.82846476 1.11664628 160 -0.59841292 0.82846476 > 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/7qkmm1352150119.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/8neq51352150119.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/90uk81352150119.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/10h2tw1352150119.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/1185nc1352150119.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/12u38s1352150119.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/13y9gl1352150119.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/14l4d31352150119.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/1531dk1352150119.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/16f5fq1352150119.tab") + } > > try(system("convert tmp/12ipo1352150119.ps tmp/12ipo1352150119.png",intern=TRUE)) character(0) > try(system("convert tmp/2jh961352150119.ps tmp/2jh961352150119.png",intern=TRUE)) character(0) > try(system("convert tmp/31s641352150119.ps tmp/31s641352150119.png",intern=TRUE)) character(0) > try(system("convert tmp/4qrzm1352150119.ps tmp/4qrzm1352150119.png",intern=TRUE)) character(0) > try(system("convert tmp/56a1r1352150119.ps tmp/56a1r1352150119.png",intern=TRUE)) character(0) > try(system("convert tmp/61sc51352150119.ps tmp/61sc51352150119.png",intern=TRUE)) character(0) > try(system("convert tmp/7qkmm1352150119.ps tmp/7qkmm1352150119.png",intern=TRUE)) character(0) > try(system("convert tmp/8neq51352150119.ps tmp/8neq51352150119.png",intern=TRUE)) character(0) > try(system("convert tmp/90uk81352150119.ps tmp/90uk81352150119.png",intern=TRUE)) character(0) > try(system("convert tmp/10h2tw1352150119.ps tmp/10h2tw1352150119.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 7.920 0.940 8.882