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(41 + ,38 + ,13 + ,12 + ,14 + ,12 + ,53 + ,32 + ,39 + ,32 + ,16 + ,11 + ,18 + ,11 + ,86 + ,51 + ,30 + ,35 + ,19 + ,15 + ,11 + ,14 + ,66 + ,42 + ,31 + ,33 + ,15 + ,6 + ,12 + ,12 + ,67 + ,41 + ,34 + ,37 + ,14 + ,13 + ,16 + ,21 + ,76 + ,46 + ,35 + ,29 + ,13 + ,10 + ,18 + ,12 + ,78 + ,47 + ,39 + ,31 + ,19 + ,12 + ,14 + ,22 + ,53 + ,37 + ,34 + ,36 + ,15 + ,14 + ,14 + ,11 + ,80 + ,49 + ,36 + ,35 + ,14 + ,12 + ,15 + ,10 + ,74 + ,45 + ,37 + ,38 + ,15 + ,6 + ,15 + ,13 + ,76 + ,47 + ,38 + ,31 + ,16 + ,10 + ,17 + ,10 + ,79 + ,49 + ,36 + ,34 + ,16 + ,12 + ,19 + ,8 + ,54 + ,33 + ,38 + ,35 + ,16 + ,12 + ,10 + ,15 + ,67 + ,42 + ,39 + ,38 + ,16 + ,11 + ,16 + ,14 + ,54 + ,33 + ,33 + ,37 + ,17 + ,15 + ,18 + ,10 + ,87 + ,53 + ,32 + ,33 + ,15 + ,12 + ,14 + ,14 + ,58 + ,36 + ,36 + ,32 + ,15 + ,10 + ,14 + ,14 + ,75 + ,45 + ,38 + ,38 + ,20 + ,12 + ,17 + ,11 + ,88 + ,54 + ,39 + ,38 + ,18 + ,11 + ,14 + ,10 + ,64 + ,41 + ,32 + ,32 + ,16 + ,12 + ,16 + ,13 + ,57 + ,36 + ,32 + ,33 + ,16 + ,11 + ,18 + ,7 + ,66 + ,41 + ,31 + ,31 + ,16 + ,12 + ,11 + ,14 + ,68 + ,44 + ,39 + ,38 + ,19 + ,13 + ,14 + ,12 + ,54 + ,33 + ,37 + ,39 + ,16 + ,11 + ,12 + ,14 + ,56 + ,37 + ,39 + ,32 + ,17 + ,9 + ,17 + ,11 + ,86 + ,52 + ,41 + ,32 + ,17 + ,13 + ,9 + ,9 + ,80 + ,47 + ,36 + ,35 + ,16 + ,10 + ,16 + ,11 + ,76 + ,43 + ,33 + ,37 + ,15 + ,14 + ,14 + ,15 + ,69 + ,44 + ,33 + ,33 + ,16 + ,12 + ,15 + ,14 + ,78 + ,45 + ,34 + ,33 + ,14 + ,10 + ,11 + ,13 + ,67 + ,44 + ,31 + ,28 + ,15 + ,12 + ,16 + ,9 + ,80 + ,49 + ,27 + ,32 + ,12 + ,8 + ,13 + ,15 + ,54 + ,33 + ,37 + ,31 + ,14 + ,10 + ,17 + ,10 + ,71 + ,43 + ,34 + ,37 + ,16 + ,12 + ,15 + ,11 + ,84 + ,54 + ,34 + ,30 + ,14 + ,12 + ,14 + ,13 + ,74 + ,42 + ,32 + ,33 + ,7 + ,7 + ,16 + ,8 + ,71 + ,44 + ,29 + ,31 + ,10 + ,6 + ,9 + ,20 + ,63 + ,37 + ,36 + ,33 + ,14 + ,12 + ,15 + ,12 + ,71 + ,43 + ,29 + ,31 + ,16 + ,10 + ,17 + ,10 + ,76 + ,46 + ,35 + ,33 + ,16 + ,10 + ,13 + ,10 + ,69 + ,42 + ,37 + ,32 + ,16 + ,10 + ,15 + ,9 + ,74 + ,45 + ,34 + ,33 + ,14 + ,12 + ,16 + ,14 + ,75 + ,44 + ,38 + ,32 + ,20 + ,15 + ,16 + ,8 + ,54 + ,33 + ,35 + ,33 + ,14 + ,10 + ,12 + ,14 + ,52 + ,31 + ,38 + ,28 + ,14 + ,10 + ,12 + ,11 + ,69 + ,42 + ,37 + ,35 + ,11 + ,12 + ,11 + ,13 + ,68 + ,40 + ,38 + ,39 + ,14 + ,13 + ,15 + ,9 + ,65 + ,43 + ,33 + ,34 + ,15 + ,11 + ,15 + ,11 + ,75 + ,46 + ,36 + ,38 + ,16 + ,11 + ,17 + ,15 + ,74 + ,42 + ,38 + ,32 + ,14 + ,12 + ,13 + ,11 + ,75 + ,45 + ,32 + ,38 + ,16 + ,14 + ,16 + ,10 + ,72 + ,44 + ,32 + ,30 + ,14 + ,10 + ,14 + ,14 + ,67 + ,40 + ,32 + ,33 + ,12 + ,12 + ,11 + ,18 + ,63 + ,37 + ,34 + ,38 + ,16 + ,13 + ,12 + ,14 + ,62 + ,46 + ,32 + ,32 + ,9 + ,5 + ,12 + ,11 + ,63 + ,36 + ,37 + ,32 + ,14 + ,6 + ,15 + ,12 + ,76 + ,47 + ,39 + ,34 + ,16 + ,12 + ,16 + ,13 + ,74 + ,45 + ,29 + ,34 + ,16 + ,12 + ,15 + ,9 + ,67 + ,42 + ,37 + ,36 + ,15 + ,11 + ,12 + ,10 + ,73 + ,43 + ,35 + ,34 + ,16 + ,10 + ,12 + ,15 + ,70 + ,43 + ,30 + ,28 + ,12 + ,7 + ,8 + ,20 + ,53 + ,32 + ,38 + ,34 + ,16 + ,12 + ,13 + ,12 + ,77 + ,45 + ,34 + ,35 + ,16 + ,14 + ,11 + ,12 + ,77 + ,45 + ,31 + ,35 + ,14 + ,11 + ,14 + ,14 + ,52 + ,31 + ,34 + ,31 + ,16 + ,12 + ,15 + ,13 + ,54 + ,33 + ,35 + ,37 + ,17 + ,13 + ,10 + ,11 + ,80 + ,49 + ,36 + ,35 + ,18 + ,14 + ,11 + ,17 + ,66 + ,42 + ,30 + ,27 + ,18 + ,11 + ,12 + ,12 + ,73 + ,41 + ,39 + ,40 + ,12 + ,12 + ,15 + ,13 + ,63 + ,38 + ,35 + ,37 + ,16 + ,12 + ,15 + ,14 + ,69 + ,42 + ,38 + ,36 + ,10 + ,8 + ,14 + ,13 + ,67 + ,44 + ,31 + ,38 + ,14 + ,11 + ,16 + ,15 + ,54 + ,33 + ,34 + ,39 + ,18 + ,14 + ,15 + ,13 + ,81 + ,48 + ,38 + ,41 + ,18 + ,14 + ,15 + ,10 + ,69 + ,40 + ,34 + ,27 + ,16 + ,12 + ,13 + ,11 + ,84 + ,50 + ,39 + ,30 + ,17 + ,9 + ,12 + ,19 + ,80 + ,49 + ,37 + ,37 + ,16 + ,13 + ,17 + ,13 + ,70 + ,43 + ,34 + ,31 + ,16 + ,11 + ,13 + ,17 + ,69 + ,44 + ,28 + ,31 + ,13 + ,12 + ,15 + ,13 + ,77 + ,47 + ,37 + ,27 + ,16 + ,12 + ,13 + ,9 + ,54 + ,33 + ,33 + ,36 + ,16 + ,12 + ,15 + ,11 + ,79 + ,46 + ,37 + ,38 + ,20 + ,12 + ,16 + ,10 + ,30 + ,0 + ,35 + ,37 + ,16 + ,12 + ,15 + ,9 + ,71 + ,45 + ,37 + ,33 + ,15 + ,12 + ,16 + ,12 + ,73 + ,43 + ,32 + ,34 + ,15 + ,11 + ,15 + ,12 + ,72 + ,44 + ,33 + ,31 + ,16 + ,10 + ,14 + ,13 + ,77 + ,47 + ,38 + ,39 + ,14 + ,9 + ,15 + ,13 + ,75 + ,45 + ,33 + ,34 + ,16 + ,12 + ,14 + ,12 + ,69 + ,42 + ,29 + ,32 + ,16 + ,12 + ,13 + ,15 + ,54 + ,33 + ,33 + ,33 + ,15 + ,12 + ,7 + ,22 + ,70 + ,43 + ,31 + ,36 + ,12 + ,9 + ,17 + ,13 + ,73 + ,46 + ,36 + ,32 + ,17 + ,15 + ,13 + ,15 + ,54 + ,33 + ,35 + ,41 + ,16 + ,12 + ,15 + ,13 + ,77 + ,46 + ,32 + ,28 + ,15 + ,12 + ,14 + ,15 + ,82 + ,48 + ,29 + ,30 + ,13 + ,12 + ,13 + ,10 + ,80 + ,47 + ,39 + ,36 + ,16 + ,10 + ,16 + ,11 + ,80 + ,47 + ,37 + ,35 + ,16 + ,13 + ,12 + ,16 + ,69 + ,43 + ,35 + ,31 + ,16 + ,9 + ,14 + ,11 + ,78 + ,46 + ,37 + ,34 + ,16 + ,12 + ,17 + ,11 + ,81 + ,48 + ,32 + ,36 + ,14 + ,10 + ,15 + ,10 + ,76 + ,46 + ,38 + ,36 + ,16 + ,14 + ,17 + ,10 + ,76 + ,45 + ,37 + ,35 + ,16 + ,11 + ,12 + ,16 + ,73 + ,45 + ,36 + ,37 + ,20 + ,15 + ,16 + ,12 + ,85 + ,52 + ,32 + ,28 + ,15 + ,11 + ,11 + ,11 + ,66 + ,42 + ,33 + ,39 + ,16 + ,11 + ,15 + ,16 + ,79 + ,47 + ,40 + ,32 + ,13 + ,12 + ,9 + ,19 + ,68 + ,41 + ,38 + ,35 + ,17 + ,12 + ,16 + ,11 + ,76 + ,47 + ,41 + ,39 + ,16 + ,12 + ,15 + ,16 + ,71 + ,43 + ,36 + ,35 + ,16 + ,11 + ,10 + ,15 + ,54 + ,33 + ,43 + ,42 + ,12 + ,7 + ,10 + ,24 + ,46 + ,30 + ,30 + ,34 + ,16 + ,12 + ,15 + ,14 + ,82 + ,49 + ,31 + ,33 + ,16 + ,14 + ,11 + ,15 + ,74 + ,44 + ,32 + ,41 + ,17 + ,11 + ,13 + ,11 + ,88 + ,55 + ,32 + ,33 + ,13 + ,11 + ,14 + ,15 + ,38 + ,11 + ,37 + ,34 + ,12 + ,10 + ,18 + ,12 + ,76 + ,47 + ,37 + ,32 + ,18 + ,13 + ,16 + ,10 + ,86 + ,53 + ,33 + ,40 + ,14 + ,13 + ,14 + ,14 + ,54 + ,33 + ,34 + ,40 + ,14 + ,8 + ,14 + ,13 + ,70 + ,44 + ,33 + ,35 + ,13 + ,11 + ,14 + ,9 + ,69 + ,42 + ,38 + ,36 + ,16 + ,12 + ,14 + ,15 + ,90 + ,55 + ,33 + ,37 + ,13 + ,11 + ,12 + ,15 + ,54 + ,33 + ,31 + ,27 + ,16 + ,13 + ,14 + ,14 + ,76 + ,46 + ,38 + ,39 + ,13 + ,12 + ,15 + ,11 + ,89 + ,54 + ,37 + ,38 + ,16 + ,14 + ,15 + ,8 + ,76 + ,47 + ,33 + ,31 + ,15 + ,13 + ,15 + ,11 + ,73 + ,45 + ,31 + ,33 + ,16 + ,15 + ,13 + ,11 + ,79 + ,47 + ,39 + ,32 + ,15 + ,10 + ,17 + ,8 + ,90 + ,55 + ,44 + ,39 + ,17 + ,11 + ,17 + ,10 + ,74 + ,44 + ,33 + ,36 + ,15 + ,9 + ,19 + ,11 + ,81 + ,53 + ,35 + ,33 + ,12 + ,11 + ,15 + ,13 + ,72 + ,44 + ,32 + ,33 + ,16 + ,10 + ,13 + ,11 + ,71 + ,42 + ,28 + ,32 + ,10 + ,11 + ,9 + ,20 + ,66 + ,40 + ,40 + ,37 + ,16 + ,8 + ,15 + ,10 + ,77 + ,46 + ,27 + ,30 + ,12 + ,11 + ,15 + ,15 + ,65 + ,40 + ,37 + ,38 + ,14 + ,12 + ,15 + ,12 + ,74 + ,46 + ,32 + ,29 + ,15 + ,12 + ,16 + ,14 + ,82 + ,53 + ,28 + ,22 + ,13 + ,9 + ,11 + ,23 + ,54 + ,33 + ,34 + ,35 + ,15 + ,11 + ,14 + ,14 + ,63 + ,42 + ,30 + ,35 + ,11 + ,10 + ,11 + ,16 + ,54 + ,35 + ,35 + ,34 + ,12 + ,8 + ,15 + ,11 + ,64 + ,40 + ,31 + ,35 + ,8 + ,9 + ,13 + ,12 + ,69 + ,41 + ,32 + ,34 + ,16 + ,8 + ,15 + ,10 + ,54 + ,33 + ,30 + ,34 + ,15 + ,9 + ,16 + ,14 + ,84 + ,51 + ,30 + ,35 + ,17 + ,15 + ,14 + ,12 + ,86 + ,53 + ,31 + ,23 + ,16 + ,11 + ,15 + ,12 + ,77 + ,46 + ,40 + ,31 + ,10 + ,8 + ,16 + ,11 + ,89 + ,55 + ,32 + ,27 + ,18 + ,13 + ,16 + ,12 + ,76 + ,47 + ,36 + ,36 + ,13 + ,12 + ,11 + ,13 + ,60 + ,38 + ,32 + ,31 + ,16 + ,12 + ,12 + ,11 + ,75 + ,46 + ,35 + ,32 + ,13 + ,9 + ,9 + ,19 + ,73 + ,46 + ,38 + ,39 + ,10 + ,7 + ,16 + ,12 + ,85 + ,53 + ,42 + ,37 + ,15 + ,13 + ,13 + ,17 + ,79 + ,47 + ,34 + ,38 + ,16 + ,9 + ,16 + ,9 + ,71 + ,41 + ,35 + ,39 + ,16 + ,6 + ,12 + ,12 + ,72 + ,44 + ,35 + ,34 + ,14 + ,8 + ,9 + ,19 + ,69 + ,43 + ,33 + ,31 + ,10 + ,8 + ,13 + ,18 + ,78 + ,51 + ,36 + ,32 + ,17 + ,15 + ,13 + ,15 + ,54 + ,33 + ,32 + ,37 + ,13 + ,6 + ,14 + ,14 + ,69 + ,43 + ,33 + ,36 + ,15 + ,9 + ,19 + ,11 + ,81 + ,53 + ,34 + ,32 + ,16 + ,11 + ,13 + ,9 + ,84 + ,51 + ,32 + ,35 + ,12 + ,8 + ,12 + ,18 + ,84 + ,50 + ,34 + ,36 + ,13 + ,8 + ,13 + ,16 + ,69 + ,46) + ,dim=c(8 + ,162) + ,dimnames=list(c('Connected' + ,'Separate' + ,'Learning' + ,'Software' + ,'Happiness' + ,'Depression' + ,'Belonging' + ,'Belonging_Final') + ,1:162)) > y <- array(NA,dim=c(8,162),dimnames=list(c('Connected','Separate','Learning','Software','Happiness','Depression','Belonging','Belonging_Final'),1:162)) > for (i in 1:dim(x)[1]) + { + for (j in 1:dim(x)[2]) + { + y[i,j] <- as.numeric(x[i,j]) + } + } > par3 = 'Linear Trend' > par2 = 'Do not include Seasonal Dummies' > par1 = '1' > par3 <- '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 Connected Separate Learning Software Happiness Depression Belonging 1 41 38 13 12 14 12 53 2 39 32 16 11 18 11 86 3 30 35 19 15 11 14 66 4 31 33 15 6 12 12 67 5 34 37 14 13 16 21 76 6 35 29 13 10 18 12 78 7 39 31 19 12 14 22 53 8 34 36 15 14 14 11 80 9 36 35 14 12 15 10 74 10 37 38 15 6 15 13 76 11 38 31 16 10 17 10 79 12 36 34 16 12 19 8 54 13 38 35 16 12 10 15 67 14 39 38 16 11 16 14 54 15 33 37 17 15 18 10 87 16 32 33 15 12 14 14 58 17 36 32 15 10 14 14 75 18 38 38 20 12 17 11 88 19 39 38 18 11 14 10 64 20 32 32 16 12 16 13 57 21 32 33 16 11 18 7 66 22 31 31 16 12 11 14 68 23 39 38 19 13 14 12 54 24 37 39 16 11 12 14 56 25 39 32 17 9 17 11 86 26 41 32 17 13 9 9 80 27 36 35 16 10 16 11 76 28 33 37 15 14 14 15 69 29 33 33 16 12 15 14 78 30 34 33 14 10 11 13 67 31 31 28 15 12 16 9 80 32 27 32 12 8 13 15 54 33 37 31 14 10 17 10 71 34 34 37 16 12 15 11 84 35 34 30 14 12 14 13 74 36 32 33 7 7 16 8 71 37 29 31 10 6 9 20 63 38 36 33 14 12 15 12 71 39 29 31 16 10 17 10 76 40 35 33 16 10 13 10 69 41 37 32 16 10 15 9 74 42 34 33 14 12 16 14 75 43 38 32 20 15 16 8 54 44 35 33 14 10 12 14 52 45 38 28 14 10 12 11 69 46 37 35 11 12 11 13 68 47 38 39 14 13 15 9 65 48 33 34 15 11 15 11 75 49 36 38 16 11 17 15 74 50 38 32 14 12 13 11 75 51 32 38 16 14 16 10 72 52 32 30 14 10 14 14 67 53 32 33 12 12 11 18 63 54 34 38 16 13 12 14 62 55 32 32 9 5 12 11 63 56 37 32 14 6 15 12 76 57 39 34 16 12 16 13 74 58 29 34 16 12 15 9 67 59 37 36 15 11 12 10 73 60 35 34 16 10 12 15 70 61 30 28 12 7 8 20 53 62 38 34 16 12 13 12 77 63 34 35 16 14 11 12 77 64 31 35 14 11 14 14 52 65 34 31 16 12 15 13 54 66 35 37 17 13 10 11 80 67 36 35 18 14 11 17 66 68 30 27 18 11 12 12 73 69 39 40 12 12 15 13 63 70 35 37 16 12 15 14 69 71 38 36 10 8 14 13 67 72 31 38 14 11 16 15 54 73 34 39 18 14 15 13 81 74 38 41 18 14 15 10 69 75 34 27 16 12 13 11 84 76 39 30 17 9 12 19 80 77 37 37 16 13 17 13 70 78 34 31 16 11 13 17 69 79 28 31 13 12 15 13 77 80 37 27 16 12 13 9 54 81 33 36 16 12 15 11 79 82 37 38 20 12 16 10 30 83 35 37 16 12 15 9 71 84 37 33 15 12 16 12 73 85 32 34 15 11 15 12 72 86 33 31 16 10 14 13 77 87 38 39 14 9 15 13 75 88 33 34 16 12 14 12 69 89 29 32 16 12 13 15 54 90 33 33 15 12 7 22 70 91 31 36 12 9 17 13 73 92 36 32 17 15 13 15 54 93 35 41 16 12 15 13 77 94 32 28 15 12 14 15 82 95 29 30 13 12 13 10 80 96 39 36 16 10 16 11 80 97 37 35 16 13 12 16 69 98 35 31 16 9 14 11 78 99 37 34 16 12 17 11 81 100 32 36 14 10 15 10 76 101 38 36 16 14 17 10 76 102 37 35 16 11 12 16 73 103 36 37 20 15 16 12 85 104 32 28 15 11 11 11 66 105 33 39 16 11 15 16 79 106 40 32 13 12 9 19 68 107 38 35 17 12 16 11 76 108 41 39 16 12 15 16 71 109 36 35 16 11 10 15 54 110 43 42 12 7 10 24 46 111 30 34 16 12 15 14 82 112 31 33 16 14 11 15 74 113 32 41 17 11 13 11 88 114 32 33 13 11 14 15 38 115 37 34 12 10 18 12 76 116 37 32 18 13 16 10 86 117 33 40 14 13 14 14 54 118 34 40 14 8 14 13 70 119 33 35 13 11 14 9 69 120 38 36 16 12 14 15 90 121 33 37 13 11 12 15 54 122 31 27 16 13 14 14 76 123 38 39 13 12 15 11 89 124 37 38 16 14 15 8 76 125 33 31 15 13 15 11 73 126 31 33 16 15 13 11 79 127 39 32 15 10 17 8 90 128 44 39 17 11 17 10 74 129 33 36 15 9 19 11 81 130 35 33 12 11 15 13 72 131 32 33 16 10 13 11 71 132 28 32 10 11 9 20 66 133 40 37 16 8 15 10 77 134 27 30 12 11 15 15 65 135 37 38 14 12 15 12 74 136 32 29 15 12 16 14 82 137 28 22 13 9 11 23 54 138 34 35 15 11 14 14 63 139 30 35 11 10 11 16 54 140 35 34 12 8 15 11 64 141 31 35 8 9 13 12 69 142 32 34 16 8 15 10 54 143 30 34 15 9 16 14 84 144 30 35 17 15 14 12 86 145 31 23 16 11 15 12 77 146 40 31 10 8 16 11 89 147 32 27 18 13 16 12 76 148 36 36 13 12 11 13 60 149 32 31 16 12 12 11 75 150 35 32 13 9 9 19 73 151 38 39 10 7 16 12 85 152 42 37 15 13 13 17 79 153 34 38 16 9 16 9 71 154 35 39 16 6 12 12 72 155 35 34 14 8 9 19 69 156 33 31 10 8 13 18 78 157 36 32 17 15 13 15 54 158 32 37 13 6 14 14 69 159 33 36 15 9 19 11 81 160 34 32 16 11 13 9 84 161 32 35 12 8 12 18 84 162 34 36 13 8 13 16 69 Belonging_Final t 1 32 1 2 51 2 3 42 3 4 41 4 5 46 5 6 47 6 7 37 7 8 49 8 9 45 9 10 47 10 11 49 11 12 33 12 13 42 13 14 33 14 15 53 15 16 36 16 17 45 17 18 54 18 19 41 19 20 36 20 21 41 21 22 44 22 23 33 23 24 37 24 25 52 25 26 47 26 27 43 27 28 44 28 29 45 29 30 44 30 31 49 31 32 33 32 33 43 33 34 54 34 35 42 35 36 44 36 37 37 37 38 43 38 39 46 39 40 42 40 41 45 41 42 44 42 43 33 43 44 31 44 45 42 45 46 40 46 47 43 47 48 46 48 49 42 49 50 45 50 51 44 51 52 40 52 53 37 53 54 46 54 55 36 55 56 47 56 57 45 57 58 42 58 59 43 59 60 43 60 61 32 61 62 45 62 63 45 63 64 31 64 65 33 65 66 49 66 67 42 67 68 41 68 69 38 69 70 42 70 71 44 71 72 33 72 73 48 73 74 40 74 75 50 75 76 49 76 77 43 77 78 44 78 79 47 79 80 33 80 81 46 81 82 0 82 83 45 83 84 43 84 85 44 85 86 47 86 87 45 87 88 42 88 89 33 89 90 43 90 91 46 91 92 33 92 93 46 93 94 48 94 95 47 95 96 47 96 97 43 97 98 46 98 99 48 99 100 46 100 101 45 101 102 45 102 103 52 103 104 42 104 105 47 105 106 41 106 107 47 107 108 43 108 109 33 109 110 30 110 111 49 111 112 44 112 113 55 113 114 11 114 115 47 115 116 53 116 117 33 117 118 44 118 119 42 119 120 55 120 121 33 121 122 46 122 123 54 123 124 47 124 125 45 125 126 47 126 127 55 127 128 44 128 129 53 129 130 44 130 131 42 131 132 40 132 133 46 133 134 40 134 135 46 135 136 53 136 137 33 137 138 42 138 139 35 139 140 40 140 141 41 141 142 33 142 143 51 143 144 53 144 145 46 145 146 55 146 147 47 147 148 38 148 149 46 149 150 46 150 151 53 151 152 47 152 153 41 153 154 44 154 155 43 155 156 51 156 157 33 157 158 43 158 159 53 159 160 51 160 161 50 161 162 46 162 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) Separate Learning Software 18.646799 0.342547 0.300043 -0.149104 Happiness Depression Belonging Belonging_Final 0.022260 -0.010015 0.047026 -0.032781 t -0.007798 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -6.3632 -2.2754 -0.2136 2.2061 7.4368 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 18.646799 4.187023 4.453 1.62e-05 *** Separate 0.342547 0.070524 4.857 2.92e-06 *** Learning 0.300043 0.134014 2.239 0.0266 * Software -0.149104 0.136957 -1.089 0.2780 Happiness 0.022260 0.128935 0.173 0.8632 Depression -0.010015 0.095599 -0.105 0.9167 Belonging 0.047026 0.075435 0.623 0.5340 Belonging_Final -0.032781 0.107857 -0.304 0.7616 t -0.007798 0.005477 -1.424 0.1565 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 3.11 on 153 degrees of freedom Multiple R-squared: 0.1931, Adjusted R-squared: 0.1509 F-statistic: 4.576 on 8 and 153 DF, p-value: 5.111e-05 > 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.37373849 0.74747699 0.626261507 [2,] 0.95414819 0.09170363 0.045851813 [3,] 0.92074874 0.15850251 0.079251257 [4,] 0.89338294 0.21323412 0.106617058 [5,] 0.89745449 0.20509102 0.102545509 [6,] 0.87145284 0.25709431 0.128547156 [7,] 0.84426411 0.31147178 0.155735892 [8,] 0.80190302 0.39619396 0.198096982 [9,] 0.81420602 0.37158795 0.185793977 [10,] 0.81519678 0.36960644 0.184803220 [11,] 0.76324676 0.47350648 0.236753239 [12,] 0.73704186 0.52591628 0.262958141 [13,] 0.67495364 0.65009272 0.325046362 [14,] 0.68622434 0.62755132 0.313775658 [15,] 0.81329300 0.37341400 0.186706999 [16,] 0.81012236 0.37975528 0.189877641 [17,] 0.76842269 0.46315462 0.231577310 [18,] 0.76488267 0.47023465 0.235117326 [19,] 0.71409926 0.57180148 0.285900738 [20,] 0.66949817 0.66100365 0.330501826 [21,] 0.77921125 0.44157750 0.220788748 [22,] 0.80121470 0.39757061 0.198785305 [23,] 0.76075252 0.47849496 0.239247479 [24,] 0.71414036 0.57171928 0.285859640 [25,] 0.67387940 0.65224120 0.326120598 [26,] 0.65466843 0.69066314 0.345331570 [27,] 0.63757973 0.72484053 0.362420266 [28,] 0.72079147 0.55841706 0.279208528 [29,] 0.67337008 0.65325984 0.326629922 [30,] 0.65664614 0.68670772 0.343353862 [31,] 0.60750505 0.78498991 0.392494954 [32,] 0.58540676 0.82918647 0.414593236 [33,] 0.54091252 0.91817495 0.459087476 [34,] 0.64539984 0.70920032 0.354600160 [35,] 0.65844059 0.68311882 0.341559408 [36,] 0.64699263 0.70601473 0.353007367 [37,] 0.61240181 0.77519638 0.387598192 [38,] 0.56295223 0.87409554 0.437047771 [39,] 0.59214877 0.81570246 0.407851230 [40,] 0.62597877 0.74804247 0.374021233 [41,] 0.58199544 0.83600912 0.418004562 [42,] 0.53515785 0.92968429 0.464842146 [43,] 0.48800370 0.97600740 0.511996301 [44,] 0.44085320 0.88170639 0.559146805 [45,] 0.43950923 0.87901846 0.560490770 [46,] 0.47449148 0.94898296 0.525508522 [47,] 0.59723578 0.80552845 0.402764224 [48,] 0.55805130 0.88389740 0.441948701 [49,] 0.50887019 0.98225961 0.491129806 [50,] 0.47069467 0.94138934 0.529305332 [51,] 0.45788914 0.91577828 0.542110861 [52,] 0.41987887 0.83975774 0.580121130 [53,] 0.41769557 0.83539114 0.582304432 [54,] 0.37228071 0.74456142 0.627719288 [55,] 0.33238553 0.66477105 0.667614474 [56,] 0.29588326 0.59176652 0.704116739 [57,] 0.31845842 0.63691683 0.681541584 [58,] 0.33961811 0.67923622 0.660381891 [59,] 0.29835290 0.59670580 0.701647101 [60,] 0.33733680 0.67467361 0.662663197 [61,] 0.36711404 0.73422808 0.632885962 [62,] 0.35985513 0.71971025 0.640144873 [63,] 0.31773362 0.63546724 0.682266381 [64,] 0.28465635 0.56931271 0.715343647 [65,] 0.35071084 0.70142169 0.649289156 [66,] 0.31584940 0.63169879 0.684150604 [67,] 0.27542235 0.55084470 0.724577652 [68,] 0.33190769 0.66381537 0.668092314 [69,] 0.41043681 0.82087362 0.589563192 [70,] 0.39499637 0.78999274 0.605003630 [71,] 0.35048101 0.70096202 0.649518988 [72,] 0.30880010 0.61760020 0.691199900 [73,] 0.30184570 0.60369140 0.698154301 [74,] 0.28380787 0.56761575 0.716192127 [75,] 0.24784868 0.49569736 0.752151319 [76,] 0.22542322 0.45084644 0.774576778 [77,] 0.19798713 0.39597427 0.802012866 [78,] 0.22700677 0.45401354 0.772993228 [79,] 0.19623323 0.39246645 0.803766775 [80,] 0.21044557 0.42089114 0.789554430 [81,] 0.19924605 0.39849211 0.800753945 [82,] 0.18743295 0.37486590 0.812567052 [83,] 0.15918427 0.31836854 0.840815730 [84,] 0.16957070 0.33914140 0.830429302 [85,] 0.16673672 0.33347343 0.833263283 [86,] 0.15299065 0.30598131 0.847009345 [87,] 0.12769649 0.25539298 0.872303509 [88,] 0.11210136 0.22420271 0.887898643 [89,] 0.11364272 0.22728544 0.886357282 [90,] 0.10553844 0.21107687 0.894461565 [91,] 0.09177800 0.18355601 0.908221997 [92,] 0.07458893 0.14917786 0.925411072 [93,] 0.05901163 0.11802325 0.940988375 [94,] 0.07111166 0.14222332 0.928888338 [95,] 0.16544743 0.33089486 0.834552568 [96,] 0.15413426 0.30826852 0.845865741 [97,] 0.17926596 0.35853191 0.820734043 [98,] 0.16709204 0.33418409 0.832907957 [99,] 0.40108028 0.80216055 0.598919723 [100,] 0.45353039 0.90706077 0.546469613 [101,] 0.42743411 0.85486823 0.572565887 [102,] 0.53634281 0.92731438 0.463657191 [103,] 0.48750593 0.97501187 0.512494066 [104,] 0.47759648 0.95519296 0.522403522 [105,] 0.44621770 0.89243539 0.553782305 [106,] 0.41267834 0.82535667 0.587321664 [107,] 0.38391290 0.76782581 0.616087096 [108,] 0.33823361 0.67646721 0.661766394 [109,] 0.30430324 0.60860648 0.695696761 [110,] 0.26020932 0.52041864 0.739790682 [111,] 0.21974721 0.43949442 0.780252792 [112,] 0.18811488 0.37622976 0.811885120 [113,] 0.15445954 0.30891908 0.845540462 [114,] 0.12251832 0.24503665 0.877481677 [115,] 0.13148605 0.26297210 0.868513952 [116,] 0.14687268 0.29374536 0.853127320 [117,] 0.33479123 0.66958246 0.665208772 [118,] 0.29455413 0.58910826 0.705445870 [119,] 0.26596059 0.53192117 0.734039413 [120,] 0.22661983 0.45323966 0.773380172 [121,] 0.25411150 0.50822300 0.745888500 [122,] 0.36843872 0.73687743 0.631561285 [123,] 0.45378716 0.90757433 0.546212836 [124,] 0.42123043 0.84246086 0.578769572 [125,] 0.35235468 0.70470936 0.647645322 [126,] 0.29665248 0.59330497 0.703347517 [127,] 0.25173532 0.50347065 0.748264676 [128,] 0.26150443 0.52300886 0.738495569 [129,] 0.21950697 0.43901395 0.780493027 [130,] 0.40889779 0.81779559 0.591102206 [131,] 0.33809422 0.67618844 0.661905781 [132,] 0.36387718 0.72775436 0.636122819 [133,] 0.77619564 0.44760871 0.223804356 [134,] 0.68637544 0.62724913 0.313624563 [135,] 0.94509794 0.10980411 0.054902057 [136,] 0.89633998 0.20732004 0.103660018 [137,] 0.92185615 0.15628770 0.078143852 [138,] 0.98731414 0.02537173 0.012685863 [139,] 0.99416682 0.01166636 0.005833178 > postscript(file="/var/wessaorg/rcomp/tmp/1pl221351785284.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/2mtji1351785284.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/33scx1351785284.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/4c77u1351785284.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/5kcm01351785284.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 5.598057724 3.583826506 -5.908369794 -4.479341352 -1.756193869 1.648782542 7 8 9 10 11 12 4.506469475 -1.686583354 0.784353233 -0.428602894 3.123315155 0.988286659 13 14 15 16 17 18 2.607674136 2.611461374 -3.722641141 -2.256302584 1.291419591 -0.371205753 19 20 21 22 23 24 1.846811936 -2.190116649 -3.037909944 -2.965697302 2.104212067 0.473005096 25 26 27 28 29 30 3.219966832 6.100484721 -0.145438323 -2.479731497 -2.122725593 -0.249519796 31 32 33 34 35 36 -2.129616647 -6.363241469 3.074476676 -2.471097331 0.653794554 -0.899224692 37 38 39 40 41 42 -3.832822550 1.791131039 -5.615609432 -0.005806021 2.153215902 -0.335230749 43 44 45 46 47 48 3.229035365 1.126643994 5.378278567 3.210340153 2.207245532 -2.022360842 49 50 51 52 53 54 -0.773350900 4.139215270 -4.178643931 -1.238215179 -1.163161605 -1.639432551 55 56 57 58 59 60 -1.073765777 2.275407468 3.908896134 -5.870266548 1.430796911 -0.134305694 61 62 63 64 65 66 -1.740399307 2.863573068 -1.128447157 -3.297908793 0.568329336 -1.237003927 67 68 69 70 71 72 0.771676663 -3.361761023 3.457441074 -0.848309722 3.877734387 -4.326162202 73 74 75 76 77 78 -3.189529042 0.405195188 1.187480439 4.677985531 1.286598919 0.260377065 79 80 81 82 83 84 -5.045037835 5.059944906 -2.789167910 0.097444589 -0.792722188 2.733477331 85 86 87 88 89 90 -2.648308922 -1.166529823 1.558104948 -1.678077606 -4.522518609 -0.778165857 91 92 93 94 95 96 -3.700664875 2.648144645 -2.294245985 -0.660574077 -3.704327853 2.993086161 97 98 99 100 101 102 2.316021657 0.678103443 1.963276497 -3.208068365 2.718759289 1.934260283 103 104 105 106 107 108 -0.810737156 -0.149248646 -3.695908303 7.243157421 2.607678755 4.721673950 109 110 111 112 113 114 1.523474274 7.105199395 -4.882828997 -2.922916441 -5.785204022 -0.910116993 115 116 117 118 119 120 3.180109272 2.270971483 -2.327638686 -2.467203419 -1.057911451 2.355010301 121 122 123 124 125 126 -1.212436801 -1.044046848 2.202816974 1.303068188 -0.034805931 -2.886010096 127 128 129 130 131 132 4.644731578 7.215576396 -2.515767623 1.955285163 -2.380238149 -3.731787671 133 134 135 136 137 138 3.761393784 -4.767794301 1.792053192 -0.566242406 -1.145296402 -0.177607213 139 140 141 142 143 144 -2.838163267 1.468458709 -1.664828043 -2.485338261 -4.831317839 -4.875527433 145 146 147 148 149 150 0.117966659 7.436775043 -0.480955908 2.373734738 -1.291295099 2.067724626 151 152 153 154 155 156 2.718842520 7.008471290 -2.190115213 -1.801774595 1.062234508 1.037801606 157 158 159 160 161 162 3.155005205 -3.101553975 -2.281831980 0.001210389 -2.186158767 -0.288974678 > postscript(file="/var/wessaorg/rcomp/tmp/6llbb1351785284.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 5.598057724 NA 1 3.583826506 5.598057724 2 -5.908369794 3.583826506 3 -4.479341352 -5.908369794 4 -1.756193869 -4.479341352 5 1.648782542 -1.756193869 6 4.506469475 1.648782542 7 -1.686583354 4.506469475 8 0.784353233 -1.686583354 9 -0.428602894 0.784353233 10 3.123315155 -0.428602894 11 0.988286659 3.123315155 12 2.607674136 0.988286659 13 2.611461374 2.607674136 14 -3.722641141 2.611461374 15 -2.256302584 -3.722641141 16 1.291419591 -2.256302584 17 -0.371205753 1.291419591 18 1.846811936 -0.371205753 19 -2.190116649 1.846811936 20 -3.037909944 -2.190116649 21 -2.965697302 -3.037909944 22 2.104212067 -2.965697302 23 0.473005096 2.104212067 24 3.219966832 0.473005096 25 6.100484721 3.219966832 26 -0.145438323 6.100484721 27 -2.479731497 -0.145438323 28 -2.122725593 -2.479731497 29 -0.249519796 -2.122725593 30 -2.129616647 -0.249519796 31 -6.363241469 -2.129616647 32 3.074476676 -6.363241469 33 -2.471097331 3.074476676 34 0.653794554 -2.471097331 35 -0.899224692 0.653794554 36 -3.832822550 -0.899224692 37 1.791131039 -3.832822550 38 -5.615609432 1.791131039 39 -0.005806021 -5.615609432 40 2.153215902 -0.005806021 41 -0.335230749 2.153215902 42 3.229035365 -0.335230749 43 1.126643994 3.229035365 44 5.378278567 1.126643994 45 3.210340153 5.378278567 46 2.207245532 3.210340153 47 -2.022360842 2.207245532 48 -0.773350900 -2.022360842 49 4.139215270 -0.773350900 50 -4.178643931 4.139215270 51 -1.238215179 -4.178643931 52 -1.163161605 -1.238215179 53 -1.639432551 -1.163161605 54 -1.073765777 -1.639432551 55 2.275407468 -1.073765777 56 3.908896134 2.275407468 57 -5.870266548 3.908896134 58 1.430796911 -5.870266548 59 -0.134305694 1.430796911 60 -1.740399307 -0.134305694 61 2.863573068 -1.740399307 62 -1.128447157 2.863573068 63 -3.297908793 -1.128447157 64 0.568329336 -3.297908793 65 -1.237003927 0.568329336 66 0.771676663 -1.237003927 67 -3.361761023 0.771676663 68 3.457441074 -3.361761023 69 -0.848309722 3.457441074 70 3.877734387 -0.848309722 71 -4.326162202 3.877734387 72 -3.189529042 -4.326162202 73 0.405195188 -3.189529042 74 1.187480439 0.405195188 75 4.677985531 1.187480439 76 1.286598919 4.677985531 77 0.260377065 1.286598919 78 -5.045037835 0.260377065 79 5.059944906 -5.045037835 80 -2.789167910 5.059944906 81 0.097444589 -2.789167910 82 -0.792722188 0.097444589 83 2.733477331 -0.792722188 84 -2.648308922 2.733477331 85 -1.166529823 -2.648308922 86 1.558104948 -1.166529823 87 -1.678077606 1.558104948 88 -4.522518609 -1.678077606 89 -0.778165857 -4.522518609 90 -3.700664875 -0.778165857 91 2.648144645 -3.700664875 92 -2.294245985 2.648144645 93 -0.660574077 -2.294245985 94 -3.704327853 -0.660574077 95 2.993086161 -3.704327853 96 2.316021657 2.993086161 97 0.678103443 2.316021657 98 1.963276497 0.678103443 99 -3.208068365 1.963276497 100 2.718759289 -3.208068365 101 1.934260283 2.718759289 102 -0.810737156 1.934260283 103 -0.149248646 -0.810737156 104 -3.695908303 -0.149248646 105 7.243157421 -3.695908303 106 2.607678755 7.243157421 107 4.721673950 2.607678755 108 1.523474274 4.721673950 109 7.105199395 1.523474274 110 -4.882828997 7.105199395 111 -2.922916441 -4.882828997 112 -5.785204022 -2.922916441 113 -0.910116993 -5.785204022 114 3.180109272 -0.910116993 115 2.270971483 3.180109272 116 -2.327638686 2.270971483 117 -2.467203419 -2.327638686 118 -1.057911451 -2.467203419 119 2.355010301 -1.057911451 120 -1.212436801 2.355010301 121 -1.044046848 -1.212436801 122 2.202816974 -1.044046848 123 1.303068188 2.202816974 124 -0.034805931 1.303068188 125 -2.886010096 -0.034805931 126 4.644731578 -2.886010096 127 7.215576396 4.644731578 128 -2.515767623 7.215576396 129 1.955285163 -2.515767623 130 -2.380238149 1.955285163 131 -3.731787671 -2.380238149 132 3.761393784 -3.731787671 133 -4.767794301 3.761393784 134 1.792053192 -4.767794301 135 -0.566242406 1.792053192 136 -1.145296402 -0.566242406 137 -0.177607213 -1.145296402 138 -2.838163267 -0.177607213 139 1.468458709 -2.838163267 140 -1.664828043 1.468458709 141 -2.485338261 -1.664828043 142 -4.831317839 -2.485338261 143 -4.875527433 -4.831317839 144 0.117966659 -4.875527433 145 7.436775043 0.117966659 146 -0.480955908 7.436775043 147 2.373734738 -0.480955908 148 -1.291295099 2.373734738 149 2.067724626 -1.291295099 150 2.718842520 2.067724626 151 7.008471290 2.718842520 152 -2.190115213 7.008471290 153 -1.801774595 -2.190115213 154 1.062234508 -1.801774595 155 1.037801606 1.062234508 156 3.155005205 1.037801606 157 -3.101553975 3.155005205 158 -2.281831980 -3.101553975 159 0.001210389 -2.281831980 160 -2.186158767 0.001210389 161 -0.288974678 -2.186158767 162 NA -0.288974678 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 3.583826506 5.598057724 [2,] -5.908369794 3.583826506 [3,] -4.479341352 -5.908369794 [4,] -1.756193869 -4.479341352 [5,] 1.648782542 -1.756193869 [6,] 4.506469475 1.648782542 [7,] -1.686583354 4.506469475 [8,] 0.784353233 -1.686583354 [9,] -0.428602894 0.784353233 [10,] 3.123315155 -0.428602894 [11,] 0.988286659 3.123315155 [12,] 2.607674136 0.988286659 [13,] 2.611461374 2.607674136 [14,] -3.722641141 2.611461374 [15,] -2.256302584 -3.722641141 [16,] 1.291419591 -2.256302584 [17,] -0.371205753 1.291419591 [18,] 1.846811936 -0.371205753 [19,] -2.190116649 1.846811936 [20,] -3.037909944 -2.190116649 [21,] -2.965697302 -3.037909944 [22,] 2.104212067 -2.965697302 [23,] 0.473005096 2.104212067 [24,] 3.219966832 0.473005096 [25,] 6.100484721 3.219966832 [26,] -0.145438323 6.100484721 [27,] -2.479731497 -0.145438323 [28,] -2.122725593 -2.479731497 [29,] -0.249519796 -2.122725593 [30,] -2.129616647 -0.249519796 [31,] -6.363241469 -2.129616647 [32,] 3.074476676 -6.363241469 [33,] -2.471097331 3.074476676 [34,] 0.653794554 -2.471097331 [35,] -0.899224692 0.653794554 [36,] -3.832822550 -0.899224692 [37,] 1.791131039 -3.832822550 [38,] -5.615609432 1.791131039 [39,] -0.005806021 -5.615609432 [40,] 2.153215902 -0.005806021 [41,] -0.335230749 2.153215902 [42,] 3.229035365 -0.335230749 [43,] 1.126643994 3.229035365 [44,] 5.378278567 1.126643994 [45,] 3.210340153 5.378278567 [46,] 2.207245532 3.210340153 [47,] -2.022360842 2.207245532 [48,] -0.773350900 -2.022360842 [49,] 4.139215270 -0.773350900 [50,] -4.178643931 4.139215270 [51,] -1.238215179 -4.178643931 [52,] -1.163161605 -1.238215179 [53,] -1.639432551 -1.163161605 [54,] -1.073765777 -1.639432551 [55,] 2.275407468 -1.073765777 [56,] 3.908896134 2.275407468 [57,] -5.870266548 3.908896134 [58,] 1.430796911 -5.870266548 [59,] -0.134305694 1.430796911 [60,] -1.740399307 -0.134305694 [61,] 2.863573068 -1.740399307 [62,] -1.128447157 2.863573068 [63,] -3.297908793 -1.128447157 [64,] 0.568329336 -3.297908793 [65,] -1.237003927 0.568329336 [66,] 0.771676663 -1.237003927 [67,] -3.361761023 0.771676663 [68,] 3.457441074 -3.361761023 [69,] -0.848309722 3.457441074 [70,] 3.877734387 -0.848309722 [71,] -4.326162202 3.877734387 [72,] -3.189529042 -4.326162202 [73,] 0.405195188 -3.189529042 [74,] 1.187480439 0.405195188 [75,] 4.677985531 1.187480439 [76,] 1.286598919 4.677985531 [77,] 0.260377065 1.286598919 [78,] -5.045037835 0.260377065 [79,] 5.059944906 -5.045037835 [80,] -2.789167910 5.059944906 [81,] 0.097444589 -2.789167910 [82,] -0.792722188 0.097444589 [83,] 2.733477331 -0.792722188 [84,] -2.648308922 2.733477331 [85,] -1.166529823 -2.648308922 [86,] 1.558104948 -1.166529823 [87,] -1.678077606 1.558104948 [88,] -4.522518609 -1.678077606 [89,] -0.778165857 -4.522518609 [90,] -3.700664875 -0.778165857 [91,] 2.648144645 -3.700664875 [92,] -2.294245985 2.648144645 [93,] -0.660574077 -2.294245985 [94,] -3.704327853 -0.660574077 [95,] 2.993086161 -3.704327853 [96,] 2.316021657 2.993086161 [97,] 0.678103443 2.316021657 [98,] 1.963276497 0.678103443 [99,] -3.208068365 1.963276497 [100,] 2.718759289 -3.208068365 [101,] 1.934260283 2.718759289 [102,] -0.810737156 1.934260283 [103,] -0.149248646 -0.810737156 [104,] -3.695908303 -0.149248646 [105,] 7.243157421 -3.695908303 [106,] 2.607678755 7.243157421 [107,] 4.721673950 2.607678755 [108,] 1.523474274 4.721673950 [109,] 7.105199395 1.523474274 [110,] -4.882828997 7.105199395 [111,] -2.922916441 -4.882828997 [112,] -5.785204022 -2.922916441 [113,] -0.910116993 -5.785204022 [114,] 3.180109272 -0.910116993 [115,] 2.270971483 3.180109272 [116,] -2.327638686 2.270971483 [117,] -2.467203419 -2.327638686 [118,] -1.057911451 -2.467203419 [119,] 2.355010301 -1.057911451 [120,] -1.212436801 2.355010301 [121,] -1.044046848 -1.212436801 [122,] 2.202816974 -1.044046848 [123,] 1.303068188 2.202816974 [124,] -0.034805931 1.303068188 [125,] -2.886010096 -0.034805931 [126,] 4.644731578 -2.886010096 [127,] 7.215576396 4.644731578 [128,] -2.515767623 7.215576396 [129,] 1.955285163 -2.515767623 [130,] -2.380238149 1.955285163 [131,] -3.731787671 -2.380238149 [132,] 3.761393784 -3.731787671 [133,] -4.767794301 3.761393784 [134,] 1.792053192 -4.767794301 [135,] -0.566242406 1.792053192 [136,] -1.145296402 -0.566242406 [137,] -0.177607213 -1.145296402 [138,] -2.838163267 -0.177607213 [139,] 1.468458709 -2.838163267 [140,] -1.664828043 1.468458709 [141,] -2.485338261 -1.664828043 [142,] -4.831317839 -2.485338261 [143,] -4.875527433 -4.831317839 [144,] 0.117966659 -4.875527433 [145,] 7.436775043 0.117966659 [146,] -0.480955908 7.436775043 [147,] 2.373734738 -0.480955908 [148,] -1.291295099 2.373734738 [149,] 2.067724626 -1.291295099 [150,] 2.718842520 2.067724626 [151,] 7.008471290 2.718842520 [152,] -2.190115213 7.008471290 [153,] -1.801774595 -2.190115213 [154,] 1.062234508 -1.801774595 [155,] 1.037801606 1.062234508 [156,] 3.155005205 1.037801606 [157,] -3.101553975 3.155005205 [158,] -2.281831980 -3.101553975 [159,] 0.001210389 -2.281831980 [160,] -2.186158767 0.001210389 [161,] -0.288974678 -2.186158767 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 3.583826506 5.598057724 2 -5.908369794 3.583826506 3 -4.479341352 -5.908369794 4 -1.756193869 -4.479341352 5 1.648782542 -1.756193869 6 4.506469475 1.648782542 7 -1.686583354 4.506469475 8 0.784353233 -1.686583354 9 -0.428602894 0.784353233 10 3.123315155 -0.428602894 11 0.988286659 3.123315155 12 2.607674136 0.988286659 13 2.611461374 2.607674136 14 -3.722641141 2.611461374 15 -2.256302584 -3.722641141 16 1.291419591 -2.256302584 17 -0.371205753 1.291419591 18 1.846811936 -0.371205753 19 -2.190116649 1.846811936 20 -3.037909944 -2.190116649 21 -2.965697302 -3.037909944 22 2.104212067 -2.965697302 23 0.473005096 2.104212067 24 3.219966832 0.473005096 25 6.100484721 3.219966832 26 -0.145438323 6.100484721 27 -2.479731497 -0.145438323 28 -2.122725593 -2.479731497 29 -0.249519796 -2.122725593 30 -2.129616647 -0.249519796 31 -6.363241469 -2.129616647 32 3.074476676 -6.363241469 33 -2.471097331 3.074476676 34 0.653794554 -2.471097331 35 -0.899224692 0.653794554 36 -3.832822550 -0.899224692 37 1.791131039 -3.832822550 38 -5.615609432 1.791131039 39 -0.005806021 -5.615609432 40 2.153215902 -0.005806021 41 -0.335230749 2.153215902 42 3.229035365 -0.335230749 43 1.126643994 3.229035365 44 5.378278567 1.126643994 45 3.210340153 5.378278567 46 2.207245532 3.210340153 47 -2.022360842 2.207245532 48 -0.773350900 -2.022360842 49 4.139215270 -0.773350900 50 -4.178643931 4.139215270 51 -1.238215179 -4.178643931 52 -1.163161605 -1.238215179 53 -1.639432551 -1.163161605 54 -1.073765777 -1.639432551 55 2.275407468 -1.073765777 56 3.908896134 2.275407468 57 -5.870266548 3.908896134 58 1.430796911 -5.870266548 59 -0.134305694 1.430796911 60 -1.740399307 -0.134305694 61 2.863573068 -1.740399307 62 -1.128447157 2.863573068 63 -3.297908793 -1.128447157 64 0.568329336 -3.297908793 65 -1.237003927 0.568329336 66 0.771676663 -1.237003927 67 -3.361761023 0.771676663 68 3.457441074 -3.361761023 69 -0.848309722 3.457441074 70 3.877734387 -0.848309722 71 -4.326162202 3.877734387 72 -3.189529042 -4.326162202 73 0.405195188 -3.189529042 74 1.187480439 0.405195188 75 4.677985531 1.187480439 76 1.286598919 4.677985531 77 0.260377065 1.286598919 78 -5.045037835 0.260377065 79 5.059944906 -5.045037835 80 -2.789167910 5.059944906 81 0.097444589 -2.789167910 82 -0.792722188 0.097444589 83 2.733477331 -0.792722188 84 -2.648308922 2.733477331 85 -1.166529823 -2.648308922 86 1.558104948 -1.166529823 87 -1.678077606 1.558104948 88 -4.522518609 -1.678077606 89 -0.778165857 -4.522518609 90 -3.700664875 -0.778165857 91 2.648144645 -3.700664875 92 -2.294245985 2.648144645 93 -0.660574077 -2.294245985 94 -3.704327853 -0.660574077 95 2.993086161 -3.704327853 96 2.316021657 2.993086161 97 0.678103443 2.316021657 98 1.963276497 0.678103443 99 -3.208068365 1.963276497 100 2.718759289 -3.208068365 101 1.934260283 2.718759289 102 -0.810737156 1.934260283 103 -0.149248646 -0.810737156 104 -3.695908303 -0.149248646 105 7.243157421 -3.695908303 106 2.607678755 7.243157421 107 4.721673950 2.607678755 108 1.523474274 4.721673950 109 7.105199395 1.523474274 110 -4.882828997 7.105199395 111 -2.922916441 -4.882828997 112 -5.785204022 -2.922916441 113 -0.910116993 -5.785204022 114 3.180109272 -0.910116993 115 2.270971483 3.180109272 116 -2.327638686 2.270971483 117 -2.467203419 -2.327638686 118 -1.057911451 -2.467203419 119 2.355010301 -1.057911451 120 -1.212436801 2.355010301 121 -1.044046848 -1.212436801 122 2.202816974 -1.044046848 123 1.303068188 2.202816974 124 -0.034805931 1.303068188 125 -2.886010096 -0.034805931 126 4.644731578 -2.886010096 127 7.215576396 4.644731578 128 -2.515767623 7.215576396 129 1.955285163 -2.515767623 130 -2.380238149 1.955285163 131 -3.731787671 -2.380238149 132 3.761393784 -3.731787671 133 -4.767794301 3.761393784 134 1.792053192 -4.767794301 135 -0.566242406 1.792053192 136 -1.145296402 -0.566242406 137 -0.177607213 -1.145296402 138 -2.838163267 -0.177607213 139 1.468458709 -2.838163267 140 -1.664828043 1.468458709 141 -2.485338261 -1.664828043 142 -4.831317839 -2.485338261 143 -4.875527433 -4.831317839 144 0.117966659 -4.875527433 145 7.436775043 0.117966659 146 -0.480955908 7.436775043 147 2.373734738 -0.480955908 148 -1.291295099 2.373734738 149 2.067724626 -1.291295099 150 2.718842520 2.067724626 151 7.008471290 2.718842520 152 -2.190115213 7.008471290 153 -1.801774595 -2.190115213 154 1.062234508 -1.801774595 155 1.037801606 1.062234508 156 3.155005205 1.037801606 157 -3.101553975 3.155005205 158 -2.281831980 -3.101553975 159 0.001210389 -2.281831980 160 -2.186158767 0.001210389 161 -0.288974678 -2.186158767 > 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/7xbft1351785284.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/8gp911351785284.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/917301351785284.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/10lf1d1351785284.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/11u2kr1351785284.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/12mf8h1351785284.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/13iky41351785284.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/14miyf1351785284.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/153k591351785284.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/16sc101351785284.tab") + } > > try(system("convert tmp/1pl221351785284.ps tmp/1pl221351785284.png",intern=TRUE)) character(0) > try(system("convert tmp/2mtji1351785284.ps tmp/2mtji1351785284.png",intern=TRUE)) character(0) > try(system("convert tmp/33scx1351785284.ps tmp/33scx1351785284.png",intern=TRUE)) character(0) > try(system("convert tmp/4c77u1351785284.ps tmp/4c77u1351785284.png",intern=TRUE)) character(0) > try(system("convert tmp/5kcm01351785284.ps tmp/5kcm01351785284.png",intern=TRUE)) character(0) > try(system("convert tmp/6llbb1351785284.ps tmp/6llbb1351785284.png",intern=TRUE)) character(0) > try(system("convert tmp/7xbft1351785284.ps tmp/7xbft1351785284.png",intern=TRUE)) character(0) > try(system("convert tmp/8gp911351785284.ps tmp/8gp911351785284.png",intern=TRUE)) character(0) > try(system("convert tmp/917301351785284.ps tmp/917301351785284.png",intern=TRUE)) character(0) > try(system("convert tmp/10lf1d1351785284.ps tmp/10lf1d1351785284.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 8.229 0.843 9.072