R version 2.9.0 (2009-04-17) Copyright (C) 2009 The R Foundation for Statistical Computing ISBN 3-900051-07-0 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 + ,14 + ,13 + ,3 + ,25 + ,55 + ,147 + ,12 + ,8 + ,13 + ,5 + ,158 + ,7 + ,71 + ,10 + ,12 + ,16 + ,6 + ,0 + ,0 + ,0 + ,9 + ,7 + ,12 + ,6 + ,143 + ,10 + ,0 + ,10 + ,10 + ,11 + ,5 + ,67 + ,74 + ,43 + ,12 + ,7 + ,12 + ,3 + ,0 + ,0 + ,0 + ,13 + ,16 + ,18 + ,8 + ,148 + ,138 + ,8 + ,12 + ,11 + ,11 + ,4 + ,28 + ,0 + ,0 + ,12 + ,14 + ,14 + ,4 + ,114 + ,113 + ,34 + ,6 + ,6 + ,9 + ,4 + ,0 + ,0 + ,0 + ,5 + ,16 + ,14 + ,6 + ,123 + ,115 + ,103 + ,12 + ,11 + ,12 + ,6 + ,145 + ,9 + ,0 + ,11 + ,16 + ,11 + ,5 + ,113 + ,114 + ,73 + ,14 + ,12 + ,12 + ,4 + ,152 + ,59 + ,159 + ,14 + ,7 + ,13 + ,6 + ,0 + ,0 + ,0 + ,12 + ,13 + ,11 + ,4 + ,36 + ,114 + ,113 + ,12 + ,11 + ,12 + ,6 + ,0 + ,0 + ,0 + ,11 + ,15 + ,16 + ,6 + ,8 + ,102 + ,44 + ,11 + ,7 + ,9 + ,4 + ,108 + ,0 + ,0 + ,7 + ,9 + ,11 + ,4 + ,112 + ,86 + ,0 + ,9 + ,7 + ,13 + ,2 + ,51 + ,17 + ,41 + ,11 + ,14 + ,15 + ,7 + ,43 + ,45 + ,74 + ,11 + ,15 + ,10 + ,5 + ,120 + ,123 + ,0 + ,12 + ,7 + ,11 + ,4 + ,13 + ,24 + ,0 + ,12 + ,15 + ,13 + ,6 + ,55 + ,5 + ,0 + ,11 + ,17 + ,16 + ,6 + ,103 + ,123 + ,32 + ,11 + ,15 + ,15 + ,7 + ,127 + ,136 + ,126 + ,8 + ,14 + ,14 + ,5 + ,14 + ,4 + ,154 + ,9 + ,14 + ,14 + ,6 + ,135 + ,76 + ,129 + ,12 + ,8 + ,14 + ,4 + ,38 + ,99 + ,98 + ,10 + ,8 + ,8 + ,4 + ,11 + ,98 + ,82 + ,10 + ,14 + ,13 + ,7 + ,43 + ,67 + ,45 + ,12 + ,14 + ,15 + ,7 + ,141 + ,92 + ,8 + ,8 + ,8 + ,13 + ,4 + ,62 + ,13 + ,0 + ,12 + ,11 + ,11 + ,4 + ,62 + ,24 + ,129 + ,11 + ,16 + ,15 + ,6 + ,135 + ,129 + ,31 + ,12 + ,10 + ,15 + ,6 + ,117 + ,117 + ,117 + ,7 + ,8 + ,9 + ,5 + ,82 + ,11 + ,99 + ,11 + ,14 + ,13 + ,6 + ,145 + ,20 + ,55 + ,11 + ,16 + ,16 + ,7 + ,87 + ,91 + ,132 + ,12 + ,13 + ,13 + ,6 + ,76 + ,111 + ,58 + ,9 + ,5 + ,11 + ,3 + ,124 + ,0 + ,0 + ,15 + ,8 + ,12 + ,3 + ,151 + ,58 + ,0 + ,11 + ,10 + ,12 + ,4 + ,131 + ,0 + ,0 + ,11 + ,8 + ,12 + ,6 + ,127 + ,146 + ,101 + ,11 + ,13 + ,14 + ,7 + ,76 + ,129 + ,31 + ,11 + ,15 + ,14 + ,5 + ,25 + ,48 + ,147 + ,15 + ,6 + ,8 + ,4 + ,0 + ,0 + ,0 + ,11 + ,12 + ,13 + ,5 + ,58 + ,111 + ,132 + ,12 + ,16 + ,16 + ,6 + ,115 + ,32 + ,123 + ,12 + ,5 + ,13 + ,6 + ,130 + ,112 + ,39 + ,9 + ,15 + ,11 + ,6 + ,17 + ,51 + ,136 + ,12 + ,12 + ,14 + ,5 + ,102 + ,53 + ,141 + ,12 + ,8 + ,13 + ,4 + ,21 + ,131 + ,0 + ,13 + ,13 + ,13 + ,5 + ,0 + ,0 + ,0 + ,11 + ,14 + ,13 + ,5 + ,14 + ,76 + ,135 + ,9 + ,12 + ,12 + ,4 + ,110 + ,106 + ,118 + ,9 + ,16 + ,16 + ,6 + ,133 + ,26 + ,154 + ,11 + ,10 + ,15 + ,2 + ,83 + ,44 + ,11 + ,15 + ,15 + ,8 + ,56 + ,63 + ,116 + ,12 + ,8 + ,12 + ,3 + ,0 + ,0 + ,0 + ,12 + ,16 + ,14 + ,6 + ,44 + ,116 + ,88 + ,9 + ,19 + ,12 + ,6 + ,70 + ,119 + ,25 + ,11 + ,14 + ,15 + ,6 + ,36 + ,18 + ,113 + ,9 + ,6 + ,12 + ,5 + ,5 + ,134 + ,157 + ,12 + ,13 + ,13 + ,5 + ,118 + ,138 + ,26 + ,12 + ,15 + ,12 + ,6 + ,17 + ,41 + ,38 + ,12 + ,7 + ,12 + ,5 + ,79 + ,0 + ,0 + ,12 + ,13 + ,13 + ,6 + ,122 + ,57 + ,53 + ,14 + ,4 + ,5 + ,2 + ,119 + ,101 + ,0 + ,11 + ,14 + ,13 + ,5 + ,36 + ,114 + ,106 + ,12 + ,13 + ,13 + ,5 + ,36 + ,113 + ,106 + ,11 + ,11 + ,14 + ,5 + ,141 + ,122 + ,102 + ,6 + ,14 + ,17 + ,6 + ,0 + ,14 + ,138 + ,10 + ,12 + ,13 + ,6 + ,37 + ,10 + ,142 + ,12 + ,15 + ,13 + ,6 + ,110 + ,27 + ,73 + ,13 + ,14 + ,12 + ,5 + ,10 + ,39 + ,130 + ,8 + ,13 + ,13 + ,5 + ,14 + ,133 + ,86 + ,12 + ,8 + ,14 + ,4 + ,157 + ,42 + ,78 + ,12 + ,6 + ,11 + ,2 + ,59 + ,0 + ,0 + ,12 + ,7 + ,12 + ,4 + ,77 + ,58 + ,0 + ,6 + ,13 + ,12 + ,6 + ,129 + ,133 + ,4 + ,11 + ,13 + ,16 + ,6 + ,125 + ,151 + ,91 + ,10 + ,11 + ,12 + ,5 + ,87 + ,111 + ,132 + ,12 + ,5 + ,12 + ,3 + ,61 + ,139 + ,0 + ,13 + ,12 + ,12 + ,6 + ,146 + ,126 + ,0 + ,11 + ,8 + ,10 + ,4 + ,96 + ,139 + ,0 + ,7 + ,11 + ,15 + ,5 + ,133 + ,138 + ,14 + ,11 + ,14 + ,15 + ,8 + ,47 + ,52 + ,97 + ,11 + ,9 + ,12 + ,4 + ,74 + ,67 + ,45 + ,11 + ,10 + ,16 + ,6 + ,109 + ,97 + ,0 + ,11 + ,13 + ,15 + ,6 + ,30 + ,137 + ,149 + ,12 + ,16 + ,16 + ,7 + ,116 + ,56 + ,57 + ,10 + ,16 + ,13 + ,6 + ,149 + ,3 + ,105 + ,11 + ,11 + ,12 + ,5 + ,19 + ,78 + ,0 + ,12 + ,8 + ,11 + ,4 + ,96 + ,0 + ,0 + ,7 + ,4 + ,13 + ,6 + ,0 + ,0 + ,0 + ,13 + ,7 + ,10 + ,3 + ,21 + ,0 + ,0 + ,8 + ,14 + ,15 + ,5 + ,26 + ,118 + ,128 + ,12 + ,11 + ,13 + ,6 + ,156 + ,39 + ,29 + ,11 + ,17 + ,16 + ,7 + ,53 + ,63 + ,148 + ,12 + ,15 + ,15 + ,7 + ,72 + ,78 + ,93 + ,14 + ,17 + ,18 + ,6 + ,27 + ,26 + ,4 + ,10 + ,5 + ,13 + ,3 + ,66 + ,50 + ,0 + ,10 + ,4 + ,10 + ,2 + ,71 + ,104 + ,158 + ,13 + ,10 + ,16 + ,8 + ,66 + ,54 + ,144 + ,10 + ,11 + ,13 + ,3 + ,40 + ,104 + ,0 + ,11 + ,15 + ,15 + ,8 + ,57 + ,148 + ,122 + ,10 + ,10 + ,14 + ,3 + ,3 + ,30 + ,149 + ,7 + ,9 + ,15 + ,4 + ,12 + ,38 + ,17 + ,10 + ,12 + ,14 + ,5 + ,107 + ,132 + ,91 + ,8 + ,15 + ,13 + ,7 + ,80 + ,132 + ,111 + ,12 + ,7 + ,13 + ,6 + ,98 + ,84 + ,99 + ,12 + ,13 + ,15 + ,6 + ,155 + ,71 + ,40 + ,12 + ,12 + ,16 + ,7 + ,111 + ,125 + ,132 + ,11 + ,14 + ,14 + ,6 + ,81 + ,25 + ,123 + ,12 + ,14 + ,14 + ,6 + ,50 + ,66 + ,54 + ,12 + ,8 + ,16 + ,6 + ,49 + ,86 + ,90 + ,12 + ,15 + ,14 + ,6 + ,96 + ,61 + ,86 + ,11 + ,12 + ,12 + ,4 + ,2 + ,60 + ,152 + ,12 + ,12 + ,13 + ,4 + ,1 + ,144 + ,152 + ,11 + ,16 + ,12 + ,5 + ,22 + ,120 + ,123 + ,11 + ,9 + ,12 + ,4 + ,64 + ,139 + ,100 + ,13 + ,15 + ,14 + ,6 + ,56 + ,131 + ,116 + ,12 + ,15 + ,14 + ,6 + ,144 + ,159 + ,59 + ,12 + ,6 + ,14 + ,5 + ,0 + ,0 + ,0 + ,12 + ,14 + ,16 + ,8 + ,94 + ,18 + ,5 + ,12 + ,15 + ,13 + ,6 + ,25 + ,123 + ,147 + ,8 + ,10 + ,14 + ,5 + ,93 + ,18 + ,139 + ,8 + ,6 + ,4 + ,4 + ,0 + ,0 + ,0 + ,12 + ,14 + ,16 + ,8 + ,48 + ,123 + ,81 + ,11 + ,12 + ,13 + ,6 + ,30 + ,105 + ,3 + ,12 + ,8 + ,16 + ,4 + ,19 + ,0 + ,0 + ,13 + ,11 + ,15 + ,6 + ,0 + ,0 + ,0 + ,12 + ,13 + ,14 + ,6 + ,10 + ,68 + ,37 + ,12 + ,9 + ,13 + ,4 + ,78 + ,157 + ,5 + ,11 + ,15 + ,14 + ,6 + ,93 + ,94 + ,69 + ,12 + ,13 + ,12 + ,3 + ,0 + ,0 + ,0 + ,12 + ,15 + ,15 + ,6 + ,95 + ,87 + ,0 + ,10 + ,14 + ,14 + ,5 + ,50 + ,156 + ,142 + ,11 + ,16 + ,13 + ,4 + ,86 + ,139 + ,17 + ,12 + ,14 + ,14 + ,6 + ,33 + ,145 + ,100 + ,12 + ,14 + ,16 + ,4 + ,152 + ,55 + ,70 + ,10 + ,10 + ,6 + ,4 + ,51 + ,41 + ,0 + ,12 + ,10 + ,13 + ,4 + ,48 + ,25 + ,123 + ,13 + ,4 + ,13 + ,6 + ,97 + ,47 + ,109 + ,12 + ,8 + ,14 + ,5 + ,77 + ,0 + ,0 + ,15 + ,15 + ,15 + ,6 + ,130 + ,143 + ,37 + ,11 + ,16 + ,14 + ,6 + ,8 + ,102 + ,44 + ,12 + ,12 + ,15 + ,8 + ,84 + ,148 + ,98 + ,11 + ,12 + ,13 + ,7 + ,51 + ,153 + ,11 + ,12 + ,15 + ,16 + ,7 + ,33 + ,32 + ,9 + ,11 + ,9 + ,12 + ,4 + ,6 + ,106 + ,0 + ,10 + ,12 + ,15 + ,6 + ,116 + ,63 + ,57 + ,11 + ,14 + ,12 + ,6 + ,88 + ,56 + ,63 + ,11 + ,11 + ,14 + ,2 + ,142 + ,39 + ,66) + ,dim=c(7 + ,156) + ,dimnames=list(c('FindingFriends' + ,'KnowingPeople' + ,'Liked' + ,'Celebrity' + ,'firstbestfriend' + ,'secondbestfriend' + ,'thirdbestfriend') + ,1:156)) > y <- array(NA,dim=c(7,156),dimnames=list(c('FindingFriends','KnowingPeople','Liked','Celebrity','firstbestfriend','secondbestfriend','thirdbestfriend'),1:156)) > 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' > #'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.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 Liked FindingFriends KnowingPeople Celebrity firstbestfriend 1 13 13 14 3 25 2 13 12 8 5 158 3 16 10 12 6 0 4 12 9 7 6 143 5 11 10 10 5 67 6 12 12 7 3 0 7 18 13 16 8 148 8 11 12 11 4 28 9 14 12 14 4 114 10 9 6 6 4 0 11 14 5 16 6 123 12 12 12 11 6 145 13 11 11 16 5 113 14 12 14 12 4 152 15 13 14 7 6 0 16 11 12 13 4 36 17 12 12 11 6 0 18 16 11 15 6 8 19 9 11 7 4 108 20 11 7 9 4 112 21 13 9 7 2 51 22 15 11 14 7 43 23 10 11 15 5 120 24 11 12 7 4 13 25 13 12 15 6 55 26 16 11 17 6 103 27 15 11 15 7 127 28 14 8 14 5 14 29 14 9 14 6 135 30 14 12 8 4 38 31 8 10 8 4 11 32 13 10 14 7 43 33 15 12 14 7 141 34 13 8 8 4 62 35 11 12 11 4 62 36 15 11 16 6 135 37 15 12 10 6 117 38 9 7 8 5 82 39 13 11 14 6 145 40 16 11 16 7 87 41 13 12 13 6 76 42 11 9 5 3 124 43 12 15 8 3 151 44 12 11 10 4 131 45 12 11 8 6 127 46 14 11 13 7 76 47 14 11 15 5 25 48 8 15 6 4 0 49 13 11 12 5 58 50 16 12 16 6 115 51 13 12 5 6 130 52 11 9 15 6 17 53 14 12 12 5 102 54 13 12 8 4 21 55 13 13 13 5 0 56 13 11 14 5 14 57 12 9 12 4 110 58 16 9 16 6 133 59 15 11 10 2 83 60 8 15 15 56 63 61 3 8 12 0 0 62 6 16 14 44 116 63 6 19 12 70 119 64 6 14 15 36 18 65 5 6 12 5 134 66 5 13 13 118 138 67 6 15 12 17 41 68 5 7 12 79 0 69 6 13 13 122 57 70 2 4 5 119 101 71 5 14 13 36 114 72 5 13 13 36 113 73 5 11 14 141 122 74 6 14 17 0 14 75 6 12 13 37 10 76 6 15 13 110 27 77 5 14 12 10 39 78 5 13 13 14 133 79 4 8 14 157 42 80 2 6 11 59 0 81 4 7 12 77 58 82 6 13 12 129 133 83 6 13 16 125 151 84 5 11 12 87 111 85 3 5 12 61 139 86 6 12 12 146 126 87 4 8 10 96 139 88 5 11 15 133 138 89 8 14 15 47 52 90 4 9 12 74 67 91 6 10 16 109 97 92 6 13 15 30 137 93 7 16 16 116 56 94 6 16 13 149 3 95 5 11 12 19 78 96 4 8 11 96 0 97 6 4 13 0 0 98 3 7 10 21 0 99 5 14 15 26 118 100 6 11 13 156 39 101 7 17 16 53 63 102 7 15 15 72 78 103 6 17 18 27 26 104 3 5 13 66 50 105 2 4 10 71 104 106 8 10 16 66 54 107 3 11 13 40 104 108 8 15 15 57 148 109 3 10 14 3 30 110 4 9 15 12 38 111 5 12 14 107 132 112 7 15 13 80 132 113 6 7 13 98 84 114 6 13 15 155 71 115 7 12 16 111 125 116 6 14 14 81 25 117 6 14 14 50 66 118 6 8 16 49 86 119 6 15 14 96 61 120 4 12 12 2 60 121 4 12 13 1 144 122 5 16 12 22 120 123 4 9 12 64 139 124 6 15 14 56 131 125 6 15 14 144 159 126 5 6 14 0 0 127 8 14 16 94 18 128 6 15 13 25 123 129 5 10 14 93 18 130 4 6 4 0 0 131 8 14 16 48 123 132 6 12 13 30 105 133 4 8 16 19 0 134 6 11 15 0 0 135 6 13 14 10 68 136 4 9 13 78 157 137 6 15 14 93 94 138 3 13 12 0 0 139 6 15 15 95 87 140 5 14 14 50 156 141 4 16 13 86 139 142 6 14 14 33 145 143 4 14 16 152 55 144 4 10 6 51 41 145 4 10 13 48 25 146 6 4 13 97 47 147 5 8 14 77 0 148 6 15 15 130 143 149 6 16 14 8 102 150 8 12 15 84 148 151 7 12 13 51 153 152 7 15 16 33 32 153 4 9 12 6 106 154 6 12 15 116 63 155 6 14 12 88 56 156 2 11 14 142 39 secondbestfriend thirdbestfriend 1 55 147 2 7 71 3 0 0 4 10 0 5 74 43 6 0 0 7 138 8 8 0 0 9 113 34 10 0 0 11 115 103 12 9 0 13 114 73 14 59 159 15 0 0 16 114 113 17 0 0 18 102 44 19 0 0 20 86 0 21 17 41 22 45 74 23 123 0 24 24 0 25 5 0 26 123 32 27 136 126 28 4 154 29 76 129 30 99 98 31 98 82 32 67 45 33 92 8 34 13 0 35 24 129 36 129 31 37 117 117 38 11 99 39 20 55 40 91 132 41 111 58 42 0 0 43 58 0 44 0 0 45 146 101 46 129 31 47 48 147 48 0 0 49 111 132 50 32 123 51 112 39 52 51 136 53 53 141 54 131 0 55 0 0 56 76 135 57 106 118 58 26 154 59 44 11 60 116 12 61 0 12 62 88 9 63 25 11 64 113 9 65 157 12 66 26 12 67 38 12 68 0 12 69 53 14 70 0 11 71 106 12 72 106 11 73 102 6 74 138 10 75 142 12 76 73 13 77 130 8 78 86 12 79 78 12 80 0 12 81 0 6 82 4 11 83 91 10 84 132 12 85 0 13 86 0 11 87 0 7 88 14 11 89 97 11 90 45 11 91 0 11 92 149 12 93 57 10 94 105 11 95 0 12 96 0 7 97 0 13 98 0 8 99 128 12 100 29 11 101 148 12 102 93 14 103 4 10 104 0 10 105 158 13 106 144 10 107 0 11 108 122 10 109 149 7 110 17 10 111 91 8 112 111 12 113 99 12 114 40 12 115 132 11 116 123 12 117 54 12 118 90 12 119 86 11 120 152 12 121 152 11 122 123 11 123 100 13 124 116 12 125 59 12 126 0 12 127 5 12 128 147 8 129 139 8 130 0 12 131 81 11 132 3 12 133 0 13 134 0 12 135 37 12 136 5 11 137 69 12 138 0 12 139 0 10 140 142 11 141 17 12 142 100 12 143 70 10 144 0 12 145 123 13 146 109 12 147 0 15 148 37 11 149 44 12 150 98 11 151 11 12 152 9 11 153 0 10 154 57 11 155 63 11 156 66 13 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) FindingFriends KnowingPeople Celebrity 6.433550 0.193381 -0.046435 -0.036421 firstbestfriend secondbestfriend thirdbestfriend 0.007353 -0.001584 0.041025 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -5.8826 -2.4255 -0.1227 1.9069 8.8890 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 6.433550 1.290503 4.985 1.70e-06 *** FindingFriends 0.193381 0.085540 2.261 0.0252 * KnowingPeople -0.046435 0.094326 -0.492 0.6232 Celebrity -0.036421 0.005816 -6.263 3.84e-09 *** firstbestfriend 0.007353 0.004876 1.508 0.1337 secondbestfriend -0.001584 0.004979 -0.318 0.7509 thirdbestfriend 0.041025 0.006274 6.539 9.31e-10 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 2.987 on 149 degrees of freedom Multiple R-squared: 0.4792, Adjusted R-squared: 0.4582 F-statistic: 22.85 on 6 and 149 DF, p-value: < 2.2e-16 > 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.26358231 5.271646e-01 7.364177e-01 [2,] 0.14471415 2.894283e-01 8.552858e-01 [3,] 0.13210524 2.642105e-01 8.678948e-01 [4,] 0.18541073 3.708215e-01 8.145893e-01 [5,] 0.11900496 2.380099e-01 8.809950e-01 [6,] 0.09544001 1.908800e-01 9.045600e-01 [7,] 0.07037319 1.407464e-01 9.296268e-01 [8,] 0.07065705 1.413141e-01 9.293429e-01 [9,] 0.06176517 1.235303e-01 9.382348e-01 [10,] 0.04463203 8.926406e-02 9.553680e-01 [11,] 0.03074496 6.148991e-02 9.692550e-01 [12,] 0.08585334 1.717067e-01 9.141467e-01 [13,] 0.06259783 1.251957e-01 9.374022e-01 [14,] 0.09053794 1.810759e-01 9.094621e-01 [15,] 0.06873345 1.374669e-01 9.312666e-01 [16,] 0.06077547 1.215509e-01 9.392245e-01 [17,] 0.07475268 1.495054e-01 9.252473e-01 [18,] 0.05216339 1.043268e-01 9.478366e-01 [19,] 0.03556641 7.113282e-02 9.644336e-01 [20,] 0.02351925 4.703849e-02 9.764808e-01 [21,] 0.01970578 3.941157e-02 9.802942e-01 [22,] 0.04725262 9.450524e-02 9.527474e-01 [23,] 0.04664213 9.328426e-02 9.533579e-01 [24,] 0.05510011 1.102002e-01 9.448999e-01 [25,] 0.08465452 1.693090e-01 9.153455e-01 [26,] 0.07565827 1.513165e-01 9.243417e-01 [27,] 0.09678236 1.935647e-01 9.032176e-01 [28,] 0.08635363 1.727073e-01 9.136464e-01 [29,] 0.10153461 2.030692e-01 8.984654e-01 [30,] 0.09092145 1.818429e-01 9.090785e-01 [31,] 0.07755396 1.551079e-01 9.224460e-01 [32,] 0.07213461 1.442692e-01 9.278654e-01 [33,] 0.08123357 1.624671e-01 9.187664e-01 [34,] 0.08496999 1.699400e-01 9.150300e-01 [35,] 0.11599941 2.319988e-01 8.840006e-01 [36,] 0.09431405 1.886281e-01 9.056859e-01 [37,] 0.14155117 2.831023e-01 8.584488e-01 [38,] 0.11448491 2.289698e-01 8.855151e-01 [39,] 0.16026235 3.205247e-01 8.397376e-01 [40,] 0.13098392 2.619678e-01 8.690161e-01 [41,] 0.13368488 2.673698e-01 8.663151e-01 [42,] 0.17523458 3.504692e-01 8.247654e-01 [43,] 0.21649728 4.329946e-01 7.835027e-01 [44,] 0.18698446 3.739689e-01 8.130155e-01 [45,] 0.45522877 9.104575e-01 5.447712e-01 [46,] 0.77907201 4.418560e-01 2.209280e-01 [47,] 0.74615594 5.076881e-01 2.538441e-01 [48,] 0.70743070 5.851386e-01 2.925693e-01 [49,] 0.69771821 6.045636e-01 3.022818e-01 [50,] 0.99989111 2.177765e-04 1.088883e-04 [51,] 0.99998291 3.418923e-05 1.709462e-05 [52,] 0.99999999 1.122675e-08 5.613377e-09 [53,] 1.00000000 5.662754e-09 2.831377e-09 [54,] 0.99999999 1.107640e-08 5.538200e-09 [55,] 1.00000000 8.269109e-09 4.134555e-09 [56,] 1.00000000 3.322442e-10 1.661221e-10 [57,] 1.00000000 1.030915e-10 5.154575e-11 [58,] 1.00000000 2.799099e-11 1.399549e-11 [59,] 1.00000000 4.853936e-11 2.426968e-11 [60,] 1.00000000 4.274604e-11 2.137302e-11 [61,] 1.00000000 9.080779e-11 4.540390e-11 [62,] 1.00000000 3.401163e-11 1.700581e-11 [63,] 1.00000000 1.860370e-11 9.301848e-12 [64,] 1.00000000 2.573584e-11 1.286792e-11 [65,] 1.00000000 7.555687e-12 3.777844e-12 [66,] 1.00000000 1.235302e-11 6.176512e-12 [67,] 1.00000000 2.260188e-11 1.130094e-11 [68,] 1.00000000 1.509378e-11 7.546892e-12 [69,] 1.00000000 5.363162e-12 2.681581e-12 [70,] 1.00000000 7.473249e-12 3.736625e-12 [71,] 1.00000000 2.512417e-12 1.256208e-12 [72,] 1.00000000 4.816034e-12 2.408017e-12 [73,] 1.00000000 9.258093e-12 4.629046e-12 [74,] 1.00000000 2.141079e-11 1.070540e-11 [75,] 1.00000000 4.982677e-11 2.491338e-11 [76,] 1.00000000 3.129271e-11 1.564635e-11 [77,] 1.00000000 4.819192e-11 2.409596e-11 [78,] 1.00000000 1.000415e-10 5.002074e-11 [79,] 1.00000000 2.083989e-10 1.041995e-10 [80,] 1.00000000 1.783772e-10 8.918862e-11 [81,] 1.00000000 3.190989e-10 1.595495e-10 [82,] 1.00000000 7.347160e-10 3.673580e-10 [83,] 1.00000000 1.019228e-09 5.096140e-10 [84,] 1.00000000 1.938604e-09 9.693020e-10 [85,] 1.00000000 2.846992e-09 1.423496e-09 [86,] 1.00000000 2.920351e-09 1.460175e-09 [87,] 1.00000000 6.424015e-09 3.212007e-09 [88,] 1.00000000 4.752592e-09 2.376296e-09 [89,] 1.00000000 5.740598e-09 2.870299e-09 [90,] 1.00000000 5.049273e-09 2.524636e-09 [91,] 1.00000000 6.822004e-09 3.411002e-09 [92,] 0.99999999 1.440341e-08 7.201705e-09 [93,] 0.99999999 2.996367e-08 1.498183e-08 [94,] 0.99999998 4.062058e-08 2.031029e-08 [95,] 0.99999997 6.045278e-08 3.022639e-08 [96,] 0.99999997 5.027684e-08 2.513842e-08 [97,] 0.99999998 3.030991e-08 1.515496e-08 [98,] 0.99999999 1.141137e-08 5.705684e-09 [99,] 0.99999999 1.118587e-08 5.592937e-09 [100,] 1.00000000 7.147938e-09 3.573969e-09 [101,] 1.00000000 7.125022e-09 3.562511e-09 [102,] 0.99999999 1.470272e-08 7.351359e-09 [103,] 0.99999999 2.094622e-08 1.047311e-08 [104,] 0.99999998 3.602549e-08 1.801275e-08 [105,] 0.99999996 7.781751e-08 3.890875e-08 [106,] 0.99999993 1.346043e-07 6.730215e-08 [107,] 0.99999987 2.683782e-07 1.341891e-07 [108,] 0.99999972 5.684971e-07 2.842486e-07 [109,] 0.99999936 1.271410e-06 6.357049e-07 [110,] 0.99999862 2.760276e-06 1.380138e-06 [111,] 0.99999797 4.068454e-06 2.034227e-06 [112,] 0.99999822 3.567904e-06 1.783952e-06 [113,] 0.99999702 5.966217e-06 2.983108e-06 [114,] 0.99999493 1.013775e-05 5.068876e-06 [115,] 0.99998868 2.263274e-05 1.131637e-05 [116,] 0.99997505 4.989011e-05 2.494505e-05 [117,] 0.99994919 1.016110e-04 5.080550e-05 [118,] 0.99997716 4.568813e-05 2.284406e-05 [119,] 0.99995284 9.431645e-05 4.715823e-05 [120,] 0.99989589 2.082160e-04 1.041080e-04 [121,] 0.99983326 3.334876e-04 1.667438e-04 [122,] 0.99975951 4.809736e-04 2.404868e-04 [123,] 0.99953109 9.378258e-04 4.689129e-04 [124,] 0.99933068 1.338641e-03 6.693203e-04 [125,] 0.99866073 2.678541e-03 1.339271e-03 [126,] 0.99737547 5.249055e-03 2.624527e-03 [127,] 0.99717527 5.649465e-03 2.824733e-03 [128,] 0.99481452 1.037097e-02 5.185485e-03 [129,] 0.99386710 1.226579e-02 6.132896e-03 [130,] 0.98711395 2.577209e-02 1.288605e-02 [131,] 0.97949507 4.100985e-02 2.050493e-02 [132,] 0.97135433 5.729134e-02 2.864567e-02 [133,] 0.94851399 1.029720e-01 5.148601e-02 [134,] 0.91652313 1.669537e-01 8.347687e-02 [135,] 0.87584862 2.483028e-01 1.241514e-01 [136,] 0.81204410 3.759118e-01 1.879559e-01 [137,] 0.68833461 6.233308e-01 3.116654e-01 > postscript(file="/var/www/html/rcomp/tmp/1lf841291122827.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/html/rcomp/tmp/2w6771291122827.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/html/rcomp/tmp/3w6771291122827.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/html/rcomp/tmp/4w6771291122827.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/html/rcomp/tmp/5og7a1291122827.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 = 156 Frequency = 1 1 2 3 4 5 6 -1.31550433 0.73606938 8.40838031 3.33399225 1.13958563 3.68018295 7 8 9 10 11 12 8.88896026 2.69646718 3.98754766 1.83045506 2.61321500 2.92329860 13 14 15 16 17 18 -0.28080791 -3.98508480 4.40268380 -1.72474502 3.97518386 6.65192194 19 20 21 22 23 24 0.11589613 3.08906739 3.19382751 4.06355931 1.63034331 2.65902537 25 26 27 28 29 30 4.76444296 6.57183878 1.50319264 0.43718559 0.53018802 1.61999333 31 32 33 34 35 36 -3.13991120 3.48149524 5.93167462 5.10128321 -2.80770203 5.34064495 37 38 39 40 41 42 1.45387871 -2.88057954 2.01704494 2.52632426 2.30559687 2.25572527 43 44 45 46 47 48 2.12806943 3.08608826 -0.81681694 4.67156997 0.17944879 -0.90997353 49 50 51 52 53 54 -0.48735633 2.36643769 2.31812885 -1.88252466 -0.46532552 4.81608306 55 56 57 58 59 60 4.83825106 -0.24946948 -0.95292670 1.53296559 5.98458131 0.63000726 61 62 63 64 65 66 -4.91567953 -2.35781748 -2.28775937 -1.45583656 -3.08344701 -0.51197695 67 68 69 70 71 72 -2.89147364 0.15495391 1.18998091 -1.83470360 -3.38872148 -3.14696317 73 74 75 76 77 78 1.24304462 -2.64614467 -1.14385127 0.65944474 -3.62854439 -4.16797338 79 80 81 82 83 84 1.70998164 -3.42651803 -1.09819485 0.88516759 0.97167131 -0.93431490 85 86 87 88 89 90 -3.17690695 1.74283848 -1.32903866 0.53598936 0.58741577 -1.79425528 91 92 93 94 95 96 1.18099212 -2.42201390 1.70840195 2.19566810 -3.37733346 -0.26058255 97 98 99 100 101 102 -1.13674586 -3.88622964 -3.65463321 3.03246993 -0.76890786 -0.01602019 103 104 105 106 107 108 -2.49692187 -2.17090586 -3.20463452 2.20011980 -4.71620447 0.13300190 109 110 111 112 113 114 -4.87981089 -3.70313697 -0.36164317 -0.10401221 1.43253712 2.44326549 115 116 117 118 119 120 1.87023158 -0.02203665 -1.56181266 -0.43512287 0.04863164 -4.81681564 121 122 123 124 125 126 -5.38340188 -4.30798103 -2.68280864 -1.91640905 0.99249200 -2.43604855 127 128 129 130 131 132 2.40890900 -2.81988049 0.42944314 -3.90039393 0.12289393 -2.31742118 133 134 135 136 137 138 -3.07896863 -2.35651878 -2.86689485 -2.32722141 -0.37121510 -5.88258430 139 140 141 142 143 144 -0.22768862 -3.04317230 -3.27919419 -2.68898412 0.43425628 -3.02504147 145 146 147 148 149 150 -2.53786234 2.26414391 -0.14147387 0.65286208 -3.75878528 1.61747860 151 152 153 154 155 156 -0.89284147 -1.06172629 -4.58786896 1.34299783 -0.14188311 -1.45444478 > postscript(file="/var/www/html/rcomp/tmp/6og7a1291122827.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 = 156 Frequency = 1 lag(myerror, k = 1) myerror 0 -1.31550433 NA 1 0.73606938 -1.31550433 2 8.40838031 0.73606938 3 3.33399225 8.40838031 4 1.13958563 3.33399225 5 3.68018295 1.13958563 6 8.88896026 3.68018295 7 2.69646718 8.88896026 8 3.98754766 2.69646718 9 1.83045506 3.98754766 10 2.61321500 1.83045506 11 2.92329860 2.61321500 12 -0.28080791 2.92329860 13 -3.98508480 -0.28080791 14 4.40268380 -3.98508480 15 -1.72474502 4.40268380 16 3.97518386 -1.72474502 17 6.65192194 3.97518386 18 0.11589613 6.65192194 19 3.08906739 0.11589613 20 3.19382751 3.08906739 21 4.06355931 3.19382751 22 1.63034331 4.06355931 23 2.65902537 1.63034331 24 4.76444296 2.65902537 25 6.57183878 4.76444296 26 1.50319264 6.57183878 27 0.43718559 1.50319264 28 0.53018802 0.43718559 29 1.61999333 0.53018802 30 -3.13991120 1.61999333 31 3.48149524 -3.13991120 32 5.93167462 3.48149524 33 5.10128321 5.93167462 34 -2.80770203 5.10128321 35 5.34064495 -2.80770203 36 1.45387871 5.34064495 37 -2.88057954 1.45387871 38 2.01704494 -2.88057954 39 2.52632426 2.01704494 40 2.30559687 2.52632426 41 2.25572527 2.30559687 42 2.12806943 2.25572527 43 3.08608826 2.12806943 44 -0.81681694 3.08608826 45 4.67156997 -0.81681694 46 0.17944879 4.67156997 47 -0.90997353 0.17944879 48 -0.48735633 -0.90997353 49 2.36643769 -0.48735633 50 2.31812885 2.36643769 51 -1.88252466 2.31812885 52 -0.46532552 -1.88252466 53 4.81608306 -0.46532552 54 4.83825106 4.81608306 55 -0.24946948 4.83825106 56 -0.95292670 -0.24946948 57 1.53296559 -0.95292670 58 5.98458131 1.53296559 59 0.63000726 5.98458131 60 -4.91567953 0.63000726 61 -2.35781748 -4.91567953 62 -2.28775937 -2.35781748 63 -1.45583656 -2.28775937 64 -3.08344701 -1.45583656 65 -0.51197695 -3.08344701 66 -2.89147364 -0.51197695 67 0.15495391 -2.89147364 68 1.18998091 0.15495391 69 -1.83470360 1.18998091 70 -3.38872148 -1.83470360 71 -3.14696317 -3.38872148 72 1.24304462 -3.14696317 73 -2.64614467 1.24304462 74 -1.14385127 -2.64614467 75 0.65944474 -1.14385127 76 -3.62854439 0.65944474 77 -4.16797338 -3.62854439 78 1.70998164 -4.16797338 79 -3.42651803 1.70998164 80 -1.09819485 -3.42651803 81 0.88516759 -1.09819485 82 0.97167131 0.88516759 83 -0.93431490 0.97167131 84 -3.17690695 -0.93431490 85 1.74283848 -3.17690695 86 -1.32903866 1.74283848 87 0.53598936 -1.32903866 88 0.58741577 0.53598936 89 -1.79425528 0.58741577 90 1.18099212 -1.79425528 91 -2.42201390 1.18099212 92 1.70840195 -2.42201390 93 2.19566810 1.70840195 94 -3.37733346 2.19566810 95 -0.26058255 -3.37733346 96 -1.13674586 -0.26058255 97 -3.88622964 -1.13674586 98 -3.65463321 -3.88622964 99 3.03246993 -3.65463321 100 -0.76890786 3.03246993 101 -0.01602019 -0.76890786 102 -2.49692187 -0.01602019 103 -2.17090586 -2.49692187 104 -3.20463452 -2.17090586 105 2.20011980 -3.20463452 106 -4.71620447 2.20011980 107 0.13300190 -4.71620447 108 -4.87981089 0.13300190 109 -3.70313697 -4.87981089 110 -0.36164317 -3.70313697 111 -0.10401221 -0.36164317 112 1.43253712 -0.10401221 113 2.44326549 1.43253712 114 1.87023158 2.44326549 115 -0.02203665 1.87023158 116 -1.56181266 -0.02203665 117 -0.43512287 -1.56181266 118 0.04863164 -0.43512287 119 -4.81681564 0.04863164 120 -5.38340188 -4.81681564 121 -4.30798103 -5.38340188 122 -2.68280864 -4.30798103 123 -1.91640905 -2.68280864 124 0.99249200 -1.91640905 125 -2.43604855 0.99249200 126 2.40890900 -2.43604855 127 -2.81988049 2.40890900 128 0.42944314 -2.81988049 129 -3.90039393 0.42944314 130 0.12289393 -3.90039393 131 -2.31742118 0.12289393 132 -3.07896863 -2.31742118 133 -2.35651878 -3.07896863 134 -2.86689485 -2.35651878 135 -2.32722141 -2.86689485 136 -0.37121510 -2.32722141 137 -5.88258430 -0.37121510 138 -0.22768862 -5.88258430 139 -3.04317230 -0.22768862 140 -3.27919419 -3.04317230 141 -2.68898412 -3.27919419 142 0.43425628 -2.68898412 143 -3.02504147 0.43425628 144 -2.53786234 -3.02504147 145 2.26414391 -2.53786234 146 -0.14147387 2.26414391 147 0.65286208 -0.14147387 148 -3.75878528 0.65286208 149 1.61747860 -3.75878528 150 -0.89284147 1.61747860 151 -1.06172629 -0.89284147 152 -4.58786896 -1.06172629 153 1.34299783 -4.58786896 154 -0.14188311 1.34299783 155 -1.45444478 -0.14188311 156 NA -1.45444478 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 0.73606938 -1.31550433 [2,] 8.40838031 0.73606938 [3,] 3.33399225 8.40838031 [4,] 1.13958563 3.33399225 [5,] 3.68018295 1.13958563 [6,] 8.88896026 3.68018295 [7,] 2.69646718 8.88896026 [8,] 3.98754766 2.69646718 [9,] 1.83045506 3.98754766 [10,] 2.61321500 1.83045506 [11,] 2.92329860 2.61321500 [12,] -0.28080791 2.92329860 [13,] -3.98508480 -0.28080791 [14,] 4.40268380 -3.98508480 [15,] -1.72474502 4.40268380 [16,] 3.97518386 -1.72474502 [17,] 6.65192194 3.97518386 [18,] 0.11589613 6.65192194 [19,] 3.08906739 0.11589613 [20,] 3.19382751 3.08906739 [21,] 4.06355931 3.19382751 [22,] 1.63034331 4.06355931 [23,] 2.65902537 1.63034331 [24,] 4.76444296 2.65902537 [25,] 6.57183878 4.76444296 [26,] 1.50319264 6.57183878 [27,] 0.43718559 1.50319264 [28,] 0.53018802 0.43718559 [29,] 1.61999333 0.53018802 [30,] -3.13991120 1.61999333 [31,] 3.48149524 -3.13991120 [32,] 5.93167462 3.48149524 [33,] 5.10128321 5.93167462 [34,] -2.80770203 5.10128321 [35,] 5.34064495 -2.80770203 [36,] 1.45387871 5.34064495 [37,] -2.88057954 1.45387871 [38,] 2.01704494 -2.88057954 [39,] 2.52632426 2.01704494 [40,] 2.30559687 2.52632426 [41,] 2.25572527 2.30559687 [42,] 2.12806943 2.25572527 [43,] 3.08608826 2.12806943 [44,] -0.81681694 3.08608826 [45,] 4.67156997 -0.81681694 [46,] 0.17944879 4.67156997 [47,] -0.90997353 0.17944879 [48,] -0.48735633 -0.90997353 [49,] 2.36643769 -0.48735633 [50,] 2.31812885 2.36643769 [51,] -1.88252466 2.31812885 [52,] -0.46532552 -1.88252466 [53,] 4.81608306 -0.46532552 [54,] 4.83825106 4.81608306 [55,] -0.24946948 4.83825106 [56,] -0.95292670 -0.24946948 [57,] 1.53296559 -0.95292670 [58,] 5.98458131 1.53296559 [59,] 0.63000726 5.98458131 [60,] -4.91567953 0.63000726 [61,] -2.35781748 -4.91567953 [62,] -2.28775937 -2.35781748 [63,] -1.45583656 -2.28775937 [64,] -3.08344701 -1.45583656 [65,] -0.51197695 -3.08344701 [66,] -2.89147364 -0.51197695 [67,] 0.15495391 -2.89147364 [68,] 1.18998091 0.15495391 [69,] -1.83470360 1.18998091 [70,] -3.38872148 -1.83470360 [71,] -3.14696317 -3.38872148 [72,] 1.24304462 -3.14696317 [73,] -2.64614467 1.24304462 [74,] -1.14385127 -2.64614467 [75,] 0.65944474 -1.14385127 [76,] -3.62854439 0.65944474 [77,] -4.16797338 -3.62854439 [78,] 1.70998164 -4.16797338 [79,] -3.42651803 1.70998164 [80,] -1.09819485 -3.42651803 [81,] 0.88516759 -1.09819485 [82,] 0.97167131 0.88516759 [83,] -0.93431490 0.97167131 [84,] -3.17690695 -0.93431490 [85,] 1.74283848 -3.17690695 [86,] -1.32903866 1.74283848 [87,] 0.53598936 -1.32903866 [88,] 0.58741577 0.53598936 [89,] -1.79425528 0.58741577 [90,] 1.18099212 -1.79425528 [91,] -2.42201390 1.18099212 [92,] 1.70840195 -2.42201390 [93,] 2.19566810 1.70840195 [94,] -3.37733346 2.19566810 [95,] -0.26058255 -3.37733346 [96,] -1.13674586 -0.26058255 [97,] -3.88622964 -1.13674586 [98,] -3.65463321 -3.88622964 [99,] 3.03246993 -3.65463321 [100,] -0.76890786 3.03246993 [101,] -0.01602019 -0.76890786 [102,] -2.49692187 -0.01602019 [103,] -2.17090586 -2.49692187 [104,] -3.20463452 -2.17090586 [105,] 2.20011980 -3.20463452 [106,] -4.71620447 2.20011980 [107,] 0.13300190 -4.71620447 [108,] -4.87981089 0.13300190 [109,] -3.70313697 -4.87981089 [110,] -0.36164317 -3.70313697 [111,] -0.10401221 -0.36164317 [112,] 1.43253712 -0.10401221 [113,] 2.44326549 1.43253712 [114,] 1.87023158 2.44326549 [115,] -0.02203665 1.87023158 [116,] -1.56181266 -0.02203665 [117,] -0.43512287 -1.56181266 [118,] 0.04863164 -0.43512287 [119,] -4.81681564 0.04863164 [120,] -5.38340188 -4.81681564 [121,] -4.30798103 -5.38340188 [122,] -2.68280864 -4.30798103 [123,] -1.91640905 -2.68280864 [124,] 0.99249200 -1.91640905 [125,] -2.43604855 0.99249200 [126,] 2.40890900 -2.43604855 [127,] -2.81988049 2.40890900 [128,] 0.42944314 -2.81988049 [129,] -3.90039393 0.42944314 [130,] 0.12289393 -3.90039393 [131,] -2.31742118 0.12289393 [132,] -3.07896863 -2.31742118 [133,] -2.35651878 -3.07896863 [134,] -2.86689485 -2.35651878 [135,] -2.32722141 -2.86689485 [136,] -0.37121510 -2.32722141 [137,] -5.88258430 -0.37121510 [138,] -0.22768862 -5.88258430 [139,] -3.04317230 -0.22768862 [140,] -3.27919419 -3.04317230 [141,] -2.68898412 -3.27919419 [142,] 0.43425628 -2.68898412 [143,] -3.02504147 0.43425628 [144,] -2.53786234 -3.02504147 [145,] 2.26414391 -2.53786234 [146,] -0.14147387 2.26414391 [147,] 0.65286208 -0.14147387 [148,] -3.75878528 0.65286208 [149,] 1.61747860 -3.75878528 [150,] -0.89284147 1.61747860 [151,] -1.06172629 -0.89284147 [152,] -4.58786896 -1.06172629 [153,] 1.34299783 -4.58786896 [154,] -0.14188311 1.34299783 [155,] -1.45444478 -0.14188311 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 0.73606938 -1.31550433 2 8.40838031 0.73606938 3 3.33399225 8.40838031 4 1.13958563 3.33399225 5 3.68018295 1.13958563 6 8.88896026 3.68018295 7 2.69646718 8.88896026 8 3.98754766 2.69646718 9 1.83045506 3.98754766 10 2.61321500 1.83045506 11 2.92329860 2.61321500 12 -0.28080791 2.92329860 13 -3.98508480 -0.28080791 14 4.40268380 -3.98508480 15 -1.72474502 4.40268380 16 3.97518386 -1.72474502 17 6.65192194 3.97518386 18 0.11589613 6.65192194 19 3.08906739 0.11589613 20 3.19382751 3.08906739 21 4.06355931 3.19382751 22 1.63034331 4.06355931 23 2.65902537 1.63034331 24 4.76444296 2.65902537 25 6.57183878 4.76444296 26 1.50319264 6.57183878 27 0.43718559 1.50319264 28 0.53018802 0.43718559 29 1.61999333 0.53018802 30 -3.13991120 1.61999333 31 3.48149524 -3.13991120 32 5.93167462 3.48149524 33 5.10128321 5.93167462 34 -2.80770203 5.10128321 35 5.34064495 -2.80770203 36 1.45387871 5.34064495 37 -2.88057954 1.45387871 38 2.01704494 -2.88057954 39 2.52632426 2.01704494 40 2.30559687 2.52632426 41 2.25572527 2.30559687 42 2.12806943 2.25572527 43 3.08608826 2.12806943 44 -0.81681694 3.08608826 45 4.67156997 -0.81681694 46 0.17944879 4.67156997 47 -0.90997353 0.17944879 48 -0.48735633 -0.90997353 49 2.36643769 -0.48735633 50 2.31812885 2.36643769 51 -1.88252466 2.31812885 52 -0.46532552 -1.88252466 53 4.81608306 -0.46532552 54 4.83825106 4.81608306 55 -0.24946948 4.83825106 56 -0.95292670 -0.24946948 57 1.53296559 -0.95292670 58 5.98458131 1.53296559 59 0.63000726 5.98458131 60 -4.91567953 0.63000726 61 -2.35781748 -4.91567953 62 -2.28775937 -2.35781748 63 -1.45583656 -2.28775937 64 -3.08344701 -1.45583656 65 -0.51197695 -3.08344701 66 -2.89147364 -0.51197695 67 0.15495391 -2.89147364 68 1.18998091 0.15495391 69 -1.83470360 1.18998091 70 -3.38872148 -1.83470360 71 -3.14696317 -3.38872148 72 1.24304462 -3.14696317 73 -2.64614467 1.24304462 74 -1.14385127 -2.64614467 75 0.65944474 -1.14385127 76 -3.62854439 0.65944474 77 -4.16797338 -3.62854439 78 1.70998164 -4.16797338 79 -3.42651803 1.70998164 80 -1.09819485 -3.42651803 81 0.88516759 -1.09819485 82 0.97167131 0.88516759 83 -0.93431490 0.97167131 84 -3.17690695 -0.93431490 85 1.74283848 -3.17690695 86 -1.32903866 1.74283848 87 0.53598936 -1.32903866 88 0.58741577 0.53598936 89 -1.79425528 0.58741577 90 1.18099212 -1.79425528 91 -2.42201390 1.18099212 92 1.70840195 -2.42201390 93 2.19566810 1.70840195 94 -3.37733346 2.19566810 95 -0.26058255 -3.37733346 96 -1.13674586 -0.26058255 97 -3.88622964 -1.13674586 98 -3.65463321 -3.88622964 99 3.03246993 -3.65463321 100 -0.76890786 3.03246993 101 -0.01602019 -0.76890786 102 -2.49692187 -0.01602019 103 -2.17090586 -2.49692187 104 -3.20463452 -2.17090586 105 2.20011980 -3.20463452 106 -4.71620447 2.20011980 107 0.13300190 -4.71620447 108 -4.87981089 0.13300190 109 -3.70313697 -4.87981089 110 -0.36164317 -3.70313697 111 -0.10401221 -0.36164317 112 1.43253712 -0.10401221 113 2.44326549 1.43253712 114 1.87023158 2.44326549 115 -0.02203665 1.87023158 116 -1.56181266 -0.02203665 117 -0.43512287 -1.56181266 118 0.04863164 -0.43512287 119 -4.81681564 0.04863164 120 -5.38340188 -4.81681564 121 -4.30798103 -5.38340188 122 -2.68280864 -4.30798103 123 -1.91640905 -2.68280864 124 0.99249200 -1.91640905 125 -2.43604855 0.99249200 126 2.40890900 -2.43604855 127 -2.81988049 2.40890900 128 0.42944314 -2.81988049 129 -3.90039393 0.42944314 130 0.12289393 -3.90039393 131 -2.31742118 0.12289393 132 -3.07896863 -2.31742118 133 -2.35651878 -3.07896863 134 -2.86689485 -2.35651878 135 -2.32722141 -2.86689485 136 -0.37121510 -2.32722141 137 -5.88258430 -0.37121510 138 -0.22768862 -5.88258430 139 -3.04317230 -0.22768862 140 -3.27919419 -3.04317230 141 -2.68898412 -3.27919419 142 0.43425628 -2.68898412 143 -3.02504147 0.43425628 144 -2.53786234 -3.02504147 145 2.26414391 -2.53786234 146 -0.14147387 2.26414391 147 0.65286208 -0.14147387 148 -3.75878528 0.65286208 149 1.61747860 -3.75878528 150 -0.89284147 1.61747860 151 -1.06172629 -0.89284147 152 -4.58786896 -1.06172629 153 1.34299783 -4.58786896 154 -0.14188311 1.34299783 155 -1.45444478 -0.14188311 > 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/html/rcomp/tmp/7z7od1291122827.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/html/rcomp/tmp/8z7od1291122827.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/html/rcomp/tmp/9agng1291122827.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/html/rcomp/tmp/10agng1291122827.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/html/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/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/html/rcomp/tmp/11dhml1291122827.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/html/rcomp/tmp/12hz291291122827.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/html/rcomp/tmp/13n0zl1291122827.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/html/rcomp/tmp/14yrgo1291122827.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/html/rcomp/tmp/15jsfc1291122827.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/html/rcomp/tmp/16g2dl1291122827.tab") + } > > try(system("convert tmp/1lf841291122827.ps tmp/1lf841291122827.png",intern=TRUE)) character(0) > try(system("convert tmp/2w6771291122827.ps tmp/2w6771291122827.png",intern=TRUE)) character(0) > try(system("convert tmp/3w6771291122827.ps tmp/3w6771291122827.png",intern=TRUE)) character(0) > try(system("convert tmp/4w6771291122827.ps tmp/4w6771291122827.png",intern=TRUE)) character(0) > try(system("convert tmp/5og7a1291122827.ps tmp/5og7a1291122827.png",intern=TRUE)) character(0) > try(system("convert tmp/6og7a1291122827.ps tmp/6og7a1291122827.png",intern=TRUE)) character(0) > try(system("convert tmp/7z7od1291122827.ps tmp/7z7od1291122827.png",intern=TRUE)) character(0) > try(system("convert tmp/8z7od1291122827.ps tmp/8z7od1291122827.png",intern=TRUE)) character(0) > try(system("convert tmp/9agng1291122827.ps tmp/9agng1291122827.png",intern=TRUE)) character(0) > try(system("convert tmp/10agng1291122827.ps tmp/10agng1291122827.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.028 1.765 9.260