R version 2.12.0 (2010-10-15) Copyright (C) 2010 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i486-pc-linux-gnu (32-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > x <- array(list(13 + ,2 + ,7 + ,41 + ,38 + ,12 + ,14 + ,12 + ,16 + ,2 + ,5 + ,39 + ,32 + ,11 + ,18 + ,11 + ,19 + ,2 + ,5 + ,30 + ,35 + ,15 + ,11 + ,14 + ,15 + ,1 + ,5 + ,31 + ,33 + ,6 + ,12 + ,12 + ,14 + ,2 + ,8 + ,34 + ,37 + ,13 + ,16 + ,21 + ,13 + ,2 + ,6 + ,35 + ,29 + ,10 + ,18 + ,12 + ,19 + ,2 + ,5 + ,39 + ,31 + ,12 + ,14 + ,22 + ,15 + ,2 + ,6 + ,34 + ,36 + ,14 + ,14 + ,11 + ,14 + ,2 + ,5 + ,36 + ,35 + ,12 + ,15 + ,10 + ,15 + ,2 + ,4 + ,37 + ,38 + ,6 + ,15 + ,13 + ,16 + ,1 + ,6 + ,38 + ,31 + ,10 + ,17 + ,10 + ,16 + ,2 + ,5 + ,36 + ,34 + ,12 + ,19 + ,8 + ,16 + ,1 + ,5 + ,38 + ,35 + ,12 + ,10 + ,15 + ,16 + ,2 + ,6 + ,39 + ,38 + ,11 + ,16 + ,14 + ,17 + ,2 + ,7 + ,33 + ,37 + ,15 + ,18 + ,10 + ,15 + ,1 + ,6 + ,32 + ,33 + ,12 + ,14 + ,14 + ,15 + ,1 + ,7 + ,36 + ,32 + ,10 + ,14 + ,14 + ,20 + ,2 + ,6 + ,38 + ,38 + ,12 + ,17 + ,11 + ,18 + ,1 + ,8 + ,39 + ,38 + ,11 + ,14 + ,10 + ,16 + ,2 + ,7 + ,32 + ,32 + ,12 + ,16 + ,13 + ,16 + ,1 + ,5 + ,32 + ,33 + ,11 + ,18 + ,7 + ,16 + ,2 + ,5 + ,31 + ,31 + ,12 + ,11 + ,14 + ,19 + ,2 + ,7 + ,39 + ,38 + ,13 + ,14 + ,12 + ,16 + ,2 + ,7 + ,37 + ,39 + ,11 + ,12 + ,14 + ,17 + ,1 + ,5 + ,39 + ,32 + ,9 + ,17 + ,11 + ,17 + ,2 + ,4 + ,41 + ,32 + ,13 + ,9 + ,9 + ,16 + ,1 + ,10 + ,36 + ,35 + ,10 + ,16 + ,11 + ,15 + ,2 + ,6 + ,33 + ,37 + ,14 + ,14 + ,15 + ,16 + ,2 + ,5 + ,33 + ,33 + ,12 + ,15 + ,14 + ,14 + ,1 + ,5 + ,34 + ,33 + ,10 + ,11 + ,13 + ,15 + ,2 + ,5 + ,31 + ,28 + ,12 + ,16 + ,9 + ,12 + ,1 + ,5 + ,27 + ,32 + ,8 + ,13 + ,15 + ,14 + ,2 + ,6 + ,37 + ,31 + ,10 + ,17 + ,10 + ,16 + ,2 + ,5 + ,34 + ,37 + ,12 + ,15 + ,11 + ,14 + ,1 + ,5 + ,34 + ,30 + ,12 + ,14 + ,13 + ,7 + ,1 + ,5 + ,32 + ,33 + ,7 + ,16 + ,8 + ,10 + ,1 + ,5 + ,29 + ,31 + ,6 + ,9 + ,20 + ,14 + ,1 + ,5 + ,36 + ,33 + ,12 + ,15 + ,12 + ,16 + ,2 + ,5 + ,29 + ,31 + ,10 + ,17 + ,10 + ,16 + ,1 + ,5 + ,35 + ,33 + ,10 + ,13 + ,10 + ,16 + ,1 + ,5 + ,37 + ,32 + ,10 + ,15 + ,9 + ,14 + ,2 + ,7 + ,34 + ,33 + ,12 + ,16 + ,14 + ,20 + ,1 + ,5 + ,38 + ,32 + ,15 + ,16 + ,8 + ,14 + ,1 + ,6 + ,35 + ,33 + ,10 + ,12 + ,14 + ,14 + ,2 + ,7 + ,38 + ,28 + ,10 + ,12 + ,11 + ,11 + ,2 + ,7 + ,37 + ,35 + ,12 + ,11 + ,13 + ,14 + ,2 + ,5 + ,38 + ,39 + ,13 + ,15 + ,9 + ,15 + ,2 + ,5 + ,33 + ,34 + ,11 + ,15 + ,11 + ,16 + ,2 + ,4 + ,36 + ,38 + ,11 + ,17 + ,15 + ,14 + ,1 + ,5 + ,38 + ,32 + ,12 + ,13 + ,11 + ,16 + ,2 + ,4 + ,32 + ,38 + ,14 + ,16 + ,10 + ,14 + ,1 + ,5 + ,32 + ,30 + ,10 + ,14 + ,14 + ,12 + ,1 + ,5 + ,32 + ,33 + ,12 + ,11 + ,18 + ,16 + ,2 + ,7 + ,34 + ,38 + ,13 + ,12 + ,14 + ,9 + ,1 + ,5 + ,32 + ,32 + ,5 + ,12 + ,11 + ,14 + ,2 + ,5 + ,37 + ,32 + ,6 + ,15 + ,12 + ,16 + ,2 + ,6 + ,39 + ,34 + ,12 + ,16 + ,13 + ,16 + ,2 + ,4 + ,29 + ,34 + ,12 + ,15 + ,9 + ,15 + ,1 + ,6 + ,37 + ,36 + ,11 + ,12 + ,10 + ,16 + ,2 + ,6 + ,35 + ,34 + ,10 + ,12 + ,15 + ,12 + ,1 + ,5 + ,30 + ,28 + ,7 + ,8 + ,20 + ,16 + ,1 + ,7 + ,38 + ,34 + ,12 + ,13 + ,12 + ,16 + ,2 + ,6 + ,34 + ,35 + ,14 + ,11 + ,12 + ,14 + ,2 + ,8 + ,31 + ,35 + ,11 + ,14 + ,14 + ,16 + ,2 + ,7 + ,34 + ,31 + ,12 + ,15 + ,13 + ,17 + ,1 + ,5 + ,35 + ,37 + ,13 + ,10 + ,11 + ,18 + ,2 + ,6 + ,36 + ,35 + ,14 + ,11 + ,17 + ,18 + ,1 + ,6 + ,30 + ,27 + ,11 + ,12 + ,12 + ,12 + ,2 + ,5 + ,39 + ,40 + ,12 + ,15 + ,13 + ,16 + ,1 + ,5 + ,35 + ,37 + ,12 + ,15 + ,14 + ,10 + ,1 + ,5 + ,38 + ,36 + ,8 + ,14 + ,13 + ,14 + ,2 + ,5 + ,31 + ,38 + ,11 + ,16 + ,15 + ,18 + ,2 + ,4 + ,34 + ,39 + ,14 + ,15 + ,13 + ,18 + ,1 + ,6 + ,38 + ,41 + ,14 + ,15 + ,10 + ,16 + ,1 + ,6 + ,34 + ,27 + ,12 + ,13 + ,11 + ,17 + ,2 + ,6 + ,39 + ,30 + ,9 + ,12 + ,19 + ,16 + ,2 + ,6 + ,37 + ,37 + ,13 + ,17 + ,13 + ,16 + ,2 + ,7 + ,34 + ,31 + ,11 + ,13 + ,17 + ,13 + ,1 + ,5 + ,28 + ,31 + ,12 + ,15 + ,13 + ,16 + ,1 + ,7 + ,37 + ,27 + ,12 + ,13 + ,9 + ,16 + ,1 + ,6 + ,33 + ,36 + ,12 + ,15 + ,11 + ,20 + ,1 + ,5 + ,37 + ,38 + ,12 + ,16 + ,10 + ,16 + ,2 + ,5 + ,35 + ,37 + ,12 + ,15 + ,9 + ,15 + ,1 + ,4 + ,37 + ,33 + ,12 + ,16 + ,12 + ,15 + ,2 + ,8 + ,32 + ,34 + ,11 + ,15 + ,12 + ,16 + ,2 + ,8 + ,33 + ,31 + ,10 + ,14 + ,13 + ,14 + ,1 + ,5 + ,38 + ,39 + ,9 + ,15 + ,13 + ,16 + ,2 + ,5 + ,33 + ,34 + ,12 + ,14 + ,12 + ,16 + ,2 + ,6 + ,29 + ,32 + ,12 + ,13 + ,15 + ,15 + ,2 + ,4 + ,33 + ,33 + ,12 + ,7 + ,22 + ,12 + ,2 + ,5 + ,31 + ,36 + ,9 + ,17 + ,13 + ,17 + ,2 + ,5 + ,36 + ,32 + ,15 + ,13 + ,15 + ,16 + ,2 + ,5 + ,35 + ,41 + ,12 + ,15 + ,13 + ,15 + ,2 + ,5 + ,32 + ,28 + ,12 + ,14 + ,15 + ,13 + ,2 + ,6 + ,29 + ,30 + ,12 + ,13 + ,10 + ,16 + ,2 + ,6 + ,39 + ,36 + ,10 + ,16 + ,11 + ,16 + ,2 + ,5 + ,37 + ,35 + ,13 + ,12 + ,16 + ,16 + ,2 + ,6 + ,35 + ,31 + ,9 + ,14 + ,11 + ,16 + ,1 + ,5 + ,37 + ,34 + ,12 + ,17 + ,11 + ,14 + ,1 + ,7 + ,32 + ,36 + ,10 + ,15 + ,10 + ,16 + ,2 + ,5 + ,38 + ,36 + ,14 + ,17 + ,10 + ,16 + ,1 + ,6 + ,37 + ,35 + ,11 + ,12 + ,16 + ,20 + ,2 + ,6 + ,36 + ,37 + ,15 + ,16 + ,12 + ,15 + ,1 + ,6 + ,32 + ,28 + ,11 + ,11 + ,11 + ,16 + ,2 + ,4 + ,33 + ,39 + ,11 + ,15 + ,16 + ,13 + ,1 + ,5 + ,40 + ,32 + ,12 + ,9 + ,19 + ,17 + ,2 + ,5 + ,38 + ,35 + ,12 + ,16 + ,11 + ,16 + ,1 + ,7 + ,41 + ,39 + ,12 + ,15 + ,16 + ,16 + ,1 + ,6 + ,36 + ,35 + ,11 + ,10 + ,15 + ,12 + ,2 + ,9 + ,43 + ,42 + ,7 + ,10 + ,24 + ,16 + ,2 + ,6 + ,30 + ,34 + ,12 + ,15 + ,14 + ,16 + ,2 + ,6 + ,31 + ,33 + ,14 + ,11 + ,15 + ,17 + ,2 + ,5 + ,32 + ,41 + ,11 + ,13 + ,11 + ,13 + ,1 + ,6 + ,32 + ,33 + ,11 + ,14 + ,15 + ,12 + ,2 + ,5 + ,37 + ,34 + ,10 + ,18 + ,12 + ,18 + ,1 + ,8 + ,37 + ,32 + ,13 + ,16 + ,10 + ,14 + ,2 + ,7 + ,33 + ,40 + ,13 + ,14 + ,14 + ,14 + ,2 + ,5 + ,34 + ,40 + ,8 + ,14 + ,13 + ,13 + ,2 + ,7 + ,33 + ,35 + ,11 + ,14 + ,9 + ,16 + ,2 + ,6 + ,38 + ,36 + ,12 + ,14 + ,15 + ,13 + ,2 + ,6 + ,33 + ,37 + ,11 + ,12 + ,15 + ,16 + ,2 + ,9 + ,31 + ,27 + ,13 + ,14 + ,14 + ,13 + ,2 + ,7 + ,38 + ,39 + ,12 + ,15 + ,11 + ,16 + ,2 + ,6 + ,37 + ,38 + ,14 + ,15 + ,8 + ,15 + ,2 + ,5 + ,33 + ,31 + ,13 + ,15 + ,11 + ,16 + ,2 + ,5 + ,31 + ,33 + ,15 + ,13 + ,11 + ,15 + ,1 + ,6 + ,39 + ,32 + ,10 + ,17 + ,8 + ,17 + ,2 + ,6 + ,44 + ,39 + ,11 + ,17 + ,10 + ,15 + ,2 + ,7 + ,33 + ,36 + ,9 + ,19 + ,11 + ,12 + ,2 + ,5 + ,35 + ,33 + ,11 + ,15 + ,13 + ,16 + ,1 + ,5 + ,32 + ,33 + ,10 + ,13 + ,11 + ,10 + ,1 + ,5 + ,28 + ,32 + ,11 + ,9 + ,20 + ,16 + ,2 + ,6 + ,40 + ,37 + ,8 + ,15 + ,10 + ,12 + ,1 + ,4 + ,27 + ,30 + ,11 + ,15 + ,15 + ,14 + ,1 + ,5 + ,37 + ,38 + ,12 + ,15 + ,12 + ,15 + ,2 + ,7 + ,32 + ,29 + ,12 + ,16 + ,14 + ,13 + ,1 + ,5 + ,28 + ,22 + ,9 + ,11 + ,23 + ,15 + ,1 + ,7 + ,34 + ,35 + ,11 + ,14 + ,14 + ,11 + ,2 + ,7 + ,30 + ,35 + ,10 + ,11 + ,16 + ,12 + ,2 + ,6 + ,35 + ,34 + ,8 + ,15 + ,11 + ,8 + ,1 + ,5 + ,31 + ,35 + ,9 + ,13 + ,12 + ,16 + ,2 + ,8 + ,32 + ,34 + ,8 + ,15 + ,10 + ,15 + ,1 + ,5 + ,30 + ,34 + ,9 + ,16 + ,14 + ,17 + ,2 + ,5 + ,30 + ,35 + ,15 + ,14 + ,12 + ,16 + ,1 + ,5 + ,31 + ,23 + ,11 + ,15 + ,12 + ,10 + ,2 + ,6 + ,40 + ,31 + ,8 + ,16 + ,11 + ,18 + ,2 + ,4 + ,32 + ,27 + ,13 + ,16 + ,12 + ,13 + ,1 + ,5 + ,36 + ,36 + ,12 + ,11 + ,13 + ,16 + ,1 + ,5 + ,32 + ,31 + ,12 + ,12 + ,11 + ,13 + ,1 + ,7 + ,35 + ,32 + ,9 + ,9 + ,19 + ,10 + ,2 + ,6 + ,38 + ,39 + ,7 + ,16 + ,12 + ,15 + ,2 + ,7 + ,42 + ,37 + ,13 + ,13 + ,17 + ,16 + ,1 + ,10 + ,34 + ,38 + ,9 + ,16 + ,9 + ,16 + ,2 + ,6 + ,35 + ,39 + ,6 + ,12 + ,12 + ,14 + ,2 + ,8 + ,35 + ,34 + ,8 + ,9 + ,19 + ,10 + ,2 + ,4 + ,33 + ,31 + ,8 + ,13 + ,18 + ,17 + ,2 + ,5 + ,36 + ,32 + ,15 + ,13 + ,15 + ,13 + ,2 + ,6 + ,32 + ,37 + ,6 + ,14 + ,14 + ,15 + ,2 + ,7 + ,33 + ,36 + ,9 + ,19 + ,11 + ,16 + ,2 + ,7 + ,34 + ,32 + ,11 + ,13 + ,9 + ,12 + ,2 + ,6 + ,32 + ,35 + ,8 + ,12 + ,18 + ,13 + ,2 + ,6 + ,34 + ,36 + ,8 + ,13 + ,16) + ,dim=c(8 + ,162) + ,dimnames=list(c('percieved_competence' + ,'gender' + ,'age' + ,'connected' + ,'seperate' + ,'software' + ,'happiness' + ,'depression') + ,1:162)) > y <- array(NA,dim=c(8,162),dimnames=list(c('percieved_competence','gender','age','connected','seperate','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 = '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 > 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 percieved_competence gender age connected seperate software happiness 1 13 2 7 41 38 12 14 2 16 2 5 39 32 11 18 3 19 2 5 30 35 15 11 4 15 1 5 31 33 6 12 5 14 2 8 34 37 13 16 6 13 2 6 35 29 10 18 7 19 2 5 39 31 12 14 8 15 2 6 34 36 14 14 9 14 2 5 36 35 12 15 10 15 2 4 37 38 6 15 11 16 1 6 38 31 10 17 12 16 2 5 36 34 12 19 13 16 1 5 38 35 12 10 14 16 2 6 39 38 11 16 15 17 2 7 33 37 15 18 16 15 1 6 32 33 12 14 17 15 1 7 36 32 10 14 18 20 2 6 38 38 12 17 19 18 1 8 39 38 11 14 20 16 2 7 32 32 12 16 21 16 1 5 32 33 11 18 22 16 2 5 31 31 12 11 23 19 2 7 39 38 13 14 24 16 2 7 37 39 11 12 25 17 1 5 39 32 9 17 26 17 2 4 41 32 13 9 27 16 1 10 36 35 10 16 28 15 2 6 33 37 14 14 29 16 2 5 33 33 12 15 30 14 1 5 34 33 10 11 31 15 2 5 31 28 12 16 32 12 1 5 27 32 8 13 33 14 2 6 37 31 10 17 34 16 2 5 34 37 12 15 35 14 1 5 34 30 12 14 36 7 1 5 32 33 7 16 37 10 1 5 29 31 6 9 38 14 1 5 36 33 12 15 39 16 2 5 29 31 10 17 40 16 1 5 35 33 10 13 41 16 1 5 37 32 10 15 42 14 2 7 34 33 12 16 43 20 1 5 38 32 15 16 44 14 1 6 35 33 10 12 45 14 2 7 38 28 10 12 46 11 2 7 37 35 12 11 47 14 2 5 38 39 13 15 48 15 2 5 33 34 11 15 49 16 2 4 36 38 11 17 50 14 1 5 38 32 12 13 51 16 2 4 32 38 14 16 52 14 1 5 32 30 10 14 53 12 1 5 32 33 12 11 54 16 2 7 34 38 13 12 55 9 1 5 32 32 5 12 56 14 2 5 37 32 6 15 57 16 2 6 39 34 12 16 58 16 2 4 29 34 12 15 59 15 1 6 37 36 11 12 60 16 2 6 35 34 10 12 61 12 1 5 30 28 7 8 62 16 1 7 38 34 12 13 63 16 2 6 34 35 14 11 64 14 2 8 31 35 11 14 65 16 2 7 34 31 12 15 66 17 1 5 35 37 13 10 67 18 2 6 36 35 14 11 68 18 1 6 30 27 11 12 69 12 2 5 39 40 12 15 70 16 1 5 35 37 12 15 71 10 1 5 38 36 8 14 72 14 2 5 31 38 11 16 73 18 2 4 34 39 14 15 74 18 1 6 38 41 14 15 75 16 1 6 34 27 12 13 76 17 2 6 39 30 9 12 77 16 2 6 37 37 13 17 78 16 2 7 34 31 11 13 79 13 1 5 28 31 12 15 80 16 1 7 37 27 12 13 81 16 1 6 33 36 12 15 82 20 1 5 37 38 12 16 83 16 2 5 35 37 12 15 84 15 1 4 37 33 12 16 85 15 2 8 32 34 11 15 86 16 2 8 33 31 10 14 87 14 1 5 38 39 9 15 88 16 2 5 33 34 12 14 89 16 2 6 29 32 12 13 90 15 2 4 33 33 12 7 91 12 2 5 31 36 9 17 92 17 2 5 36 32 15 13 93 16 2 5 35 41 12 15 94 15 2 5 32 28 12 14 95 13 2 6 29 30 12 13 96 16 2 6 39 36 10 16 97 16 2 5 37 35 13 12 98 16 2 6 35 31 9 14 99 16 1 5 37 34 12 17 100 14 1 7 32 36 10 15 101 16 2 5 38 36 14 17 102 16 1 6 37 35 11 12 103 20 2 6 36 37 15 16 104 15 1 6 32 28 11 11 105 16 2 4 33 39 11 15 106 13 1 5 40 32 12 9 107 17 2 5 38 35 12 16 108 16 1 7 41 39 12 15 109 16 1 6 36 35 11 10 110 12 2 9 43 42 7 10 111 16 2 6 30 34 12 15 112 16 2 6 31 33 14 11 113 17 2 5 32 41 11 13 114 13 1 6 32 33 11 14 115 12 2 5 37 34 10 18 116 18 1 8 37 32 13 16 117 14 2 7 33 40 13 14 118 14 2 5 34 40 8 14 119 13 2 7 33 35 11 14 120 16 2 6 38 36 12 14 121 13 2 6 33 37 11 12 122 16 2 9 31 27 13 14 123 13 2 7 38 39 12 15 124 16 2 6 37 38 14 15 125 15 2 5 33 31 13 15 126 16 2 5 31 33 15 13 127 15 1 6 39 32 10 17 128 17 2 6 44 39 11 17 129 15 2 7 33 36 9 19 130 12 2 5 35 33 11 15 131 16 1 5 32 33 10 13 132 10 1 5 28 32 11 9 133 16 2 6 40 37 8 15 134 12 1 4 27 30 11 15 135 14 1 5 37 38 12 15 136 15 2 7 32 29 12 16 137 13 1 5 28 22 9 11 138 15 1 7 34 35 11 14 139 11 2 7 30 35 10 11 140 12 2 6 35 34 8 15 141 8 1 5 31 35 9 13 142 16 2 8 32 34 8 15 143 15 1 5 30 34 9 16 144 17 2 5 30 35 15 14 145 16 1 5 31 23 11 15 146 10 2 6 40 31 8 16 147 18 2 4 32 27 13 16 148 13 1 5 36 36 12 11 149 16 1 5 32 31 12 12 150 13 1 7 35 32 9 9 151 10 2 6 38 39 7 16 152 15 2 7 42 37 13 13 153 16 1 10 34 38 9 16 154 16 2 6 35 39 6 12 155 14 2 8 35 34 8 9 156 10 2 4 33 31 8 13 157 17 2 5 36 32 15 13 158 13 2 6 32 37 6 14 159 15 2 7 33 36 9 19 160 16 2 7 34 32 11 13 161 12 2 6 32 35 8 12 162 13 2 6 34 36 8 13 depression t 1 12 1 2 11 2 3 14 3 4 12 4 5 21 5 6 12 6 7 22 7 8 11 8 9 10 9 10 13 10 11 10 11 12 8 12 13 15 13 14 14 14 15 10 15 16 14 16 17 14 17 18 11 18 19 10 19 20 13 20 21 7 21 22 14 22 23 12 23 24 14 24 25 11 25 26 9 26 27 11 27 28 15 28 29 14 29 30 13 30 31 9 31 32 15 32 33 10 33 34 11 34 35 13 35 36 8 36 37 20 37 38 12 38 39 10 39 40 10 40 41 9 41 42 14 42 43 8 43 44 14 44 45 11 45 46 13 46 47 9 47 48 11 48 49 15 49 50 11 50 51 10 51 52 14 52 53 18 53 54 14 54 55 11 55 56 12 56 57 13 57 58 9 58 59 10 59 60 15 60 61 20 61 62 12 62 63 12 63 64 14 64 65 13 65 66 11 66 67 17 67 68 12 68 69 13 69 70 14 70 71 13 71 72 15 72 73 13 73 74 10 74 75 11 75 76 19 76 77 13 77 78 17 78 79 13 79 80 9 80 81 11 81 82 10 82 83 9 83 84 12 84 85 12 85 86 13 86 87 13 87 88 12 88 89 15 89 90 22 90 91 13 91 92 15 92 93 13 93 94 15 94 95 10 95 96 11 96 97 16 97 98 11 98 99 11 99 100 10 100 101 10 101 102 16 102 103 12 103 104 11 104 105 16 105 106 19 106 107 11 107 108 16 108 109 15 109 110 24 110 111 14 111 112 15 112 113 11 113 114 15 114 115 12 115 116 10 116 117 14 117 118 13 118 119 9 119 120 15 120 121 15 121 122 14 122 123 11 123 124 8 124 125 11 125 126 11 126 127 8 127 128 10 128 129 11 129 130 13 130 131 11 131 132 20 132 133 10 133 134 15 134 135 12 135 136 14 136 137 23 137 138 14 138 139 16 139 140 11 140 141 12 141 142 10 142 143 14 143 144 12 144 145 12 145 146 11 146 147 12 147 148 13 148 149 11 149 150 19 150 151 12 151 152 17 152 153 9 153 154 12 154 155 19 155 156 18 156 157 15 157 158 14 158 159 11 159 160 9 160 161 18 161 162 16 162 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) gender age connected seperate software 6.04208 0.14504 0.14099 0.10225 -0.02631 0.53286 happiness depression t 0.05087 -0.08022 -0.00436 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -6.0411 -1.1661 0.1906 1.1344 4.2758 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 6.042076 2.473965 2.442 0.0157 * gender 0.145036 0.322662 0.449 0.6537 age 0.140985 0.128192 1.100 0.2731 connected 0.102250 0.047382 2.158 0.0325 * seperate -0.026305 0.045461 -0.579 0.5637 software 0.532858 0.070429 7.566 3.35e-12 *** happiness 0.050866 0.076943 0.661 0.5095 depression -0.080217 0.056287 -1.425 0.1562 t -0.004360 0.003204 -1.361 0.1756 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 1.843 on 153 degrees of freedom Multiple R-squared: 0.3661, Adjusted R-squared: 0.333 F-statistic: 11.05 on 8 and 153 DF, p-value: 3.025e-12 > if (n > n25) { + kp3 <- k + 3 + nmkm3 <- n - k - 3 + gqarr <- array(NA, dim=c(nmkm3-kp3+1,3)) + numgqtests <- 0 + numsignificant1 <- 0 + numsignificant5 <- 0 + numsignificant10 <- 0 + for (mypoint in kp3:nmkm3) { + j <- 0 + numgqtests <- numgqtests + 1 + for (myalt in c('greater', 'two.sided', 'less')) { + j <- j + 1 + gqarr[mypoint-kp3+1,j] <- gqtest(mylm, point=mypoint, alternative=myalt)$p.value + } + if (gqarr[mypoint-kp3+1,2] < 0.01) numsignificant1 <- numsignificant1 + 1 + if (gqarr[mypoint-kp3+1,2] < 0.05) numsignificant5 <- numsignificant5 + 1 + if (gqarr[mypoint-kp3+1,2] < 0.10) numsignificant10 <- numsignificant10 + 1 + } + gqarr + } [,1] [,2] [,3] [1,] 0.20015918 0.4003184 0.79984082 [2,] 0.28122755 0.5624551 0.71877245 [3,] 0.35659119 0.7131824 0.64340881 [4,] 0.36339217 0.7267843 0.63660783 [5,] 0.36478964 0.7295793 0.63521036 [6,] 0.33912445 0.6782489 0.66087555 [7,] 0.70023888 0.5995222 0.29976112 [8,] 0.80364021 0.3927196 0.19635979 [9,] 0.73646478 0.5270704 0.26353522 [10,] 0.68305717 0.6338857 0.31694283 [11,] 0.63986448 0.7202710 0.36013552 [12,] 0.61163485 0.7767303 0.38836515 [13,] 0.56229450 0.8754110 0.43770550 [14,] 0.50814443 0.9837111 0.49185557 [15,] 0.45912780 0.9182556 0.54087220 [16,] 0.40476451 0.8095290 0.59523549 [17,] 0.51692360 0.9661528 0.48307640 [18,] 0.46307874 0.9261575 0.53692126 [19,] 0.50674701 0.9865060 0.49325299 [20,] 0.44565377 0.8913075 0.55434623 [21,] 0.46549134 0.9309827 0.53450866 [22,] 0.43675693 0.8735139 0.56324307 [23,] 0.37735576 0.7547115 0.62264424 [24,] 0.38323557 0.7664711 0.61676443 [25,] 0.87249097 0.2550181 0.12750903 [26,] 0.85424364 0.2915127 0.14575636 [27,] 0.84386819 0.3122636 0.15613181 [28,] 0.86983170 0.2603366 0.13016830 [29,] 0.85859886 0.2828023 0.14140114 [30,] 0.83604865 0.3279027 0.16395135 [31,] 0.81829518 0.3634096 0.18170482 [32,] 0.82538334 0.3492333 0.17461666 [33,] 0.78987163 0.4202567 0.21012837 [34,] 0.75401725 0.4919655 0.24598275 [35,] 0.89111992 0.2177602 0.10888008 [36,] 0.90396263 0.1920747 0.09603737 [37,] 0.88564114 0.2287177 0.11435886 [38,] 0.86718109 0.2656378 0.13281891 [39,] 0.86363030 0.2727394 0.13636970 [40,] 0.83452496 0.3309501 0.16547504 [41,] 0.80197196 0.3960561 0.19802804 [42,] 0.82133073 0.3573385 0.17866927 [43,] 0.80559244 0.3888151 0.19440756 [44,] 0.81648665 0.3670267 0.18351335 [45,] 0.81336408 0.3732718 0.18663592 [46,] 0.78108014 0.4378397 0.21891986 [47,] 0.76637710 0.4672458 0.23362290 [48,] 0.73281040 0.5343792 0.26718960 [49,] 0.74463614 0.5107277 0.25536386 [50,] 0.71133399 0.5773320 0.28866601 [51,] 0.67590724 0.6481855 0.32409276 [52,] 0.63999587 0.7200083 0.36000413 [53,] 0.61170664 0.7765867 0.38829336 [54,] 0.57948321 0.8410336 0.42051679 [55,] 0.55428255 0.8914349 0.44571745 [56,] 0.54370626 0.9125875 0.45629374 [57,] 0.66989928 0.6602014 0.33010072 [58,] 0.79090968 0.4181806 0.20909032 [59,] 0.76104648 0.4779070 0.23895352 [60,] 0.84018784 0.3196243 0.15981216 [61,] 0.81318914 0.3736217 0.18681086 [62,] 0.80995362 0.3800928 0.19004638 [63,] 0.78947457 0.4210509 0.21052543 [64,] 0.75520540 0.4895892 0.24479460 [65,] 0.80406227 0.3918755 0.19593773 [66,] 0.77197483 0.4560503 0.22802517 [67,] 0.74774599 0.5045080 0.25225401 [68,] 0.74878046 0.5024391 0.25121954 [69,] 0.71328448 0.5734310 0.28671552 [70,] 0.67886772 0.6422646 0.32113228 [71,] 0.82130857 0.3573829 0.17869143 [72,] 0.78960588 0.4207882 0.21039412 [73,] 0.76176988 0.4764602 0.23823012 [74,] 0.72933466 0.5413307 0.27066534 [75,] 0.70724599 0.5855080 0.29275401 [76,] 0.66515497 0.6696901 0.33484503 [77,] 0.62463857 0.7507229 0.37536143 [78,] 0.59260158 0.8147968 0.40739842 [79,] 0.56577933 0.8684413 0.43422067 [80,] 0.55355224 0.8928955 0.44644776 [81,] 0.51023301 0.9795340 0.48976699 [82,] 0.46927669 0.9385534 0.53072331 [83,] 0.42334032 0.8466806 0.57665968 [84,] 0.45761320 0.9152264 0.54238680 [85,] 0.41830418 0.8366084 0.58169582 [86,] 0.37593189 0.7518638 0.62406811 [87,] 0.36651726 0.7330345 0.63348274 [88,] 0.32321854 0.6464371 0.67678146 [89,] 0.28902166 0.5780433 0.71097834 [90,] 0.26148596 0.5229719 0.73851404 [91,] 0.24454146 0.4890829 0.75545854 [92,] 0.29258235 0.5851647 0.70741765 [93,] 0.25177306 0.5035461 0.74822694 [94,] 0.27227337 0.5445467 0.72772663 [95,] 0.27416081 0.5483216 0.72583919 [96,] 0.26139651 0.5227930 0.73860349 [97,] 0.23610731 0.4722146 0.76389269 [98,] 0.23775586 0.4755117 0.76224414 [99,] 0.21416918 0.4283384 0.78583082 [100,] 0.19846660 0.3969332 0.80153340 [101,] 0.17176480 0.3435296 0.82823520 [102,] 0.25281390 0.5056278 0.74718610 [103,] 0.22238138 0.4447628 0.77761862 [104,] 0.23327879 0.4665576 0.76672121 [105,] 0.21728212 0.4345642 0.78271788 [106,] 0.19131950 0.3826390 0.80868050 [107,] 0.20902944 0.4180589 0.79097056 [108,] 0.20737194 0.4147439 0.79262806 [109,] 0.21448814 0.4289763 0.78551186 [110,] 0.18386132 0.3677226 0.81613868 [111,] 0.15098001 0.3019600 0.84901999 [112,] 0.16030628 0.3206126 0.83969372 [113,] 0.13073434 0.2614687 0.86926566 [114,] 0.10511866 0.2102373 0.89488134 [115,] 0.08170348 0.1634070 0.91829652 [116,] 0.06184653 0.1236931 0.93815347 [117,] 0.06980687 0.1396137 0.93019313 [118,] 0.05885216 0.1177043 0.94114784 [119,] 0.05730869 0.1146174 0.94269131 [120,] 0.07233652 0.1446730 0.92766348 [121,] 0.07676355 0.1535271 0.92323645 [122,] 0.18439213 0.3687843 0.81560787 [123,] 0.16224600 0.3244920 0.83775400 [124,] 0.14716614 0.2943323 0.85283386 [125,] 0.11367064 0.2273413 0.88632936 [126,] 0.08847746 0.1769549 0.91152254 [127,] 0.07598846 0.1519769 0.92401154 [128,] 0.11940168 0.2388034 0.88059832 [129,] 0.08880493 0.1776099 0.91119507 [130,] 0.49669435 0.9933887 0.50330565 [131,] 0.43027815 0.8605563 0.56972185 [132,] 0.41167928 0.8233586 0.58832072 [133,] 0.65640402 0.6871920 0.34359598 [134,] 0.70414998 0.5917000 0.29585002 [135,] 0.62279246 0.7544151 0.37720754 [136,] 0.54263950 0.9147210 0.45736050 [137,] 0.63742389 0.7251522 0.36257611 [138,] 0.51962782 0.9607444 0.48037218 [139,] 0.41638777 0.8327755 0.58361223 > postscript(file="/var/www/rcomp/tmp/1d0v31322148407.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/www/rcomp/tmp/22jvr1322148407.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/www/rcomp/tmp/3guzb1322148407.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/www/rcomp/tmp/4cfvi1322148407.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/www/rcomp/tmp/5nr4l1322148407.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > qqnorm(mysum$resid, main='Residual Normal Q-Q Plot') > qqline(mysum$resid) > grid() > dev.off() null device 1 > (myerror <- as.ts(mysum$resid)) Time Series: Start = 1 End = 162 Frequency = 1 1 2 3 4 5 6 -3.65116381 -0.06898907 2.39982071 2.97878216 -1.99789919 -2.24937333 7 8 9 10 11 12 3.47950128 -1.96245101 -2.11327801 2.44653547 0.55375601 -0.49040241 13 14 15 16 17 18 0.50011567 0.34256371 -0.76090037 -0.35058079 0.14320489 3.63787833 19 20 21 22 23 24 2.00829470 0.17258302 0.58007848 0.87376700 2.11640117 0.67945094 25 26 27 28 29 30 2.29291385 0.20378435 0.50038303 -1.42582416 0.54893312 -0.21495545 31 32 33 34 35 36 -0.82132500 -0.39237038 -1.39310725 0.33305376 -1.49038676 -6.04113582 37 38 39 40 41 42 -0.93110777 -1.73397405 1.59204050 1.38401175 0.97561634 -1.82947189 43 44 45 46 47 48 2.08671057 -0.36779806 -1.32838853 -4.89205690 -2.65994730 -0.04971177 49 50 51 52 53 54 1.11324030 -1.89094277 -0.41783331 -0.06582990 -2.57480319 0.02498337 55 56 57 58 59 60 -2.47476508 1.26806721 -0.18824754 0.85058291 -0.28170726 1.66345015 61 62 63 64 65 66 0.51037696 0.01223648 -0.51613284 -0.88058151 0.18884966 1.23683741 67 68 69 70 71 72 1.69789288 3.39697130 -3.78624214 0.77345635 -3.45315646 -0.36534428 73 74 75 76 77 78 1.79141232 1.06179718 0.35454947 3.07271689 -0.40135296 1.20099101 79 80 81 82 83 84 -1.70960030 -0.23181990 0.61797641 4.27584816 0.28401602 -0.54553911 85 86 87 88 89 90 -0.12887477 1.35826088 0.11179712 0.72291866 1.23420143 1.00455398 91 92 93 94 95 96 -1.48069602 0.07393999 0.75370743 -0.06585124 -2.19333414 0.93969131 97 98 99 100 101 102 0.26920699 1.86047661 0.27409978 -0.35241606 -1.05778998 1.36077600 103 104 105 106 107 108 2.71919303 0.34639035 1.87241375 -2.00607336 1.13886584 0.25671497 109 110 111 112 113 114 1.51506264 -0.72679496 1.09853529 0.19230515 2.62181767 -1.31021173 115 116 117 118 119 120 -2.70610673 1.31044660 -1.64719957 1.12095593 -2.10537487 0.50346894 121 122 123 124 125 126 -1.32002336 -0.04483874 -2.91725442 -1.00233264 -0.85861432 -0.56112734 127 128 129 130 131 132 -0.17684714 0.98293886 0.93635163 -2.76255209 2.16775203 -3.05263152 133 134 135 136 137 138 2.06143769 -1.55957003 -1.28176402 -0.32034008 0.91075105 0.42133963 139 140 141 142 143 144 -2.46444423 -1.39548927 -5.02070999 2.55779426 2.07179049 0.70156695 145 146 147 148 149 150 1.51361637 -4.01036201 2.40467336 -1.89176049 1.17877306 0.01362895 151 152 153 154 155 156 -2.96054218 -1.20224525 1.70560118 4.09561255 1.33487725 -2.25492005 157 158 159 160 161 162 0.35734891 1.42589465 1.06715576 0.94309067 -0.25675159 0.35811295 > postscript(file="/var/www/rcomp/tmp/6ajyb1322148407.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > dum <- cbind(lag(myerror,k=1),myerror) > dum Time Series: Start = 0 End = 162 Frequency = 1 lag(myerror, k = 1) myerror 0 -3.65116381 NA 1 -0.06898907 -3.65116381 2 2.39982071 -0.06898907 3 2.97878216 2.39982071 4 -1.99789919 2.97878216 5 -2.24937333 -1.99789919 6 3.47950128 -2.24937333 7 -1.96245101 3.47950128 8 -2.11327801 -1.96245101 9 2.44653547 -2.11327801 10 0.55375601 2.44653547 11 -0.49040241 0.55375601 12 0.50011567 -0.49040241 13 0.34256371 0.50011567 14 -0.76090037 0.34256371 15 -0.35058079 -0.76090037 16 0.14320489 -0.35058079 17 3.63787833 0.14320489 18 2.00829470 3.63787833 19 0.17258302 2.00829470 20 0.58007848 0.17258302 21 0.87376700 0.58007848 22 2.11640117 0.87376700 23 0.67945094 2.11640117 24 2.29291385 0.67945094 25 0.20378435 2.29291385 26 0.50038303 0.20378435 27 -1.42582416 0.50038303 28 0.54893312 -1.42582416 29 -0.21495545 0.54893312 30 -0.82132500 -0.21495545 31 -0.39237038 -0.82132500 32 -1.39310725 -0.39237038 33 0.33305376 -1.39310725 34 -1.49038676 0.33305376 35 -6.04113582 -1.49038676 36 -0.93110777 -6.04113582 37 -1.73397405 -0.93110777 38 1.59204050 -1.73397405 39 1.38401175 1.59204050 40 0.97561634 1.38401175 41 -1.82947189 0.97561634 42 2.08671057 -1.82947189 43 -0.36779806 2.08671057 44 -1.32838853 -0.36779806 45 -4.89205690 -1.32838853 46 -2.65994730 -4.89205690 47 -0.04971177 -2.65994730 48 1.11324030 -0.04971177 49 -1.89094277 1.11324030 50 -0.41783331 -1.89094277 51 -0.06582990 -0.41783331 52 -2.57480319 -0.06582990 53 0.02498337 -2.57480319 54 -2.47476508 0.02498337 55 1.26806721 -2.47476508 56 -0.18824754 1.26806721 57 0.85058291 -0.18824754 58 -0.28170726 0.85058291 59 1.66345015 -0.28170726 60 0.51037696 1.66345015 61 0.01223648 0.51037696 62 -0.51613284 0.01223648 63 -0.88058151 -0.51613284 64 0.18884966 -0.88058151 65 1.23683741 0.18884966 66 1.69789288 1.23683741 67 3.39697130 1.69789288 68 -3.78624214 3.39697130 69 0.77345635 -3.78624214 70 -3.45315646 0.77345635 71 -0.36534428 -3.45315646 72 1.79141232 -0.36534428 73 1.06179718 1.79141232 74 0.35454947 1.06179718 75 3.07271689 0.35454947 76 -0.40135296 3.07271689 77 1.20099101 -0.40135296 78 -1.70960030 1.20099101 79 -0.23181990 -1.70960030 80 0.61797641 -0.23181990 81 4.27584816 0.61797641 82 0.28401602 4.27584816 83 -0.54553911 0.28401602 84 -0.12887477 -0.54553911 85 1.35826088 -0.12887477 86 0.11179712 1.35826088 87 0.72291866 0.11179712 88 1.23420143 0.72291866 89 1.00455398 1.23420143 90 -1.48069602 1.00455398 91 0.07393999 -1.48069602 92 0.75370743 0.07393999 93 -0.06585124 0.75370743 94 -2.19333414 -0.06585124 95 0.93969131 -2.19333414 96 0.26920699 0.93969131 97 1.86047661 0.26920699 98 0.27409978 1.86047661 99 -0.35241606 0.27409978 100 -1.05778998 -0.35241606 101 1.36077600 -1.05778998 102 2.71919303 1.36077600 103 0.34639035 2.71919303 104 1.87241375 0.34639035 105 -2.00607336 1.87241375 106 1.13886584 -2.00607336 107 0.25671497 1.13886584 108 1.51506264 0.25671497 109 -0.72679496 1.51506264 110 1.09853529 -0.72679496 111 0.19230515 1.09853529 112 2.62181767 0.19230515 113 -1.31021173 2.62181767 114 -2.70610673 -1.31021173 115 1.31044660 -2.70610673 116 -1.64719957 1.31044660 117 1.12095593 -1.64719957 118 -2.10537487 1.12095593 119 0.50346894 -2.10537487 120 -1.32002336 0.50346894 121 -0.04483874 -1.32002336 122 -2.91725442 -0.04483874 123 -1.00233264 -2.91725442 124 -0.85861432 -1.00233264 125 -0.56112734 -0.85861432 126 -0.17684714 -0.56112734 127 0.98293886 -0.17684714 128 0.93635163 0.98293886 129 -2.76255209 0.93635163 130 2.16775203 -2.76255209 131 -3.05263152 2.16775203 132 2.06143769 -3.05263152 133 -1.55957003 2.06143769 134 -1.28176402 -1.55957003 135 -0.32034008 -1.28176402 136 0.91075105 -0.32034008 137 0.42133963 0.91075105 138 -2.46444423 0.42133963 139 -1.39548927 -2.46444423 140 -5.02070999 -1.39548927 141 2.55779426 -5.02070999 142 2.07179049 2.55779426 143 0.70156695 2.07179049 144 1.51361637 0.70156695 145 -4.01036201 1.51361637 146 2.40467336 -4.01036201 147 -1.89176049 2.40467336 148 1.17877306 -1.89176049 149 0.01362895 1.17877306 150 -2.96054218 0.01362895 151 -1.20224525 -2.96054218 152 1.70560118 -1.20224525 153 4.09561255 1.70560118 154 1.33487725 4.09561255 155 -2.25492005 1.33487725 156 0.35734891 -2.25492005 157 1.42589465 0.35734891 158 1.06715576 1.42589465 159 0.94309067 1.06715576 160 -0.25675159 0.94309067 161 0.35811295 -0.25675159 162 NA 0.35811295 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -0.06898907 -3.65116381 [2,] 2.39982071 -0.06898907 [3,] 2.97878216 2.39982071 [4,] -1.99789919 2.97878216 [5,] -2.24937333 -1.99789919 [6,] 3.47950128 -2.24937333 [7,] -1.96245101 3.47950128 [8,] -2.11327801 -1.96245101 [9,] 2.44653547 -2.11327801 [10,] 0.55375601 2.44653547 [11,] -0.49040241 0.55375601 [12,] 0.50011567 -0.49040241 [13,] 0.34256371 0.50011567 [14,] -0.76090037 0.34256371 [15,] -0.35058079 -0.76090037 [16,] 0.14320489 -0.35058079 [17,] 3.63787833 0.14320489 [18,] 2.00829470 3.63787833 [19,] 0.17258302 2.00829470 [20,] 0.58007848 0.17258302 [21,] 0.87376700 0.58007848 [22,] 2.11640117 0.87376700 [23,] 0.67945094 2.11640117 [24,] 2.29291385 0.67945094 [25,] 0.20378435 2.29291385 [26,] 0.50038303 0.20378435 [27,] -1.42582416 0.50038303 [28,] 0.54893312 -1.42582416 [29,] -0.21495545 0.54893312 [30,] -0.82132500 -0.21495545 [31,] -0.39237038 -0.82132500 [32,] -1.39310725 -0.39237038 [33,] 0.33305376 -1.39310725 [34,] -1.49038676 0.33305376 [35,] -6.04113582 -1.49038676 [36,] -0.93110777 -6.04113582 [37,] -1.73397405 -0.93110777 [38,] 1.59204050 -1.73397405 [39,] 1.38401175 1.59204050 [40,] 0.97561634 1.38401175 [41,] -1.82947189 0.97561634 [42,] 2.08671057 -1.82947189 [43,] -0.36779806 2.08671057 [44,] -1.32838853 -0.36779806 [45,] -4.89205690 -1.32838853 [46,] -2.65994730 -4.89205690 [47,] -0.04971177 -2.65994730 [48,] 1.11324030 -0.04971177 [49,] -1.89094277 1.11324030 [50,] -0.41783331 -1.89094277 [51,] -0.06582990 -0.41783331 [52,] -2.57480319 -0.06582990 [53,] 0.02498337 -2.57480319 [54,] -2.47476508 0.02498337 [55,] 1.26806721 -2.47476508 [56,] -0.18824754 1.26806721 [57,] 0.85058291 -0.18824754 [58,] -0.28170726 0.85058291 [59,] 1.66345015 -0.28170726 [60,] 0.51037696 1.66345015 [61,] 0.01223648 0.51037696 [62,] -0.51613284 0.01223648 [63,] -0.88058151 -0.51613284 [64,] 0.18884966 -0.88058151 [65,] 1.23683741 0.18884966 [66,] 1.69789288 1.23683741 [67,] 3.39697130 1.69789288 [68,] -3.78624214 3.39697130 [69,] 0.77345635 -3.78624214 [70,] -3.45315646 0.77345635 [71,] -0.36534428 -3.45315646 [72,] 1.79141232 -0.36534428 [73,] 1.06179718 1.79141232 [74,] 0.35454947 1.06179718 [75,] 3.07271689 0.35454947 [76,] -0.40135296 3.07271689 [77,] 1.20099101 -0.40135296 [78,] -1.70960030 1.20099101 [79,] -0.23181990 -1.70960030 [80,] 0.61797641 -0.23181990 [81,] 4.27584816 0.61797641 [82,] 0.28401602 4.27584816 [83,] -0.54553911 0.28401602 [84,] -0.12887477 -0.54553911 [85,] 1.35826088 -0.12887477 [86,] 0.11179712 1.35826088 [87,] 0.72291866 0.11179712 [88,] 1.23420143 0.72291866 [89,] 1.00455398 1.23420143 [90,] -1.48069602 1.00455398 [91,] 0.07393999 -1.48069602 [92,] 0.75370743 0.07393999 [93,] -0.06585124 0.75370743 [94,] -2.19333414 -0.06585124 [95,] 0.93969131 -2.19333414 [96,] 0.26920699 0.93969131 [97,] 1.86047661 0.26920699 [98,] 0.27409978 1.86047661 [99,] -0.35241606 0.27409978 [100,] -1.05778998 -0.35241606 [101,] 1.36077600 -1.05778998 [102,] 2.71919303 1.36077600 [103,] 0.34639035 2.71919303 [104,] 1.87241375 0.34639035 [105,] -2.00607336 1.87241375 [106,] 1.13886584 -2.00607336 [107,] 0.25671497 1.13886584 [108,] 1.51506264 0.25671497 [109,] -0.72679496 1.51506264 [110,] 1.09853529 -0.72679496 [111,] 0.19230515 1.09853529 [112,] 2.62181767 0.19230515 [113,] -1.31021173 2.62181767 [114,] -2.70610673 -1.31021173 [115,] 1.31044660 -2.70610673 [116,] -1.64719957 1.31044660 [117,] 1.12095593 -1.64719957 [118,] -2.10537487 1.12095593 [119,] 0.50346894 -2.10537487 [120,] -1.32002336 0.50346894 [121,] -0.04483874 -1.32002336 [122,] -2.91725442 -0.04483874 [123,] -1.00233264 -2.91725442 [124,] -0.85861432 -1.00233264 [125,] -0.56112734 -0.85861432 [126,] -0.17684714 -0.56112734 [127,] 0.98293886 -0.17684714 [128,] 0.93635163 0.98293886 [129,] -2.76255209 0.93635163 [130,] 2.16775203 -2.76255209 [131,] -3.05263152 2.16775203 [132,] 2.06143769 -3.05263152 [133,] -1.55957003 2.06143769 [134,] -1.28176402 -1.55957003 [135,] -0.32034008 -1.28176402 [136,] 0.91075105 -0.32034008 [137,] 0.42133963 0.91075105 [138,] -2.46444423 0.42133963 [139,] -1.39548927 -2.46444423 [140,] -5.02070999 -1.39548927 [141,] 2.55779426 -5.02070999 [142,] 2.07179049 2.55779426 [143,] 0.70156695 2.07179049 [144,] 1.51361637 0.70156695 [145,] -4.01036201 1.51361637 [146,] 2.40467336 -4.01036201 [147,] -1.89176049 2.40467336 [148,] 1.17877306 -1.89176049 [149,] 0.01362895 1.17877306 [150,] -2.96054218 0.01362895 [151,] -1.20224525 -2.96054218 [152,] 1.70560118 -1.20224525 [153,] 4.09561255 1.70560118 [154,] 1.33487725 4.09561255 [155,] -2.25492005 1.33487725 [156,] 0.35734891 -2.25492005 [157,] 1.42589465 0.35734891 [158,] 1.06715576 1.42589465 [159,] 0.94309067 1.06715576 [160,] -0.25675159 0.94309067 [161,] 0.35811295 -0.25675159 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -0.06898907 -3.65116381 2 2.39982071 -0.06898907 3 2.97878216 2.39982071 4 -1.99789919 2.97878216 5 -2.24937333 -1.99789919 6 3.47950128 -2.24937333 7 -1.96245101 3.47950128 8 -2.11327801 -1.96245101 9 2.44653547 -2.11327801 10 0.55375601 2.44653547 11 -0.49040241 0.55375601 12 0.50011567 -0.49040241 13 0.34256371 0.50011567 14 -0.76090037 0.34256371 15 -0.35058079 -0.76090037 16 0.14320489 -0.35058079 17 3.63787833 0.14320489 18 2.00829470 3.63787833 19 0.17258302 2.00829470 20 0.58007848 0.17258302 21 0.87376700 0.58007848 22 2.11640117 0.87376700 23 0.67945094 2.11640117 24 2.29291385 0.67945094 25 0.20378435 2.29291385 26 0.50038303 0.20378435 27 -1.42582416 0.50038303 28 0.54893312 -1.42582416 29 -0.21495545 0.54893312 30 -0.82132500 -0.21495545 31 -0.39237038 -0.82132500 32 -1.39310725 -0.39237038 33 0.33305376 -1.39310725 34 -1.49038676 0.33305376 35 -6.04113582 -1.49038676 36 -0.93110777 -6.04113582 37 -1.73397405 -0.93110777 38 1.59204050 -1.73397405 39 1.38401175 1.59204050 40 0.97561634 1.38401175 41 -1.82947189 0.97561634 42 2.08671057 -1.82947189 43 -0.36779806 2.08671057 44 -1.32838853 -0.36779806 45 -4.89205690 -1.32838853 46 -2.65994730 -4.89205690 47 -0.04971177 -2.65994730 48 1.11324030 -0.04971177 49 -1.89094277 1.11324030 50 -0.41783331 -1.89094277 51 -0.06582990 -0.41783331 52 -2.57480319 -0.06582990 53 0.02498337 -2.57480319 54 -2.47476508 0.02498337 55 1.26806721 -2.47476508 56 -0.18824754 1.26806721 57 0.85058291 -0.18824754 58 -0.28170726 0.85058291 59 1.66345015 -0.28170726 60 0.51037696 1.66345015 61 0.01223648 0.51037696 62 -0.51613284 0.01223648 63 -0.88058151 -0.51613284 64 0.18884966 -0.88058151 65 1.23683741 0.18884966 66 1.69789288 1.23683741 67 3.39697130 1.69789288 68 -3.78624214 3.39697130 69 0.77345635 -3.78624214 70 -3.45315646 0.77345635 71 -0.36534428 -3.45315646 72 1.79141232 -0.36534428 73 1.06179718 1.79141232 74 0.35454947 1.06179718 75 3.07271689 0.35454947 76 -0.40135296 3.07271689 77 1.20099101 -0.40135296 78 -1.70960030 1.20099101 79 -0.23181990 -1.70960030 80 0.61797641 -0.23181990 81 4.27584816 0.61797641 82 0.28401602 4.27584816 83 -0.54553911 0.28401602 84 -0.12887477 -0.54553911 85 1.35826088 -0.12887477 86 0.11179712 1.35826088 87 0.72291866 0.11179712 88 1.23420143 0.72291866 89 1.00455398 1.23420143 90 -1.48069602 1.00455398 91 0.07393999 -1.48069602 92 0.75370743 0.07393999 93 -0.06585124 0.75370743 94 -2.19333414 -0.06585124 95 0.93969131 -2.19333414 96 0.26920699 0.93969131 97 1.86047661 0.26920699 98 0.27409978 1.86047661 99 -0.35241606 0.27409978 100 -1.05778998 -0.35241606 101 1.36077600 -1.05778998 102 2.71919303 1.36077600 103 0.34639035 2.71919303 104 1.87241375 0.34639035 105 -2.00607336 1.87241375 106 1.13886584 -2.00607336 107 0.25671497 1.13886584 108 1.51506264 0.25671497 109 -0.72679496 1.51506264 110 1.09853529 -0.72679496 111 0.19230515 1.09853529 112 2.62181767 0.19230515 113 -1.31021173 2.62181767 114 -2.70610673 -1.31021173 115 1.31044660 -2.70610673 116 -1.64719957 1.31044660 117 1.12095593 -1.64719957 118 -2.10537487 1.12095593 119 0.50346894 -2.10537487 120 -1.32002336 0.50346894 121 -0.04483874 -1.32002336 122 -2.91725442 -0.04483874 123 -1.00233264 -2.91725442 124 -0.85861432 -1.00233264 125 -0.56112734 -0.85861432 126 -0.17684714 -0.56112734 127 0.98293886 -0.17684714 128 0.93635163 0.98293886 129 -2.76255209 0.93635163 130 2.16775203 -2.76255209 131 -3.05263152 2.16775203 132 2.06143769 -3.05263152 133 -1.55957003 2.06143769 134 -1.28176402 -1.55957003 135 -0.32034008 -1.28176402 136 0.91075105 -0.32034008 137 0.42133963 0.91075105 138 -2.46444423 0.42133963 139 -1.39548927 -2.46444423 140 -5.02070999 -1.39548927 141 2.55779426 -5.02070999 142 2.07179049 2.55779426 143 0.70156695 2.07179049 144 1.51361637 0.70156695 145 -4.01036201 1.51361637 146 2.40467336 -4.01036201 147 -1.89176049 2.40467336 148 1.17877306 -1.89176049 149 0.01362895 1.17877306 150 -2.96054218 0.01362895 151 -1.20224525 -2.96054218 152 1.70560118 -1.20224525 153 4.09561255 1.70560118 154 1.33487725 4.09561255 155 -2.25492005 1.33487725 156 0.35734891 -2.25492005 157 1.42589465 0.35734891 158 1.06715576 1.42589465 159 0.94309067 1.06715576 160 -0.25675159 0.94309067 161 0.35811295 -0.25675159 > 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/www/rcomp/tmp/7utcg1322148407.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/www/rcomp/tmp/8tj271322148407.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/www/rcomp/tmp/9kxbn1322148407.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/www/rcomp/tmp/10g7ew1322148407.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/www/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/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/www/rcomp/tmp/111d8e1322148407.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/www/rcomp/tmp/12s3wg1322148407.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/www/rcomp/tmp/13v0251322148407.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/www/rcomp/tmp/14k0he1322148407.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/www/rcomp/tmp/15uuvo1322148407.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/www/rcomp/tmp/16dywy1322148407.tab") + } > > try(system("convert tmp/1d0v31322148407.ps tmp/1d0v31322148407.png",intern=TRUE)) character(0) > try(system("convert tmp/22jvr1322148407.ps tmp/22jvr1322148407.png",intern=TRUE)) character(0) > try(system("convert tmp/3guzb1322148407.ps tmp/3guzb1322148407.png",intern=TRUE)) character(0) > try(system("convert tmp/4cfvi1322148407.ps tmp/4cfvi1322148407.png",intern=TRUE)) character(0) > try(system("convert tmp/5nr4l1322148407.ps tmp/5nr4l1322148407.png",intern=TRUE)) character(0) > try(system("convert tmp/6ajyb1322148407.ps tmp/6ajyb1322148407.png",intern=TRUE)) character(0) > try(system("convert tmp/7utcg1322148407.ps tmp/7utcg1322148407.png",intern=TRUE)) character(0) > try(system("convert tmp/8tj271322148407.ps tmp/8tj271322148407.png",intern=TRUE)) character(0) > try(system("convert tmp/9kxbn1322148407.ps tmp/9kxbn1322148407.png",intern=TRUE)) character(0) > try(system("convert tmp/10g7ew1322148407.ps tmp/10g7ew1322148407.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.970 0.290 5.198