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(2 + ,7 + ,41 + ,38 + ,13 + ,12 + ,14 + ,12 + ,2 + ,5 + ,39 + ,32 + ,16 + ,11 + ,18 + ,11 + ,2 + ,5 + ,30 + ,35 + ,19 + ,15 + ,11 + ,14 + ,1 + ,5 + ,31 + ,33 + ,15 + ,6 + ,12 + ,12 + ,2 + ,8 + ,34 + ,37 + ,14 + ,13 + ,16 + ,21 + ,2 + ,6 + ,35 + ,29 + ,13 + ,10 + ,18 + ,12 + ,2 + ,5 + ,39 + ,31 + ,19 + ,12 + ,14 + ,22 + ,2 + ,6 + ,34 + ,36 + ,15 + ,14 + ,14 + ,11 + ,2 + ,5 + ,36 + ,35 + ,14 + ,12 + ,15 + ,10 + ,2 + ,4 + ,37 + ,38 + ,15 + ,6 + ,15 + ,13 + ,1 + ,6 + ,38 + ,31 + ,16 + ,10 + ,17 + ,10 + ,2 + ,5 + ,36 + ,34 + ,16 + ,12 + ,19 + ,8 + ,1 + ,5 + ,38 + ,35 + ,16 + ,12 + ,10 + ,15 + ,2 + ,6 + ,39 + ,38 + ,16 + ,11 + ,16 + ,14 + ,2 + ,7 + ,33 + ,37 + ,17 + ,15 + ,18 + ,10 + ,1 + ,6 + ,32 + ,33 + ,15 + ,12 + ,14 + ,14 + ,1 + ,7 + ,36 + ,32 + ,15 + ,10 + ,14 + ,14 + ,2 + ,6 + ,38 + ,38 + ,20 + ,12 + ,17 + ,11 + ,1 + ,8 + ,39 + ,38 + ,18 + ,11 + ,14 + ,10 + ,2 + ,7 + ,32 + ,32 + ,16 + ,12 + ,16 + ,13 + ,1 + ,5 + ,32 + ,33 + ,16 + ,11 + ,18 + ,7 + ,2 + ,5 + ,31 + ,31 + ,16 + ,12 + ,11 + ,14 + ,2 + ,7 + ,39 + ,38 + ,19 + ,13 + ,14 + ,12 + ,2 + ,7 + ,37 + ,39 + ,16 + ,11 + ,12 + ,14 + ,1 + ,5 + ,39 + ,32 + ,17 + ,9 + ,17 + ,11 + ,2 + ,4 + ,41 + ,32 + ,17 + ,13 + ,9 + ,9 + ,1 + ,10 + ,36 + ,35 + ,16 + ,10 + ,16 + ,11 + ,2 + ,6 + ,33 + ,37 + ,15 + ,14 + ,14 + ,15 + ,2 + ,5 + ,33 + ,33 + ,16 + ,12 + ,15 + ,14 + ,1 + ,5 + ,34 + ,33 + ,14 + ,10 + ,11 + ,13 + ,2 + ,5 + ,31 + ,28 + ,15 + ,12 + ,16 + ,9 + ,1 + ,5 + ,27 + ,32 + ,12 + ,8 + ,13 + ,15 + ,2 + ,6 + ,37 + ,31 + ,14 + ,10 + ,17 + ,10 + ,2 + ,5 + ,34 + ,37 + ,16 + ,12 + ,15 + ,11 + ,1 + ,5 + ,34 + ,30 + ,14 + ,12 + ,14 + ,13 + ,1 + ,5 + ,32 + ,33 + ,7 + ,7 + ,16 + ,8 + ,1 + ,5 + ,29 + ,31 + ,10 + ,6 + ,9 + ,20 + ,1 + ,5 + ,36 + ,33 + ,14 + ,12 + ,15 + ,12 + ,2 + ,5 + ,29 + ,31 + ,16 + ,10 + ,17 + ,10 + ,1 + ,5 + ,35 + ,33 + ,16 + ,10 + ,13 + ,10 + ,1 + ,5 + ,37 + ,32 + ,16 + ,10 + ,15 + ,9 + ,2 + ,7 + ,34 + ,33 + ,14 + ,12 + ,16 + ,14 + ,1 + ,5 + ,38 + ,32 + ,20 + ,15 + ,16 + ,8 + ,1 + ,6 + ,35 + ,33 + ,14 + ,10 + ,12 + ,14 + ,2 + ,7 + ,38 + ,28 + ,14 + ,10 + ,12 + ,11 + ,2 + ,7 + ,37 + ,35 + ,11 + ,12 + ,11 + ,13 + ,2 + ,5 + ,38 + ,39 + ,14 + ,13 + ,15 + ,9 + ,2 + ,5 + ,33 + ,34 + ,15 + ,11 + ,15 + ,11 + ,2 + ,4 + ,36 + ,38 + ,16 + ,11 + ,17 + ,15 + ,1 + ,5 + ,38 + ,32 + ,14 + ,12 + ,13 + ,11 + ,2 + ,4 + ,32 + ,38 + ,16 + ,14 + ,16 + ,10 + ,1 + ,5 + ,32 + ,30 + ,14 + ,10 + ,14 + ,14 + ,1 + ,5 + ,32 + ,33 + ,12 + ,12 + ,11 + ,18 + ,2 + ,7 + ,34 + ,38 + ,16 + ,13 + ,12 + ,14 + ,1 + ,5 + ,32 + ,32 + ,9 + ,5 + ,12 + ,11 + ,2 + ,5 + ,37 + ,32 + ,14 + ,6 + ,15 + ,12 + ,2 + ,6 + ,39 + ,34 + ,16 + ,12 + ,16 + ,13 + ,2 + ,4 + ,29 + ,34 + ,16 + ,12 + ,15 + ,9 + ,1 + ,6 + ,37 + ,36 + ,15 + ,11 + ,12 + ,10 + ,2 + ,6 + ,35 + ,34 + ,16 + ,10 + ,12 + ,15 + ,1 + ,5 + ,30 + ,28 + ,12 + ,7 + ,8 + ,20 + ,1 + ,7 + ,38 + ,34 + ,16 + ,12 + ,13 + ,12 + ,2 + ,6 + ,34 + ,35 + ,16 + ,14 + ,11 + ,12 + ,2 + ,8 + ,31 + ,35 + ,14 + ,11 + ,14 + ,14 + ,2 + ,7 + ,34 + ,31 + ,16 + ,12 + ,15 + ,13 + ,1 + ,5 + ,35 + ,37 + ,17 + ,13 + ,10 + ,11 + ,2 + ,6 + ,36 + ,35 + ,18 + ,14 + ,11 + ,17 + ,1 + ,6 + ,30 + ,27 + ,18 + ,11 + ,12 + ,12 + ,2 + ,5 + ,39 + ,40 + ,12 + ,12 + ,15 + ,13 + ,1 + ,5 + ,35 + ,37 + ,16 + ,12 + ,15 + ,14 + ,1 + ,5 + ,38 + ,36 + ,10 + ,8 + ,14 + ,13 + ,2 + ,5 + ,31 + ,38 + ,14 + ,11 + ,16 + ,15 + ,2 + ,4 + ,34 + ,39 + ,18 + ,14 + ,15 + ,13 + ,1 + ,6 + ,38 + ,41 + ,18 + ,14 + ,15 + ,10 + ,1 + ,6 + ,34 + ,27 + ,16 + ,12 + ,13 + ,11 + ,2 + ,6 + ,39 + ,30 + ,17 + ,9 + ,12 + ,19 + ,2 + ,6 + ,37 + ,37 + ,16 + ,13 + ,17 + ,13 + ,2 + ,7 + ,34 + ,31 + ,16 + ,11 + ,13 + ,17 + ,1 + ,5 + ,28 + ,31 + ,13 + ,12 + ,15 + ,13 + ,1 + ,7 + ,37 + ,27 + ,16 + ,12 + ,13 + ,9 + ,1 + ,6 + ,33 + ,36 + ,16 + ,12 + ,15 + ,11 + ,1 + ,5 + ,37 + ,38 + ,20 + ,12 + ,16 + ,10 + ,2 + ,5 + ,35 + ,37 + ,16 + ,12 + ,15 + ,9 + ,1 + ,4 + ,37 + ,33 + ,15 + ,12 + ,16 + ,12 + ,2 + ,8 + ,32 + ,34 + ,15 + ,11 + ,15 + ,12 + ,2 + ,8 + ,33 + ,31 + ,16 + ,10 + ,14 + ,13 + ,1 + ,5 + ,38 + ,39 + ,14 + ,9 + ,15 + ,13 + ,2 + ,5 + ,33 + ,34 + ,16 + ,12 + ,14 + ,12 + ,2 + ,6 + ,29 + ,32 + ,16 + ,12 + ,13 + ,15 + ,2 + ,4 + ,33 + ,33 + ,15 + ,12 + ,7 + ,22 + ,2 + ,5 + ,31 + ,36 + ,12 + ,9 + ,17 + ,13 + ,2 + ,5 + ,36 + ,32 + ,17 + ,15 + ,13 + ,15 + ,2 + ,5 + ,35 + ,41 + ,16 + ,12 + ,15 + ,13 + ,2 + ,5 + ,32 + ,28 + ,15 + ,12 + ,14 + ,15 + ,2 + ,6 + ,29 + ,30 + ,13 + ,12 + ,13 + ,10 + ,2 + ,6 + ,39 + ,36 + ,16 + ,10 + ,16 + ,11 + ,2 + ,5 + ,37 + ,35 + ,16 + ,13 + ,12 + ,16 + ,2 + ,6 + ,35 + ,31 + ,16 + ,9 + ,14 + ,11 + ,1 + ,5 + ,37 + ,34 + ,16 + ,12 + ,17 + ,11 + ,1 + ,7 + ,32 + ,36 + ,14 + ,10 + ,15 + ,10 + ,2 + ,5 + ,38 + ,36 + ,16 + ,14 + ,17 + ,10 + ,1 + ,6 + ,37 + ,35 + ,16 + ,11 + ,12 + ,16 + ,2 + ,6 + ,36 + ,37 + ,20 + ,15 + ,16 + ,12 + ,1 + ,6 + ,32 + ,28 + ,15 + ,11 + ,11 + ,11 + ,2 + ,4 + ,33 + ,39 + ,16 + ,11 + ,15 + ,16 + ,1 + ,5 + ,40 + ,32 + ,13 + ,12 + ,9 + ,19 + ,2 + ,5 + ,38 + ,35 + ,17 + ,12 + ,16 + ,11 + ,1 + ,7 + ,41 + ,39 + ,16 + ,12 + ,15 + ,16 + ,1 + ,6 + ,36 + ,35 + ,16 + ,11 + ,10 + ,15 + ,2 + ,9 + ,43 + ,42 + ,12 + ,7 + ,10 + ,24 + ,2 + ,6 + ,30 + ,34 + ,16 + ,12 + ,15 + ,14 + ,2 + ,6 + ,31 + ,33 + ,16 + ,14 + ,11 + ,15 + ,2 + ,5 + ,32 + ,41 + ,17 + ,11 + ,13 + ,11 + ,1 + ,6 + ,32 + ,33 + ,13 + ,11 + ,14 + ,15 + ,2 + ,5 + ,37 + ,34 + ,12 + ,10 + ,18 + ,12 + ,1 + ,8 + ,37 + ,32 + ,18 + ,13 + ,16 + ,10 + ,2 + ,7 + ,33 + ,40 + ,14 + ,13 + ,14 + ,14 + ,2 + ,5 + ,34 + ,40 + ,14 + ,8 + ,14 + ,13 + ,2 + ,7 + ,33 + ,35 + ,13 + ,11 + ,14 + ,9 + ,2 + ,6 + ,38 + ,36 + ,16 + ,12 + ,14 + ,15 + ,2 + ,6 + ,33 + ,37 + ,13 + ,11 + ,12 + ,15 + ,2 + ,9 + ,31 + ,27 + ,16 + ,13 + ,14 + ,14 + ,2 + ,7 + ,38 + ,39 + ,13 + ,12 + ,15 + ,11 + ,2 + ,6 + ,37 + ,38 + ,16 + ,14 + ,15 + ,8 + ,2 + ,5 + ,33 + ,31 + ,15 + ,13 + ,15 + ,11 + ,2 + ,5 + ,31 + ,33 + ,16 + ,15 + ,13 + ,11 + ,1 + ,6 + ,39 + ,32 + ,15 + ,10 + ,17 + ,8 + ,2 + ,6 + ,44 + ,39 + ,17 + ,11 + ,17 + ,10 + ,2 + ,7 + ,33 + ,36 + ,15 + ,9 + ,19 + ,11 + ,2 + ,5 + ,35 + ,33 + ,12 + ,11 + ,15 + ,13 + ,1 + ,5 + ,32 + ,33 + ,16 + ,10 + ,13 + ,11 + ,1 + ,5 + ,28 + ,32 + ,10 + ,11 + ,9 + ,20 + ,2 + ,6 + ,40 + ,37 + ,16 + ,8 + ,15 + ,10 + ,1 + ,4 + ,27 + ,30 + ,12 + ,11 + ,15 + ,15 + ,1 + ,5 + ,37 + ,38 + ,14 + ,12 + ,15 + ,12 + ,2 + ,7 + ,32 + ,29 + ,15 + ,12 + ,16 + ,14 + ,1 + ,5 + ,28 + ,22 + ,13 + ,9 + ,11 + ,23 + ,1 + ,7 + ,34 + ,35 + ,15 + ,11 + ,14 + ,14 + ,2 + ,7 + ,30 + ,35 + ,11 + ,10 + ,11 + ,16 + ,2 + ,6 + ,35 + ,34 + ,12 + ,8 + ,15 + ,11 + ,1 + ,5 + ,31 + ,35 + ,8 + ,9 + ,13 + ,12 + ,2 + ,8 + ,32 + ,34 + ,16 + ,8 + ,15 + ,10 + ,1 + ,5 + ,30 + ,34 + ,15 + ,9 + ,16 + ,14 + ,2 + ,5 + ,30 + ,35 + ,17 + ,15 + ,14 + ,12 + ,1 + ,5 + ,31 + ,23 + ,16 + ,11 + ,15 + ,12 + ,2 + ,6 + ,40 + ,31 + ,10 + ,8 + ,16 + ,11 + ,2 + ,4 + ,32 + ,27 + ,18 + ,13 + ,16 + ,12 + ,1 + ,5 + ,36 + ,36 + ,13 + ,12 + ,11 + ,13 + ,1 + ,5 + ,32 + ,31 + ,16 + ,12 + ,12 + ,11 + ,1 + ,7 + ,35 + ,32 + ,13 + ,9 + ,9 + ,19 + ,2 + ,6 + ,38 + ,39 + ,10 + ,7 + ,16 + ,12 + ,2 + ,7 + ,42 + ,37 + ,15 + ,13 + ,13 + ,17 + ,1 + ,10 + ,34 + ,38 + ,16 + ,9 + ,16 + ,9 + ,2 + ,6 + ,35 + ,39 + ,16 + ,6 + ,12 + ,12 + ,2 + ,8 + ,35 + ,34 + ,14 + ,8 + ,9 + ,19 + ,2 + ,4 + ,33 + ,31 + ,10 + ,8 + ,13 + ,18 + ,2 + ,5 + ,36 + ,32 + ,17 + ,15 + ,13 + ,15 + ,2 + ,6 + ,32 + ,37 + ,13 + ,6 + ,14 + ,14 + ,2 + ,7 + ,33 + ,36 + ,15 + ,9 + ,19 + ,11 + ,2 + ,7 + ,34 + ,32 + ,16 + ,11 + ,13 + ,9 + ,2 + ,6 + ,32 + ,35 + ,12 + ,8 + ,12 + ,18 + ,2 + ,6 + ,34 + ,36 + ,13 + ,8 + ,13 + ,16) + ,dim=c(8 + ,162) + ,dimnames=list(c('Gender' + ,'Age' + ,'Connected' + ,'Separate' + ,'Learning' + ,'Software' + ,'Happiness' + ,'Depression') + ,1:162)) > y <- array(NA,dim=c(8,162),dimnames=list(c('Gender','Age','Connected','Separate','Learning','Software','Happiness','Depression'),1:162)) > for (i in 1:dim(x)[1]) + { + for (j in 1:dim(x)[2]) + { + y[i,j] <- as.numeric(x[i,j]) + } + } > par3 = 'No Linear Trend' > par2 = 'Do not include Seasonal Dummies' > par1 = '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 Connected Gender Age Separate Learning Software Happiness Depression 1 41 2 7 38 13 12 14 12 2 39 2 5 32 16 11 18 11 3 30 2 5 35 19 15 11 14 4 31 1 5 33 15 6 12 12 5 34 2 8 37 14 13 16 21 6 35 2 6 29 13 10 18 12 7 39 2 5 31 19 12 14 22 8 34 2 6 36 15 14 14 11 9 36 2 5 35 14 12 15 10 10 37 2 4 38 15 6 15 13 11 38 1 6 31 16 10 17 10 12 36 2 5 34 16 12 19 8 13 38 1 5 35 16 12 10 15 14 39 2 6 38 16 11 16 14 15 33 2 7 37 17 15 18 10 16 32 1 6 33 15 12 14 14 17 36 1 7 32 15 10 14 14 18 38 2 6 38 20 12 17 11 19 39 1 8 38 18 11 14 10 20 32 2 7 32 16 12 16 13 21 32 1 5 33 16 11 18 7 22 31 2 5 31 16 12 11 14 23 39 2 7 38 19 13 14 12 24 37 2 7 39 16 11 12 14 25 39 1 5 32 17 9 17 11 26 41 2 4 32 17 13 9 9 27 36 1 10 35 16 10 16 11 28 33 2 6 37 15 14 14 15 29 33 2 5 33 16 12 15 14 30 34 1 5 33 14 10 11 13 31 31 2 5 28 15 12 16 9 32 27 1 5 32 12 8 13 15 33 37 2 6 31 14 10 17 10 34 34 2 5 37 16 12 15 11 35 34 1 5 30 14 12 14 13 36 32 1 5 33 7 7 16 8 37 29 1 5 31 10 6 9 20 38 36 1 5 33 14 12 15 12 39 29 2 5 31 16 10 17 10 40 35 1 5 33 16 10 13 10 41 37 1 5 32 16 10 15 9 42 34 2 7 33 14 12 16 14 43 38 1 5 32 20 15 16 8 44 35 1 6 33 14 10 12 14 45 38 2 7 28 14 10 12 11 46 37 2 7 35 11 12 11 13 47 38 2 5 39 14 13 15 9 48 33 2 5 34 15 11 15 11 49 36 2 4 38 16 11 17 15 50 38 1 5 32 14 12 13 11 51 32 2 4 38 16 14 16 10 52 32 1 5 30 14 10 14 14 53 32 1 5 33 12 12 11 18 54 34 2 7 38 16 13 12 14 55 32 1 5 32 9 5 12 11 56 37 2 5 32 14 6 15 12 57 39 2 6 34 16 12 16 13 58 29 2 4 34 16 12 15 9 59 37 1 6 36 15 11 12 10 60 35 2 6 34 16 10 12 15 61 30 1 5 28 12 7 8 20 62 38 1 7 34 16 12 13 12 63 34 2 6 35 16 14 11 12 64 31 2 8 35 14 11 14 14 65 34 2 7 31 16 12 15 13 66 35 1 5 37 17 13 10 11 67 36 2 6 35 18 14 11 17 68 30 1 6 27 18 11 12 12 69 39 2 5 40 12 12 15 13 70 35 1 5 37 16 12 15 14 71 38 1 5 36 10 8 14 13 72 31 2 5 38 14 11 16 15 73 34 2 4 39 18 14 15 13 74 38 1 6 41 18 14 15 10 75 34 1 6 27 16 12 13 11 76 39 2 6 30 17 9 12 19 77 37 2 6 37 16 13 17 13 78 34 2 7 31 16 11 13 17 79 28 1 5 31 13 12 15 13 80 37 1 7 27 16 12 13 9 81 33 1 6 36 16 12 15 11 82 37 1 5 38 20 12 16 10 83 35 2 5 37 16 12 15 9 84 37 1 4 33 15 12 16 12 85 32 2 8 34 15 11 15 12 86 33 2 8 31 16 10 14 13 87 38 1 5 39 14 9 15 13 88 33 2 5 34 16 12 14 12 89 29 2 6 32 16 12 13 15 90 33 2 4 33 15 12 7 22 91 31 2 5 36 12 9 17 13 92 36 2 5 32 17 15 13 15 93 35 2 5 41 16 12 15 13 94 32 2 5 28 15 12 14 15 95 29 2 6 30 13 12 13 10 96 39 2 6 36 16 10 16 11 97 37 2 5 35 16 13 12 16 98 35 2 6 31 16 9 14 11 99 37 1 5 34 16 12 17 11 100 32 1 7 36 14 10 15 10 101 38 2 5 36 16 14 17 10 102 37 1 6 35 16 11 12 16 103 36 2 6 37 20 15 16 12 104 32 1 6 28 15 11 11 11 105 33 2 4 39 16 11 15 16 106 40 1 5 32 13 12 9 19 107 38 2 5 35 17 12 16 11 108 41 1 7 39 16 12 15 16 109 36 1 6 35 16 11 10 15 110 43 2 9 42 12 7 10 24 111 30 2 6 34 16 12 15 14 112 31 2 6 33 16 14 11 15 113 32 2 5 41 17 11 13 11 114 32 1 6 33 13 11 14 15 115 37 2 5 34 12 10 18 12 116 37 1 8 32 18 13 16 10 117 33 2 7 40 14 13 14 14 118 34 2 5 40 14 8 14 13 119 33 2 7 35 13 11 14 9 120 38 2 6 36 16 12 14 15 121 33 2 6 37 13 11 12 15 122 31 2 9 27 16 13 14 14 123 38 2 7 39 13 12 15 11 124 37 2 6 38 16 14 15 8 125 33 2 5 31 15 13 15 11 126 31 2 5 33 16 15 13 11 127 39 1 6 32 15 10 17 8 128 44 2 6 39 17 11 17 10 129 33 2 7 36 15 9 19 11 130 35 2 5 33 12 11 15 13 131 32 1 5 33 16 10 13 11 132 28 1 5 32 10 11 9 20 133 40 2 6 37 16 8 15 10 134 27 1 4 30 12 11 15 15 135 37 1 5 38 14 12 15 12 136 32 2 7 29 15 12 16 14 137 28 1 5 22 13 9 11 23 138 34 1 7 35 15 11 14 14 139 30 2 7 35 11 10 11 16 140 35 2 6 34 12 8 15 11 141 31 1 5 35 8 9 13 12 142 32 2 8 34 16 8 15 10 143 30 1 5 34 15 9 16 14 144 30 2 5 35 17 15 14 12 145 31 1 5 23 16 11 15 12 146 40 2 6 31 10 8 16 11 147 32 2 4 27 18 13 16 12 148 36 1 5 36 13 12 11 13 149 32 1 5 31 16 12 12 11 150 35 1 7 32 13 9 9 19 151 38 2 6 39 10 7 16 12 152 42 2 7 37 15 13 13 17 153 34 1 10 38 16 9 16 9 154 35 2 6 39 16 6 12 12 155 35 2 8 34 14 8 9 19 156 33 2 4 31 10 8 13 18 157 36 2 5 32 17 15 13 15 158 32 2 6 37 13 6 14 14 159 33 2 7 36 15 9 19 11 160 34 2 7 32 16 11 13 9 161 32 2 6 35 12 8 12 18 162 34 2 6 36 13 8 13 16 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) Gender Age Separate Learning Software 18.18215 -0.33115 0.29146 0.33016 0.31233 -0.10855 Happiness Depression 0.06861 -0.03075 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -6.1837 -2.2167 -0.1848 2.2657 7.5099 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 18.18215 3.91823 4.640 7.39e-06 *** Gender -0.33115 0.54193 -0.611 0.5421 Age 0.29146 0.21418 1.361 0.1756 Separate 0.33016 0.07181 4.598 8.86e-06 *** Learning 0.31233 0.13307 2.347 0.0202 * Software -0.10855 0.13863 -0.783 0.4348 Happiness 0.06861 0.12958 0.529 0.5973 Depression -0.03075 0.09539 -0.322 0.7476 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 3.105 on 154 degrees of freedom Multiple R-squared: 0.1902, Adjusted R-squared: 0.1534 F-statistic: 5.169 on 7 and 154 DF, p-value: 2.632e-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.94872152 0.1025570 0.05127848 [2,] 0.93318759 0.1336248 0.06681241 [3,] 0.92268618 0.1546276 0.07731382 [4,] 0.89210578 0.2157884 0.10789422 [5,] 0.86700598 0.2659880 0.13299402 [6,] 0.89312738 0.2137452 0.10687262 [7,] 0.85834083 0.2833183 0.14165917 [8,] 0.82137686 0.3572463 0.17862314 [9,] 0.80393901 0.3921220 0.19606099 [10,] 0.78885941 0.4222812 0.21114059 [11,] 0.80233722 0.3953256 0.19766278 [12,] 0.76163126 0.4767375 0.23836874 [13,] 0.73026218 0.5394756 0.26973782 [14,] 0.66446109 0.6710778 0.33553891 [15,] 0.65490679 0.6901864 0.34509321 [16,] 0.87129826 0.2574035 0.12870174 [17,] 0.83322255 0.3335549 0.16677745 [18,] 0.80782180 0.3843564 0.19217820 [19,] 0.78070087 0.4385983 0.21929913 [20,] 0.73056022 0.5388796 0.26943978 [21,] 0.71065455 0.5786909 0.28934545 [22,] 0.82755302 0.3448940 0.17244698 [23,] 0.81139182 0.3772164 0.18860818 [24,] 0.78448349 0.4310330 0.21551651 [25,] 0.75618049 0.4876390 0.24381951 [26,] 0.70948456 0.5810309 0.29051544 [27,] 0.68616952 0.6276610 0.31383048 [28,] 0.67060158 0.6587968 0.32939842 [29,] 0.78040153 0.4391969 0.21959847 [30,] 0.73669123 0.5266175 0.26330877 [31,] 0.71045438 0.5790912 0.28954562 [32,] 0.66134731 0.6773054 0.33865269 [33,] 0.62913341 0.7417332 0.37086659 [34,] 0.58220190 0.8355962 0.41779810 [35,] 0.64134357 0.7173129 0.35865643 [36,] 0.64056213 0.7188757 0.35943787 [37,] 0.61760048 0.7647990 0.38239952 [38,] 0.58544406 0.8291119 0.41455594 [39,] 0.53754834 0.9249033 0.46245166 [40,] 0.58028619 0.8394276 0.41971381 [41,] 0.59303708 0.8139258 0.40696292 [42,] 0.54848351 0.9030330 0.45151649 [43,] 0.49963413 0.9992683 0.50036587 [44,] 0.47854467 0.9570893 0.52145533 [45,] 0.43058675 0.8611735 0.56941325 [46,] 0.42073938 0.8414788 0.57926062 [47,] 0.44645666 0.8929133 0.55354334 [48,] 0.55681557 0.8863689 0.44318443 [49,] 0.51838957 0.9632209 0.48161043 [50,] 0.47128923 0.9425785 0.52871077 [51,] 0.43465428 0.8693086 0.56534572 [52,] 0.41392048 0.8278410 0.58607952 [53,] 0.37507220 0.7501444 0.62492780 [54,] 0.42289384 0.8457877 0.57710616 [55,] 0.37981330 0.7596266 0.62018670 [56,] 0.33815046 0.6763009 0.66184954 [57,] 0.29783002 0.5956600 0.70216998 [58,] 0.32681875 0.6536375 0.67318125 [59,] 0.35009435 0.7001887 0.64990565 [60,] 0.30896779 0.6179356 0.69103221 [61,] 0.33678883 0.6735777 0.66321117 [62,] 0.37597961 0.7519592 0.62402039 [63,] 0.35259748 0.7051950 0.64740252 [64,] 0.30966327 0.6193265 0.69033673 [65,] 0.27682514 0.5536503 0.72317486 [66,] 0.34846684 0.6969337 0.65153316 [67,] 0.31066520 0.6213304 0.68933480 [68,] 0.27101582 0.5420316 0.72898418 [69,] 0.32397852 0.6479570 0.67602148 [70,] 0.35425262 0.7085052 0.64574738 [71,] 0.34459429 0.6891886 0.65540571 [72,] 0.30301551 0.6060310 0.69698449 [73,] 0.26581832 0.5316366 0.73418168 [74,] 0.26851099 0.5370220 0.73148901 [75,] 0.27730795 0.5546159 0.72269205 [76,] 0.25171412 0.5034282 0.74828588 [77,] 0.22919007 0.4583801 0.77080993 [78,] 0.20211356 0.4042271 0.79788644 [79,] 0.25315609 0.5063122 0.74684391 [80,] 0.21785486 0.4357097 0.78214514 [81,] 0.22558536 0.4511707 0.77441464 [82,] 0.20924959 0.4184992 0.79075041 [83,] 0.18896642 0.3779328 0.81103358 [84,] 0.15872566 0.3174513 0.84127434 [85,] 0.16220800 0.3244160 0.83779200 [86,] 0.16305509 0.3261102 0.83694491 [87,] 0.15330545 0.3066109 0.84669455 [88,] 0.13327495 0.2665499 0.86672505 [89,] 0.11864778 0.2372956 0.88135222 [90,] 0.12613215 0.2522643 0.87386785 [91,] 0.11992625 0.2398525 0.88007375 [92,] 0.10545440 0.2109088 0.89454560 [93,] 0.08601938 0.1720388 0.91398062 [94,] 0.07037071 0.1407414 0.92962929 [95,] 0.06825579 0.1365116 0.93174421 [96,] 0.18357626 0.3671525 0.81642374 [97,] 0.17832499 0.3566500 0.82167501 [98,] 0.19648423 0.3929685 0.80351577 [99,] 0.18106673 0.3621335 0.81893327 [100,] 0.29440034 0.5888007 0.70559966 [101,] 0.34256618 0.6851324 0.65743382 [102,] 0.32341214 0.6468243 0.67658786 [103,] 0.38129308 0.7625862 0.61870692 [104,] 0.34248003 0.6849601 0.65751997 [105,] 0.32879074 0.6575815 0.67120926 [106,] 0.30727370 0.6145474 0.69272630 [107,] 0.31474441 0.6294888 0.68525559 [108,] 0.29495117 0.5899023 0.70504883 [109,] 0.26638199 0.5327640 0.73361801 [110,] 0.25440536 0.5088107 0.74559464 [111,] 0.22686151 0.4537230 0.77313849 [112,] 0.19927505 0.3985501 0.80072495 [113,] 0.17065569 0.3413114 0.82934431 [114,] 0.13857312 0.2771462 0.86142688 [115,] 0.11070633 0.2214127 0.88929367 [116,] 0.11855989 0.2371198 0.88144011 [117,] 0.17826841 0.3565368 0.82173159 [118,] 0.37649989 0.7529998 0.62350011 [119,] 0.35111797 0.7022359 0.64888203 [120,] 0.30280304 0.6056061 0.69719696 [121,] 0.25915941 0.5183188 0.74084059 [122,] 0.27871629 0.5574326 0.72128371 [123,] 0.37334605 0.7466921 0.62665395 [124,] 0.45928390 0.9185678 0.54071610 [125,] 0.43662466 0.8732493 0.56337534 [126,] 0.39611108 0.7922222 0.60388892 [127,] 0.36143350 0.7228670 0.63856650 [128,] 0.29810213 0.5962043 0.70189787 [129,] 0.55697410 0.8860518 0.44302590 [130,] 0.47841843 0.9568369 0.52158157 [131,] 0.61040497 0.7791901 0.38959503 [132,] 0.57189490 0.8562102 0.42810510 [133,] 0.50202107 0.9959579 0.49797893 [134,] 0.76998670 0.4600266 0.23001330 [135,] 0.72954079 0.5409184 0.27045921 [136,] 0.92573349 0.1485330 0.07426651 [137,] 0.91042599 0.1791480 0.08957401 [138,] 0.90656324 0.1868735 0.09343676 [139,] 0.84695913 0.3060817 0.15304087 [140,] 0.80212991 0.3957402 0.19787009 [141,] 0.65359267 0.6928147 0.34640733 > postscript(file="/var/wessaorg/rcomp/tmp/1ja4n1354802079.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/2m2j11354802079.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/3a5p51354802079.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/4b2gh1354802079.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/54p8s1354802079.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.54455467 4.75771288 -5.16308271 -3.69161629 -1.48100748 2.31593310 7 8 9 10 11 12 4.87208422 -0.94198352 1.67552285 1.10513028 3.39456541 1.04508752 13 14 15 16 17 18 3.21648072 2.71475092 -3.38490523 -2.40750550 1.41409301 0.41310553 19 20 21 22 23 24 1.19021712 -2.51795579 -3.02659550 -2.23108425 1.77909377 0.36755370 25 26 27 28 29 30 3.96573600 7.50990161 -0.99257548 -2.14914659 -1.16583073 0.15426810 31 32 33 34 35 36 -1.42504968 -6.18371433 3.35038712 -1.57871724 1.15602392 -0.48181248 37 38 39 40 41 42 -3.01780878 2.06618875 -4.98281820 0.30013734 2.46233443 -0.19269661 43 44 45 46 47 48 2.65638098 0.82494608 5.42318482 3.39627309 2.43268308 -1.38445151 49 50 51 52 53 54 0.25982224 4.50281282 -3.49967166 -1.03032371 -0.85021949 -2.08518975 55 56 57 58 59 60 -0.62674481 3.07621005 4.11318915 -5.35827188 1.50768366 0.23201767 61 62 63 64 65 66 -1.47484415 2.66564383 -0.68758924 -4.11581547 -0.11918930 -0.77062195 67 68 69 70 71 72 0.84148684 -3.39638489 3.74164137 -0.81762168 3.99021135 -4.33836570 73 74 75 76 77 78 -2.29364693 0.03970522 1.23747736 5.25477007 1.16265155 0.03247247 79 80 81 82 83 84 -4.93040769 3.88451458 -2.87117389 -0.58872439 -0.64021558 2.97671157 85 86 87 88 89 90 -3.22809569 -1.55914380 1.79033422 -1.48888208 -4.95917277 0.23281591 91 92 93 94 95 96 -3.40057831 2.34560199 -1.83785791 -0.10334118 -3.51559447 3.17427451 97 98 99 100 101 102 2.54971674 0.85373836 1.94339657 -3.78581454 2.80057664 1.71000355 103 104 105 106 107 108 -0.83173361 -0.75168241 -2.90237485 7.33556804 2.70066063 4.00062826 109 110 111 112 113 114 0.81646787 6.05399667 -4.78745493 -2.93502223 -5.18302604 -1.86063496 115 116 117 118 119 120 3.26893368 1.25105894 -3.25805298 -2.24861524 -1.66576198 2.65158148 121 122 123 124 125 126 -1.71290853 -2.17357488 2.11503900 0.92450785 -0.17687546 -2.79521955 127 128 129 130 131 132 4.31524221 6.88065286 -3.11922369 1.94421123 -2.66911349 -3.80522654 133 134 135 136 137 138 3.66487554 -5.04349867 1.41539000 -1.18439249 -1.70269646 -1.46783785 139 140 141 142 143 144 -3.72857620 0.93544350 -1.90855316 -3.92757410 -4.90905949 -4.80573151 145 146 147 148 149 150 -0.36543190 7.48198577 -0.53963423 1.69322053 -1.72309045 1.42699395 151 152 153 154 155 156 2.76290853 6.58094564 -4.15310147 -1.94522218 0.38547866 1.48597909 157 158 159 160 161 162 2.34560199 -3.42361319 -3.11922369 -0.54368063 -1.97365184 -0.74625155 > postscript(file="/var/wessaorg/rcomp/tmp/68avi1354802079.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.54455467 NA 1 4.75771288 5.54455467 2 -5.16308271 4.75771288 3 -3.69161629 -5.16308271 4 -1.48100748 -3.69161629 5 2.31593310 -1.48100748 6 4.87208422 2.31593310 7 -0.94198352 4.87208422 8 1.67552285 -0.94198352 9 1.10513028 1.67552285 10 3.39456541 1.10513028 11 1.04508752 3.39456541 12 3.21648072 1.04508752 13 2.71475092 3.21648072 14 -3.38490523 2.71475092 15 -2.40750550 -3.38490523 16 1.41409301 -2.40750550 17 0.41310553 1.41409301 18 1.19021712 0.41310553 19 -2.51795579 1.19021712 20 -3.02659550 -2.51795579 21 -2.23108425 -3.02659550 22 1.77909377 -2.23108425 23 0.36755370 1.77909377 24 3.96573600 0.36755370 25 7.50990161 3.96573600 26 -0.99257548 7.50990161 27 -2.14914659 -0.99257548 28 -1.16583073 -2.14914659 29 0.15426810 -1.16583073 30 -1.42504968 0.15426810 31 -6.18371433 -1.42504968 32 3.35038712 -6.18371433 33 -1.57871724 3.35038712 34 1.15602392 -1.57871724 35 -0.48181248 1.15602392 36 -3.01780878 -0.48181248 37 2.06618875 -3.01780878 38 -4.98281820 2.06618875 39 0.30013734 -4.98281820 40 2.46233443 0.30013734 41 -0.19269661 2.46233443 42 2.65638098 -0.19269661 43 0.82494608 2.65638098 44 5.42318482 0.82494608 45 3.39627309 5.42318482 46 2.43268308 3.39627309 47 -1.38445151 2.43268308 48 0.25982224 -1.38445151 49 4.50281282 0.25982224 50 -3.49967166 4.50281282 51 -1.03032371 -3.49967166 52 -0.85021949 -1.03032371 53 -2.08518975 -0.85021949 54 -0.62674481 -2.08518975 55 3.07621005 -0.62674481 56 4.11318915 3.07621005 57 -5.35827188 4.11318915 58 1.50768366 -5.35827188 59 0.23201767 1.50768366 60 -1.47484415 0.23201767 61 2.66564383 -1.47484415 62 -0.68758924 2.66564383 63 -4.11581547 -0.68758924 64 -0.11918930 -4.11581547 65 -0.77062195 -0.11918930 66 0.84148684 -0.77062195 67 -3.39638489 0.84148684 68 3.74164137 -3.39638489 69 -0.81762168 3.74164137 70 3.99021135 -0.81762168 71 -4.33836570 3.99021135 72 -2.29364693 -4.33836570 73 0.03970522 -2.29364693 74 1.23747736 0.03970522 75 5.25477007 1.23747736 76 1.16265155 5.25477007 77 0.03247247 1.16265155 78 -4.93040769 0.03247247 79 3.88451458 -4.93040769 80 -2.87117389 3.88451458 81 -0.58872439 -2.87117389 82 -0.64021558 -0.58872439 83 2.97671157 -0.64021558 84 -3.22809569 2.97671157 85 -1.55914380 -3.22809569 86 1.79033422 -1.55914380 87 -1.48888208 1.79033422 88 -4.95917277 -1.48888208 89 0.23281591 -4.95917277 90 -3.40057831 0.23281591 91 2.34560199 -3.40057831 92 -1.83785791 2.34560199 93 -0.10334118 -1.83785791 94 -3.51559447 -0.10334118 95 3.17427451 -3.51559447 96 2.54971674 3.17427451 97 0.85373836 2.54971674 98 1.94339657 0.85373836 99 -3.78581454 1.94339657 100 2.80057664 -3.78581454 101 1.71000355 2.80057664 102 -0.83173361 1.71000355 103 -0.75168241 -0.83173361 104 -2.90237485 -0.75168241 105 7.33556804 -2.90237485 106 2.70066063 7.33556804 107 4.00062826 2.70066063 108 0.81646787 4.00062826 109 6.05399667 0.81646787 110 -4.78745493 6.05399667 111 -2.93502223 -4.78745493 112 -5.18302604 -2.93502223 113 -1.86063496 -5.18302604 114 3.26893368 -1.86063496 115 1.25105894 3.26893368 116 -3.25805298 1.25105894 117 -2.24861524 -3.25805298 118 -1.66576198 -2.24861524 119 2.65158148 -1.66576198 120 -1.71290853 2.65158148 121 -2.17357488 -1.71290853 122 2.11503900 -2.17357488 123 0.92450785 2.11503900 124 -0.17687546 0.92450785 125 -2.79521955 -0.17687546 126 4.31524221 -2.79521955 127 6.88065286 4.31524221 128 -3.11922369 6.88065286 129 1.94421123 -3.11922369 130 -2.66911349 1.94421123 131 -3.80522654 -2.66911349 132 3.66487554 -3.80522654 133 -5.04349867 3.66487554 134 1.41539000 -5.04349867 135 -1.18439249 1.41539000 136 -1.70269646 -1.18439249 137 -1.46783785 -1.70269646 138 -3.72857620 -1.46783785 139 0.93544350 -3.72857620 140 -1.90855316 0.93544350 141 -3.92757410 -1.90855316 142 -4.90905949 -3.92757410 143 -4.80573151 -4.90905949 144 -0.36543190 -4.80573151 145 7.48198577 -0.36543190 146 -0.53963423 7.48198577 147 1.69322053 -0.53963423 148 -1.72309045 1.69322053 149 1.42699395 -1.72309045 150 2.76290853 1.42699395 151 6.58094564 2.76290853 152 -4.15310147 6.58094564 153 -1.94522218 -4.15310147 154 0.38547866 -1.94522218 155 1.48597909 0.38547866 156 2.34560199 1.48597909 157 -3.42361319 2.34560199 158 -3.11922369 -3.42361319 159 -0.54368063 -3.11922369 160 -1.97365184 -0.54368063 161 -0.74625155 -1.97365184 162 NA -0.74625155 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 4.75771288 5.54455467 [2,] -5.16308271 4.75771288 [3,] -3.69161629 -5.16308271 [4,] -1.48100748 -3.69161629 [5,] 2.31593310 -1.48100748 [6,] 4.87208422 2.31593310 [7,] -0.94198352 4.87208422 [8,] 1.67552285 -0.94198352 [9,] 1.10513028 1.67552285 [10,] 3.39456541 1.10513028 [11,] 1.04508752 3.39456541 [12,] 3.21648072 1.04508752 [13,] 2.71475092 3.21648072 [14,] -3.38490523 2.71475092 [15,] -2.40750550 -3.38490523 [16,] 1.41409301 -2.40750550 [17,] 0.41310553 1.41409301 [18,] 1.19021712 0.41310553 [19,] -2.51795579 1.19021712 [20,] -3.02659550 -2.51795579 [21,] -2.23108425 -3.02659550 [22,] 1.77909377 -2.23108425 [23,] 0.36755370 1.77909377 [24,] 3.96573600 0.36755370 [25,] 7.50990161 3.96573600 [26,] -0.99257548 7.50990161 [27,] -2.14914659 -0.99257548 [28,] -1.16583073 -2.14914659 [29,] 0.15426810 -1.16583073 [30,] -1.42504968 0.15426810 [31,] -6.18371433 -1.42504968 [32,] 3.35038712 -6.18371433 [33,] -1.57871724 3.35038712 [34,] 1.15602392 -1.57871724 [35,] -0.48181248 1.15602392 [36,] -3.01780878 -0.48181248 [37,] 2.06618875 -3.01780878 [38,] -4.98281820 2.06618875 [39,] 0.30013734 -4.98281820 [40,] 2.46233443 0.30013734 [41,] -0.19269661 2.46233443 [42,] 2.65638098 -0.19269661 [43,] 0.82494608 2.65638098 [44,] 5.42318482 0.82494608 [45,] 3.39627309 5.42318482 [46,] 2.43268308 3.39627309 [47,] -1.38445151 2.43268308 [48,] 0.25982224 -1.38445151 [49,] 4.50281282 0.25982224 [50,] -3.49967166 4.50281282 [51,] -1.03032371 -3.49967166 [52,] -0.85021949 -1.03032371 [53,] -2.08518975 -0.85021949 [54,] -0.62674481 -2.08518975 [55,] 3.07621005 -0.62674481 [56,] 4.11318915 3.07621005 [57,] -5.35827188 4.11318915 [58,] 1.50768366 -5.35827188 [59,] 0.23201767 1.50768366 [60,] -1.47484415 0.23201767 [61,] 2.66564383 -1.47484415 [62,] -0.68758924 2.66564383 [63,] -4.11581547 -0.68758924 [64,] -0.11918930 -4.11581547 [65,] -0.77062195 -0.11918930 [66,] 0.84148684 -0.77062195 [67,] -3.39638489 0.84148684 [68,] 3.74164137 -3.39638489 [69,] -0.81762168 3.74164137 [70,] 3.99021135 -0.81762168 [71,] -4.33836570 3.99021135 [72,] -2.29364693 -4.33836570 [73,] 0.03970522 -2.29364693 [74,] 1.23747736 0.03970522 [75,] 5.25477007 1.23747736 [76,] 1.16265155 5.25477007 [77,] 0.03247247 1.16265155 [78,] -4.93040769 0.03247247 [79,] 3.88451458 -4.93040769 [80,] -2.87117389 3.88451458 [81,] -0.58872439 -2.87117389 [82,] -0.64021558 -0.58872439 [83,] 2.97671157 -0.64021558 [84,] -3.22809569 2.97671157 [85,] -1.55914380 -3.22809569 [86,] 1.79033422 -1.55914380 [87,] -1.48888208 1.79033422 [88,] -4.95917277 -1.48888208 [89,] 0.23281591 -4.95917277 [90,] -3.40057831 0.23281591 [91,] 2.34560199 -3.40057831 [92,] -1.83785791 2.34560199 [93,] -0.10334118 -1.83785791 [94,] -3.51559447 -0.10334118 [95,] 3.17427451 -3.51559447 [96,] 2.54971674 3.17427451 [97,] 0.85373836 2.54971674 [98,] 1.94339657 0.85373836 [99,] -3.78581454 1.94339657 [100,] 2.80057664 -3.78581454 [101,] 1.71000355 2.80057664 [102,] -0.83173361 1.71000355 [103,] -0.75168241 -0.83173361 [104,] -2.90237485 -0.75168241 [105,] 7.33556804 -2.90237485 [106,] 2.70066063 7.33556804 [107,] 4.00062826 2.70066063 [108,] 0.81646787 4.00062826 [109,] 6.05399667 0.81646787 [110,] -4.78745493 6.05399667 [111,] -2.93502223 -4.78745493 [112,] -5.18302604 -2.93502223 [113,] -1.86063496 -5.18302604 [114,] 3.26893368 -1.86063496 [115,] 1.25105894 3.26893368 [116,] -3.25805298 1.25105894 [117,] -2.24861524 -3.25805298 [118,] -1.66576198 -2.24861524 [119,] 2.65158148 -1.66576198 [120,] -1.71290853 2.65158148 [121,] -2.17357488 -1.71290853 [122,] 2.11503900 -2.17357488 [123,] 0.92450785 2.11503900 [124,] -0.17687546 0.92450785 [125,] -2.79521955 -0.17687546 [126,] 4.31524221 -2.79521955 [127,] 6.88065286 4.31524221 [128,] -3.11922369 6.88065286 [129,] 1.94421123 -3.11922369 [130,] -2.66911349 1.94421123 [131,] -3.80522654 -2.66911349 [132,] 3.66487554 -3.80522654 [133,] -5.04349867 3.66487554 [134,] 1.41539000 -5.04349867 [135,] -1.18439249 1.41539000 [136,] -1.70269646 -1.18439249 [137,] -1.46783785 -1.70269646 [138,] -3.72857620 -1.46783785 [139,] 0.93544350 -3.72857620 [140,] -1.90855316 0.93544350 [141,] -3.92757410 -1.90855316 [142,] -4.90905949 -3.92757410 [143,] -4.80573151 -4.90905949 [144,] -0.36543190 -4.80573151 [145,] 7.48198577 -0.36543190 [146,] -0.53963423 7.48198577 [147,] 1.69322053 -0.53963423 [148,] -1.72309045 1.69322053 [149,] 1.42699395 -1.72309045 [150,] 2.76290853 1.42699395 [151,] 6.58094564 2.76290853 [152,] -4.15310147 6.58094564 [153,] -1.94522218 -4.15310147 [154,] 0.38547866 -1.94522218 [155,] 1.48597909 0.38547866 [156,] 2.34560199 1.48597909 [157,] -3.42361319 2.34560199 [158,] -3.11922369 -3.42361319 [159,] -0.54368063 -3.11922369 [160,] -1.97365184 -0.54368063 [161,] -0.74625155 -1.97365184 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 4.75771288 5.54455467 2 -5.16308271 4.75771288 3 -3.69161629 -5.16308271 4 -1.48100748 -3.69161629 5 2.31593310 -1.48100748 6 4.87208422 2.31593310 7 -0.94198352 4.87208422 8 1.67552285 -0.94198352 9 1.10513028 1.67552285 10 3.39456541 1.10513028 11 1.04508752 3.39456541 12 3.21648072 1.04508752 13 2.71475092 3.21648072 14 -3.38490523 2.71475092 15 -2.40750550 -3.38490523 16 1.41409301 -2.40750550 17 0.41310553 1.41409301 18 1.19021712 0.41310553 19 -2.51795579 1.19021712 20 -3.02659550 -2.51795579 21 -2.23108425 -3.02659550 22 1.77909377 -2.23108425 23 0.36755370 1.77909377 24 3.96573600 0.36755370 25 7.50990161 3.96573600 26 -0.99257548 7.50990161 27 -2.14914659 -0.99257548 28 -1.16583073 -2.14914659 29 0.15426810 -1.16583073 30 -1.42504968 0.15426810 31 -6.18371433 -1.42504968 32 3.35038712 -6.18371433 33 -1.57871724 3.35038712 34 1.15602392 -1.57871724 35 -0.48181248 1.15602392 36 -3.01780878 -0.48181248 37 2.06618875 -3.01780878 38 -4.98281820 2.06618875 39 0.30013734 -4.98281820 40 2.46233443 0.30013734 41 -0.19269661 2.46233443 42 2.65638098 -0.19269661 43 0.82494608 2.65638098 44 5.42318482 0.82494608 45 3.39627309 5.42318482 46 2.43268308 3.39627309 47 -1.38445151 2.43268308 48 0.25982224 -1.38445151 49 4.50281282 0.25982224 50 -3.49967166 4.50281282 51 -1.03032371 -3.49967166 52 -0.85021949 -1.03032371 53 -2.08518975 -0.85021949 54 -0.62674481 -2.08518975 55 3.07621005 -0.62674481 56 4.11318915 3.07621005 57 -5.35827188 4.11318915 58 1.50768366 -5.35827188 59 0.23201767 1.50768366 60 -1.47484415 0.23201767 61 2.66564383 -1.47484415 62 -0.68758924 2.66564383 63 -4.11581547 -0.68758924 64 -0.11918930 -4.11581547 65 -0.77062195 -0.11918930 66 0.84148684 -0.77062195 67 -3.39638489 0.84148684 68 3.74164137 -3.39638489 69 -0.81762168 3.74164137 70 3.99021135 -0.81762168 71 -4.33836570 3.99021135 72 -2.29364693 -4.33836570 73 0.03970522 -2.29364693 74 1.23747736 0.03970522 75 5.25477007 1.23747736 76 1.16265155 5.25477007 77 0.03247247 1.16265155 78 -4.93040769 0.03247247 79 3.88451458 -4.93040769 80 -2.87117389 3.88451458 81 -0.58872439 -2.87117389 82 -0.64021558 -0.58872439 83 2.97671157 -0.64021558 84 -3.22809569 2.97671157 85 -1.55914380 -3.22809569 86 1.79033422 -1.55914380 87 -1.48888208 1.79033422 88 -4.95917277 -1.48888208 89 0.23281591 -4.95917277 90 -3.40057831 0.23281591 91 2.34560199 -3.40057831 92 -1.83785791 2.34560199 93 -0.10334118 -1.83785791 94 -3.51559447 -0.10334118 95 3.17427451 -3.51559447 96 2.54971674 3.17427451 97 0.85373836 2.54971674 98 1.94339657 0.85373836 99 -3.78581454 1.94339657 100 2.80057664 -3.78581454 101 1.71000355 2.80057664 102 -0.83173361 1.71000355 103 -0.75168241 -0.83173361 104 -2.90237485 -0.75168241 105 7.33556804 -2.90237485 106 2.70066063 7.33556804 107 4.00062826 2.70066063 108 0.81646787 4.00062826 109 6.05399667 0.81646787 110 -4.78745493 6.05399667 111 -2.93502223 -4.78745493 112 -5.18302604 -2.93502223 113 -1.86063496 -5.18302604 114 3.26893368 -1.86063496 115 1.25105894 3.26893368 116 -3.25805298 1.25105894 117 -2.24861524 -3.25805298 118 -1.66576198 -2.24861524 119 2.65158148 -1.66576198 120 -1.71290853 2.65158148 121 -2.17357488 -1.71290853 122 2.11503900 -2.17357488 123 0.92450785 2.11503900 124 -0.17687546 0.92450785 125 -2.79521955 -0.17687546 126 4.31524221 -2.79521955 127 6.88065286 4.31524221 128 -3.11922369 6.88065286 129 1.94421123 -3.11922369 130 -2.66911349 1.94421123 131 -3.80522654 -2.66911349 132 3.66487554 -3.80522654 133 -5.04349867 3.66487554 134 1.41539000 -5.04349867 135 -1.18439249 1.41539000 136 -1.70269646 -1.18439249 137 -1.46783785 -1.70269646 138 -3.72857620 -1.46783785 139 0.93544350 -3.72857620 140 -1.90855316 0.93544350 141 -3.92757410 -1.90855316 142 -4.90905949 -3.92757410 143 -4.80573151 -4.90905949 144 -0.36543190 -4.80573151 145 7.48198577 -0.36543190 146 -0.53963423 7.48198577 147 1.69322053 -0.53963423 148 -1.72309045 1.69322053 149 1.42699395 -1.72309045 150 2.76290853 1.42699395 151 6.58094564 2.76290853 152 -4.15310147 6.58094564 153 -1.94522218 -4.15310147 154 0.38547866 -1.94522218 155 1.48597909 0.38547866 156 2.34560199 1.48597909 157 -3.42361319 2.34560199 158 -3.11922369 -3.42361319 159 -0.54368063 -3.11922369 160 -1.97365184 -0.54368063 161 -0.74625155 -1.97365184 > 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/7ljgn1354802079.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/8tw8a1354802079.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/9deo51354802079.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/10c8451354802079.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/111rfq1354802079.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/12qspv1354802079.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/13eec61354802079.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/14wcyb1354802079.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/153hkd1354802079.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/167mao1354802079.tab") + } > > try(system("convert tmp/1ja4n1354802079.ps tmp/1ja4n1354802079.png",intern=TRUE)) character(0) > try(system("convert tmp/2m2j11354802079.ps tmp/2m2j11354802079.png",intern=TRUE)) character(0) > try(system("convert tmp/3a5p51354802079.ps tmp/3a5p51354802079.png",intern=TRUE)) character(0) > try(system("convert tmp/4b2gh1354802079.ps tmp/4b2gh1354802079.png",intern=TRUE)) character(0) > try(system("convert tmp/54p8s1354802079.ps tmp/54p8s1354802079.png",intern=TRUE)) character(0) > try(system("convert tmp/68avi1354802079.ps tmp/68avi1354802079.png",intern=TRUE)) character(0) > try(system("convert tmp/7ljgn1354802079.ps tmp/7ljgn1354802079.png",intern=TRUE)) character(0) > try(system("convert tmp/8tw8a1354802079.ps tmp/8tw8a1354802079.png",intern=TRUE)) character(0) > try(system("convert tmp/9deo51354802079.ps tmp/9deo51354802079.png",intern=TRUE)) character(0) > try(system("convert tmp/10c8451354802079.ps tmp/10c8451354802079.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 8.042 1.015 9.059