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(1801 + ,159261 + ,91 + ,586 + ,111 + ,0 + ,74 + ,1717 + ,189672 + ,59 + ,520 + ,76 + ,1 + ,80 + ,192 + ,7215 + ,18 + ,72 + ,1 + ,0 + ,0 + ,2295 + ,129098 + ,95 + ,645 + ,155 + ,0 + ,84 + ,3450 + ,230632 + ,136 + ,1163 + ,125 + ,0 + ,124 + ,6861 + ,515038 + ,263 + ,1945 + ,278 + ,1 + ,140 + ,1795 + ,180745 + ,56 + ,585 + ,89 + ,1 + ,88 + ,1681 + ,185559 + ,59 + ,470 + ,59 + ,0 + ,115 + ,1897 + ,154581 + ,44 + ,612 + ,87 + ,0 + ,109 + ,2974 + ,298001 + ,96 + ,992 + ,129 + ,1 + ,104 + ,1946 + ,121844 + ,75 + ,634 + ,158 + ,2 + ,63 + ,2148 + ,184039 + ,69 + ,677 + ,120 + ,0 + ,118 + ,1832 + ,100324 + ,98 + ,665 + ,87 + ,0 + ,71 + ,3183 + ,220269 + ,119 + ,1079 + ,264 + ,4 + ,112 + ,1476 + ,168265 + ,58 + ,413 + ,51 + ,4 + ,63 + ,1567 + ,154647 + ,88 + ,469 + ,85 + ,3 + ,86 + ,1756 + ,142018 + ,57 + ,431 + ,96 + ,0 + ,132 + ,1247 + ,79030 + ,61 + ,361 + ,72 + ,5 + ,54 + ,2779 + ,167047 + ,87 + ,877 + ,147 + ,0 + ,134 + ,726 + ,27997 + ,24 + ,221 + ,49 + ,0 + ,57 + ,1048 + ,73019 + ,59 + ,366 + ,40 + ,0 + ,59 + ,2805 + ,241082 + ,100 + ,846 + ,99 + ,0 + ,113 + ,1760 + ,195820 + ,72 + ,642 + ,127 + ,0 + ,96 + ,2266 + ,142001 + ,54 + ,689 + ,164 + ,1 + ,96 + ,1848 + ,145433 + ,86 + ,576 + ,41 + ,1 + ,78 + ,1665 + ,183744 + ,32 + ,610 + ,160 + ,0 + ,80 + ,2084 + ,202357 + ,163 + ,673 + ,92 + ,0 + ,93 + ,1440 + ,199532 + ,93 + ,361 + ,59 + ,0 + ,109 + ,2741 + ,354924 + ,118 + ,907 + ,89 + ,0 + ,115 + ,2112 + ,192399 + ,44 + ,882 + ,90 + ,0 + ,79 + ,1684 + ,182286 + ,44 + ,490 + ,76 + ,0 + ,103 + ,1616 + ,181590 + ,45 + ,548 + ,116 + ,2 + ,71 + ,2227 + ,133801 + ,105 + ,723 + ,92 + ,4 + ,66 + ,3088 + ,233686 + ,123 + ,918 + ,344 + ,0 + ,100 + ,2389 + ,219428 + ,53 + ,787 + ,84 + ,1 + ,96 + ,1 + ,0 + ,1 + ,0 + ,0 + ,0 + ,0 + ,2099 + ,223044 + ,63 + ,983 + ,61 + ,0 + ,109 + ,1669 + ,100129 + ,51 + ,539 + ,138 + ,3 + ,51 + ,2137 + ,145864 + ,49 + ,515 + ,270 + ,9 + ,119 + ,2153 + ,249965 + ,64 + ,795 + ,64 + ,0 + ,136 + ,2390 + ,242379 + ,71 + ,753 + ,96 + ,2 + ,84 + ,1701 + ,145794 + ,59 + ,635 + ,62 + ,0 + ,136 + ,983 + ,96404 + ,32 + ,361 + ,35 + ,2 + ,84 + ,2161 + ,195891 + ,78 + ,804 + ,59 + ,1 + ,92 + ,1276 + ,117156 + ,50 + ,394 + ,56 + ,2 + ,103 + ,1190 + ,157787 + ,95 + ,320 + ,40 + ,2 + ,82 + ,745 + ,81293 + ,32 + ,212 + ,49 + ,1 + ,106 + ,2330 + ,237435 + ,101 + ,772 + ,121 + ,0 + ,96 + ,2289 + ,233155 + ,89 + ,740 + ,113 + ,1 + ,124 + ,2639 + ,160344 + ,59 + ,938 + ,172 + ,8 + ,97 + ,658 + ,48188 + ,28 + ,205 + ,37 + ,0 + ,82 + ,1917 + ,161922 + ,69 + ,492 + ,51 + ,0 + ,79 + ,2557 + ,307432 + ,74 + ,818 + ,89 + ,0 + ,97 + ,2026 + ,235223 + ,79 + ,680 + ,73 + ,0 + ,107 + ,1911 + ,195583 + ,59 + ,691 + ,49 + ,1 + ,126 + ,1716 + ,146061 + ,56 + ,534 + ,74 + ,8 + ,40 + ,1852 + ,208834 + ,67 + ,487 + ,58 + ,0 + ,96 + ,981 + ,93764 + ,24 + ,301 + ,72 + ,1 + ,100 + ,1177 + ,151985 + ,66 + ,421 + ,32 + ,0 + ,91 + ,2833 + ,193222 + ,96 + ,947 + ,59 + ,10 + ,136 + ,1688 + ,148922 + ,60 + ,492 + ,70 + ,6 + ,124 + ,2097 + ,132856 + ,80 + ,790 + ,85 + ,0 + ,79 + ,1331 + ,129561 + ,61 + ,362 + ,87 + ,11 + ,74 + ,1244 + ,112718 + ,37 + ,430 + ,48 + ,3 + ,96 + ,1256 + ,160930 + ,35 + ,416 + ,56 + ,0 + ,97 + ,1294 + ,99184 + ,41 + ,409 + ,41 + ,0 + ,122 + ,2303 + ,192535 + ,70 + ,498 + ,86 + ,8 + ,144 + ,2897 + ,138708 + ,65 + ,887 + ,152 + ,2 + ,90 + ,1103 + ,114408 + ,38 + ,267 + ,48 + ,0 + ,93 + ,340 + ,31970 + ,15 + ,101 + ,40 + ,0 + ,78 + ,2791 + ,225558 + ,112 + ,1000 + ,135 + ,3 + ,72 + ,1338 + ,139220 + ,72 + ,416 + ,83 + ,1 + ,45 + ,1441 + ,113612 + ,68 + ,480 + ,62 + ,2 + ,120 + ,1623 + ,108641 + ,71 + ,454 + ,91 + ,1 + ,59 + ,2650 + ,162203 + ,67 + ,671 + ,91 + ,0 + ,133 + ,1499 + ,100098 + ,44 + ,413 + ,82 + ,2 + ,117 + ,2302 + ,174768 + ,60 + ,677 + ,112 + ,1 + ,123 + ,2540 + ,158459 + ,97 + ,820 + ,69 + ,0 + ,110 + ,1000 + ,80934 + ,30 + ,316 + ,78 + ,0 + ,75 + ,1234 + ,84971 + ,71 + ,395 + ,105 + ,0 + ,114 + ,927 + ,80545 + ,68 + ,217 + ,49 + ,0 + ,94 + ,2176 + ,287191 + ,64 + ,818 + ,60 + ,0 + ,116 + ,957 + ,62974 + ,28 + ,292 + ,49 + ,1 + ,86 + ,1551 + ,134091 + ,40 + ,513 + ,132 + ,0 + ,90 + ,1014 + ,75555 + ,46 + ,345 + ,49 + ,0 + ,87 + ,1771 + ,162154 + ,54 + ,557 + ,71 + ,0 + ,99 + ,2613 + ,226638 + ,227 + ,645 + ,100 + ,0 + ,132 + ,1205 + ,115367 + ,112 + ,284 + ,74 + ,0 + ,96 + ,1337 + ,108749 + ,62 + ,424 + ,49 + ,7 + ,91 + ,1524 + ,155537 + ,52 + ,614 + ,72 + ,0 + ,77 + ,1829 + ,153133 + ,41 + ,672 + ,59 + ,5 + ,104 + ,2229 + ,165618 + ,78 + ,649 + ,90 + ,1 + ,97 + ,1233 + ,151517 + ,57 + ,415 + ,68 + ,0 + ,94 + ,1365 + ,133686 + ,58 + ,505 + ,81 + ,0 + ,60 + ,950 + ,61342 + ,40 + ,387 + ,33 + ,0 + ,46 + ,2319 + ,245196 + ,117 + ,730 + ,166 + ,0 + ,135 + ,1857 + ,195576 + ,70 + ,563 + ,94 + ,0 + ,90 + ,223 + ,19349 + ,12 + ,67 + ,15 + ,0 + ,2 + ,2390 + ,225371 + ,105 + ,812 + ,104 + ,3 + ,96 + ,1985 + ,153213 + ,78 + ,811 + ,61 + ,0 + ,109 + ,700 + ,59117 + ,29 + ,281 + ,11 + ,0 + ,15 + ,1062 + ,91762 + ,24 + ,338 + ,45 + ,0 + ,68 + ,1311 + ,136769 + ,54 + ,413 + ,84 + ,0 + ,88 + ,1157 + ,114798 + ,61 + ,298 + ,66 + ,1 + ,84 + ,823 + ,85338 + ,40 + ,223 + ,27 + ,1 + ,46 + ,596 + ,27676 + ,22 + ,194 + ,59 + ,0 + ,59 + ,1545 + ,153535 + ,48 + ,371 + ,127 + ,0 + ,116 + ,1130 + ,122417 + ,37 + ,268 + ,48 + ,0 + ,29 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,1082 + ,91529 + ,32 + ,332 + ,58 + ,0 + ,91 + ,1135 + ,107205 + ,67 + ,371 + ,57 + ,0 + ,76 + ,1367 + ,144664 + ,45 + ,465 + ,59 + ,0 + ,83 + ,1506 + ,146445 + ,63 + ,447 + ,76 + ,1 + ,84 + ,870 + ,76656 + ,60 + ,295 + ,71 + ,0 + ,65 + ,78 + ,3616 + ,5 + ,14 + ,5 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,1130 + ,183088 + ,44 + ,388 + ,70 + ,0 + ,84 + ,1582 + ,144677 + ,84 + ,564 + ,76 + ,0 + ,114 + ,2034 + ,159104 + ,98 + ,562 + ,122 + ,2 + ,124 + ,919 + ,113273 + ,38 + ,288 + ,56 + ,0 + ,92 + ,778 + ,43410 + ,19 + ,292 + ,63 + ,0 + ,3 + ,1752 + ,175774 + ,73 + ,530 + ,92 + ,1 + ,109 + ,957 + ,95401 + ,42 + ,256 + ,54 + ,0 + ,74 + ,2098 + ,134837 + ,55 + ,602 + ,64 + ,8 + ,121 + ,731 + ,60493 + ,40 + ,174 + ,29 + ,3 + ,48 + ,285 + ,19764 + ,12 + ,75 + ,19 + ,1 + ,8 + ,1834 + ,164062 + ,56 + ,565 + ,64 + ,3 + ,80 + ,1148 + ,132696 + ,33 + ,377 + ,79 + ,0 + ,107 + ,1646 + ,155367 + ,54 + ,544 + ,97 + ,0 + ,116 + ,256 + ,11796 + ,9 + ,79 + ,22 + ,0 + ,8 + ,98 + ,10674 + ,9 + ,33 + ,7 + ,0 + ,0 + ,1404 + ,142261 + ,57 + ,479 + ,37 + ,0 + ,56 + ,41 + ,6836 + ,3 + ,11 + ,5 + ,0 + ,4 + ,1824 + ,162563 + ,63 + ,626 + ,48 + ,6 + ,70 + ,42 + ,5118 + ,3 + ,6 + ,1 + ,0 + ,0 + ,528 + ,40248 + ,16 + ,183 + ,34 + ,1 + ,14 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,0 + ,1073 + ,122641 + ,47 + ,334 + ,49 + ,0 + ,91 + ,1305 + ,88837 + ,38 + ,269 + ,44 + ,0 + ,89 + ,81 + ,7131 + ,4 + ,27 + ,0 + ,1 + ,0 + ,261 + ,9056 + ,14 + ,99 + ,18 + ,0 + ,12 + ,934 + ,76611 + ,24 + ,260 + ,48 + ,1 + ,60 + ,1180 + ,132697 + ,51 + ,290 + ,54 + ,0 + ,80 + ,1147 + ,100681 + ,19 + ,414 + ,50 + ,1 + ,88) + ,dim=c(7 + ,144) + ,dimnames=list(c('page_views' + ,'time_spent_seconds' + ,'number_logins' + ,'number_course_compenium_views' + ,'number_compendium_views' + ,'number_compediums_shared' + ,'number_feedbackmessage_PR') + ,1:144)) > y <- array(NA,dim=c(7,144),dimnames=list(c('page_views','time_spent_seconds','number_logins','number_course_compenium_views','number_compendium_views','number_compediums_shared','number_feedbackmessage_PR'),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 = 'Do not include Seasonal Dummies' > par1 = '1' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Prof. Dr. P. Wessa > #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/ > #Source of accompanying publication: Office for Research, Development, and Education > #Technical description: Write here your technical program description (don't use hard returns!) > library(lattice) > library(lmtest) Loading required package: zoo > n25 <- 25 #minimum number of obs. for Goldfeld-Quandt test > par1 <- as.numeric(par1) > x <- t(y) > k <- length(x[1,]) > n <- length(x[,1]) > x1 <- cbind(x[,par1], x[,1:k!=par1]) > mycolnames <- c(colnames(x)[par1], colnames(x)[1:k!=par1]) > colnames(x1) <- mycolnames #colnames(x)[par1] > x <- x1 > if (par3 == 'First Differences'){ + x2 <- array(0, dim=c(n-1,k), dimnames=list(1:(n-1), paste('(1-B)',colnames(x),sep=''))) + for (i in 1:n-1) { + for (j in 1:k) { + x2[i,j] <- x[i+1,j] - x[i,j] + } + } + x <- x2 + } > if (par2 == 'Include Monthly Dummies'){ + x2 <- array(0, dim=c(n,11), dimnames=list(1:n, paste('M', seq(1:11), sep =''))) + for (i in 1:11){ + x2[seq(i,n,12),i] <- 1 + } + x <- cbind(x, x2) + } > if (par2 == 'Include Quarterly Dummies'){ + x2 <- array(0, dim=c(n,3), dimnames=list(1:n, paste('Q', seq(1:3), sep =''))) + for (i in 1:3){ + x2[seq(i,n,4),i] <- 1 + } + x <- cbind(x, x2) + } > k <- length(x[1,]) > if (par3 == 'Linear Trend'){ + x <- cbind(x, c(1:n)) + colnames(x)[k+1] <- 't' + } > x page_views time_spent_seconds number_logins number_course_compenium_views 1 1801 159261 91 586 2 1717 189672 59 520 3 192 7215 18 72 4 2295 129098 95 645 5 3450 230632 136 1163 6 6861 515038 263 1945 7 1795 180745 56 585 8 1681 185559 59 470 9 1897 154581 44 612 10 2974 298001 96 992 11 1946 121844 75 634 12 2148 184039 69 677 13 1832 100324 98 665 14 3183 220269 119 1079 15 1476 168265 58 413 16 1567 154647 88 469 17 1756 142018 57 431 18 1247 79030 61 361 19 2779 167047 87 877 20 726 27997 24 221 21 1048 73019 59 366 22 2805 241082 100 846 23 1760 195820 72 642 24 2266 142001 54 689 25 1848 145433 86 576 26 1665 183744 32 610 27 2084 202357 163 673 28 1440 199532 93 361 29 2741 354924 118 907 30 2112 192399 44 882 31 1684 182286 44 490 32 1616 181590 45 548 33 2227 133801 105 723 34 3088 233686 123 918 35 2389 219428 53 787 36 1 0 1 0 37 2099 223044 63 983 38 1669 100129 51 539 39 2137 145864 49 515 40 2153 249965 64 795 41 2390 242379 71 753 42 1701 145794 59 635 43 983 96404 32 361 44 2161 195891 78 804 45 1276 117156 50 394 46 1190 157787 95 320 47 745 81293 32 212 48 2330 237435 101 772 49 2289 233155 89 740 50 2639 160344 59 938 51 658 48188 28 205 52 1917 161922 69 492 53 2557 307432 74 818 54 2026 235223 79 680 55 1911 195583 59 691 56 1716 146061 56 534 57 1852 208834 67 487 58 981 93764 24 301 59 1177 151985 66 421 60 2833 193222 96 947 61 1688 148922 60 492 62 2097 132856 80 790 63 1331 129561 61 362 64 1244 112718 37 430 65 1256 160930 35 416 66 1294 99184 41 409 67 2303 192535 70 498 68 2897 138708 65 887 69 1103 114408 38 267 70 340 31970 15 101 71 2791 225558 112 1000 72 1338 139220 72 416 73 1441 113612 68 480 74 1623 108641 71 454 75 2650 162203 67 671 76 1499 100098 44 413 77 2302 174768 60 677 78 2540 158459 97 820 79 1000 80934 30 316 80 1234 84971 71 395 81 927 80545 68 217 82 2176 287191 64 818 83 957 62974 28 292 84 1551 134091 40 513 85 1014 75555 46 345 86 1771 162154 54 557 87 2613 226638 227 645 88 1205 115367 112 284 89 1337 108749 62 424 90 1524 155537 52 614 91 1829 153133 41 672 92 2229 165618 78 649 93 1233 151517 57 415 94 1365 133686 58 505 95 950 61342 40 387 96 2319 245196 117 730 97 1857 195576 70 563 98 223 19349 12 67 99 2390 225371 105 812 100 1985 153213 78 811 101 700 59117 29 281 102 1062 91762 24 338 103 1311 136769 54 413 104 1157 114798 61 298 105 823 85338 40 223 106 596 27676 22 194 107 1545 153535 48 371 108 1130 122417 37 268 109 0 0 0 0 110 1082 91529 32 332 111 1135 107205 67 371 112 1367 144664 45 465 113 1506 146445 63 447 114 870 76656 60 295 115 78 3616 5 14 116 0 0 0 0 117 1130 183088 44 388 118 1582 144677 84 564 119 2034 159104 98 562 120 919 113273 38 288 121 778 43410 19 292 122 1752 175774 73 530 123 957 95401 42 256 124 2098 134837 55 602 125 731 60493 40 174 126 285 19764 12 75 127 1834 164062 56 565 128 1148 132696 33 377 129 1646 155367 54 544 130 256 11796 9 79 131 98 10674 9 33 132 1404 142261 57 479 133 41 6836 3 11 134 1824 162563 63 626 135 42 5118 3 6 136 528 40248 16 183 137 0 0 0 0 138 1073 122641 47 334 139 1305 88837 38 269 140 81 7131 4 27 141 261 9056 14 99 142 934 76611 24 260 143 1180 132697 51 290 144 1147 100681 19 414 number_compendium_views number_compediums_shared number_feedbackmessage_PR 1 111 0 74 2 76 1 80 3 1 0 0 4 155 0 84 5 125 0 124 6 278 1 140 7 89 1 88 8 59 0 115 9 87 0 109 10 129 1 104 11 158 2 63 12 120 0 118 13 87 0 71 14 264 4 112 15 51 4 63 16 85 3 86 17 96 0 132 18 72 5 54 19 147 0 134 20 49 0 57 21 40 0 59 22 99 0 113 23 127 0 96 24 164 1 96 25 41 1 78 26 160 0 80 27 92 0 93 28 59 0 109 29 89 0 115 30 90 0 79 31 76 0 103 32 116 2 71 33 92 4 66 34 344 0 100 35 84 1 96 36 0 0 0 37 61 0 109 38 138 3 51 39 270 9 119 40 64 0 136 41 96 2 84 42 62 0 136 43 35 2 84 44 59 1 92 45 56 2 103 46 40 2 82 47 49 1 106 48 121 0 96 49 113 1 124 50 172 8 97 51 37 0 82 52 51 0 79 53 89 0 97 54 73 0 107 55 49 1 126 56 74 8 40 57 58 0 96 58 72 1 100 59 32 0 91 60 59 10 136 61 70 6 124 62 85 0 79 63 87 11 74 64 48 3 96 65 56 0 97 66 41 0 122 67 86 8 144 68 152 2 90 69 48 0 93 70 40 0 78 71 135 3 72 72 83 1 45 73 62 2 120 74 91 1 59 75 91 0 133 76 82 2 117 77 112 1 123 78 69 0 110 79 78 0 75 80 105 0 114 81 49 0 94 82 60 0 116 83 49 1 86 84 132 0 90 85 49 0 87 86 71 0 99 87 100 0 132 88 74 0 96 89 49 7 91 90 72 0 77 91 59 5 104 92 90 1 97 93 68 0 94 94 81 0 60 95 33 0 46 96 166 0 135 97 94 0 90 98 15 0 2 99 104 3 96 100 61 0 109 101 11 0 15 102 45 0 68 103 84 0 88 104 66 1 84 105 27 1 46 106 59 0 59 107 127 0 116 108 48 0 29 109 0 0 0 110 58 0 91 111 57 0 76 112 59 0 83 113 76 1 84 114 71 0 65 115 5 0 0 116 0 0 0 117 70 0 84 118 76 0 114 119 122 2 124 120 56 0 92 121 63 0 3 122 92 1 109 123 54 0 74 124 64 8 121 125 29 3 48 126 19 1 8 127 64 3 80 128 79 0 107 129 97 0 116 130 22 0 8 131 7 0 0 132 37 0 56 133 5 0 4 134 48 6 70 135 1 0 0 136 34 1 14 137 0 0 0 138 49 0 91 139 44 0 89 140 0 1 0 141 18 0 12 142 48 1 60 143 54 0 80 144 50 1 88 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) time_spent_seconds -57.486955 0.001307 number_logins number_course_compenium_views 3.688767 1.941027 number_compendium_views number_compediums_shared 1.924615 18.608580 number_feedbackmessage_PR 1.091017 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -511.72 -99.98 -8.22 68.91 793.63 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) -57.486955 35.926502 -1.600 0.11187 time_spent_seconds 0.001307 0.000438 2.984 0.00337 ** number_logins 3.688767 0.637222 5.789 4.62e-08 *** number_course_compenium_views 1.941027 0.122191 15.885 < 2e-16 *** number_compendium_views 1.924615 0.392627 4.902 2.64e-06 *** number_compediums_shared 18.608580 6.680595 2.785 0.00610 ** number_feedbackmessage_PR 1.091017 0.559025 1.952 0.05302 . --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 171.9 on 137 degrees of freedom Multiple R-squared: 0.9636, Adjusted R-squared: 0.962 F-statistic: 604.3 on 6 and 137 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.9277846 1.444307e-01 7.221536e-02 [2,] 0.8627197 2.745605e-01 1.372803e-01 [3,] 0.7788007 4.423986e-01 2.211993e-01 [4,] 0.7434471 5.131057e-01 2.565529e-01 [5,] 0.6611103 6.777795e-01 3.388897e-01 [6,] 0.7132958 5.734084e-01 2.867042e-01 [7,] 0.6578037 6.843926e-01 3.421963e-01 [8,] 0.7230608 5.538783e-01 2.769392e-01 [9,] 0.7810693 4.378615e-01 2.189307e-01 [10,] 0.7893558 4.212884e-01 2.106442e-01 [11,] 0.7828545 4.342911e-01 2.171455e-01 [12,] 0.7387272 5.225457e-01 2.612728e-01 [13,] 0.7044521 5.910957e-01 2.955479e-01 [14,] 0.8875074 2.249853e-01 1.124926e-01 [15,] 0.9254894 1.490212e-01 7.451062e-02 [16,] 0.9021182 1.957635e-01 9.788176e-02 [17,] 0.8915199 2.169602e-01 1.084801e-01 [18,] 0.9763820 4.723593e-02 2.361797e-02 [19,] 0.9658880 6.822404e-02 3.411202e-02 [20,] 0.9800581 3.988387e-02 1.994193e-02 [21,] 0.9889361 2.212786e-02 1.106393e-02 [22,] 0.9870421 2.591585e-02 1.295793e-02 [23,] 0.9824200 3.516002e-02 1.758001e-02 [24,] 0.9752586 4.948282e-02 2.474141e-02 [25,] 0.9670272 6.594565e-02 3.297282e-02 [26,] 0.9619151 7.616984e-02 3.808492e-02 [27,] 0.9630877 7.382457e-02 3.691229e-02 [28,] 0.9985539 2.892146e-03 1.446073e-03 [29,] 0.9978303 4.339465e-03 2.169733e-03 [30,] 0.9968791 6.241878e-03 3.120939e-03 [31,] 0.9967004 6.599235e-03 3.299617e-03 [32,] 0.9957579 8.484183e-03 4.242092e-03 [33,] 0.9950808 9.838323e-03 4.919162e-03 [34,] 0.9934711 1.305773e-02 6.528863e-03 [35,] 0.9916180 1.676397e-02 8.381983e-03 [36,] 0.9882220 2.355610e-02 1.177805e-02 [37,] 0.9863415 2.731699e-02 1.365850e-02 [38,] 0.9822138 3.557242e-02 1.778621e-02 [39,] 0.9789686 4.206285e-02 2.103142e-02 [40,] 0.9733890 5.322202e-02 2.661101e-02 [41,] 0.9690083 6.198342e-02 3.099171e-02 [42,] 0.9603098 7.938039e-02 3.969020e-02 [43,] 0.9882603 2.347941e-02 1.173970e-02 [44,] 0.9858517 2.829665e-02 1.414832e-02 [45,] 0.9816542 3.669160e-02 1.834580e-02 [46,] 0.9765347 4.693054e-02 2.346527e-02 [47,] 0.9689698 6.206048e-02 3.103024e-02 [48,] 0.9782432 4.351354e-02 2.175677e-02 [49,] 0.9724480 5.510401e-02 2.755200e-02 [50,] 0.9715810 5.683801e-02 2.841900e-02 [51,] 0.9627021 7.459572e-02 3.729786e-02 [52,] 0.9523901 9.521971e-02 4.760985e-02 [53,] 0.9416077 1.167845e-01 5.839226e-02 [54,] 0.9476919 1.046162e-01 5.230810e-02 [55,] 0.9387879 1.224241e-01 6.121206e-02 [56,] 0.9228762 1.542477e-01 7.712384e-02 [57,] 0.9083034 1.833933e-01 9.169663e-02 [58,] 0.9640666 7.186682e-02 3.593341e-02 [59,] 0.9909578 1.808441e-02 9.042206e-03 [60,] 0.9903746 1.925082e-02 9.625410e-03 [61,] 0.9884976 2.300484e-02 1.150242e-02 [62,] 0.9869812 2.603756e-02 1.301878e-02 [63,] 0.9824858 3.502848e-02 1.751424e-02 [64,] 0.9813821 3.723586e-02 1.861793e-02 [65,] 0.9816856 3.662877e-02 1.831438e-02 [66,] 0.9999456 1.087003e-04 5.435015e-05 [67,] 0.9999306 1.388256e-04 6.941280e-05 [68,] 0.9999773 4.532313e-05 2.266157e-05 [69,] 0.9999970 5.934580e-06 2.967290e-06 [70,] 0.9999945 1.090373e-05 5.451866e-06 [71,] 0.9999948 1.033165e-05 5.165823e-06 [72,] 0.9999907 1.868127e-05 9.340637e-06 [73,] 0.9999900 1.996888e-05 9.984440e-06 [74,] 0.9999831 3.380261e-05 1.690131e-05 [75,] 0.9999703 5.940197e-05 2.970099e-05 [76,] 0.9999497 1.006424e-04 5.032121e-05 [77,] 0.9999476 1.047597e-04 5.237985e-05 [78,] 0.9999552 8.962747e-05 4.481373e-05 [79,] 0.9999264 1.471936e-04 7.359678e-05 [80,] 0.9999592 8.166306e-05 4.083153e-05 [81,] 0.9999568 8.635136e-05 4.317568e-05 [82,] 0.9999537 9.250830e-05 4.625415e-05 [83,] 0.9999973 5.494531e-06 2.747265e-06 [84,] 0.9999974 5.124704e-06 2.562352e-06 [85,] 0.9999959 8.242398e-06 4.121199e-06 [86,] 0.9999919 1.612254e-05 8.061270e-06 [87,] 0.9999931 1.375991e-05 6.879957e-06 [88,] 0.9999896 2.081457e-05 1.040729e-05 [89,] 0.9999818 3.638335e-05 1.819167e-05 [90,] 0.9999715 5.691906e-05 2.845953e-05 [91,] 0.9999601 7.972408e-05 3.986204e-05 [92,] 0.9999280 1.439899e-04 7.199495e-05 [93,] 0.9999009 1.982838e-04 9.914191e-05 [94,] 0.9998332 3.336818e-04 1.668409e-04 [95,] 0.9997009 5.982096e-04 2.991048e-04 [96,] 0.9994975 1.005063e-03 5.025313e-04 [97,] 0.9991626 1.674869e-03 8.374343e-04 [98,] 0.9988177 2.364618e-03 1.182309e-03 [99,] 0.9997757 4.485192e-04 2.242596e-04 [100,] 0.9995971 8.057071e-04 4.028536e-04 [101,] 0.9992679 1.464216e-03 7.321078e-04 [102,] 0.9988795 2.240901e-03 1.120451e-03 [103,] 0.9980151 3.969718e-03 1.984859e-03 [104,] 0.9968651 6.269811e-03 3.134906e-03 [105,] 0.9975770 4.846000e-03 2.423000e-03 [106,] 0.9958801 8.239718e-03 4.119859e-03 [107,] 0.9931020 1.379601e-02 6.898005e-03 [108,] 0.9936246 1.275075e-02 6.375374e-03 [109,] 0.9980555 3.889095e-03 1.944548e-03 [110,] 0.9970076 5.984818e-03 2.992409e-03 [111,] 0.9967080 6.584085e-03 3.292043e-03 [112,] 0.9961826 7.634743e-03 3.817372e-03 [113,] 0.9930478 1.390440e-02 6.952201e-03 [114,] 0.9876501 2.469974e-02 1.234987e-02 [115,] 0.9800458 3.990836e-02 1.995418e-02 [116,] 0.9787678 4.246447e-02 2.123223e-02 [117,] 0.9622312 7.553765e-02 3.776883e-02 [118,] 0.9758720 4.825603e-02 2.412802e-02 [119,] 0.9612199 7.756015e-02 3.878007e-02 [120,] 0.9486622 1.026755e-01 5.133775e-02 [121,] 0.9060233 1.879533e-01 9.397666e-02 [122,] 0.8383873 3.232254e-01 1.616127e-01 [123,] 0.9217432 1.565135e-01 7.825675e-02 [124,] 0.8410673 3.178654e-01 1.589327e-01 [125,] 0.7680220 4.639560e-01 2.319780e-01 > postscript(file="/var/wessaorg/rcomp/tmp/1w5vv1324638944.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/28nho1324638944.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/3mgyp1324638944.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/40uzc1324638944.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/53izq1324638944.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 -117.112566 47.503378 31.982482 191.433692 71.161723 793.630149 7 8 9 10 11 12 -11.679949 127.070774 115.913477 -17.892344 -73.040241 36.702212 13 14 15 16 17 18 -138.796018 -285.404855 56.692293 -125.794785 252.286998 -15.040167 19 20 21 22 23 24 165.882244 72.910743 -59.337467 222.648624 -299.292759 162.384789 25 26 27 28 29 30 97.561516 -214.905072 -309.049957 -39.488321 -157.849397 -215.625342 31 32 33 34 35 36 131.232444 -131.415606 -4.544933 -166.629773 151.645303 54.798188 37 38 39 40 41 42 -511.717301 -15.760533 6.548146 -166.903018 93.639708 -149.921424 43 44 45 46 47 48 -100.463212 -118.335187 -26.178576 -133.925979 -61.842490 -131.432718 49 50 51 52 53 54 -94.221954 -137.092241 -9.352294 369.041420 74.905662 -92.434533 55 56 57 58 59 60 -96.358533 4.613314 227.802789 -23.100123 -185.618832 -2.294131 61 62 63 64 65 66 -7.087019 -97.416289 -161.353032 -69.876810 -46.987559 64.746683 67 68 69 70 71 72 412.557033 383.821019 158.712212 -57.748622 -194.629097 -86.942945 73 74 75 76 77 78 -119.968595 137.274388 625.708421 139.050625 227.349138 188.159757 79 80 81 82 83 84 -4.246358 -174.616503 10.334992 -207.672471 55.388906 -62.273077 85 86 87 88 89 90 -55.805834 91.590370 -51.457787 -99.820204 -123.167230 -227.946181 91 92 93 94 95 96 -89.288275 224.964716 -156.721407 -167.727558 -85.098150 -259.228798 97 98 99 100 101 102 28.803142 49.837612 -171.171658 -255.941343 -9.702309 94.183706 103 104 105 106 107 108 -68.749014 23.756613 67.812880 -18.312719 133.691019 246.819381 109 110 111 112 113 114 57.486955 46.510813 -107.490636 -37.229748 15.565578 -174.175100 115 116 117 118 119 120 75.520503 57.486955 -193.553801 -224.810295 23.917087 -78.872108 121 122 123 124 125 126 17.371226 -32.821917 53.327248 203.852846 60.140684 62.913958 127 128 129 130 131 132 107.567254 -90.191846 -67.894730 60.462976 30.813736 3.269757 133 134 135 136 137 138 43.149352 -58.819685 68.161991 19.345432 57.486955 -45.036449 139 140 141 142 143 144 402.307289 43.397230 15.113458 121.727906 121.851220 -11.597299 > postscript(file="/var/wessaorg/rcomp/tmp/6utk71324638944.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 -117.112566 NA 1 47.503378 -117.112566 2 31.982482 47.503378 3 191.433692 31.982482 4 71.161723 191.433692 5 793.630149 71.161723 6 -11.679949 793.630149 7 127.070774 -11.679949 8 115.913477 127.070774 9 -17.892344 115.913477 10 -73.040241 -17.892344 11 36.702212 -73.040241 12 -138.796018 36.702212 13 -285.404855 -138.796018 14 56.692293 -285.404855 15 -125.794785 56.692293 16 252.286998 -125.794785 17 -15.040167 252.286998 18 165.882244 -15.040167 19 72.910743 165.882244 20 -59.337467 72.910743 21 222.648624 -59.337467 22 -299.292759 222.648624 23 162.384789 -299.292759 24 97.561516 162.384789 25 -214.905072 97.561516 26 -309.049957 -214.905072 27 -39.488321 -309.049957 28 -157.849397 -39.488321 29 -215.625342 -157.849397 30 131.232444 -215.625342 31 -131.415606 131.232444 32 -4.544933 -131.415606 33 -166.629773 -4.544933 34 151.645303 -166.629773 35 54.798188 151.645303 36 -511.717301 54.798188 37 -15.760533 -511.717301 38 6.548146 -15.760533 39 -166.903018 6.548146 40 93.639708 -166.903018 41 -149.921424 93.639708 42 -100.463212 -149.921424 43 -118.335187 -100.463212 44 -26.178576 -118.335187 45 -133.925979 -26.178576 46 -61.842490 -133.925979 47 -131.432718 -61.842490 48 -94.221954 -131.432718 49 -137.092241 -94.221954 50 -9.352294 -137.092241 51 369.041420 -9.352294 52 74.905662 369.041420 53 -92.434533 74.905662 54 -96.358533 -92.434533 55 4.613314 -96.358533 56 227.802789 4.613314 57 -23.100123 227.802789 58 -185.618832 -23.100123 59 -2.294131 -185.618832 60 -7.087019 -2.294131 61 -97.416289 -7.087019 62 -161.353032 -97.416289 63 -69.876810 -161.353032 64 -46.987559 -69.876810 65 64.746683 -46.987559 66 412.557033 64.746683 67 383.821019 412.557033 68 158.712212 383.821019 69 -57.748622 158.712212 70 -194.629097 -57.748622 71 -86.942945 -194.629097 72 -119.968595 -86.942945 73 137.274388 -119.968595 74 625.708421 137.274388 75 139.050625 625.708421 76 227.349138 139.050625 77 188.159757 227.349138 78 -4.246358 188.159757 79 -174.616503 -4.246358 80 10.334992 -174.616503 81 -207.672471 10.334992 82 55.388906 -207.672471 83 -62.273077 55.388906 84 -55.805834 -62.273077 85 91.590370 -55.805834 86 -51.457787 91.590370 87 -99.820204 -51.457787 88 -123.167230 -99.820204 89 -227.946181 -123.167230 90 -89.288275 -227.946181 91 224.964716 -89.288275 92 -156.721407 224.964716 93 -167.727558 -156.721407 94 -85.098150 -167.727558 95 -259.228798 -85.098150 96 28.803142 -259.228798 97 49.837612 28.803142 98 -171.171658 49.837612 99 -255.941343 -171.171658 100 -9.702309 -255.941343 101 94.183706 -9.702309 102 -68.749014 94.183706 103 23.756613 -68.749014 104 67.812880 23.756613 105 -18.312719 67.812880 106 133.691019 -18.312719 107 246.819381 133.691019 108 57.486955 246.819381 109 46.510813 57.486955 110 -107.490636 46.510813 111 -37.229748 -107.490636 112 15.565578 -37.229748 113 -174.175100 15.565578 114 75.520503 -174.175100 115 57.486955 75.520503 116 -193.553801 57.486955 117 -224.810295 -193.553801 118 23.917087 -224.810295 119 -78.872108 23.917087 120 17.371226 -78.872108 121 -32.821917 17.371226 122 53.327248 -32.821917 123 203.852846 53.327248 124 60.140684 203.852846 125 62.913958 60.140684 126 107.567254 62.913958 127 -90.191846 107.567254 128 -67.894730 -90.191846 129 60.462976 -67.894730 130 30.813736 60.462976 131 3.269757 30.813736 132 43.149352 3.269757 133 -58.819685 43.149352 134 68.161991 -58.819685 135 19.345432 68.161991 136 57.486955 19.345432 137 -45.036449 57.486955 138 402.307289 -45.036449 139 43.397230 402.307289 140 15.113458 43.397230 141 121.727906 15.113458 142 121.851220 121.727906 143 -11.597299 121.851220 144 NA -11.597299 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 47.503378 -117.112566 [2,] 31.982482 47.503378 [3,] 191.433692 31.982482 [4,] 71.161723 191.433692 [5,] 793.630149 71.161723 [6,] -11.679949 793.630149 [7,] 127.070774 -11.679949 [8,] 115.913477 127.070774 [9,] -17.892344 115.913477 [10,] -73.040241 -17.892344 [11,] 36.702212 -73.040241 [12,] -138.796018 36.702212 [13,] -285.404855 -138.796018 [14,] 56.692293 -285.404855 [15,] -125.794785 56.692293 [16,] 252.286998 -125.794785 [17,] -15.040167 252.286998 [18,] 165.882244 -15.040167 [19,] 72.910743 165.882244 [20,] -59.337467 72.910743 [21,] 222.648624 -59.337467 [22,] -299.292759 222.648624 [23,] 162.384789 -299.292759 [24,] 97.561516 162.384789 [25,] -214.905072 97.561516 [26,] -309.049957 -214.905072 [27,] -39.488321 -309.049957 [28,] -157.849397 -39.488321 [29,] -215.625342 -157.849397 [30,] 131.232444 -215.625342 [31,] -131.415606 131.232444 [32,] -4.544933 -131.415606 [33,] -166.629773 -4.544933 [34,] 151.645303 -166.629773 [35,] 54.798188 151.645303 [36,] -511.717301 54.798188 [37,] -15.760533 -511.717301 [38,] 6.548146 -15.760533 [39,] -166.903018 6.548146 [40,] 93.639708 -166.903018 [41,] -149.921424 93.639708 [42,] -100.463212 -149.921424 [43,] -118.335187 -100.463212 [44,] -26.178576 -118.335187 [45,] -133.925979 -26.178576 [46,] -61.842490 -133.925979 [47,] -131.432718 -61.842490 [48,] -94.221954 -131.432718 [49,] -137.092241 -94.221954 [50,] -9.352294 -137.092241 [51,] 369.041420 -9.352294 [52,] 74.905662 369.041420 [53,] -92.434533 74.905662 [54,] -96.358533 -92.434533 [55,] 4.613314 -96.358533 [56,] 227.802789 4.613314 [57,] -23.100123 227.802789 [58,] -185.618832 -23.100123 [59,] -2.294131 -185.618832 [60,] -7.087019 -2.294131 [61,] -97.416289 -7.087019 [62,] -161.353032 -97.416289 [63,] -69.876810 -161.353032 [64,] -46.987559 -69.876810 [65,] 64.746683 -46.987559 [66,] 412.557033 64.746683 [67,] 383.821019 412.557033 [68,] 158.712212 383.821019 [69,] -57.748622 158.712212 [70,] -194.629097 -57.748622 [71,] -86.942945 -194.629097 [72,] -119.968595 -86.942945 [73,] 137.274388 -119.968595 [74,] 625.708421 137.274388 [75,] 139.050625 625.708421 [76,] 227.349138 139.050625 [77,] 188.159757 227.349138 [78,] -4.246358 188.159757 [79,] -174.616503 -4.246358 [80,] 10.334992 -174.616503 [81,] -207.672471 10.334992 [82,] 55.388906 -207.672471 [83,] -62.273077 55.388906 [84,] -55.805834 -62.273077 [85,] 91.590370 -55.805834 [86,] -51.457787 91.590370 [87,] -99.820204 -51.457787 [88,] -123.167230 -99.820204 [89,] -227.946181 -123.167230 [90,] -89.288275 -227.946181 [91,] 224.964716 -89.288275 [92,] -156.721407 224.964716 [93,] -167.727558 -156.721407 [94,] -85.098150 -167.727558 [95,] -259.228798 -85.098150 [96,] 28.803142 -259.228798 [97,] 49.837612 28.803142 [98,] -171.171658 49.837612 [99,] -255.941343 -171.171658 [100,] -9.702309 -255.941343 [101,] 94.183706 -9.702309 [102,] -68.749014 94.183706 [103,] 23.756613 -68.749014 [104,] 67.812880 23.756613 [105,] -18.312719 67.812880 [106,] 133.691019 -18.312719 [107,] 246.819381 133.691019 [108,] 57.486955 246.819381 [109,] 46.510813 57.486955 [110,] -107.490636 46.510813 [111,] -37.229748 -107.490636 [112,] 15.565578 -37.229748 [113,] -174.175100 15.565578 [114,] 75.520503 -174.175100 [115,] 57.486955 75.520503 [116,] -193.553801 57.486955 [117,] -224.810295 -193.553801 [118,] 23.917087 -224.810295 [119,] -78.872108 23.917087 [120,] 17.371226 -78.872108 [121,] -32.821917 17.371226 [122,] 53.327248 -32.821917 [123,] 203.852846 53.327248 [124,] 60.140684 203.852846 [125,] 62.913958 60.140684 [126,] 107.567254 62.913958 [127,] -90.191846 107.567254 [128,] -67.894730 -90.191846 [129,] 60.462976 -67.894730 [130,] 30.813736 60.462976 [131,] 3.269757 30.813736 [132,] 43.149352 3.269757 [133,] -58.819685 43.149352 [134,] 68.161991 -58.819685 [135,] 19.345432 68.161991 [136,] 57.486955 19.345432 [137,] -45.036449 57.486955 [138,] 402.307289 -45.036449 [139,] 43.397230 402.307289 [140,] 15.113458 43.397230 [141,] 121.727906 15.113458 [142,] 121.851220 121.727906 [143,] -11.597299 121.851220 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 47.503378 -117.112566 2 31.982482 47.503378 3 191.433692 31.982482 4 71.161723 191.433692 5 793.630149 71.161723 6 -11.679949 793.630149 7 127.070774 -11.679949 8 115.913477 127.070774 9 -17.892344 115.913477 10 -73.040241 -17.892344 11 36.702212 -73.040241 12 -138.796018 36.702212 13 -285.404855 -138.796018 14 56.692293 -285.404855 15 -125.794785 56.692293 16 252.286998 -125.794785 17 -15.040167 252.286998 18 165.882244 -15.040167 19 72.910743 165.882244 20 -59.337467 72.910743 21 222.648624 -59.337467 22 -299.292759 222.648624 23 162.384789 -299.292759 24 97.561516 162.384789 25 -214.905072 97.561516 26 -309.049957 -214.905072 27 -39.488321 -309.049957 28 -157.849397 -39.488321 29 -215.625342 -157.849397 30 131.232444 -215.625342 31 -131.415606 131.232444 32 -4.544933 -131.415606 33 -166.629773 -4.544933 34 151.645303 -166.629773 35 54.798188 151.645303 36 -511.717301 54.798188 37 -15.760533 -511.717301 38 6.548146 -15.760533 39 -166.903018 6.548146 40 93.639708 -166.903018 41 -149.921424 93.639708 42 -100.463212 -149.921424 43 -118.335187 -100.463212 44 -26.178576 -118.335187 45 -133.925979 -26.178576 46 -61.842490 -133.925979 47 -131.432718 -61.842490 48 -94.221954 -131.432718 49 -137.092241 -94.221954 50 -9.352294 -137.092241 51 369.041420 -9.352294 52 74.905662 369.041420 53 -92.434533 74.905662 54 -96.358533 -92.434533 55 4.613314 -96.358533 56 227.802789 4.613314 57 -23.100123 227.802789 58 -185.618832 -23.100123 59 -2.294131 -185.618832 60 -7.087019 -2.294131 61 -97.416289 -7.087019 62 -161.353032 -97.416289 63 -69.876810 -161.353032 64 -46.987559 -69.876810 65 64.746683 -46.987559 66 412.557033 64.746683 67 383.821019 412.557033 68 158.712212 383.821019 69 -57.748622 158.712212 70 -194.629097 -57.748622 71 -86.942945 -194.629097 72 -119.968595 -86.942945 73 137.274388 -119.968595 74 625.708421 137.274388 75 139.050625 625.708421 76 227.349138 139.050625 77 188.159757 227.349138 78 -4.246358 188.159757 79 -174.616503 -4.246358 80 10.334992 -174.616503 81 -207.672471 10.334992 82 55.388906 -207.672471 83 -62.273077 55.388906 84 -55.805834 -62.273077 85 91.590370 -55.805834 86 -51.457787 91.590370 87 -99.820204 -51.457787 88 -123.167230 -99.820204 89 -227.946181 -123.167230 90 -89.288275 -227.946181 91 224.964716 -89.288275 92 -156.721407 224.964716 93 -167.727558 -156.721407 94 -85.098150 -167.727558 95 -259.228798 -85.098150 96 28.803142 -259.228798 97 49.837612 28.803142 98 -171.171658 49.837612 99 -255.941343 -171.171658 100 -9.702309 -255.941343 101 94.183706 -9.702309 102 -68.749014 94.183706 103 23.756613 -68.749014 104 67.812880 23.756613 105 -18.312719 67.812880 106 133.691019 -18.312719 107 246.819381 133.691019 108 57.486955 246.819381 109 46.510813 57.486955 110 -107.490636 46.510813 111 -37.229748 -107.490636 112 15.565578 -37.229748 113 -174.175100 15.565578 114 75.520503 -174.175100 115 57.486955 75.520503 116 -193.553801 57.486955 117 -224.810295 -193.553801 118 23.917087 -224.810295 119 -78.872108 23.917087 120 17.371226 -78.872108 121 -32.821917 17.371226 122 53.327248 -32.821917 123 203.852846 53.327248 124 60.140684 203.852846 125 62.913958 60.140684 126 107.567254 62.913958 127 -90.191846 107.567254 128 -67.894730 -90.191846 129 60.462976 -67.894730 130 30.813736 60.462976 131 3.269757 30.813736 132 43.149352 3.269757 133 -58.819685 43.149352 134 68.161991 -58.819685 135 19.345432 68.161991 136 57.486955 19.345432 137 -45.036449 57.486955 138 402.307289 -45.036449 139 43.397230 402.307289 140 15.113458 43.397230 141 121.727906 15.113458 142 121.851220 121.727906 143 -11.597299 121.851220 > 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/79i5a1324638944.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/865n21324638944.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/9ajxi1324638944.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/107f6t1324638944.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/11v5iv1324638944.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/120i831324638944.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/1307tv1324638944.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/141e2b1324638944.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/15w8l31324638944.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/16d96n1324638945.tab") + } > > try(system("convert tmp/1w5vv1324638944.ps tmp/1w5vv1324638944.png",intern=TRUE)) character(0) > try(system("convert tmp/28nho1324638944.ps tmp/28nho1324638944.png",intern=TRUE)) character(0) > try(system("convert tmp/3mgyp1324638944.ps tmp/3mgyp1324638944.png",intern=TRUE)) character(0) > try(system("convert tmp/40uzc1324638944.ps tmp/40uzc1324638944.png",intern=TRUE)) character(0) > try(system("convert tmp/53izq1324638944.ps tmp/53izq1324638944.png",intern=TRUE)) character(0) > try(system("convert tmp/6utk71324638944.ps tmp/6utk71324638944.png",intern=TRUE)) character(0) > try(system("convert tmp/79i5a1324638944.ps tmp/79i5a1324638944.png",intern=TRUE)) character(0) > try(system("convert tmp/865n21324638944.ps tmp/865n21324638944.png",intern=TRUE)) character(0) > try(system("convert tmp/9ajxi1324638944.ps tmp/9ajxi1324638944.png",intern=TRUE)) character(0) > try(system("convert tmp/107f6t1324638944.ps tmp/107f6t1324638944.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 4.756 0.735 5.577