R version 2.9.0 (2009-04-17) Copyright (C) 2009 The R Foundation for Statistical Computing ISBN 3-900051-07-0 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > x <- array(list(14 + ,12 + ,53 + ,18 + ,11 + ,86 + ,11 + ,14 + ,66 + ,12 + ,12 + ,67 + ,16 + ,21 + ,76 + ,18 + ,12 + ,78 + ,14 + ,22 + ,53 + ,14 + ,11 + ,80 + ,15 + ,10 + ,74 + ,15 + ,13 + ,76 + ,17 + ,10 + ,79 + ,19 + ,8 + ,54 + ,10 + ,15 + ,67 + ,16 + ,14 + ,54 + ,18 + ,10 + ,87 + ,14 + ,14 + ,58 + ,14 + ,14 + ,75 + ,17 + ,11 + ,88 + ,14 + ,10 + ,64 + ,16 + ,13 + ,57 + ,18 + ,7 + ,66 + ,11 + ,14 + ,68 + ,14 + ,12 + ,54 + ,12 + ,14 + ,56 + ,17 + ,11 + ,86 + ,9 + ,9 + ,80 + ,16 + ,11 + ,76 + ,14 + ,15 + ,69 + ,15 + ,14 + ,78 + ,11 + ,13 + ,67 + ,16 + ,9 + ,80 + ,13 + ,15 + ,54 + ,17 + ,10 + ,71 + ,15 + ,11 + ,84 + ,14 + ,13 + ,74 + ,16 + ,8 + ,71 + ,9 + ,20 + ,63 + ,15 + ,12 + ,71 + ,17 + ,10 + ,76 + ,13 + ,10 + ,69 + ,15 + ,9 + ,74 + ,16 + ,14 + ,75 + ,16 + ,8 + ,54 + ,12 + ,14 + ,52 + ,12 + ,11 + ,69 + ,11 + ,13 + ,68 + ,15 + ,9 + ,65 + ,15 + ,11 + ,75 + ,17 + ,15 + ,74 + ,13 + ,11 + ,75 + ,16 + ,10 + ,72 + ,14 + ,14 + ,67 + ,11 + ,18 + ,63 + ,12 + ,14 + ,62 + ,12 + ,11 + ,63 + ,15 + ,12 + ,76 + ,16 + ,13 + ,74 + ,15 + ,9 + ,67 + ,12 + ,10 + ,73 + ,12 + ,15 + ,70 + ,8 + ,20 + ,53 + ,13 + ,12 + ,77 + ,11 + ,12 + ,77 + ,14 + ,14 + ,52 + ,15 + ,13 + ,54 + ,10 + ,11 + ,80 + ,11 + ,17 + ,66 + ,12 + ,12 + ,73 + ,15 + ,13 + ,63 + ,15 + ,14 + ,69 + ,14 + ,13 + ,67 + ,16 + ,15 + ,54 + ,15 + ,13 + ,81 + ,15 + ,10 + ,69 + ,13 + ,11 + ,84 + ,12 + ,19 + ,80 + ,17 + ,13 + ,70 + ,13 + ,17 + ,69 + ,15 + ,13 + ,77 + ,13 + ,9 + ,54 + ,15 + ,11 + ,79 + ,16 + ,10 + ,30 + ,15 + ,9 + ,71 + ,16 + ,12 + ,73 + ,15 + ,12 + ,72 + ,14 + ,13 + ,77 + ,15 + ,13 + ,75 + ,14 + ,12 + ,69 + ,13 + ,15 + ,54 + ,7 + ,22 + ,70 + ,17 + ,13 + ,73 + ,13 + ,15 + ,54 + ,15 + ,13 + ,77 + ,14 + ,15 + ,82 + ,13 + ,10 + ,80 + ,16 + ,11 + ,80 + ,12 + ,16 + ,69 + ,14 + ,11 + ,78 + ,17 + ,11 + ,81 + ,15 + ,10 + ,76 + ,17 + ,10 + ,76 + ,12 + ,16 + ,73 + ,16 + ,12 + ,85 + ,11 + ,11 + ,66 + ,15 + ,16 + ,79 + ,9 + ,19 + ,68 + ,16 + ,11 + ,76 + ,15 + ,16 + ,71 + ,10 + ,15 + ,54 + ,10 + ,24 + ,46 + ,15 + ,14 + ,82 + ,11 + ,15 + ,74 + ,13 + ,11 + ,88 + ,14 + ,15 + ,38 + ,18 + ,12 + ,76 + ,16 + ,10 + ,86 + ,14 + ,14 + ,54 + ,14 + ,13 + ,70 + ,14 + ,9 + ,69 + ,14 + ,15 + ,90 + ,12 + ,15 + ,54 + ,14 + ,14 + ,76 + ,15 + ,11 + ,89 + ,15 + ,8 + ,76 + ,15 + ,11 + ,73 + ,13 + ,11 + ,79 + ,17 + ,8 + ,90 + ,17 + ,10 + ,74 + ,19 + ,11 + ,81 + ,15 + ,13 + ,72 + ,13 + ,11 + ,71 + ,9 + ,20 + ,66 + ,15 + ,10 + ,77 + ,15 + ,15 + ,65 + ,15 + ,12 + ,74 + ,16 + ,14 + ,82 + ,11 + ,23 + ,54 + ,14 + ,14 + ,63 + ,11 + ,16 + ,54 + ,15 + ,11 + ,64 + ,13 + ,12 + ,69 + ,15 + ,10 + ,54 + ,16 + ,14 + ,84 + ,14 + ,12 + ,86 + ,15 + ,12 + ,77 + ,16 + ,11 + ,89 + ,16 + ,12 + ,76 + ,11 + ,13 + ,60 + ,12 + ,11 + ,75 + ,9 + ,19 + ,73 + ,16 + ,12 + ,85 + ,13 + ,17 + ,79 + ,16 + ,9 + ,71 + ,12 + ,12 + ,72 + ,9 + ,19 + ,69 + ,13 + ,18 + ,78 + ,13 + ,15 + ,54 + ,14 + ,14 + ,69 + ,19 + ,11 + ,81 + ,13 + ,9 + ,84 + ,12 + ,18 + ,84 + ,13 + ,16 + ,69) + ,dim=c(3 + ,162) + ,dimnames=list(c('Happiness' + ,'Depression' + ,'Belonging') + ,1:162)) > y <- array(NA,dim=c(3,162),dimnames=list(c('Happiness','Depression','Belonging'),1:162)) > for (i in 1:dim(x)[1]) + { + for (j in 1:dim(x)[2]) + { + y[i,j] <- as.numeric(x[i,j]) + } + } > par3 = 'No Linear Trend' > par2 = 'Do not include Seasonal Dummies' > par1 = '3' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Prof. Dr. P. Wessa > #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/ > #Source of accompanying publication: Office for Research, Development, and Education > #Technical description: Write here your technical program description (don't use hard returns!) > library(lattice) > library(lmtest) Loading required package: zoo Attaching package: 'zoo' The following object(s) are masked from package:base : as.Date.numeric > n25 <- 25 #minimum number of obs. for Goldfeld-Quandt test > par1 <- as.numeric(par1) > x <- t(y) > k <- length(x[1,]) > n <- length(x[,1]) > x1 <- cbind(x[,par1], x[,1:k!=par1]) > mycolnames <- c(colnames(x)[par1], colnames(x)[1:k!=par1]) > colnames(x1) <- mycolnames #colnames(x)[par1] > x <- x1 > if (par3 == 'First Differences'){ + x2 <- array(0, dim=c(n-1,k), dimnames=list(1:(n-1), paste('(1-B)',colnames(x),sep=''))) + for (i in 1:n-1) { + for (j in 1:k) { + x2[i,j] <- x[i+1,j] - x[i,j] + } + } + x <- x2 + } > if (par2 == 'Include Monthly Dummies'){ + x2 <- array(0, dim=c(n,11), dimnames=list(1:n, paste('M', seq(1:11), sep =''))) + for (i in 1:11){ + x2[seq(i,n,12),i] <- 1 + } + x <- cbind(x, x2) + } > if (par2 == 'Include Quarterly Dummies'){ + x2 <- array(0, dim=c(n,3), dimnames=list(1:n, paste('Q', seq(1:3), sep =''))) + for (i in 1:3){ + x2[seq(i,n,4),i] <- 1 + } + x <- cbind(x, x2) + } > k <- length(x[1,]) > if (par3 == 'Linear Trend'){ + x <- cbind(x, c(1:n)) + colnames(x)[k+1] <- 't' + } > x Belonging Happiness Depression 1 53 14 12 2 86 18 11 3 66 11 14 4 67 12 12 5 76 16 21 6 78 18 12 7 53 14 22 8 80 14 11 9 74 15 10 10 76 15 13 11 79 17 10 12 54 19 8 13 67 10 15 14 54 16 14 15 87 18 10 16 58 14 14 17 75 14 14 18 88 17 11 19 64 14 10 20 57 16 13 21 66 18 7 22 68 11 14 23 54 14 12 24 56 12 14 25 86 17 11 26 80 9 9 27 76 16 11 28 69 14 15 29 78 15 14 30 67 11 13 31 80 16 9 32 54 13 15 33 71 17 10 34 84 15 11 35 74 14 13 36 71 16 8 37 63 9 20 38 71 15 12 39 76 17 10 40 69 13 10 41 74 15 9 42 75 16 14 43 54 16 8 44 52 12 14 45 69 12 11 46 68 11 13 47 65 15 9 48 75 15 11 49 74 17 15 50 75 13 11 51 72 16 10 52 67 14 14 53 63 11 18 54 62 12 14 55 63 12 11 56 76 15 12 57 74 16 13 58 67 15 9 59 73 12 10 60 70 12 15 61 53 8 20 62 77 13 12 63 77 11 12 64 52 14 14 65 54 15 13 66 80 10 11 67 66 11 17 68 73 12 12 69 63 15 13 70 69 15 14 71 67 14 13 72 54 16 15 73 81 15 13 74 69 15 10 75 84 13 11 76 80 12 19 77 70 17 13 78 69 13 17 79 77 15 13 80 54 13 9 81 79 15 11 82 30 16 10 83 71 15 9 84 73 16 12 85 72 15 12 86 77 14 13 87 75 15 13 88 69 14 12 89 54 13 15 90 70 7 22 91 73 17 13 92 54 13 15 93 77 15 13 94 82 14 15 95 80 13 10 96 80 16 11 97 69 12 16 98 78 14 11 99 81 17 11 100 76 15 10 101 76 17 10 102 73 12 16 103 85 16 12 104 66 11 11 105 79 15 16 106 68 9 19 107 76 16 11 108 71 15 16 109 54 10 15 110 46 10 24 111 82 15 14 112 74 11 15 113 88 13 11 114 38 14 15 115 76 18 12 116 86 16 10 117 54 14 14 118 70 14 13 119 69 14 9 120 90 14 15 121 54 12 15 122 76 14 14 123 89 15 11 124 76 15 8 125 73 15 11 126 79 13 11 127 90 17 8 128 74 17 10 129 81 19 11 130 72 15 13 131 71 13 11 132 66 9 20 133 77 15 10 134 65 15 15 135 74 15 12 136 82 16 14 137 54 11 23 138 63 14 14 139 54 11 16 140 64 15 11 141 69 13 12 142 54 15 10 143 84 16 14 144 86 14 12 145 77 15 12 146 89 16 11 147 76 16 12 148 60 11 13 149 75 12 11 150 73 9 19 151 85 16 12 152 79 13 17 153 71 16 9 154 72 12 12 155 69 9 19 156 78 13 18 157 54 13 15 158 69 14 14 159 81 19 11 160 84 13 9 161 84 12 18 162 69 13 16 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) Happiness Depression 65.5916 0.8897 -0.5705 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -44.122 -4.177 1.215 6.361 20.510 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 65.5916 8.5983 7.628 2.05e-12 *** Happiness 0.8897 0.4110 2.165 0.0319 * Depression -0.5705 0.3035 -1.880 0.0619 . --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 10.23 on 159 degrees of freedom Multiple R-squared: 0.1016, Adjusted R-squared: 0.09025 F-statistic: 8.986 on 2 and 159 DF, p-value: 0.0002007 > 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.62780061 0.74439878 0.3721994 [2,] 0.66640621 0.66718759 0.3335938 [3,] 0.63591843 0.72816313 0.3640816 [4,] 0.51073579 0.97852841 0.4892642 [5,] 0.40714807 0.81429614 0.5928519 [6,] 0.30386508 0.60773015 0.6961349 [7,] 0.81476963 0.37046074 0.1852304 [8,] 0.74931509 0.50136982 0.2506849 [9,] 0.81935826 0.36128348 0.1806417 [10,] 0.84051998 0.31896005 0.1594800 [11,] 0.83199133 0.33601734 0.1680087 [12,] 0.80039435 0.39921129 0.1996056 [13,] 0.83379471 0.33241058 0.1662053 [14,] 0.80531004 0.38937992 0.1946900 [15,] 0.83746463 0.32507074 0.1625354 [16,] 0.83073448 0.33853104 0.1692655 [17,] 0.78810245 0.42379509 0.2118975 [18,] 0.82767785 0.34464429 0.1723221 [19,] 0.81619204 0.36761592 0.1838080 [20,] 0.83923902 0.32152195 0.1607610 [21,] 0.86791444 0.26417113 0.1320856 [22,] 0.83743945 0.32512110 0.1625605 [23,] 0.79834711 0.40330578 0.2016529 [24,] 0.78372676 0.43254648 0.2162732 [25,] 0.73765302 0.52469397 0.2623470 [26,] 0.70449973 0.59100054 0.2955003 [27,] 0.72873245 0.54253510 0.2712675 [28,] 0.68394699 0.63210602 0.3160530 [29,] 0.70217764 0.59564472 0.2978224 [30,] 0.66185116 0.67629767 0.3381488 [31,] 0.61797720 0.76404560 0.3820228 [32,] 0.56977336 0.86045328 0.4302266 [33,] 0.51563098 0.96873805 0.4843690 [34,] 0.46297117 0.92594234 0.5370288 [35,] 0.41154264 0.82308527 0.5884574 [36,] 0.36038389 0.72076778 0.6396161 [37,] 0.32074540 0.64149079 0.6792546 [38,] 0.47426341 0.94852682 0.5257366 [39,] 0.53221509 0.93556981 0.4677849 [40,] 0.48175712 0.96351423 0.5182429 [41,] 0.43280537 0.86561073 0.5671946 [42,] 0.41146802 0.82293604 0.5885320 [43,] 0.36962492 0.73924985 0.6303751 [44,] 0.32704965 0.65409929 0.6729504 [45,] 0.29588389 0.59176779 0.7041161 [46,] 0.25533475 0.51066951 0.7446652 [47,] 0.21883800 0.43767600 0.7811620 [48,] 0.18458103 0.36916206 0.8154190 [49,] 0.16139872 0.32279743 0.8386013 [50,] 0.14252560 0.28505119 0.8574744 [51,] 0.12325161 0.24650321 0.8767484 [52,] 0.10170389 0.20340779 0.8982961 [53,] 0.08862735 0.17725469 0.9113727 [54,] 0.07369648 0.14739296 0.9263035 [55,] 0.06022646 0.12045293 0.9397735 [56,] 0.05320241 0.10640482 0.9467976 [57,] 0.04867118 0.09734237 0.9513288 [58,] 0.04783978 0.09567957 0.9521602 [59,] 0.07598862 0.15197723 0.9240114 [60,] 0.11048926 0.22097851 0.8895107 [61,] 0.12219674 0.24439348 0.8778033 [62,] 0.10095752 0.20191505 0.8990425 [63,] 0.08497602 0.16995204 0.9150240 [64,] 0.07805554 0.15611108 0.9219445 [65,] 0.06313982 0.12627963 0.9368602 [66,] 0.05126378 0.10252756 0.9487362 [67,] 0.07489509 0.14979018 0.9251049 [68,] 0.07691698 0.15383396 0.9230830 [69,] 0.06395249 0.12790498 0.9360475 [70,] 0.07669773 0.15339546 0.9233023 [71,] 0.10267434 0.20534869 0.8973257 [72,] 0.08637860 0.17275719 0.9136214 [73,] 0.07080207 0.14160415 0.9291979 [74,] 0.06160228 0.12320456 0.9383977 [75,] 0.09657389 0.19314777 0.9034261 [76,] 0.08637814 0.17275629 0.9136219 [77,] 0.75752770 0.48494460 0.2424723 [78,] 0.72797087 0.54405826 0.2720291 [79,] 0.69269912 0.61460177 0.3073009 [80,] 0.65464971 0.69070058 0.3453503 [81,] 0.62878836 0.74242328 0.3712116 [82,] 0.59138771 0.81722458 0.4086123 [83,] 0.55199501 0.89600997 0.4480050 [84,] 0.60781242 0.78437515 0.3921876 [85,] 0.62202343 0.75595315 0.3779766 [86,] 0.58457094 0.83085812 0.4154291 [87,] 0.64194726 0.71610547 0.3580527 [88,] 0.61037910 0.77924180 0.3896209 [89,] 0.62890459 0.74219083 0.3710954 [90,] 0.61280105 0.77439790 0.3871990 [91,] 0.58382061 0.83235877 0.4161794 [92,] 0.53922430 0.92155141 0.4607757 [93,] 0.50739986 0.98520027 0.4926001 [94,] 0.47720574 0.95441148 0.5227943 [95,] 0.43463174 0.86926349 0.5653683 [96,] 0.39458031 0.78916062 0.6054197 [97,] 0.36333390 0.72666779 0.6366661 [98,] 0.36877349 0.73754698 0.6312265 [99,] 0.33024374 0.66048748 0.6697563 [100,] 0.31626028 0.63252056 0.6837397 [101,] 0.28962908 0.57925817 0.7103709 [102,] 0.25279287 0.50558573 0.7472071 [103,] 0.21644495 0.43288990 0.7835551 [104,] 0.22848789 0.45697579 0.7715121 [105,] 0.26223881 0.52447762 0.7377612 [106,] 0.25893689 0.51787377 0.7410631 [107,] 0.23635540 0.47271081 0.7636446 [108,] 0.29589950 0.59179900 0.7041005 [109,] 0.74366345 0.51267310 0.2563365 [110,] 0.70842901 0.58314198 0.2915710 [111,] 0.70757601 0.58484797 0.2924240 [112,] 0.80207253 0.39585494 0.1979275 [113,] 0.76744633 0.46510735 0.2325537 [114,] 0.73628108 0.52743783 0.2637189 [115,] 0.82911470 0.34177060 0.1708853 [116,] 0.87313510 0.25372980 0.1268649 [117,] 0.84760702 0.30478595 0.1523930 [118,] 0.88137081 0.23725838 0.1186292 [119,] 0.85147580 0.29704840 0.1485242 [120,] 0.81822312 0.36355376 0.1817769 [121,] 0.79937732 0.40124535 0.2006227 [122,] 0.81925513 0.36148974 0.1807449 [123,] 0.78350666 0.43298667 0.2164933 [124,] 0.74040603 0.51918795 0.2595940 [125,] 0.69272831 0.61454339 0.3072717 [126,] 0.63819788 0.72360424 0.3618021 [127,] 0.58411083 0.83177835 0.4158892 [128,] 0.52729860 0.94540281 0.4727014 [129,] 0.51289580 0.97420840 0.4871042 [130,] 0.45117006 0.90234012 0.5488299 [131,] 0.41403162 0.82806324 0.5859684 [132,] 0.49019563 0.98039126 0.5098044 [133,] 0.49610178 0.99220356 0.5038982 [134,] 0.59525878 0.80948244 0.4047412 [135,] 0.60428472 0.79143056 0.3957153 [136,] 0.54101772 0.91796456 0.4589823 [137,] 0.80318420 0.39363159 0.1968158 [138,] 0.76634044 0.46731913 0.2336596 [139,] 0.78464627 0.43070747 0.2153537 [140,] 0.72071630 0.55856740 0.2792837 [141,] 0.75959200 0.48081599 0.2404080 [142,] 0.68632590 0.62734821 0.3136741 [143,] 0.71716147 0.56567707 0.2828385 [144,] 0.63413064 0.73173872 0.3658694 [145,] 0.54964136 0.90071728 0.4503586 [146,] 0.52699341 0.94601317 0.4730066 [147,] 0.45925181 0.91850361 0.5407482 [148,] 0.37181121 0.74362243 0.6281888 [149,] 0.26410660 0.52821321 0.7358934 [150,] 0.16744989 0.33489978 0.8325501 [151,] 0.11528682 0.23057364 0.8847132 > postscript(file="/var/www/html/rcomp/tmp/1mdix1290557264.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(x[,1], type='l', main='Actuals and Interpolation', ylab='value of Actuals and Interpolation (dots)', xlab='time or index') > points(x[,1]-mysum$resid) > grid() > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/2e4hi1290557264.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(mysum$resid, type='b', pch=19, main='Residuals', ylab='value of Residuals', xlab='time or index') > grid() > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/3e4hi1290557264.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > hist(mysum$resid, main='Residual Histogram', xlab='values of Residuals') > grid() > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/4e4hi1290557264.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > densityplot(~mysum$resid,col='black',main='Residual Density Plot', xlab='values of Residuals') > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/57vg31290557264.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > qqnorm(mysum$resid, main='Residual Normal Q-Q Plot') > qqline(mysum$resid) > grid() > dev.off() null device 1 > (myerror <- as.ts(mysum$resid)) Time Series: Start = 1 End = 162 Frequency = 1 1 2 3 4 5 6 -18.20164758 10.66895918 -1.39147144 -2.42220344 8.15345300 3.23946415 7 8 9 10 11 12 -12.49659790 8.22784745 0.76762042 4.47913532 3.98817628 -23.93227779 13 14 15 16 17 18 1.06875560 -17.84008178 11.09845421 -12.06063764 4.93936236 13.55868125 19 20 21 22 23 24 -8.34265752 -15.41058675 -11.61306069 0.60852856 -17.20164758 -12.28119351 25 26 27 28 29 30 11.55868125 11.53544786 2.44840332 -0.49013267 7.04964029 -0.96197641 31 32 33 34 35 36 5.30739338 -14.60041061 -4.01182372 11.33812538 3.36885739 -4.26311159 37 38 39 40 41 42 0.81100251 -1.09136965 0.98817628 -2.45293545 0.19711545 3.15991822 43 44 45 46 47 48 -21.26311159 -16.28119351 -0.99270841 0.03802359 -8.80288455 2.33812538 49 50 51 52 53 54 1.84070112 4.11756952 -2.12210165 -3.06063764 -2.10945157 -6.28119351 55 56 57 58 59 60 -6.99270841 3.90863035 1.58941325 -6.80288455 2.43678662 2.28931146 61 62 63 64 65 66 -8.29927542 6.68807449 8.46751862 -18.06063764 -17.52086468 11.78673572 67 68 69 70 71 72 0.32004347 3.57779656 -8.52086468 -1.95035971 -3.63114261 -17.26957681 73 74 75 76 77 78 9.47913532 -4.23237958 13.11756952 14.57133134 -3.30030882 1.54059933 79 80 81 82 83 84 5.47913532 -18.02344042 6.33812538 -44.12210165 -2.80288455 0.01890828 85 86 87 88 89 90 -0.09136965 6.36885739 3.47913532 -2.20164758 -14.60041061 10.73145658 91 92 93 94 95 96 -0.30030882 -14.60041061 5.47913532 12.50986733 8.54706455 6.44840332 97 98 99 100 101 102 1.85981643 6.22784745 6.55868125 2.76762042 0.98817628 5.85981643 103 104 105 106 107 108 12.01890828 -3.10298634 9.19065023 5.24049754 2.44840332 1.19065023 109 110 111 112 113 114 -11.93124440 -14.79669969 11.04964029 7.17903353 17.11756952 -31.49013267 115 116 117 118 119 120 1.23946415 11.87789835 -16.06063764 -0.63114261 -3.91316248 20.50986733 121 122 123 124 125 126 -13.71068854 5.93936236 16.33812538 1.62661048 0.33812538 8.11756952 127 128 129 130 131 132 13.84716634 -1.01182372 4.77923711 0.47913532 0.11756952 3.81100251 133 134 135 136 137 138 3.76762042 -5.37985474 1.90863035 10.15991822 -8.25692672 -7.06063764 139 140 141 142 143 144 -12.25046150 -8.66187462 -1.31192551 -19.23237958 12.15991822 14.79835242 145 146 147 148 149 150 4.90863035 15.44840332 3.01890828 -7.96197641 5.00729159 10.24049754 151 152 153 154 155 156 12.01890828 11.54059933 -3.69260662 2.57779656 6.24049754 11.11110430 157 158 159 160 161 162 -14.60041061 -1.06063764 4.77923711 11.97655958 18.00082637 0.97009436 > postscript(file="/var/www/html/rcomp/tmp/67vg31290557264.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > dum <- cbind(lag(myerror,k=1),myerror) > dum Time Series: Start = 0 End = 162 Frequency = 1 lag(myerror, k = 1) myerror 0 -18.20164758 NA 1 10.66895918 -18.20164758 2 -1.39147144 10.66895918 3 -2.42220344 -1.39147144 4 8.15345300 -2.42220344 5 3.23946415 8.15345300 6 -12.49659790 3.23946415 7 8.22784745 -12.49659790 8 0.76762042 8.22784745 9 4.47913532 0.76762042 10 3.98817628 4.47913532 11 -23.93227779 3.98817628 12 1.06875560 -23.93227779 13 -17.84008178 1.06875560 14 11.09845421 -17.84008178 15 -12.06063764 11.09845421 16 4.93936236 -12.06063764 17 13.55868125 4.93936236 18 -8.34265752 13.55868125 19 -15.41058675 -8.34265752 20 -11.61306069 -15.41058675 21 0.60852856 -11.61306069 22 -17.20164758 0.60852856 23 -12.28119351 -17.20164758 24 11.55868125 -12.28119351 25 11.53544786 11.55868125 26 2.44840332 11.53544786 27 -0.49013267 2.44840332 28 7.04964029 -0.49013267 29 -0.96197641 7.04964029 30 5.30739338 -0.96197641 31 -14.60041061 5.30739338 32 -4.01182372 -14.60041061 33 11.33812538 -4.01182372 34 3.36885739 11.33812538 35 -4.26311159 3.36885739 36 0.81100251 -4.26311159 37 -1.09136965 0.81100251 38 0.98817628 -1.09136965 39 -2.45293545 0.98817628 40 0.19711545 -2.45293545 41 3.15991822 0.19711545 42 -21.26311159 3.15991822 43 -16.28119351 -21.26311159 44 -0.99270841 -16.28119351 45 0.03802359 -0.99270841 46 -8.80288455 0.03802359 47 2.33812538 -8.80288455 48 1.84070112 2.33812538 49 4.11756952 1.84070112 50 -2.12210165 4.11756952 51 -3.06063764 -2.12210165 52 -2.10945157 -3.06063764 53 -6.28119351 -2.10945157 54 -6.99270841 -6.28119351 55 3.90863035 -6.99270841 56 1.58941325 3.90863035 57 -6.80288455 1.58941325 58 2.43678662 -6.80288455 59 2.28931146 2.43678662 60 -8.29927542 2.28931146 61 6.68807449 -8.29927542 62 8.46751862 6.68807449 63 -18.06063764 8.46751862 64 -17.52086468 -18.06063764 65 11.78673572 -17.52086468 66 0.32004347 11.78673572 67 3.57779656 0.32004347 68 -8.52086468 3.57779656 69 -1.95035971 -8.52086468 70 -3.63114261 -1.95035971 71 -17.26957681 -3.63114261 72 9.47913532 -17.26957681 73 -4.23237958 9.47913532 74 13.11756952 -4.23237958 75 14.57133134 13.11756952 76 -3.30030882 14.57133134 77 1.54059933 -3.30030882 78 5.47913532 1.54059933 79 -18.02344042 5.47913532 80 6.33812538 -18.02344042 81 -44.12210165 6.33812538 82 -2.80288455 -44.12210165 83 0.01890828 -2.80288455 84 -0.09136965 0.01890828 85 6.36885739 -0.09136965 86 3.47913532 6.36885739 87 -2.20164758 3.47913532 88 -14.60041061 -2.20164758 89 10.73145658 -14.60041061 90 -0.30030882 10.73145658 91 -14.60041061 -0.30030882 92 5.47913532 -14.60041061 93 12.50986733 5.47913532 94 8.54706455 12.50986733 95 6.44840332 8.54706455 96 1.85981643 6.44840332 97 6.22784745 1.85981643 98 6.55868125 6.22784745 99 2.76762042 6.55868125 100 0.98817628 2.76762042 101 5.85981643 0.98817628 102 12.01890828 5.85981643 103 -3.10298634 12.01890828 104 9.19065023 -3.10298634 105 5.24049754 9.19065023 106 2.44840332 5.24049754 107 1.19065023 2.44840332 108 -11.93124440 1.19065023 109 -14.79669969 -11.93124440 110 11.04964029 -14.79669969 111 7.17903353 11.04964029 112 17.11756952 7.17903353 113 -31.49013267 17.11756952 114 1.23946415 -31.49013267 115 11.87789835 1.23946415 116 -16.06063764 11.87789835 117 -0.63114261 -16.06063764 118 -3.91316248 -0.63114261 119 20.50986733 -3.91316248 120 -13.71068854 20.50986733 121 5.93936236 -13.71068854 122 16.33812538 5.93936236 123 1.62661048 16.33812538 124 0.33812538 1.62661048 125 8.11756952 0.33812538 126 13.84716634 8.11756952 127 -1.01182372 13.84716634 128 4.77923711 -1.01182372 129 0.47913532 4.77923711 130 0.11756952 0.47913532 131 3.81100251 0.11756952 132 3.76762042 3.81100251 133 -5.37985474 3.76762042 134 1.90863035 -5.37985474 135 10.15991822 1.90863035 136 -8.25692672 10.15991822 137 -7.06063764 -8.25692672 138 -12.25046150 -7.06063764 139 -8.66187462 -12.25046150 140 -1.31192551 -8.66187462 141 -19.23237958 -1.31192551 142 12.15991822 -19.23237958 143 14.79835242 12.15991822 144 4.90863035 14.79835242 145 15.44840332 4.90863035 146 3.01890828 15.44840332 147 -7.96197641 3.01890828 148 5.00729159 -7.96197641 149 10.24049754 5.00729159 150 12.01890828 10.24049754 151 11.54059933 12.01890828 152 -3.69260662 11.54059933 153 2.57779656 -3.69260662 154 6.24049754 2.57779656 155 11.11110430 6.24049754 156 -14.60041061 11.11110430 157 -1.06063764 -14.60041061 158 4.77923711 -1.06063764 159 11.97655958 4.77923711 160 18.00082637 11.97655958 161 0.97009436 18.00082637 162 NA 0.97009436 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 10.66895918 -18.20164758 [2,] -1.39147144 10.66895918 [3,] -2.42220344 -1.39147144 [4,] 8.15345300 -2.42220344 [5,] 3.23946415 8.15345300 [6,] -12.49659790 3.23946415 [7,] 8.22784745 -12.49659790 [8,] 0.76762042 8.22784745 [9,] 4.47913532 0.76762042 [10,] 3.98817628 4.47913532 [11,] -23.93227779 3.98817628 [12,] 1.06875560 -23.93227779 [13,] -17.84008178 1.06875560 [14,] 11.09845421 -17.84008178 [15,] -12.06063764 11.09845421 [16,] 4.93936236 -12.06063764 [17,] 13.55868125 4.93936236 [18,] -8.34265752 13.55868125 [19,] -15.41058675 -8.34265752 [20,] -11.61306069 -15.41058675 [21,] 0.60852856 -11.61306069 [22,] -17.20164758 0.60852856 [23,] -12.28119351 -17.20164758 [24,] 11.55868125 -12.28119351 [25,] 11.53544786 11.55868125 [26,] 2.44840332 11.53544786 [27,] -0.49013267 2.44840332 [28,] 7.04964029 -0.49013267 [29,] -0.96197641 7.04964029 [30,] 5.30739338 -0.96197641 [31,] -14.60041061 5.30739338 [32,] -4.01182372 -14.60041061 [33,] 11.33812538 -4.01182372 [34,] 3.36885739 11.33812538 [35,] -4.26311159 3.36885739 [36,] 0.81100251 -4.26311159 [37,] -1.09136965 0.81100251 [38,] 0.98817628 -1.09136965 [39,] -2.45293545 0.98817628 [40,] 0.19711545 -2.45293545 [41,] 3.15991822 0.19711545 [42,] -21.26311159 3.15991822 [43,] -16.28119351 -21.26311159 [44,] -0.99270841 -16.28119351 [45,] 0.03802359 -0.99270841 [46,] -8.80288455 0.03802359 [47,] 2.33812538 -8.80288455 [48,] 1.84070112 2.33812538 [49,] 4.11756952 1.84070112 [50,] -2.12210165 4.11756952 [51,] -3.06063764 -2.12210165 [52,] -2.10945157 -3.06063764 [53,] -6.28119351 -2.10945157 [54,] -6.99270841 -6.28119351 [55,] 3.90863035 -6.99270841 [56,] 1.58941325 3.90863035 [57,] -6.80288455 1.58941325 [58,] 2.43678662 -6.80288455 [59,] 2.28931146 2.43678662 [60,] -8.29927542 2.28931146 [61,] 6.68807449 -8.29927542 [62,] 8.46751862 6.68807449 [63,] -18.06063764 8.46751862 [64,] -17.52086468 -18.06063764 [65,] 11.78673572 -17.52086468 [66,] 0.32004347 11.78673572 [67,] 3.57779656 0.32004347 [68,] -8.52086468 3.57779656 [69,] -1.95035971 -8.52086468 [70,] -3.63114261 -1.95035971 [71,] -17.26957681 -3.63114261 [72,] 9.47913532 -17.26957681 [73,] -4.23237958 9.47913532 [74,] 13.11756952 -4.23237958 [75,] 14.57133134 13.11756952 [76,] -3.30030882 14.57133134 [77,] 1.54059933 -3.30030882 [78,] 5.47913532 1.54059933 [79,] -18.02344042 5.47913532 [80,] 6.33812538 -18.02344042 [81,] -44.12210165 6.33812538 [82,] -2.80288455 -44.12210165 [83,] 0.01890828 -2.80288455 [84,] -0.09136965 0.01890828 [85,] 6.36885739 -0.09136965 [86,] 3.47913532 6.36885739 [87,] -2.20164758 3.47913532 [88,] -14.60041061 -2.20164758 [89,] 10.73145658 -14.60041061 [90,] -0.30030882 10.73145658 [91,] -14.60041061 -0.30030882 [92,] 5.47913532 -14.60041061 [93,] 12.50986733 5.47913532 [94,] 8.54706455 12.50986733 [95,] 6.44840332 8.54706455 [96,] 1.85981643 6.44840332 [97,] 6.22784745 1.85981643 [98,] 6.55868125 6.22784745 [99,] 2.76762042 6.55868125 [100,] 0.98817628 2.76762042 [101,] 5.85981643 0.98817628 [102,] 12.01890828 5.85981643 [103,] -3.10298634 12.01890828 [104,] 9.19065023 -3.10298634 [105,] 5.24049754 9.19065023 [106,] 2.44840332 5.24049754 [107,] 1.19065023 2.44840332 [108,] -11.93124440 1.19065023 [109,] -14.79669969 -11.93124440 [110,] 11.04964029 -14.79669969 [111,] 7.17903353 11.04964029 [112,] 17.11756952 7.17903353 [113,] -31.49013267 17.11756952 [114,] 1.23946415 -31.49013267 [115,] 11.87789835 1.23946415 [116,] -16.06063764 11.87789835 [117,] -0.63114261 -16.06063764 [118,] -3.91316248 -0.63114261 [119,] 20.50986733 -3.91316248 [120,] -13.71068854 20.50986733 [121,] 5.93936236 -13.71068854 [122,] 16.33812538 5.93936236 [123,] 1.62661048 16.33812538 [124,] 0.33812538 1.62661048 [125,] 8.11756952 0.33812538 [126,] 13.84716634 8.11756952 [127,] -1.01182372 13.84716634 [128,] 4.77923711 -1.01182372 [129,] 0.47913532 4.77923711 [130,] 0.11756952 0.47913532 [131,] 3.81100251 0.11756952 [132,] 3.76762042 3.81100251 [133,] -5.37985474 3.76762042 [134,] 1.90863035 -5.37985474 [135,] 10.15991822 1.90863035 [136,] -8.25692672 10.15991822 [137,] -7.06063764 -8.25692672 [138,] -12.25046150 -7.06063764 [139,] -8.66187462 -12.25046150 [140,] -1.31192551 -8.66187462 [141,] -19.23237958 -1.31192551 [142,] 12.15991822 -19.23237958 [143,] 14.79835242 12.15991822 [144,] 4.90863035 14.79835242 [145,] 15.44840332 4.90863035 [146,] 3.01890828 15.44840332 [147,] -7.96197641 3.01890828 [148,] 5.00729159 -7.96197641 [149,] 10.24049754 5.00729159 [150,] 12.01890828 10.24049754 [151,] 11.54059933 12.01890828 [152,] -3.69260662 11.54059933 [153,] 2.57779656 -3.69260662 [154,] 6.24049754 2.57779656 [155,] 11.11110430 6.24049754 [156,] -14.60041061 11.11110430 [157,] -1.06063764 -14.60041061 [158,] 4.77923711 -1.06063764 [159,] 11.97655958 4.77923711 [160,] 18.00082637 11.97655958 [161,] 0.97009436 18.00082637 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 10.66895918 -18.20164758 2 -1.39147144 10.66895918 3 -2.42220344 -1.39147144 4 8.15345300 -2.42220344 5 3.23946415 8.15345300 6 -12.49659790 3.23946415 7 8.22784745 -12.49659790 8 0.76762042 8.22784745 9 4.47913532 0.76762042 10 3.98817628 4.47913532 11 -23.93227779 3.98817628 12 1.06875560 -23.93227779 13 -17.84008178 1.06875560 14 11.09845421 -17.84008178 15 -12.06063764 11.09845421 16 4.93936236 -12.06063764 17 13.55868125 4.93936236 18 -8.34265752 13.55868125 19 -15.41058675 -8.34265752 20 -11.61306069 -15.41058675 21 0.60852856 -11.61306069 22 -17.20164758 0.60852856 23 -12.28119351 -17.20164758 24 11.55868125 -12.28119351 25 11.53544786 11.55868125 26 2.44840332 11.53544786 27 -0.49013267 2.44840332 28 7.04964029 -0.49013267 29 -0.96197641 7.04964029 30 5.30739338 -0.96197641 31 -14.60041061 5.30739338 32 -4.01182372 -14.60041061 33 11.33812538 -4.01182372 34 3.36885739 11.33812538 35 -4.26311159 3.36885739 36 0.81100251 -4.26311159 37 -1.09136965 0.81100251 38 0.98817628 -1.09136965 39 -2.45293545 0.98817628 40 0.19711545 -2.45293545 41 3.15991822 0.19711545 42 -21.26311159 3.15991822 43 -16.28119351 -21.26311159 44 -0.99270841 -16.28119351 45 0.03802359 -0.99270841 46 -8.80288455 0.03802359 47 2.33812538 -8.80288455 48 1.84070112 2.33812538 49 4.11756952 1.84070112 50 -2.12210165 4.11756952 51 -3.06063764 -2.12210165 52 -2.10945157 -3.06063764 53 -6.28119351 -2.10945157 54 -6.99270841 -6.28119351 55 3.90863035 -6.99270841 56 1.58941325 3.90863035 57 -6.80288455 1.58941325 58 2.43678662 -6.80288455 59 2.28931146 2.43678662 60 -8.29927542 2.28931146 61 6.68807449 -8.29927542 62 8.46751862 6.68807449 63 -18.06063764 8.46751862 64 -17.52086468 -18.06063764 65 11.78673572 -17.52086468 66 0.32004347 11.78673572 67 3.57779656 0.32004347 68 -8.52086468 3.57779656 69 -1.95035971 -8.52086468 70 -3.63114261 -1.95035971 71 -17.26957681 -3.63114261 72 9.47913532 -17.26957681 73 -4.23237958 9.47913532 74 13.11756952 -4.23237958 75 14.57133134 13.11756952 76 -3.30030882 14.57133134 77 1.54059933 -3.30030882 78 5.47913532 1.54059933 79 -18.02344042 5.47913532 80 6.33812538 -18.02344042 81 -44.12210165 6.33812538 82 -2.80288455 -44.12210165 83 0.01890828 -2.80288455 84 -0.09136965 0.01890828 85 6.36885739 -0.09136965 86 3.47913532 6.36885739 87 -2.20164758 3.47913532 88 -14.60041061 -2.20164758 89 10.73145658 -14.60041061 90 -0.30030882 10.73145658 91 -14.60041061 -0.30030882 92 5.47913532 -14.60041061 93 12.50986733 5.47913532 94 8.54706455 12.50986733 95 6.44840332 8.54706455 96 1.85981643 6.44840332 97 6.22784745 1.85981643 98 6.55868125 6.22784745 99 2.76762042 6.55868125 100 0.98817628 2.76762042 101 5.85981643 0.98817628 102 12.01890828 5.85981643 103 -3.10298634 12.01890828 104 9.19065023 -3.10298634 105 5.24049754 9.19065023 106 2.44840332 5.24049754 107 1.19065023 2.44840332 108 -11.93124440 1.19065023 109 -14.79669969 -11.93124440 110 11.04964029 -14.79669969 111 7.17903353 11.04964029 112 17.11756952 7.17903353 113 -31.49013267 17.11756952 114 1.23946415 -31.49013267 115 11.87789835 1.23946415 116 -16.06063764 11.87789835 117 -0.63114261 -16.06063764 118 -3.91316248 -0.63114261 119 20.50986733 -3.91316248 120 -13.71068854 20.50986733 121 5.93936236 -13.71068854 122 16.33812538 5.93936236 123 1.62661048 16.33812538 124 0.33812538 1.62661048 125 8.11756952 0.33812538 126 13.84716634 8.11756952 127 -1.01182372 13.84716634 128 4.77923711 -1.01182372 129 0.47913532 4.77923711 130 0.11756952 0.47913532 131 3.81100251 0.11756952 132 3.76762042 3.81100251 133 -5.37985474 3.76762042 134 1.90863035 -5.37985474 135 10.15991822 1.90863035 136 -8.25692672 10.15991822 137 -7.06063764 -8.25692672 138 -12.25046150 -7.06063764 139 -8.66187462 -12.25046150 140 -1.31192551 -8.66187462 141 -19.23237958 -1.31192551 142 12.15991822 -19.23237958 143 14.79835242 12.15991822 144 4.90863035 14.79835242 145 15.44840332 4.90863035 146 3.01890828 15.44840332 147 -7.96197641 3.01890828 148 5.00729159 -7.96197641 149 10.24049754 5.00729159 150 12.01890828 10.24049754 151 11.54059933 12.01890828 152 -3.69260662 11.54059933 153 2.57779656 -3.69260662 154 6.24049754 2.57779656 155 11.11110430 6.24049754 156 -14.60041061 11.11110430 157 -1.06063764 -14.60041061 158 4.77923711 -1.06063764 159 11.97655958 4.77923711 160 18.00082637 11.97655958 161 0.97009436 18.00082637 > plot(z,main=paste('Residual Lag plot, lowess, and regression line'), ylab='values of Residuals', xlab='lagged values of Residuals') > lines(lowess(z)) > abline(lm(z)) > grid() > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/705go1290557264.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > acf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Autocorrelation Function') > grid() > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/805go1290557264.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > pacf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Partial Autocorrelation Function') > grid() > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/9bwf91290557264.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > opar <- par(mfrow = c(2,2), oma = c(0, 0, 1.1, 0)) > plot(mylm, las = 1, sub='Residual Diagnostics') > par(opar) > dev.off() null device 1 > if (n > n25) { + postscript(file="/var/www/html/rcomp/tmp/10bwf91290557264.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) + plot(kp3:nmkm3,gqarr[,2], main='Goldfeld-Quandt test',ylab='2-sided p-value',xlab='breakpoint') + grid() + dev.off() + } null device 1 > > #Note: the /var/www/html/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/rcomp/createtable") > > a<-table.start() > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Estimated Regression Equation', 1, TRUE) > a<-table.row.end(a) > myeq <- colnames(x)[1] > myeq <- paste(myeq, '[t] = ', sep='') > for (i in 1:k){ + if (mysum$coefficients[i,1] > 0) myeq <- paste(myeq, '+', '') + myeq <- paste(myeq, mysum$coefficients[i,1], sep=' ') + if (rownames(mysum$coefficients)[i] != '(Intercept)') { + myeq <- paste(myeq, rownames(mysum$coefficients)[i], sep='') + if (rownames(mysum$coefficients)[i] != 't') myeq <- paste(myeq, '[t]', sep='') + } + } > myeq <- paste(myeq, ' + e[t]') > a<-table.row.start(a) > a<-table.element(a, myeq) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/www/html/rcomp/tmp/11wxex1290557264.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,hyperlink('http://www.xycoon.com/ols1.htm','Multiple Linear Regression - Ordinary Least Squares',''), 6, TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Variable',header=TRUE) > a<-table.element(a,'Parameter',header=TRUE) > a<-table.element(a,'S.D.',header=TRUE) > a<-table.element(a,'T-STAT
H0: parameter = 0',header=TRUE) > a<-table.element(a,'2-tail p-value',header=TRUE) > a<-table.element(a,'1-tail p-value',header=TRUE) > a<-table.row.end(a) > for (i in 1:k){ + a<-table.row.start(a) + a<-table.element(a,rownames(mysum$coefficients)[i],header=TRUE) + a<-table.element(a,mysum$coefficients[i,1]) + a<-table.element(a, round(mysum$coefficients[i,2],6)) + a<-table.element(a, round(mysum$coefficients[i,3],4)) + a<-table.element(a, round(mysum$coefficients[i,4],6)) + a<-table.element(a, round(mysum$coefficients[i,4]/2,6)) + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/www/html/rcomp/tmp/12ixck1290557264.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Regression Statistics', 2, TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Multiple R',1,TRUE) > a<-table.element(a, sqrt(mysum$r.squared)) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'R-squared',1,TRUE) > a<-table.element(a, mysum$r.squared) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Adjusted R-squared',1,TRUE) > a<-table.element(a, mysum$adj.r.squared) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'F-TEST (value)',1,TRUE) > a<-table.element(a, mysum$fstatistic[1]) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'F-TEST (DF numerator)',1,TRUE) > a<-table.element(a, mysum$fstatistic[2]) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'F-TEST (DF denominator)',1,TRUE) > a<-table.element(a, mysum$fstatistic[3]) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'p-value',1,TRUE) > a<-table.element(a, 1-pf(mysum$fstatistic[1],mysum$fstatistic[2],mysum$fstatistic[3])) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Residual Statistics', 2, TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Residual Standard Deviation',1,TRUE) > a<-table.element(a, mysum$sigma) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Sum Squared Residuals',1,TRUE) > a<-table.element(a, sum(myerror*myerror)) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/www/html/rcomp/tmp/136y9w1290557264.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Actuals, Interpolation, and Residuals', 4, TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Time or Index', 1, TRUE) > a<-table.element(a, 'Actuals', 1, TRUE) > a<-table.element(a, 'Interpolation
Forecast', 1, TRUE) > a<-table.element(a, 'Residuals
Prediction Error', 1, TRUE) > a<-table.row.end(a) > for (i in 1:n) { + a<-table.row.start(a) + a<-table.element(a,i, 1, TRUE) + a<-table.element(a,x[i]) + a<-table.element(a,x[i]-mysum$resid[i]) + a<-table.element(a,mysum$resid[i]) + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/www/html/rcomp/tmp/14z78h1290557264.tab") > if (n > n25) { + a<-table.start() + a<-table.row.start(a) + a<-table.element(a,'Goldfeld-Quandt test for Heteroskedasticity',4,TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'p-values',header=TRUE) + a<-table.element(a,'Alternative Hypothesis',3,header=TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'breakpoint index',header=TRUE) + a<-table.element(a,'greater',header=TRUE) + a<-table.element(a,'2-sided',header=TRUE) + a<-table.element(a,'less',header=TRUE) + a<-table.row.end(a) + for (mypoint in kp3:nmkm3) { + a<-table.row.start(a) + a<-table.element(a,mypoint,header=TRUE) + a<-table.element(a,gqarr[mypoint-kp3+1,1]) + a<-table.element(a,gqarr[mypoint-kp3+1,2]) + a<-table.element(a,gqarr[mypoint-kp3+1,3]) + a<-table.row.end(a) + } + a<-table.end(a) + table.save(a,file="/var/www/html/rcomp/tmp/15visi1290557265.tab") + a<-table.start() + a<-table.row.start(a) + a<-table.element(a,'Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity',4,TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'Description',header=TRUE) + a<-table.element(a,'# significant tests',header=TRUE) + a<-table.element(a,'% significant tests',header=TRUE) + a<-table.element(a,'OK/NOK',header=TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'1% type I error level',header=TRUE) + a<-table.element(a,numsignificant1) + a<-table.element(a,numsignificant1/numgqtests) + if (numsignificant1/numgqtests < 0.01) dum <- 'OK' else dum <- 'NOK' + a<-table.element(a,dum) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'5% type I error level',header=TRUE) + a<-table.element(a,numsignificant5) + a<-table.element(a,numsignificant5/numgqtests) + if (numsignificant5/numgqtests < 0.05) dum <- 'OK' else dum <- 'NOK' + a<-table.element(a,dum) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'10% type I error level',header=TRUE) + a<-table.element(a,numsignificant10) + a<-table.element(a,numsignificant10/numgqtests) + if (numsignificant10/numgqtests < 0.1) dum <- 'OK' else dum <- 'NOK' + a<-table.element(a,dum) + a<-table.row.end(a) + a<-table.end(a) + table.save(a,file="/var/www/html/rcomp/tmp/169sp91290557265.tab") + } > > try(system("convert tmp/1mdix1290557264.ps tmp/1mdix1290557264.png",intern=TRUE)) character(0) > try(system("convert tmp/2e4hi1290557264.ps tmp/2e4hi1290557264.png",intern=TRUE)) character(0) > try(system("convert tmp/3e4hi1290557264.ps tmp/3e4hi1290557264.png",intern=TRUE)) character(0) > try(system("convert tmp/4e4hi1290557264.ps tmp/4e4hi1290557264.png",intern=TRUE)) character(0) > try(system("convert tmp/57vg31290557264.ps tmp/57vg31290557264.png",intern=TRUE)) character(0) > try(system("convert tmp/67vg31290557264.ps tmp/67vg31290557264.png",intern=TRUE)) character(0) > try(system("convert tmp/705go1290557264.ps tmp/705go1290557264.png",intern=TRUE)) character(0) > try(system("convert tmp/805go1290557264.ps tmp/805go1290557264.png",intern=TRUE)) character(0) > try(system("convert tmp/9bwf91290557264.ps tmp/9bwf91290557264.png",intern=TRUE)) character(0) > try(system("convert tmp/10bwf91290557264.ps tmp/10bwf91290557264.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.966 1.775 9.598