R version 2.13.0 (2011-04-13) Copyright (C) 2011 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(0 + ,1 + ,0 + ,90604 + ,0 + ,2 + ,0 + ,97527 + ,0 + ,3 + ,0 + ,111940 + ,0 + ,4 + ,0 + ,100280 + ,0 + ,5 + ,0 + ,100009 + ,0 + ,6 + ,0 + ,95558 + ,0 + ,7 + ,0 + ,98533 + ,0 + ,8 + ,0 + ,92694 + ,0 + ,9 + ,0 + ,97920 + ,0 + ,10 + ,0 + ,110933 + ,0 + ,11 + ,0 + ,110855 + ,0 + ,12 + ,0 + ,111716 + ,0 + ,13 + ,0 + ,96348 + ,0 + ,14 + ,0 + ,105425 + ,0 + ,15 + ,0 + ,114874 + ,0 + ,16 + ,0 + ,104199 + ,0 + ,17 + ,0 + ,101166 + ,0 + ,18 + ,0 + ,99010 + ,0 + ,19 + ,0 + ,101607 + ,0 + ,20 + ,0 + ,97492 + ,0 + ,21 + ,0 + ,106088 + ,0 + ,22 + ,0 + ,113536 + ,0 + ,23 + ,0 + ,112475 + ,0 + ,24 + ,0 + ,115491 + ,0 + ,25 + ,0 + ,97733 + ,0 + ,26 + ,0 + ,102591 + ,0 + ,27 + ,0 + ,114783 + ,0 + ,28 + ,0 + ,100397 + ,0 + ,29 + ,0 + ,97772 + ,0 + ,30 + ,0 + ,96128 + ,0 + ,31 + ,0 + ,91261 + ,0 + ,32 + ,0 + ,90686 + ,0 + ,33 + ,0 + ,97792 + ,0 + ,34 + ,0 + ,108848 + ,0 + ,35 + ,0 + ,109989 + ,0 + ,36 + ,0 + ,109453 + ,0 + ,37 + ,0 + ,93945 + ,0 + ,38 + ,0 + ,98750 + ,0 + ,39 + ,0 + ,119043 + ,0 + ,40 + ,0 + ,104776 + ,0 + ,41 + ,0 + ,103262 + ,0 + ,42 + ,0 + ,106735 + ,0 + ,43 + ,0 + ,101600 + ,0 + ,44 + ,0 + ,99358 + ,0 + ,45 + ,0 + ,105240 + ,0 + ,46 + ,0 + ,114079 + ,0 + ,47 + ,0 + ,121637 + ,0 + ,48 + ,0 + ,111747 + ,0 + ,49 + ,0 + ,99496 + ,0 + ,50 + ,0 + ,104992 + ,0 + ,51 + ,0 + ,124255 + ,0 + ,52 + ,0 + ,108258 + ,0 + ,53 + ,0 + ,106940 + ,0 + ,54 + ,0 + ,104939 + ,0 + ,55 + ,0 + ,105896 + ,0 + ,56 + ,0 + ,107287 + ,0 + ,57 + ,0 + ,110783 + ,0 + ,58 + ,0 + ,122139 + ,0 + ,59 + ,0 + ,125823 + ,0 + ,60 + ,0 + ,120480 + ,0 + ,61 + ,0 + ,103296 + ,0 + ,62 + ,0 + ,117121 + ,0 + ,63 + ,0 + ,129924 + ,0 + ,64 + ,0 + ,118589 + ,0 + ,65 + ,0 + ,118062 + ,0 + ,66 + ,0 + ,113597 + ,0 + ,67 + ,0 + ,117161 + ,0 + ,68 + ,0 + ,112893 + ,0 + ,69 + ,0 + ,119657 + ,0 + ,70 + ,0 + ,136562 + ,0 + ,71 + ,0 + ,140446 + ,0 + ,72 + ,0 + ,138744 + ,0 + ,73 + ,0 + ,120324 + ,0 + ,74 + ,0 + ,118113 + ,0 + ,75 + ,0 + ,130257 + ,0 + ,76 + ,0 + ,125510 + ,0 + ,77 + ,0 + ,117986 + ,0 + ,78 + ,0 + ,118316 + ,0 + ,79 + ,0 + ,122075 + ,0 + ,80 + ,0 + ,117573 + ,0 + ,81 + ,0 + ,122566 + ,0 + ,82 + ,0 + ,135934 + ,0 + ,83 + ,0 + ,138394 + ,0 + ,84 + ,0 + ,137999 + ,0 + ,85 + ,0 + ,118780 + ,0 + ,86 + ,0 + ,117907 + ,0 + ,87 + ,0 + ,142932 + ,0 + ,88 + ,0 + ,132200 + ,0 + ,89 + ,0 + ,125666 + ,0 + ,90 + ,0 + ,127958 + ,0 + ,91 + ,0 + ,127718 + ,0 + ,92 + ,0 + ,124368 + ,0 + ,93 + ,0 + ,135241 + ,0 + ,94 + ,0 + ,144734 + ,0 + ,95 + ,0 + ,142320 + ,0 + ,96 + ,0 + ,141481 + ,0 + ,97 + ,0 + ,120471 + ,0 + ,98 + ,0 + ,123422 + ,0 + ,99 + ,0 + ,145829 + ,0 + ,100 + ,0 + ,134572 + ,0 + ,101 + ,0 + ,132156 + ,0 + ,102 + ,0 + ,140265 + ,0 + ,103 + ,0 + ,137771 + ,0 + ,104 + ,0 + ,134035 + ,0 + ,105 + ,0 + ,144016 + ,0 + ,106 + ,0 + ,151905 + ,0 + ,107 + ,0 + ,155791 + ,0 + ,108 + ,0 + ,148440 + ,0 + ,109 + ,0 + ,129862 + ,0 + ,110 + ,0 + ,134264 + ,0 + ,111 + ,0 + ,151952 + ,0 + ,112 + ,0 + ,143191 + ,0 + ,113 + ,0 + ,137242 + ,0 + ,114 + ,0 + ,136993 + ,0 + ,115 + ,0 + ,134431 + ,0 + ,116 + ,0 + ,132523 + ,0 + ,117 + ,0 + ,133486 + ,0 + ,118 + ,0 + ,140120 + ,1 + ,119 + ,119 + ,137521 + ,1 + ,120 + ,120 + ,112193 + ,1 + ,121 + ,121 + ,94256 + ,1 + ,122 + ,122 + ,99047 + ,1 + ,123 + ,123 + ,109761 + ,1 + ,124 + ,124 + ,102160 + ,1 + ,125 + ,125 + ,104792 + ,1 + ,126 + ,126 + ,104341 + ,1 + ,127 + ,127 + ,112430 + ,1 + ,128 + ,128 + ,113034 + ,1 + ,129 + ,129 + ,114197 + ,1 + ,130 + ,130 + ,127876 + ,1 + ,131 + ,131 + ,135199 + ,1 + ,132 + ,132 + ,123663 + ,1 + ,133 + ,133 + ,112578 + ,1 + ,134 + ,134 + ,117104 + ,1 + ,135 + ,135 + ,139703 + ,1 + ,136 + ,136 + ,114961 + ,1 + ,137 + ,137 + ,134222 + ,1 + ,138 + ,138 + ,128390 + ,1 + ,139 + ,139 + ,134197 + ,1 + ,140 + ,140 + ,135963 + ,1 + ,141 + ,141 + ,135936 + ,1 + ,142 + ,142 + ,146803 + ,1 + ,143 + ,143 + ,143231 + ,1 + ,144 + ,144 + ,131510) + ,dim=c(4 + ,144) + ,dimnames=list(c('crisis_10/8' + ,'t' + ,'t_crisis_10/8' + ,'Totale_goederenvervoer_ton') + ,1:144)) > y <- array(NA,dim=c(4,144),dimnames=list(c('crisis_10/8','t','t_crisis_10/8','Totale_goederenvervoer_ton'),1:144)) > 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 = 'Include Monthly Dummies' > par1 = '4' > #'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 Totale_goederenvervoer_ton crisis_10/8 t t_crisis_10/8 M1 M2 M3 M4 M5 M6 1 90604 0 1 0 1 0 0 0 0 0 2 97527 0 2 0 0 1 0 0 0 0 3 111940 0 3 0 0 0 1 0 0 0 4 100280 0 4 0 0 0 0 1 0 0 5 100009 0 5 0 0 0 0 0 1 0 6 95558 0 6 0 0 0 0 0 0 1 7 98533 0 7 0 0 0 0 0 0 0 8 92694 0 8 0 0 0 0 0 0 0 9 97920 0 9 0 0 0 0 0 0 0 10 110933 0 10 0 0 0 0 0 0 0 11 110855 0 11 0 0 0 0 0 0 0 12 111716 0 12 0 0 0 0 0 0 0 13 96348 0 13 0 1 0 0 0 0 0 14 105425 0 14 0 0 1 0 0 0 0 15 114874 0 15 0 0 0 1 0 0 0 16 104199 0 16 0 0 0 0 1 0 0 17 101166 0 17 0 0 0 0 0 1 0 18 99010 0 18 0 0 0 0 0 0 1 19 101607 0 19 0 0 0 0 0 0 0 20 97492 0 20 0 0 0 0 0 0 0 21 106088 0 21 0 0 0 0 0 0 0 22 113536 0 22 0 0 0 0 0 0 0 23 112475 0 23 0 0 0 0 0 0 0 24 115491 0 24 0 0 0 0 0 0 0 25 97733 0 25 0 1 0 0 0 0 0 26 102591 0 26 0 0 1 0 0 0 0 27 114783 0 27 0 0 0 1 0 0 0 28 100397 0 28 0 0 0 0 1 0 0 29 97772 0 29 0 0 0 0 0 1 0 30 96128 0 30 0 0 0 0 0 0 1 31 91261 0 31 0 0 0 0 0 0 0 32 90686 0 32 0 0 0 0 0 0 0 33 97792 0 33 0 0 0 0 0 0 0 34 108848 0 34 0 0 0 0 0 0 0 35 109989 0 35 0 0 0 0 0 0 0 36 109453 0 36 0 0 0 0 0 0 0 37 93945 0 37 0 1 0 0 0 0 0 38 98750 0 38 0 0 1 0 0 0 0 39 119043 0 39 0 0 0 1 0 0 0 40 104776 0 40 0 0 0 0 1 0 0 41 103262 0 41 0 0 0 0 0 1 0 42 106735 0 42 0 0 0 0 0 0 1 43 101600 0 43 0 0 0 0 0 0 0 44 99358 0 44 0 0 0 0 0 0 0 45 105240 0 45 0 0 0 0 0 0 0 46 114079 0 46 0 0 0 0 0 0 0 47 121637 0 47 0 0 0 0 0 0 0 48 111747 0 48 0 0 0 0 0 0 0 49 99496 0 49 0 1 0 0 0 0 0 50 104992 0 50 0 0 1 0 0 0 0 51 124255 0 51 0 0 0 1 0 0 0 52 108258 0 52 0 0 0 0 1 0 0 53 106940 0 53 0 0 0 0 0 1 0 54 104939 0 54 0 0 0 0 0 0 1 55 105896 0 55 0 0 0 0 0 0 0 56 107287 0 56 0 0 0 0 0 0 0 57 110783 0 57 0 0 0 0 0 0 0 58 122139 0 58 0 0 0 0 0 0 0 59 125823 0 59 0 0 0 0 0 0 0 60 120480 0 60 0 0 0 0 0 0 0 61 103296 0 61 0 1 0 0 0 0 0 62 117121 0 62 0 0 1 0 0 0 0 63 129924 0 63 0 0 0 1 0 0 0 64 118589 0 64 0 0 0 0 1 0 0 65 118062 0 65 0 0 0 0 0 1 0 66 113597 0 66 0 0 0 0 0 0 1 67 117161 0 67 0 0 0 0 0 0 0 68 112893 0 68 0 0 0 0 0 0 0 69 119657 0 69 0 0 0 0 0 0 0 70 136562 0 70 0 0 0 0 0 0 0 71 140446 0 71 0 0 0 0 0 0 0 72 138744 0 72 0 0 0 0 0 0 0 73 120324 0 73 0 1 0 0 0 0 0 74 118113 0 74 0 0 1 0 0 0 0 75 130257 0 75 0 0 0 1 0 0 0 76 125510 0 76 0 0 0 0 1 0 0 77 117986 0 77 0 0 0 0 0 1 0 78 118316 0 78 0 0 0 0 0 0 1 79 122075 0 79 0 0 0 0 0 0 0 80 117573 0 80 0 0 0 0 0 0 0 81 122566 0 81 0 0 0 0 0 0 0 82 135934 0 82 0 0 0 0 0 0 0 83 138394 0 83 0 0 0 0 0 0 0 84 137999 0 84 0 0 0 0 0 0 0 85 118780 0 85 0 1 0 0 0 0 0 86 117907 0 86 0 0 1 0 0 0 0 87 142932 0 87 0 0 0 1 0 0 0 88 132200 0 88 0 0 0 0 1 0 0 89 125666 0 89 0 0 0 0 0 1 0 90 127958 0 90 0 0 0 0 0 0 1 91 127718 0 91 0 0 0 0 0 0 0 92 124368 0 92 0 0 0 0 0 0 0 93 135241 0 93 0 0 0 0 0 0 0 94 144734 0 94 0 0 0 0 0 0 0 95 142320 0 95 0 0 0 0 0 0 0 96 141481 0 96 0 0 0 0 0 0 0 97 120471 0 97 0 1 0 0 0 0 0 98 123422 0 98 0 0 1 0 0 0 0 99 145829 0 99 0 0 0 1 0 0 0 100 134572 0 100 0 0 0 0 1 0 0 101 132156 0 101 0 0 0 0 0 1 0 102 140265 0 102 0 0 0 0 0 0 1 103 137771 0 103 0 0 0 0 0 0 0 104 134035 0 104 0 0 0 0 0 0 0 105 144016 0 105 0 0 0 0 0 0 0 106 151905 0 106 0 0 0 0 0 0 0 107 155791 0 107 0 0 0 0 0 0 0 108 148440 0 108 0 0 0 0 0 0 0 109 129862 0 109 0 1 0 0 0 0 0 110 134264 0 110 0 0 1 0 0 0 0 111 151952 0 111 0 0 0 1 0 0 0 112 143191 0 112 0 0 0 0 1 0 0 113 137242 0 113 0 0 0 0 0 1 0 114 136993 0 114 0 0 0 0 0 0 1 115 134431 0 115 0 0 0 0 0 0 0 116 132523 0 116 0 0 0 0 0 0 0 117 133486 0 117 0 0 0 0 0 0 0 118 140120 0 118 0 0 0 0 0 0 0 119 137521 1 119 119 0 0 0 0 0 0 120 112193 1 120 120 0 0 0 0 0 0 121 94256 1 121 121 1 0 0 0 0 0 122 99047 1 122 122 0 1 0 0 0 0 123 109761 1 123 123 0 0 1 0 0 0 124 102160 1 124 124 0 0 0 1 0 0 125 104792 1 125 125 0 0 0 0 1 0 126 104341 1 126 126 0 0 0 0 0 1 127 112430 1 127 127 0 0 0 0 0 0 128 113034 1 128 128 0 0 0 0 0 0 129 114197 1 129 129 0 0 0 0 0 0 130 127876 1 130 130 0 0 0 0 0 0 131 135199 1 131 131 0 0 0 0 0 0 132 123663 1 132 132 0 0 0 0 0 0 133 112578 1 133 133 1 0 0 0 0 0 134 117104 1 134 134 0 1 0 0 0 0 135 139703 1 135 135 0 0 1 0 0 0 136 114961 1 136 136 0 0 0 1 0 0 137 134222 1 137 137 0 0 0 0 1 0 138 128390 1 138 138 0 0 0 0 0 1 139 134197 1 139 139 0 0 0 0 0 0 140 135963 1 140 140 0 0 0 0 0 0 141 135936 1 141 141 0 0 0 0 0 0 142 146803 1 142 142 0 0 0 0 0 0 143 143231 1 143 143 0 0 0 0 0 0 144 131510 1 144 144 0 0 0 0 0 0 M7 M8 M9 M10 M11 1 0 0 0 0 0 2 0 0 0 0 0 3 0 0 0 0 0 4 0 0 0 0 0 5 0 0 0 0 0 6 0 0 0 0 0 7 1 0 0 0 0 8 0 1 0 0 0 9 0 0 1 0 0 10 0 0 0 1 0 11 0 0 0 0 1 12 0 0 0 0 0 13 0 0 0 0 0 14 0 0 0 0 0 15 0 0 0 0 0 16 0 0 0 0 0 17 0 0 0 0 0 18 0 0 0 0 0 19 1 0 0 0 0 20 0 1 0 0 0 21 0 0 1 0 0 22 0 0 0 1 0 23 0 0 0 0 1 24 0 0 0 0 0 25 0 0 0 0 0 26 0 0 0 0 0 27 0 0 0 0 0 28 0 0 0 0 0 29 0 0 0 0 0 30 0 0 0 0 0 31 1 0 0 0 0 32 0 1 0 0 0 33 0 0 1 0 0 34 0 0 0 1 0 35 0 0 0 0 1 36 0 0 0 0 0 37 0 0 0 0 0 38 0 0 0 0 0 39 0 0 0 0 0 40 0 0 0 0 0 41 0 0 0 0 0 42 0 0 0 0 0 43 1 0 0 0 0 44 0 1 0 0 0 45 0 0 1 0 0 46 0 0 0 1 0 47 0 0 0 0 1 48 0 0 0 0 0 49 0 0 0 0 0 50 0 0 0 0 0 51 0 0 0 0 0 52 0 0 0 0 0 53 0 0 0 0 0 54 0 0 0 0 0 55 1 0 0 0 0 56 0 1 0 0 0 57 0 0 1 0 0 58 0 0 0 1 0 59 0 0 0 0 1 60 0 0 0 0 0 61 0 0 0 0 0 62 0 0 0 0 0 63 0 0 0 0 0 64 0 0 0 0 0 65 0 0 0 0 0 66 0 0 0 0 0 67 1 0 0 0 0 68 0 1 0 0 0 69 0 0 1 0 0 70 0 0 0 1 0 71 0 0 0 0 1 72 0 0 0 0 0 73 0 0 0 0 0 74 0 0 0 0 0 75 0 0 0 0 0 76 0 0 0 0 0 77 0 0 0 0 0 78 0 0 0 0 0 79 1 0 0 0 0 80 0 1 0 0 0 81 0 0 1 0 0 82 0 0 0 1 0 83 0 0 0 0 1 84 0 0 0 0 0 85 0 0 0 0 0 86 0 0 0 0 0 87 0 0 0 0 0 88 0 0 0 0 0 89 0 0 0 0 0 90 0 0 0 0 0 91 1 0 0 0 0 92 0 1 0 0 0 93 0 0 1 0 0 94 0 0 0 1 0 95 0 0 0 0 1 96 0 0 0 0 0 97 0 0 0 0 0 98 0 0 0 0 0 99 0 0 0 0 0 100 0 0 0 0 0 101 0 0 0 0 0 102 0 0 0 0 0 103 1 0 0 0 0 104 0 1 0 0 0 105 0 0 1 0 0 106 0 0 0 1 0 107 0 0 0 0 1 108 0 0 0 0 0 109 0 0 0 0 0 110 0 0 0 0 0 111 0 0 0 0 0 112 0 0 0 0 0 113 0 0 0 0 0 114 0 0 0 0 0 115 1 0 0 0 0 116 0 1 0 0 0 117 0 0 1 0 0 118 0 0 0 1 0 119 0 0 0 0 1 120 0 0 0 0 0 121 0 0 0 0 0 122 0 0 0 0 0 123 0 0 0 0 0 124 0 0 0 0 0 125 0 0 0 0 0 126 0 0 0 0 0 127 1 0 0 0 0 128 0 1 0 0 0 129 0 0 1 0 0 130 0 0 0 1 0 131 0 0 0 0 1 132 0 0 0 0 0 133 0 0 0 0 0 134 0 0 0 0 0 135 0 0 0 0 0 136 0 0 0 0 0 137 0 0 0 0 0 138 0 0 0 0 0 139 1 0 0 0 0 140 0 1 0 0 0 141 0 0 1 0 0 142 0 0 0 1 0 143 0 0 0 0 1 144 0 0 0 0 0 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) `crisis_10/8` t `t_crisis_10/8` 100340.8 -150216.1 401.0 944.7 M1 M2 M3 M4 -15696.2 -11373.9 4650.1 -8088.4 M5 M6 M7 M8 -9465.0 -10610.6 -10131.6 -12921.2 M9 M10 M11 -8061.7 2258.7 6534.2 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -12402.0 -4086.1 121.7 3625.9 20718.4 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 100340.78 1889.80 53.096 < 2e-16 *** `crisis_10/8` -150216.14 19601.33 -7.664 3.81e-12 *** t 401.04 15.26 26.284 < 2e-16 *** `t_crisis_10/8` 944.71 149.31 6.327 3.78e-09 *** M1 -15696.22 2305.71 -6.808 3.37e-10 *** M2 -11373.88 2304.12 -4.936 2.41e-06 *** M3 4650.13 2302.87 2.019 0.045530 * M4 -8088.36 2301.95 -3.514 0.000610 *** M5 -9465.01 2301.38 -4.113 6.92e-05 *** M6 -10610.59 2301.15 -4.611 9.52e-06 *** M7 -10131.58 2301.25 -4.403 2.22e-05 *** M8 -12921.23 2301.70 -5.614 1.16e-07 *** M9 -8061.72 2302.48 -3.501 0.000636 *** M10 2258.70 2303.61 0.981 0.328671 M11 6534.22 2299.21 2.842 0.005214 ** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 5631 on 129 degrees of freedom Multiple R-squared: 0.889, Adjusted R-squared: 0.8769 F-statistic: 73.79 on 14 and 129 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.0801705421 0.160341084 0.9198295 [2,] 0.0287923716 0.057584743 0.9712076 [3,] 0.0092865025 0.018573005 0.9907135 [4,] 0.0086670115 0.017334023 0.9913330 [5,] 0.0037595065 0.007519013 0.9962405 [6,] 0.0019489100 0.003897820 0.9980511 [7,] 0.0007417712 0.001483542 0.9992582 [8,] 0.0003569135 0.000713827 0.9996431 [9,] 0.0007248421 0.001449684 0.9992752 [10,] 0.0006460807 0.001292161 0.9993539 [11,] 0.0020381075 0.004076215 0.9979619 [12,] 0.0045348778 0.009069756 0.9954651 [13,] 0.0038512683 0.007702537 0.9961487 [14,] 0.0389887929 0.077977586 0.9610112 [15,] 0.0435899354 0.087179871 0.9564101 [16,] 0.0419692673 0.083938535 0.9580307 [17,] 0.0344991717 0.068998343 0.9655008 [18,] 0.0272208296 0.054441659 0.9727792 [19,] 0.0230463747 0.046092749 0.9769536 [20,] 0.0147574391 0.029514878 0.9852426 [21,] 0.0106079180 0.021215836 0.9893921 [22,] 0.0117149229 0.023429846 0.9882851 [23,] 0.0086340014 0.017268003 0.9913660 [24,] 0.0064547817 0.012909563 0.9935452 [25,] 0.0165131572 0.033026314 0.9834868 [26,] 0.0127891516 0.025578303 0.9872108 [27,] 0.0111344670 0.022268934 0.9888655 [28,] 0.0082425070 0.016485014 0.9917575 [29,] 0.0056844571 0.011368914 0.9943155 [30,] 0.0108685915 0.021737183 0.9891314 [31,] 0.0086799741 0.017359948 0.9913200 [32,] 0.0060207097 0.012041419 0.9939793 [33,] 0.0038967727 0.007793545 0.9961032 [34,] 0.0043533543 0.008706709 0.9956466 [35,] 0.0030709625 0.006141925 0.9969290 [36,] 0.0022675097 0.004535019 0.9977325 [37,] 0.0016576585 0.003315317 0.9983423 [38,] 0.0015475108 0.003095022 0.9984525 [39,] 0.0027482815 0.005496563 0.9972517 [40,] 0.0025513349 0.005102670 0.9974487 [41,] 0.0027275626 0.005455125 0.9972724 [42,] 0.0043852366 0.008770473 0.9956148 [43,] 0.0035640973 0.007128195 0.9964359 [44,] 0.0027856094 0.005571219 0.9972144 [45,] 0.0053376629 0.010675326 0.9946623 [46,] 0.0053097348 0.010619470 0.9946903 [47,] 0.0067222314 0.013444463 0.9932778 [48,] 0.0093435335 0.018687067 0.9906565 [49,] 0.0087524213 0.017504843 0.9912476 [50,] 0.0127333645 0.025466729 0.9872666 [51,] 0.0141907669 0.028381534 0.9858092 [52,] 0.0152969284 0.030593857 0.9847031 [53,] 0.0380676086 0.076135217 0.9619324 [54,] 0.0822865678 0.164573136 0.9177134 [55,] 0.1848475128 0.369695026 0.8151525 [56,] 0.2440343940 0.488068788 0.7559656 [57,] 0.2092582994 0.418516599 0.7907417 [58,] 0.1827451497 0.365490299 0.8172549 [59,] 0.1760239887 0.352047977 0.8239760 [60,] 0.1517208319 0.303441664 0.8482792 [61,] 0.1337054359 0.267410872 0.8662946 [62,] 0.1229587475 0.245917495 0.8770413 [63,] 0.1154794097 0.230958819 0.8845206 [64,] 0.1049522095 0.209904419 0.8950478 [65,] 0.0897998260 0.179599652 0.9102002 [66,] 0.0936367045 0.187273409 0.9063633 [67,] 0.0851912844 0.170382569 0.9148087 [68,] 0.0671375143 0.134275029 0.9328625 [69,] 0.0627825241 0.125565048 0.9372175 [70,] 0.0546480514 0.109296103 0.9453519 [71,] 0.0531759079 0.106351816 0.9468241 [72,] 0.0447560699 0.089512140 0.9552439 [73,] 0.0397201889 0.079440378 0.9602798 [74,] 0.0366108299 0.073221660 0.9633892 [75,] 0.0392784567 0.078556913 0.9607215 [76,] 0.0393653767 0.078730753 0.9606346 [77,] 0.0339338422 0.067867684 0.9660662 [78,] 0.0562524995 0.112504999 0.9437475 [79,] 0.0429351624 0.085870325 0.9570648 [80,] 0.0431172617 0.086234523 0.9568827 [81,] 0.0550527433 0.110105487 0.9449473 [82,] 0.0470364670 0.094072934 0.9529635 [83,] 0.0361586088 0.072317218 0.9638414 [84,] 0.0464205042 0.092841008 0.9535795 [85,] 0.0526837216 0.105367443 0.9473163 [86,] 0.0563939998 0.112788000 0.9436060 [87,] 0.0835201042 0.167040208 0.9164799 [88,] 0.0834164412 0.166832882 0.9165836 [89,] 0.0746788654 0.149357731 0.9253211 [90,] 0.1123131583 0.224626317 0.8876868 [91,] 0.0864091204 0.172818241 0.9135909 [92,] 0.0786311794 0.157262359 0.9213688 [93,] 0.0702250640 0.140450128 0.9297749 [94,] 0.0551855310 0.110371062 0.9448145 [95,] 0.0595094489 0.119018898 0.9404906 [96,] 0.0430053532 0.086010706 0.9569946 [97,] 0.0323060849 0.064612170 0.9676939 [98,] 0.0211058269 0.042211654 0.9788942 [99,] 0.0137137203 0.027427441 0.9862863 [100,] 0.0091839629 0.018367926 0.9908160 [101,] 0.0071752123 0.014350425 0.9928248 [102,] 0.1524417256 0.304883451 0.8475583 [103,] 0.2843716469 0.568743294 0.7156284 [104,] 0.2232615296 0.446523059 0.7767385 [105,] 0.1668639794 0.333727959 0.8331360 [106,] 0.2139504960 0.427900992 0.7860495 [107,] 0.1845550207 0.369110041 0.8154450 [108,] 0.2639475768 0.527895154 0.7360524 [109,] 0.2221455833 0.444291167 0.7778544 > postscript(file="/var/wessaorg/rcomp/tmp/1y7wk1324323146.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(x[,1], type='l', main='Actuals and Interpolation', ylab='value of Actuals and Interpolation (dots)', xlab='time or index') > points(x[,1]-mysum$resid) > grid() > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/2q26j1324323146.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(mysum$resid, type='b', pch=19, main='Residuals', ylab='value of Residuals', xlab='time or index') > grid() > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/3ue8h1324323146.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > hist(mysum$resid, main='Residual Histogram', xlab='values of Residuals') > grid() > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/48dxq1324323146.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > densityplot(~mysum$resid,col='black',main='Residual Density Plot', xlab='values of Residuals') > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/5urt31324323146.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 = 144 Frequency = 1 1 2 3 4 5 6 5558.40529 7758.02313 5745.97430 6423.42548 7128.04332 3421.57782 7 8 9 10 11 12 5516.52900 2066.14683 2031.59801 4323.13251 -431.41643 6562.76033 13 14 15 16 17 18 6489.94235 10843.56019 3867.51137 5529.96254 3472.58038 2061.11489 19 20 21 22 23 24 3778.06606 2051.68390 5387.13507 2113.66958 -3623.87937 5525.29739 25 26 27 28 29 30 3062.47942 3197.09726 -1035.95157 -3084.50039 -4733.88255 -5633.34805 31 32 33 34 35 36 -11380.39687 -9566.77903 -7721.32786 -7386.79335 -10922.34230 -5325.16554 37 38 39 40 41 42 -5537.98352 -5456.36568 -1588.41450 -3517.96333 -4056.34549 161.18902 43 44 45 46 47 48 -5853.85981 -5707.24197 -5085.79080 -6968.25629 -4086.80524 -7843.62848 49 50 51 52 53 54 -4799.44645 -4026.82861 -1188.87744 -4848.42626 -5190.80842 -6447.27392 55 56 57 58 59 60 -6370.32274 -2590.70490 -4355.25373 -3720.71922 -4713.26817 -3923.09141 61 62 63 64 65 66 -5811.90938 3289.70846 -332.34037 670.11080 1118.72864 -2601.73685 67 68 69 70 71 72 82.21432 -1797.16784 -293.71667 5889.81784 5097.26890 9528.44566 73 74 75 76 77 78 6403.62768 -530.75448 -4811.80331 2778.64787 -3769.73429 -2695.19979 79 80 81 82 83 84 183.75139 -1929.63077 -2197.17960 449.35491 -1767.19404 3970.98272 85 86 87 88 89 90 47.16475 -5549.21741 3050.73376 4656.18493 -902.19723 2134.33728 91 92 93 94 95 96 1014.28845 52.90629 5665.35746 4436.89197 -2653.65697 2640.51979 97 98 99 100 101 102 -3074.29819 -4846.68035 1135.27082 2215.72200 775.33984 9628.87434 103 104 105 106 107 108 6254.82552 4907.44336 9627.89453 6795.42904 6004.88009 4787.05685 109 110 111 112 113 114 1504.23888 1182.85672 2445.80789 6022.25906 1048.87690 1544.41141 115 116 117 118 119 120 -1897.63742 -1417.01958 -5714.56840 -9802.03390 20718.41858 578.88830 121 122 123 124 125 126 -3007.63671 -3884.72591 -10540.48178 -6748.73764 -4085.82684 -4736.99937 127 128 129 130 131 132 1527.24476 3575.15556 -1467.10031 545.72716 2247.47118 -4100.05910 133 134 135 136 137 138 -834.58412 -1976.67332 3252.57082 -10096.68505 9195.22575 3163.05322 139 140 141 142 143 144 7145.29735 10355.20815 4122.95229 3323.77975 -5869.47623 -12402.00651 > postscript(file="/var/wessaorg/rcomp/tmp/6jqm01324323146.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 = 144 Frequency = 1 lag(myerror, k = 1) myerror 0 5558.40529 NA 1 7758.02313 5558.40529 2 5745.97430 7758.02313 3 6423.42548 5745.97430 4 7128.04332 6423.42548 5 3421.57782 7128.04332 6 5516.52900 3421.57782 7 2066.14683 5516.52900 8 2031.59801 2066.14683 9 4323.13251 2031.59801 10 -431.41643 4323.13251 11 6562.76033 -431.41643 12 6489.94235 6562.76033 13 10843.56019 6489.94235 14 3867.51137 10843.56019 15 5529.96254 3867.51137 16 3472.58038 5529.96254 17 2061.11489 3472.58038 18 3778.06606 2061.11489 19 2051.68390 3778.06606 20 5387.13507 2051.68390 21 2113.66958 5387.13507 22 -3623.87937 2113.66958 23 5525.29739 -3623.87937 24 3062.47942 5525.29739 25 3197.09726 3062.47942 26 -1035.95157 3197.09726 27 -3084.50039 -1035.95157 28 -4733.88255 -3084.50039 29 -5633.34805 -4733.88255 30 -11380.39687 -5633.34805 31 -9566.77903 -11380.39687 32 -7721.32786 -9566.77903 33 -7386.79335 -7721.32786 34 -10922.34230 -7386.79335 35 -5325.16554 -10922.34230 36 -5537.98352 -5325.16554 37 -5456.36568 -5537.98352 38 -1588.41450 -5456.36568 39 -3517.96333 -1588.41450 40 -4056.34549 -3517.96333 41 161.18902 -4056.34549 42 -5853.85981 161.18902 43 -5707.24197 -5853.85981 44 -5085.79080 -5707.24197 45 -6968.25629 -5085.79080 46 -4086.80524 -6968.25629 47 -7843.62848 -4086.80524 48 -4799.44645 -7843.62848 49 -4026.82861 -4799.44645 50 -1188.87744 -4026.82861 51 -4848.42626 -1188.87744 52 -5190.80842 -4848.42626 53 -6447.27392 -5190.80842 54 -6370.32274 -6447.27392 55 -2590.70490 -6370.32274 56 -4355.25373 -2590.70490 57 -3720.71922 -4355.25373 58 -4713.26817 -3720.71922 59 -3923.09141 -4713.26817 60 -5811.90938 -3923.09141 61 3289.70846 -5811.90938 62 -332.34037 3289.70846 63 670.11080 -332.34037 64 1118.72864 670.11080 65 -2601.73685 1118.72864 66 82.21432 -2601.73685 67 -1797.16784 82.21432 68 -293.71667 -1797.16784 69 5889.81784 -293.71667 70 5097.26890 5889.81784 71 9528.44566 5097.26890 72 6403.62768 9528.44566 73 -530.75448 6403.62768 74 -4811.80331 -530.75448 75 2778.64787 -4811.80331 76 -3769.73429 2778.64787 77 -2695.19979 -3769.73429 78 183.75139 -2695.19979 79 -1929.63077 183.75139 80 -2197.17960 -1929.63077 81 449.35491 -2197.17960 82 -1767.19404 449.35491 83 3970.98272 -1767.19404 84 47.16475 3970.98272 85 -5549.21741 47.16475 86 3050.73376 -5549.21741 87 4656.18493 3050.73376 88 -902.19723 4656.18493 89 2134.33728 -902.19723 90 1014.28845 2134.33728 91 52.90629 1014.28845 92 5665.35746 52.90629 93 4436.89197 5665.35746 94 -2653.65697 4436.89197 95 2640.51979 -2653.65697 96 -3074.29819 2640.51979 97 -4846.68035 -3074.29819 98 1135.27082 -4846.68035 99 2215.72200 1135.27082 100 775.33984 2215.72200 101 9628.87434 775.33984 102 6254.82552 9628.87434 103 4907.44336 6254.82552 104 9627.89453 4907.44336 105 6795.42904 9627.89453 106 6004.88009 6795.42904 107 4787.05685 6004.88009 108 1504.23888 4787.05685 109 1182.85672 1504.23888 110 2445.80789 1182.85672 111 6022.25906 2445.80789 112 1048.87690 6022.25906 113 1544.41141 1048.87690 114 -1897.63742 1544.41141 115 -1417.01958 -1897.63742 116 -5714.56840 -1417.01958 117 -9802.03390 -5714.56840 118 20718.41858 -9802.03390 119 578.88830 20718.41858 120 -3007.63671 578.88830 121 -3884.72591 -3007.63671 122 -10540.48178 -3884.72591 123 -6748.73764 -10540.48178 124 -4085.82684 -6748.73764 125 -4736.99937 -4085.82684 126 1527.24476 -4736.99937 127 3575.15556 1527.24476 128 -1467.10031 3575.15556 129 545.72716 -1467.10031 130 2247.47118 545.72716 131 -4100.05910 2247.47118 132 -834.58412 -4100.05910 133 -1976.67332 -834.58412 134 3252.57082 -1976.67332 135 -10096.68505 3252.57082 136 9195.22575 -10096.68505 137 3163.05322 9195.22575 138 7145.29735 3163.05322 139 10355.20815 7145.29735 140 4122.95229 10355.20815 141 3323.77975 4122.95229 142 -5869.47623 3323.77975 143 -12402.00651 -5869.47623 144 NA -12402.00651 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 7758.02313 5558.40529 [2,] 5745.97430 7758.02313 [3,] 6423.42548 5745.97430 [4,] 7128.04332 6423.42548 [5,] 3421.57782 7128.04332 [6,] 5516.52900 3421.57782 [7,] 2066.14683 5516.52900 [8,] 2031.59801 2066.14683 [9,] 4323.13251 2031.59801 [10,] -431.41643 4323.13251 [11,] 6562.76033 -431.41643 [12,] 6489.94235 6562.76033 [13,] 10843.56019 6489.94235 [14,] 3867.51137 10843.56019 [15,] 5529.96254 3867.51137 [16,] 3472.58038 5529.96254 [17,] 2061.11489 3472.58038 [18,] 3778.06606 2061.11489 [19,] 2051.68390 3778.06606 [20,] 5387.13507 2051.68390 [21,] 2113.66958 5387.13507 [22,] -3623.87937 2113.66958 [23,] 5525.29739 -3623.87937 [24,] 3062.47942 5525.29739 [25,] 3197.09726 3062.47942 [26,] -1035.95157 3197.09726 [27,] -3084.50039 -1035.95157 [28,] -4733.88255 -3084.50039 [29,] -5633.34805 -4733.88255 [30,] -11380.39687 -5633.34805 [31,] -9566.77903 -11380.39687 [32,] -7721.32786 -9566.77903 [33,] -7386.79335 -7721.32786 [34,] -10922.34230 -7386.79335 [35,] -5325.16554 -10922.34230 [36,] -5537.98352 -5325.16554 [37,] -5456.36568 -5537.98352 [38,] -1588.41450 -5456.36568 [39,] -3517.96333 -1588.41450 [40,] -4056.34549 -3517.96333 [41,] 161.18902 -4056.34549 [42,] -5853.85981 161.18902 [43,] -5707.24197 -5853.85981 [44,] -5085.79080 -5707.24197 [45,] -6968.25629 -5085.79080 [46,] -4086.80524 -6968.25629 [47,] -7843.62848 -4086.80524 [48,] -4799.44645 -7843.62848 [49,] -4026.82861 -4799.44645 [50,] -1188.87744 -4026.82861 [51,] -4848.42626 -1188.87744 [52,] -5190.80842 -4848.42626 [53,] -6447.27392 -5190.80842 [54,] -6370.32274 -6447.27392 [55,] -2590.70490 -6370.32274 [56,] -4355.25373 -2590.70490 [57,] -3720.71922 -4355.25373 [58,] -4713.26817 -3720.71922 [59,] -3923.09141 -4713.26817 [60,] -5811.90938 -3923.09141 [61,] 3289.70846 -5811.90938 [62,] -332.34037 3289.70846 [63,] 670.11080 -332.34037 [64,] 1118.72864 670.11080 [65,] -2601.73685 1118.72864 [66,] 82.21432 -2601.73685 [67,] -1797.16784 82.21432 [68,] -293.71667 -1797.16784 [69,] 5889.81784 -293.71667 [70,] 5097.26890 5889.81784 [71,] 9528.44566 5097.26890 [72,] 6403.62768 9528.44566 [73,] -530.75448 6403.62768 [74,] -4811.80331 -530.75448 [75,] 2778.64787 -4811.80331 [76,] -3769.73429 2778.64787 [77,] -2695.19979 -3769.73429 [78,] 183.75139 -2695.19979 [79,] -1929.63077 183.75139 [80,] -2197.17960 -1929.63077 [81,] 449.35491 -2197.17960 [82,] -1767.19404 449.35491 [83,] 3970.98272 -1767.19404 [84,] 47.16475 3970.98272 [85,] -5549.21741 47.16475 [86,] 3050.73376 -5549.21741 [87,] 4656.18493 3050.73376 [88,] -902.19723 4656.18493 [89,] 2134.33728 -902.19723 [90,] 1014.28845 2134.33728 [91,] 52.90629 1014.28845 [92,] 5665.35746 52.90629 [93,] 4436.89197 5665.35746 [94,] -2653.65697 4436.89197 [95,] 2640.51979 -2653.65697 [96,] -3074.29819 2640.51979 [97,] -4846.68035 -3074.29819 [98,] 1135.27082 -4846.68035 [99,] 2215.72200 1135.27082 [100,] 775.33984 2215.72200 [101,] 9628.87434 775.33984 [102,] 6254.82552 9628.87434 [103,] 4907.44336 6254.82552 [104,] 9627.89453 4907.44336 [105,] 6795.42904 9627.89453 [106,] 6004.88009 6795.42904 [107,] 4787.05685 6004.88009 [108,] 1504.23888 4787.05685 [109,] 1182.85672 1504.23888 [110,] 2445.80789 1182.85672 [111,] 6022.25906 2445.80789 [112,] 1048.87690 6022.25906 [113,] 1544.41141 1048.87690 [114,] -1897.63742 1544.41141 [115,] -1417.01958 -1897.63742 [116,] -5714.56840 -1417.01958 [117,] -9802.03390 -5714.56840 [118,] 20718.41858 -9802.03390 [119,] 578.88830 20718.41858 [120,] -3007.63671 578.88830 [121,] -3884.72591 -3007.63671 [122,] -10540.48178 -3884.72591 [123,] -6748.73764 -10540.48178 [124,] -4085.82684 -6748.73764 [125,] -4736.99937 -4085.82684 [126,] 1527.24476 -4736.99937 [127,] 3575.15556 1527.24476 [128,] -1467.10031 3575.15556 [129,] 545.72716 -1467.10031 [130,] 2247.47118 545.72716 [131,] -4100.05910 2247.47118 [132,] -834.58412 -4100.05910 [133,] -1976.67332 -834.58412 [134,] 3252.57082 -1976.67332 [135,] -10096.68505 3252.57082 [136,] 9195.22575 -10096.68505 [137,] 3163.05322 9195.22575 [138,] 7145.29735 3163.05322 [139,] 10355.20815 7145.29735 [140,] 4122.95229 10355.20815 [141,] 3323.77975 4122.95229 [142,] -5869.47623 3323.77975 [143,] -12402.00651 -5869.47623 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 7758.02313 5558.40529 2 5745.97430 7758.02313 3 6423.42548 5745.97430 4 7128.04332 6423.42548 5 3421.57782 7128.04332 6 5516.52900 3421.57782 7 2066.14683 5516.52900 8 2031.59801 2066.14683 9 4323.13251 2031.59801 10 -431.41643 4323.13251 11 6562.76033 -431.41643 12 6489.94235 6562.76033 13 10843.56019 6489.94235 14 3867.51137 10843.56019 15 5529.96254 3867.51137 16 3472.58038 5529.96254 17 2061.11489 3472.58038 18 3778.06606 2061.11489 19 2051.68390 3778.06606 20 5387.13507 2051.68390 21 2113.66958 5387.13507 22 -3623.87937 2113.66958 23 5525.29739 -3623.87937 24 3062.47942 5525.29739 25 3197.09726 3062.47942 26 -1035.95157 3197.09726 27 -3084.50039 -1035.95157 28 -4733.88255 -3084.50039 29 -5633.34805 -4733.88255 30 -11380.39687 -5633.34805 31 -9566.77903 -11380.39687 32 -7721.32786 -9566.77903 33 -7386.79335 -7721.32786 34 -10922.34230 -7386.79335 35 -5325.16554 -10922.34230 36 -5537.98352 -5325.16554 37 -5456.36568 -5537.98352 38 -1588.41450 -5456.36568 39 -3517.96333 -1588.41450 40 -4056.34549 -3517.96333 41 161.18902 -4056.34549 42 -5853.85981 161.18902 43 -5707.24197 -5853.85981 44 -5085.79080 -5707.24197 45 -6968.25629 -5085.79080 46 -4086.80524 -6968.25629 47 -7843.62848 -4086.80524 48 -4799.44645 -7843.62848 49 -4026.82861 -4799.44645 50 -1188.87744 -4026.82861 51 -4848.42626 -1188.87744 52 -5190.80842 -4848.42626 53 -6447.27392 -5190.80842 54 -6370.32274 -6447.27392 55 -2590.70490 -6370.32274 56 -4355.25373 -2590.70490 57 -3720.71922 -4355.25373 58 -4713.26817 -3720.71922 59 -3923.09141 -4713.26817 60 -5811.90938 -3923.09141 61 3289.70846 -5811.90938 62 -332.34037 3289.70846 63 670.11080 -332.34037 64 1118.72864 670.11080 65 -2601.73685 1118.72864 66 82.21432 -2601.73685 67 -1797.16784 82.21432 68 -293.71667 -1797.16784 69 5889.81784 -293.71667 70 5097.26890 5889.81784 71 9528.44566 5097.26890 72 6403.62768 9528.44566 73 -530.75448 6403.62768 74 -4811.80331 -530.75448 75 2778.64787 -4811.80331 76 -3769.73429 2778.64787 77 -2695.19979 -3769.73429 78 183.75139 -2695.19979 79 -1929.63077 183.75139 80 -2197.17960 -1929.63077 81 449.35491 -2197.17960 82 -1767.19404 449.35491 83 3970.98272 -1767.19404 84 47.16475 3970.98272 85 -5549.21741 47.16475 86 3050.73376 -5549.21741 87 4656.18493 3050.73376 88 -902.19723 4656.18493 89 2134.33728 -902.19723 90 1014.28845 2134.33728 91 52.90629 1014.28845 92 5665.35746 52.90629 93 4436.89197 5665.35746 94 -2653.65697 4436.89197 95 2640.51979 -2653.65697 96 -3074.29819 2640.51979 97 -4846.68035 -3074.29819 98 1135.27082 -4846.68035 99 2215.72200 1135.27082 100 775.33984 2215.72200 101 9628.87434 775.33984 102 6254.82552 9628.87434 103 4907.44336 6254.82552 104 9627.89453 4907.44336 105 6795.42904 9627.89453 106 6004.88009 6795.42904 107 4787.05685 6004.88009 108 1504.23888 4787.05685 109 1182.85672 1504.23888 110 2445.80789 1182.85672 111 6022.25906 2445.80789 112 1048.87690 6022.25906 113 1544.41141 1048.87690 114 -1897.63742 1544.41141 115 -1417.01958 -1897.63742 116 -5714.56840 -1417.01958 117 -9802.03390 -5714.56840 118 20718.41858 -9802.03390 119 578.88830 20718.41858 120 -3007.63671 578.88830 121 -3884.72591 -3007.63671 122 -10540.48178 -3884.72591 123 -6748.73764 -10540.48178 124 -4085.82684 -6748.73764 125 -4736.99937 -4085.82684 126 1527.24476 -4736.99937 127 3575.15556 1527.24476 128 -1467.10031 3575.15556 129 545.72716 -1467.10031 130 2247.47118 545.72716 131 -4100.05910 2247.47118 132 -834.58412 -4100.05910 133 -1976.67332 -834.58412 134 3252.57082 -1976.67332 135 -10096.68505 3252.57082 136 9195.22575 -10096.68505 137 3163.05322 9195.22575 138 7145.29735 3163.05322 139 10355.20815 7145.29735 140 4122.95229 10355.20815 141 3323.77975 4122.95229 142 -5869.47623 3323.77975 143 -12402.00651 -5869.47623 > plot(z,main=paste('Residual Lag plot, lowess, and regression line'), ylab='values of Residuals', xlab='lagged values of Residuals') > lines(lowess(z)) > abline(lm(z)) > grid() > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7ghgi1324323146.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > acf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Autocorrelation Function') > grid() > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/84ev21324323146.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > pacf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Partial Autocorrelation Function') > grid() > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/9lsmc1324323146.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > opar <- par(mfrow = c(2,2), oma = c(0, 0, 1.1, 0)) > plot(mylm, las = 1, sub='Residual Diagnostics') > par(opar) > dev.off() null device 1 > if (n > n25) { + postscript(file="/var/wessaorg/rcomp/tmp/10utwo1324323146.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) + plot(kp3:nmkm3,gqarr[,2], main='Goldfeld-Quandt test',ylab='2-sided p-value',xlab='breakpoint') + grid() + dev.off() + } null device 1 > > #Note: the /var/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/wessaorg/rcomp/createtable") > > a<-table.start() > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Estimated Regression Equation', 1, TRUE) > a<-table.row.end(a) > myeq <- colnames(x)[1] > myeq <- paste(myeq, '[t] = ', sep='') > for (i in 1:k){ + if (mysum$coefficients[i,1] > 0) myeq <- paste(myeq, '+', '') + myeq <- paste(myeq, mysum$coefficients[i,1], sep=' ') + if (rownames(mysum$coefficients)[i] != '(Intercept)') { + myeq <- paste(myeq, rownames(mysum$coefficients)[i], sep='') + if (rownames(mysum$coefficients)[i] != 't') myeq <- paste(myeq, '[t]', sep='') + } + } > myeq <- paste(myeq, ' + e[t]') > a<-table.row.start(a) > a<-table.element(a, myeq) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/wessaorg/rcomp/tmp/11746g1324323146.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,hyperlink('http://www.xycoon.com/ols1.htm','Multiple Linear Regression - Ordinary Least Squares',''), 6, TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Variable',header=TRUE) > a<-table.element(a,'Parameter',header=TRUE) > a<-table.element(a,'S.D.',header=TRUE) > a<-table.element(a,'T-STAT
H0: parameter = 0',header=TRUE) > a<-table.element(a,'2-tail p-value',header=TRUE) > a<-table.element(a,'1-tail p-value',header=TRUE) > a<-table.row.end(a) > for (i in 1:k){ + a<-table.row.start(a) + a<-table.element(a,rownames(mysum$coefficients)[i],header=TRUE) + a<-table.element(a,mysum$coefficients[i,1]) + a<-table.element(a, round(mysum$coefficients[i,2],6)) + a<-table.element(a, round(mysum$coefficients[i,3],4)) + a<-table.element(a, round(mysum$coefficients[i,4],6)) + a<-table.element(a, round(mysum$coefficients[i,4]/2,6)) + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/wessaorg/rcomp/tmp/12h46b1324323146.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Regression Statistics', 2, TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Multiple R',1,TRUE) > a<-table.element(a, sqrt(mysum$r.squared)) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'R-squared',1,TRUE) > a<-table.element(a, mysum$r.squared) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Adjusted R-squared',1,TRUE) > a<-table.element(a, mysum$adj.r.squared) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'F-TEST (value)',1,TRUE) > a<-table.element(a, mysum$fstatistic[1]) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'F-TEST (DF numerator)',1,TRUE) > a<-table.element(a, mysum$fstatistic[2]) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'F-TEST (DF denominator)',1,TRUE) > a<-table.element(a, mysum$fstatistic[3]) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'p-value',1,TRUE) > a<-table.element(a, 1-pf(mysum$fstatistic[1],mysum$fstatistic[2],mysum$fstatistic[3])) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Residual Statistics', 2, TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Residual Standard Deviation',1,TRUE) > a<-table.element(a, mysum$sigma) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Sum Squared Residuals',1,TRUE) > a<-table.element(a, sum(myerror*myerror)) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/wessaorg/rcomp/tmp/13v0fe1324323146.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Actuals, Interpolation, and Residuals', 4, TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Time or Index', 1, TRUE) > a<-table.element(a, 'Actuals', 1, TRUE) > a<-table.element(a, 'Interpolation
Forecast', 1, TRUE) > a<-table.element(a, 'Residuals
Prediction Error', 1, TRUE) > a<-table.row.end(a) > for (i in 1:n) { + a<-table.row.start(a) + a<-table.element(a,i, 1, TRUE) + a<-table.element(a,x[i]) + a<-table.element(a,x[i]-mysum$resid[i]) + a<-table.element(a,mysum$resid[i]) + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/wessaorg/rcomp/tmp/14q2f71324323146.tab") > if (n > n25) { + a<-table.start() + a<-table.row.start(a) + a<-table.element(a,'Goldfeld-Quandt test for Heteroskedasticity',4,TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'p-values',header=TRUE) + a<-table.element(a,'Alternative Hypothesis',3,header=TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'breakpoint index',header=TRUE) + a<-table.element(a,'greater',header=TRUE) + a<-table.element(a,'2-sided',header=TRUE) + a<-table.element(a,'less',header=TRUE) + a<-table.row.end(a) + for (mypoint in kp3:nmkm3) { + a<-table.row.start(a) + a<-table.element(a,mypoint,header=TRUE) + a<-table.element(a,gqarr[mypoint-kp3+1,1]) + a<-table.element(a,gqarr[mypoint-kp3+1,2]) + a<-table.element(a,gqarr[mypoint-kp3+1,3]) + a<-table.row.end(a) + } + a<-table.end(a) + table.save(a,file="/var/wessaorg/rcomp/tmp/15jvqo1324323146.tab") + a<-table.start() + a<-table.row.start(a) + a<-table.element(a,'Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity',4,TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'Description',header=TRUE) + a<-table.element(a,'# significant tests',header=TRUE) + a<-table.element(a,'% significant tests',header=TRUE) + a<-table.element(a,'OK/NOK',header=TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'1% type I error level',header=TRUE) + a<-table.element(a,numsignificant1) + a<-table.element(a,numsignificant1/numgqtests) + if (numsignificant1/numgqtests < 0.01) dum <- 'OK' else dum <- 'NOK' + a<-table.element(a,dum) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'5% type I error level',header=TRUE) + a<-table.element(a,numsignificant5) + a<-table.element(a,numsignificant5/numgqtests) + if (numsignificant5/numgqtests < 0.05) dum <- 'OK' else dum <- 'NOK' + a<-table.element(a,dum) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'10% type I error level',header=TRUE) + a<-table.element(a,numsignificant10) + a<-table.element(a,numsignificant10/numgqtests) + if (numsignificant10/numgqtests < 0.1) dum <- 'OK' else dum <- 'NOK' + a<-table.element(a,dum) + a<-table.row.end(a) + a<-table.end(a) + table.save(a,file="/var/wessaorg/rcomp/tmp/16amqv1324323146.tab") + } > > try(system("convert tmp/1y7wk1324323146.ps tmp/1y7wk1324323146.png",intern=TRUE)) character(0) > try(system("convert tmp/2q26j1324323146.ps tmp/2q26j1324323146.png",intern=TRUE)) character(0) > try(system("convert tmp/3ue8h1324323146.ps tmp/3ue8h1324323146.png",intern=TRUE)) character(0) > try(system("convert tmp/48dxq1324323146.ps tmp/48dxq1324323146.png",intern=TRUE)) character(0) > try(system("convert tmp/5urt31324323146.ps tmp/5urt31324323146.png",intern=TRUE)) character(0) > try(system("convert tmp/6jqm01324323146.ps tmp/6jqm01324323146.png",intern=TRUE)) character(0) > try(system("convert tmp/7ghgi1324323146.ps tmp/7ghgi1324323146.png",intern=TRUE)) character(0) > try(system("convert tmp/84ev21324323146.ps tmp/84ev21324323146.png",intern=TRUE)) character(0) > try(system("convert tmp/9lsmc1324323146.ps tmp/9lsmc1324323146.png",intern=TRUE)) character(0) > try(system("convert tmp/10utwo1324323146.ps tmp/10utwo1324323146.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.778 0.862 6.020