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 + ,0 + ,119 + ,0 + ,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 0 119 0 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` 100862.8 -182585.8 395.3 1187.8 M1 M2 M3 M4 -15580.9 -11293.3 4695.9 -8077.3 M5 M6 M7 M8 -9488.7 -10669.0 -10224.7 -13049.1 M9 M10 M11 -8224.3 2061.4 3152.5 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -14724.1 -3891.8 359.3 3404.5 10321.9 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 100862.82 1805.22 55.873 < 2e-16 *** `crisis_10/8` -182585.83 20060.26 -9.102 1.41e-15 *** t 395.26 14.43 27.388 < 2e-16 *** `t_crisis_10/8` 1187.78 152.14 7.807 1.76e-12 *** M1 -15580.95 2207.08 -7.060 9.22e-11 *** M2 -11293.33 2205.47 -5.121 1.08e-06 *** M3 4695.95 2204.21 2.130 0.035033 * M4 -8077.27 2203.31 -3.666 0.000359 *** M5 -9488.66 2202.77 -4.308 3.24e-05 *** M6 -10668.96 2202.59 -4.844 3.59e-06 *** M7 -10224.68 2202.77 -4.642 8.38e-06 *** M8 -13049.07 2203.31 -5.922 2.70e-08 *** M9 -8224.29 2204.21 -3.731 0.000285 *** M10 2061.41 2205.47 0.935 0.351699 M11 3152.52 2207.08 1.428 0.155603 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 5390 on 129 degrees of freedom Multiple R-squared: 0.8983, Adjusted R-squared: 0.8873 F-statistic: 81.39 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.0880736444 0.1761472887 0.9119264 [2,] 0.0325719106 0.0651438212 0.9674281 [3,] 0.0108105970 0.0216211939 0.9891894 [4,] 0.0102890165 0.0205780329 0.9897110 [5,] 0.0045691678 0.0091383357 0.9954308 [6,] 0.0024771073 0.0049542146 0.9975229 [7,] 0.0009632479 0.0019264958 0.9990368 [8,] 0.0004682517 0.0009365034 0.9995317 [9,] 0.0009448019 0.0018896039 0.9990552 [10,] 0.0008468539 0.0016937079 0.9991531 [11,] 0.0026563550 0.0053127100 0.9973436 [12,] 0.0059029132 0.0118058264 0.9940971 [13,] 0.0051007258 0.0102014516 0.9948993 [14,] 0.0504747784 0.1009495568 0.9495252 [15,] 0.0577192247 0.1154384493 0.9422808 [16,] 0.0567250491 0.1134500981 0.9432750 [17,] 0.0479327669 0.0958655337 0.9520672 [18,] 0.0349358142 0.0698716285 0.9650642 [19,] 0.0300497268 0.0600994536 0.9699503 [20,] 0.0197509094 0.0395018188 0.9802491 [21,] 0.0144548283 0.0289096567 0.9855452 [22,] 0.0158267440 0.0316534879 0.9841733 [23,] 0.0118173259 0.0236346518 0.9881827 [24,] 0.0089907723 0.0179815446 0.9910092 [25,] 0.0220809255 0.0441618511 0.9779191 [26,] 0.0176623416 0.0353246833 0.9823377 [27,] 0.0158716154 0.0317432308 0.9841284 [28,] 0.0121259845 0.0242519689 0.9878740 [29,] 0.0087983757 0.0175967513 0.9912016 [30,] 0.0158994071 0.0317988142 0.9841006 [31,] 0.0133666043 0.0267332085 0.9866334 [32,] 0.0096479639 0.0192959277 0.9903520 [33,] 0.0064260015 0.0128520029 0.9935740 [34,] 0.0071051461 0.0142102922 0.9928949 [35,] 0.0052500004 0.0105000009 0.9947500 [36,] 0.0040998986 0.0081997971 0.9959001 [37,] 0.0032458448 0.0064916897 0.9967542 [38,] 0.0033062664 0.0066125327 0.9966937 [39,] 0.0059110880 0.0118221759 0.9940889 [40,] 0.0058330152 0.0116660304 0.9941670 [41,] 0.0065586886 0.0131173773 0.9934413 [42,] 0.0084303768 0.0168607535 0.9915696 [43,] 0.0073211283 0.0146422566 0.9926789 [44,] 0.0064098936 0.0128197872 0.9935901 [45,] 0.0112369915 0.0224739830 0.9887630 [46,] 0.0112560002 0.0225120005 0.9887440 [47,] 0.0140274854 0.0280549708 0.9859725 [48,] 0.0190361023 0.0380722046 0.9809639 [49,] 0.0190315189 0.0380630379 0.9809685 [50,] 0.0277509309 0.0555018618 0.9722491 [51,] 0.0326581394 0.0653162788 0.9673419 [52,] 0.0362966103 0.0725932206 0.9637034 [53,] 0.0786243254 0.1572486507 0.9213757 [54,] 0.1711803127 0.3423606254 0.8288197 [55,] 0.3190385580 0.6380771161 0.6809614 [56,] 0.3837210372 0.7674420744 0.6162790 [57,] 0.3358771325 0.6717542649 0.6641229 [58,] 0.3131594792 0.6263189584 0.6868405 [59,] 0.2981531699 0.5963063397 0.7018468 [60,] 0.2770312687 0.5540625374 0.7229687 [61,] 0.2642504252 0.5285008503 0.7357496 [62,] 0.2557454130 0.5114908260 0.7442546 [63,] 0.2611701081 0.5223402161 0.7388299 [64,] 0.2608066470 0.5216132941 0.7391934 [65,] 0.2399486844 0.4798973688 0.7600513 [66,] 0.2110714270 0.4221428540 0.7889286 [67,] 0.1932522692 0.3865045384 0.8067477 [68,] 0.1632765153 0.3265530307 0.8367235 [69,] 0.1691730782 0.3383461564 0.8308269 [70,] 0.1510451359 0.3020902718 0.8489549 [71,] 0.1420799346 0.2841598692 0.8579201 [72,] 0.1357722259 0.2715444519 0.8642278 [73,] 0.1311128106 0.2622256211 0.8688872 [74,] 0.1370969322 0.2741938643 0.8629031 [75,] 0.1718473551 0.3436947102 0.8281526 [76,] 0.1750923109 0.3501846218 0.8249077 [77,] 0.1610801935 0.3221603870 0.8389198 [78,] 0.1507154677 0.3014309354 0.8492845 [79,] 0.1231416929 0.2462833859 0.8768583 [80,] 0.1483203768 0.2966407536 0.8516796 [81,] 0.2248568397 0.4497136794 0.7751432 [82,] 0.2277371244 0.4554742488 0.7722629 [83,] 0.2044924912 0.4089849823 0.7955075 [84,] 0.3143603353 0.6287206706 0.6856397 [85,] 0.3365202421 0.6730404841 0.6634798 [86,] 0.3954965374 0.7909930747 0.6045035 [87,] 0.5970076965 0.8059846071 0.4029923 [88,] 0.6102385130 0.7795229740 0.3897615 [89,] 0.6291131981 0.7417736037 0.3708868 [90,] 0.6068254958 0.7863490085 0.3931745 [91,] 0.5438225084 0.9123549831 0.4561775 [92,] 0.5508679543 0.8982640914 0.4491320 [93,] 0.5486735615 0.9026528769 0.4513264 [94,] 0.5033844224 0.9932311552 0.4966156 [95,] 0.5566213265 0.8867573471 0.4433787 [96,] 0.4958187151 0.9916374301 0.5041813 [97,] 0.4438172286 0.8876344572 0.5561828 [98,] 0.3693669765 0.7387339531 0.6306330 [99,] 0.3072552916 0.6145105833 0.6927447 [100,] 0.2489074726 0.4978149451 0.7510925 [101,] 0.2113760551 0.4227521102 0.7886239 [102,] 0.1963913964 0.3927827928 0.8036086 [103,] 0.3391587412 0.6783174823 0.6608413 [104,] 0.2537216023 0.5074432047 0.7462784 [105,] 0.1793662023 0.3587324046 0.8206338 [106,] 0.2257411430 0.4514822860 0.7742589 [107,] 0.1849648835 0.3699297671 0.8150351 [108,] 0.2494609868 0.4989219736 0.7505390 [109,] 0.2032405970 0.4064811940 0.7967594 > postscript(file="/var/wessaorg/rcomp/tmp/1d8j11324322400.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/2v0101324322400.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/3mr171324322400.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/4unn51324322400.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/53qnm1324322400.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 4926.87056 7167.00035 5195.46346 5913.42658 6658.55636 2992.60281 7 8 9 10 11 12 5128.06593 1718.19572 1724.15883 4056.20528 2491.83507 6110.09971 13 14 15 16 17 18 5927.79013 10321.91992 3386.38304 5089.34615 3072.47594 1701.52239 19 20 21 22 23 24 3458.98550 1773.11529 5149.07840 1916.12486 -631.24536 5142.01928 25 26 27 28 29 30 2569.70971 2744.83949 -1447.69739 -3455.73428 -5064.60449 -5923.55804 31 32 33 34 35 36 -11630.09492 -9775.96514 -7890.00202 -7514.95557 -7860.32579 -5639.06114 37 38 39 40 41 42 -5961.37072 -5839.24094 -1930.77782 -3819.81470 -4317.68492 -59.63847 43 44 45 46 47 48 -6034.17535 -5847.04557 -5185.08245 -7027.03600 -955.40622 -8088.14157 49 50 51 52 53 54 -5153.45115 -4340.32136 -1461.85825 -5080.89513 -5382.76535 -6598.71890 55 56 57 58 59 60 -6481.25578 -2661.12599 -4385.16288 -3710.11643 -1512.48664 -4098.22200 61 62 63 64 65 66 -6096.53158 3045.59821 -535.93867 507.02444 996.15423 -2683.79932 67 68 69 70 71 72 40.66379 -1798.20642 -254.24330 5969.80315 8367.43293 9422.69758 73 74 75 76 77 78 6188.38800 -705.48222 -4946.01910 2684.94402 -3822.92620 -2707.87975 79 80 81 82 83 84 211.58337 -1861.28685 -2088.32373 598.72272 1572.35250 3934.61715 85 86 87 88 89 90 -98.69243 -5654.56265 2985.90047 4631.86359 -886.00663 2191.03982 91 92 93 94 95 96 1111.50294 190.63272 5843.59584 4655.64229 755.27207 2673.53672 97 98 99 100 101 102 -3150.77286 -4882.64307 1139.82004 2260.78316 860.91294 9754.95939 103 104 105 106 107 108 6421.42251 5114.55230 9875.51541 7083.56186 9483.19165 4889.45629 109 110 111 112 113 114 1497.14671 1216.27650 2519.73962 6136.70273 1203.83252 1739.87897 115 116 117 118 119 120 -1661.65792 -1140.52813 -5397.56501 -9444.51856 -13529.88878 3951.75752 121 122 123 124 125 126 12.66924 -1066.97968 -7925.29526 -4336.11085 -1875.75977 -2729.49202 127 128 129 130 131 132 3332.19239 5177.54347 -67.27211 1742.99564 6391.84672 -3574.66734 133 134 135 136 137 138 -661.75562 -2006.40454 3020.27987 -10531.53571 8557.81537 2323.08311 139 140 141 142 143 144 6102.76753 9110.11861 2675.30302 1673.57077 -4572.57815 -14724.09221 > postscript(file="/var/wessaorg/rcomp/tmp/67lkn1324322400.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 4926.87056 NA 1 7167.00035 4926.87056 2 5195.46346 7167.00035 3 5913.42658 5195.46346 4 6658.55636 5913.42658 5 2992.60281 6658.55636 6 5128.06593 2992.60281 7 1718.19572 5128.06593 8 1724.15883 1718.19572 9 4056.20528 1724.15883 10 2491.83507 4056.20528 11 6110.09971 2491.83507 12 5927.79013 6110.09971 13 10321.91992 5927.79013 14 3386.38304 10321.91992 15 5089.34615 3386.38304 16 3072.47594 5089.34615 17 1701.52239 3072.47594 18 3458.98550 1701.52239 19 1773.11529 3458.98550 20 5149.07840 1773.11529 21 1916.12486 5149.07840 22 -631.24536 1916.12486 23 5142.01928 -631.24536 24 2569.70971 5142.01928 25 2744.83949 2569.70971 26 -1447.69739 2744.83949 27 -3455.73428 -1447.69739 28 -5064.60449 -3455.73428 29 -5923.55804 -5064.60449 30 -11630.09492 -5923.55804 31 -9775.96514 -11630.09492 32 -7890.00202 -9775.96514 33 -7514.95557 -7890.00202 34 -7860.32579 -7514.95557 35 -5639.06114 -7860.32579 36 -5961.37072 -5639.06114 37 -5839.24094 -5961.37072 38 -1930.77782 -5839.24094 39 -3819.81470 -1930.77782 40 -4317.68492 -3819.81470 41 -59.63847 -4317.68492 42 -6034.17535 -59.63847 43 -5847.04557 -6034.17535 44 -5185.08245 -5847.04557 45 -7027.03600 -5185.08245 46 -955.40622 -7027.03600 47 -8088.14157 -955.40622 48 -5153.45115 -8088.14157 49 -4340.32136 -5153.45115 50 -1461.85825 -4340.32136 51 -5080.89513 -1461.85825 52 -5382.76535 -5080.89513 53 -6598.71890 -5382.76535 54 -6481.25578 -6598.71890 55 -2661.12599 -6481.25578 56 -4385.16288 -2661.12599 57 -3710.11643 -4385.16288 58 -1512.48664 -3710.11643 59 -4098.22200 -1512.48664 60 -6096.53158 -4098.22200 61 3045.59821 -6096.53158 62 -535.93867 3045.59821 63 507.02444 -535.93867 64 996.15423 507.02444 65 -2683.79932 996.15423 66 40.66379 -2683.79932 67 -1798.20642 40.66379 68 -254.24330 -1798.20642 69 5969.80315 -254.24330 70 8367.43293 5969.80315 71 9422.69758 8367.43293 72 6188.38800 9422.69758 73 -705.48222 6188.38800 74 -4946.01910 -705.48222 75 2684.94402 -4946.01910 76 -3822.92620 2684.94402 77 -2707.87975 -3822.92620 78 211.58337 -2707.87975 79 -1861.28685 211.58337 80 -2088.32373 -1861.28685 81 598.72272 -2088.32373 82 1572.35250 598.72272 83 3934.61715 1572.35250 84 -98.69243 3934.61715 85 -5654.56265 -98.69243 86 2985.90047 -5654.56265 87 4631.86359 2985.90047 88 -886.00663 4631.86359 89 2191.03982 -886.00663 90 1111.50294 2191.03982 91 190.63272 1111.50294 92 5843.59584 190.63272 93 4655.64229 5843.59584 94 755.27207 4655.64229 95 2673.53672 755.27207 96 -3150.77286 2673.53672 97 -4882.64307 -3150.77286 98 1139.82004 -4882.64307 99 2260.78316 1139.82004 100 860.91294 2260.78316 101 9754.95939 860.91294 102 6421.42251 9754.95939 103 5114.55230 6421.42251 104 9875.51541 5114.55230 105 7083.56186 9875.51541 106 9483.19165 7083.56186 107 4889.45629 9483.19165 108 1497.14671 4889.45629 109 1216.27650 1497.14671 110 2519.73962 1216.27650 111 6136.70273 2519.73962 112 1203.83252 6136.70273 113 1739.87897 1203.83252 114 -1661.65792 1739.87897 115 -1140.52813 -1661.65792 116 -5397.56501 -1140.52813 117 -9444.51856 -5397.56501 118 -13529.88878 -9444.51856 119 3951.75752 -13529.88878 120 12.66924 3951.75752 121 -1066.97968 12.66924 122 -7925.29526 -1066.97968 123 -4336.11085 -7925.29526 124 -1875.75977 -4336.11085 125 -2729.49202 -1875.75977 126 3332.19239 -2729.49202 127 5177.54347 3332.19239 128 -67.27211 5177.54347 129 1742.99564 -67.27211 130 6391.84672 1742.99564 131 -3574.66734 6391.84672 132 -661.75562 -3574.66734 133 -2006.40454 -661.75562 134 3020.27987 -2006.40454 135 -10531.53571 3020.27987 136 8557.81537 -10531.53571 137 2323.08311 8557.81537 138 6102.76753 2323.08311 139 9110.11861 6102.76753 140 2675.30302 9110.11861 141 1673.57077 2675.30302 142 -4572.57815 1673.57077 143 -14724.09221 -4572.57815 144 NA -14724.09221 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 7167.00035 4926.87056 [2,] 5195.46346 7167.00035 [3,] 5913.42658 5195.46346 [4,] 6658.55636 5913.42658 [5,] 2992.60281 6658.55636 [6,] 5128.06593 2992.60281 [7,] 1718.19572 5128.06593 [8,] 1724.15883 1718.19572 [9,] 4056.20528 1724.15883 [10,] 2491.83507 4056.20528 [11,] 6110.09971 2491.83507 [12,] 5927.79013 6110.09971 [13,] 10321.91992 5927.79013 [14,] 3386.38304 10321.91992 [15,] 5089.34615 3386.38304 [16,] 3072.47594 5089.34615 [17,] 1701.52239 3072.47594 [18,] 3458.98550 1701.52239 [19,] 1773.11529 3458.98550 [20,] 5149.07840 1773.11529 [21,] 1916.12486 5149.07840 [22,] -631.24536 1916.12486 [23,] 5142.01928 -631.24536 [24,] 2569.70971 5142.01928 [25,] 2744.83949 2569.70971 [26,] -1447.69739 2744.83949 [27,] -3455.73428 -1447.69739 [28,] -5064.60449 -3455.73428 [29,] -5923.55804 -5064.60449 [30,] -11630.09492 -5923.55804 [31,] -9775.96514 -11630.09492 [32,] -7890.00202 -9775.96514 [33,] -7514.95557 -7890.00202 [34,] -7860.32579 -7514.95557 [35,] -5639.06114 -7860.32579 [36,] -5961.37072 -5639.06114 [37,] -5839.24094 -5961.37072 [38,] -1930.77782 -5839.24094 [39,] -3819.81470 -1930.77782 [40,] -4317.68492 -3819.81470 [41,] -59.63847 -4317.68492 [42,] -6034.17535 -59.63847 [43,] -5847.04557 -6034.17535 [44,] -5185.08245 -5847.04557 [45,] -7027.03600 -5185.08245 [46,] -955.40622 -7027.03600 [47,] -8088.14157 -955.40622 [48,] -5153.45115 -8088.14157 [49,] -4340.32136 -5153.45115 [50,] -1461.85825 -4340.32136 [51,] -5080.89513 -1461.85825 [52,] -5382.76535 -5080.89513 [53,] -6598.71890 -5382.76535 [54,] -6481.25578 -6598.71890 [55,] -2661.12599 -6481.25578 [56,] -4385.16288 -2661.12599 [57,] -3710.11643 -4385.16288 [58,] -1512.48664 -3710.11643 [59,] -4098.22200 -1512.48664 [60,] -6096.53158 -4098.22200 [61,] 3045.59821 -6096.53158 [62,] -535.93867 3045.59821 [63,] 507.02444 -535.93867 [64,] 996.15423 507.02444 [65,] -2683.79932 996.15423 [66,] 40.66379 -2683.79932 [67,] -1798.20642 40.66379 [68,] -254.24330 -1798.20642 [69,] 5969.80315 -254.24330 [70,] 8367.43293 5969.80315 [71,] 9422.69758 8367.43293 [72,] 6188.38800 9422.69758 [73,] -705.48222 6188.38800 [74,] -4946.01910 -705.48222 [75,] 2684.94402 -4946.01910 [76,] -3822.92620 2684.94402 [77,] -2707.87975 -3822.92620 [78,] 211.58337 -2707.87975 [79,] -1861.28685 211.58337 [80,] -2088.32373 -1861.28685 [81,] 598.72272 -2088.32373 [82,] 1572.35250 598.72272 [83,] 3934.61715 1572.35250 [84,] -98.69243 3934.61715 [85,] -5654.56265 -98.69243 [86,] 2985.90047 -5654.56265 [87,] 4631.86359 2985.90047 [88,] -886.00663 4631.86359 [89,] 2191.03982 -886.00663 [90,] 1111.50294 2191.03982 [91,] 190.63272 1111.50294 [92,] 5843.59584 190.63272 [93,] 4655.64229 5843.59584 [94,] 755.27207 4655.64229 [95,] 2673.53672 755.27207 [96,] -3150.77286 2673.53672 [97,] -4882.64307 -3150.77286 [98,] 1139.82004 -4882.64307 [99,] 2260.78316 1139.82004 [100,] 860.91294 2260.78316 [101,] 9754.95939 860.91294 [102,] 6421.42251 9754.95939 [103,] 5114.55230 6421.42251 [104,] 9875.51541 5114.55230 [105,] 7083.56186 9875.51541 [106,] 9483.19165 7083.56186 [107,] 4889.45629 9483.19165 [108,] 1497.14671 4889.45629 [109,] 1216.27650 1497.14671 [110,] 2519.73962 1216.27650 [111,] 6136.70273 2519.73962 [112,] 1203.83252 6136.70273 [113,] 1739.87897 1203.83252 [114,] -1661.65792 1739.87897 [115,] -1140.52813 -1661.65792 [116,] -5397.56501 -1140.52813 [117,] -9444.51856 -5397.56501 [118,] -13529.88878 -9444.51856 [119,] 3951.75752 -13529.88878 [120,] 12.66924 3951.75752 [121,] -1066.97968 12.66924 [122,] -7925.29526 -1066.97968 [123,] -4336.11085 -7925.29526 [124,] -1875.75977 -4336.11085 [125,] -2729.49202 -1875.75977 [126,] 3332.19239 -2729.49202 [127,] 5177.54347 3332.19239 [128,] -67.27211 5177.54347 [129,] 1742.99564 -67.27211 [130,] 6391.84672 1742.99564 [131,] -3574.66734 6391.84672 [132,] -661.75562 -3574.66734 [133,] -2006.40454 -661.75562 [134,] 3020.27987 -2006.40454 [135,] -10531.53571 3020.27987 [136,] 8557.81537 -10531.53571 [137,] 2323.08311 8557.81537 [138,] 6102.76753 2323.08311 [139,] 9110.11861 6102.76753 [140,] 2675.30302 9110.11861 [141,] 1673.57077 2675.30302 [142,] -4572.57815 1673.57077 [143,] -14724.09221 -4572.57815 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 7167.00035 4926.87056 2 5195.46346 7167.00035 3 5913.42658 5195.46346 4 6658.55636 5913.42658 5 2992.60281 6658.55636 6 5128.06593 2992.60281 7 1718.19572 5128.06593 8 1724.15883 1718.19572 9 4056.20528 1724.15883 10 2491.83507 4056.20528 11 6110.09971 2491.83507 12 5927.79013 6110.09971 13 10321.91992 5927.79013 14 3386.38304 10321.91992 15 5089.34615 3386.38304 16 3072.47594 5089.34615 17 1701.52239 3072.47594 18 3458.98550 1701.52239 19 1773.11529 3458.98550 20 5149.07840 1773.11529 21 1916.12486 5149.07840 22 -631.24536 1916.12486 23 5142.01928 -631.24536 24 2569.70971 5142.01928 25 2744.83949 2569.70971 26 -1447.69739 2744.83949 27 -3455.73428 -1447.69739 28 -5064.60449 -3455.73428 29 -5923.55804 -5064.60449 30 -11630.09492 -5923.55804 31 -9775.96514 -11630.09492 32 -7890.00202 -9775.96514 33 -7514.95557 -7890.00202 34 -7860.32579 -7514.95557 35 -5639.06114 -7860.32579 36 -5961.37072 -5639.06114 37 -5839.24094 -5961.37072 38 -1930.77782 -5839.24094 39 -3819.81470 -1930.77782 40 -4317.68492 -3819.81470 41 -59.63847 -4317.68492 42 -6034.17535 -59.63847 43 -5847.04557 -6034.17535 44 -5185.08245 -5847.04557 45 -7027.03600 -5185.08245 46 -955.40622 -7027.03600 47 -8088.14157 -955.40622 48 -5153.45115 -8088.14157 49 -4340.32136 -5153.45115 50 -1461.85825 -4340.32136 51 -5080.89513 -1461.85825 52 -5382.76535 -5080.89513 53 -6598.71890 -5382.76535 54 -6481.25578 -6598.71890 55 -2661.12599 -6481.25578 56 -4385.16288 -2661.12599 57 -3710.11643 -4385.16288 58 -1512.48664 -3710.11643 59 -4098.22200 -1512.48664 60 -6096.53158 -4098.22200 61 3045.59821 -6096.53158 62 -535.93867 3045.59821 63 507.02444 -535.93867 64 996.15423 507.02444 65 -2683.79932 996.15423 66 40.66379 -2683.79932 67 -1798.20642 40.66379 68 -254.24330 -1798.20642 69 5969.80315 -254.24330 70 8367.43293 5969.80315 71 9422.69758 8367.43293 72 6188.38800 9422.69758 73 -705.48222 6188.38800 74 -4946.01910 -705.48222 75 2684.94402 -4946.01910 76 -3822.92620 2684.94402 77 -2707.87975 -3822.92620 78 211.58337 -2707.87975 79 -1861.28685 211.58337 80 -2088.32373 -1861.28685 81 598.72272 -2088.32373 82 1572.35250 598.72272 83 3934.61715 1572.35250 84 -98.69243 3934.61715 85 -5654.56265 -98.69243 86 2985.90047 -5654.56265 87 4631.86359 2985.90047 88 -886.00663 4631.86359 89 2191.03982 -886.00663 90 1111.50294 2191.03982 91 190.63272 1111.50294 92 5843.59584 190.63272 93 4655.64229 5843.59584 94 755.27207 4655.64229 95 2673.53672 755.27207 96 -3150.77286 2673.53672 97 -4882.64307 -3150.77286 98 1139.82004 -4882.64307 99 2260.78316 1139.82004 100 860.91294 2260.78316 101 9754.95939 860.91294 102 6421.42251 9754.95939 103 5114.55230 6421.42251 104 9875.51541 5114.55230 105 7083.56186 9875.51541 106 9483.19165 7083.56186 107 4889.45629 9483.19165 108 1497.14671 4889.45629 109 1216.27650 1497.14671 110 2519.73962 1216.27650 111 6136.70273 2519.73962 112 1203.83252 6136.70273 113 1739.87897 1203.83252 114 -1661.65792 1739.87897 115 -1140.52813 -1661.65792 116 -5397.56501 -1140.52813 117 -9444.51856 -5397.56501 118 -13529.88878 -9444.51856 119 3951.75752 -13529.88878 120 12.66924 3951.75752 121 -1066.97968 12.66924 122 -7925.29526 -1066.97968 123 -4336.11085 -7925.29526 124 -1875.75977 -4336.11085 125 -2729.49202 -1875.75977 126 3332.19239 -2729.49202 127 5177.54347 3332.19239 128 -67.27211 5177.54347 129 1742.99564 -67.27211 130 6391.84672 1742.99564 131 -3574.66734 6391.84672 132 -661.75562 -3574.66734 133 -2006.40454 -661.75562 134 3020.27987 -2006.40454 135 -10531.53571 3020.27987 136 8557.81537 -10531.53571 137 2323.08311 8557.81537 138 6102.76753 2323.08311 139 9110.11861 6102.76753 140 2675.30302 9110.11861 141 1673.57077 2675.30302 142 -4572.57815 1673.57077 143 -14724.09221 -4572.57815 > 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/7d0n31324322400.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/8dhkq1324322400.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/9q3sl1324322400.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/104tmq1324322400.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/11knyf1324322400.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/12bmke1324322400.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/13c80k1324322400.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/14uk871324322400.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/15lvby1324322400.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/16dvp31324322400.tab") + } > > try(system("convert tmp/1d8j11324322400.ps tmp/1d8j11324322400.png",intern=TRUE)) character(0) > try(system("convert tmp/2v0101324322400.ps tmp/2v0101324322400.png",intern=TRUE)) character(0) > try(system("convert tmp/3mr171324322400.ps tmp/3mr171324322400.png",intern=TRUE)) character(0) > try(system("convert tmp/4unn51324322400.ps tmp/4unn51324322400.png",intern=TRUE)) character(0) > try(system("convert tmp/53qnm1324322400.ps tmp/53qnm1324322400.png",intern=TRUE)) character(0) > try(system("convert tmp/67lkn1324322400.ps tmp/67lkn1324322400.png",intern=TRUE)) character(0) > try(system("convert tmp/7d0n31324322400.ps tmp/7d0n31324322400.png",intern=TRUE)) character(0) > try(system("convert tmp/8dhkq1324322400.ps tmp/8dhkq1324322400.png",intern=TRUE)) character(0) > try(system("convert tmp/9q3sl1324322400.ps tmp/9q3sl1324322400.png",intern=TRUE)) character(0) > try(system("convert tmp/104tmq1324322400.ps tmp/104tmq1324322400.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 5.504 0.748 6.269