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 = '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 t 1 53 14 12 1 2 86 18 11 2 3 66 11 14 3 4 67 12 12 4 5 76 16 21 5 6 78 18 12 6 7 53 14 22 7 8 80 14 11 8 9 74 15 10 9 10 76 15 13 10 11 79 17 10 11 12 54 19 8 12 13 67 10 15 13 14 54 16 14 14 15 87 18 10 15 16 58 14 14 16 17 75 14 14 17 18 88 17 11 18 19 64 14 10 19 20 57 16 13 20 21 66 18 7 21 22 68 11 14 22 23 54 14 12 23 24 56 12 14 24 25 86 17 11 25 26 80 9 9 26 27 76 16 11 27 28 69 14 15 28 29 78 15 14 29 30 67 11 13 30 31 80 16 9 31 32 54 13 15 32 33 71 17 10 33 34 84 15 11 34 35 74 14 13 35 36 71 16 8 36 37 63 9 20 37 38 71 15 12 38 39 76 17 10 39 40 69 13 10 40 41 74 15 9 41 42 75 16 14 42 43 54 16 8 43 44 52 12 14 44 45 69 12 11 45 46 68 11 13 46 47 65 15 9 47 48 75 15 11 48 49 74 17 15 49 50 75 13 11 50 51 72 16 10 51 52 67 14 14 52 53 63 11 18 53 54 62 12 14 54 55 63 12 11 55 56 76 15 12 56 57 74 16 13 57 58 67 15 9 58 59 73 12 10 59 60 70 12 15 60 61 53 8 20 61 62 77 13 12 62 63 77 11 12 63 64 52 14 14 64 65 54 15 13 65 66 80 10 11 66 67 66 11 17 67 68 73 12 12 68 69 63 15 13 69 70 69 15 14 70 71 67 14 13 71 72 54 16 15 72 73 81 15 13 73 74 69 15 10 74 75 84 13 11 75 76 80 12 19 76 77 70 17 13 77 78 69 13 17 78 79 77 15 13 79 80 54 13 9 80 81 79 15 11 81 82 30 16 10 82 83 71 15 9 83 84 73 16 12 84 85 72 15 12 85 86 77 14 13 86 87 75 15 13 87 88 69 14 12 88 89 54 13 15 89 90 70 7 22 90 91 73 17 13 91 92 54 13 15 92 93 77 15 13 93 94 82 14 15 94 95 80 13 10 95 96 80 16 11 96 97 69 12 16 97 98 78 14 11 98 99 81 17 11 99 100 76 15 10 100 101 76 17 10 101 102 73 12 16 102 103 85 16 12 103 104 66 11 11 104 105 79 15 16 105 106 68 9 19 106 107 76 16 11 107 108 71 15 16 108 109 54 10 15 109 110 46 10 24 110 111 82 15 14 111 112 74 11 15 112 113 88 13 11 113 114 38 14 15 114 115 76 18 12 115 116 86 16 10 116 117 54 14 14 117 118 70 14 13 118 119 69 14 9 119 120 90 14 15 120 121 54 12 15 121 122 76 14 14 122 123 89 15 11 123 124 76 15 8 124 125 73 15 11 125 126 79 13 11 126 127 90 17 8 127 128 74 17 10 128 129 81 19 11 129 130 72 15 13 130 131 71 13 11 131 132 66 9 20 132 133 77 15 10 133 134 65 15 15 134 135 74 15 12 135 136 82 16 14 136 137 54 11 23 137 138 63 14 14 138 139 54 11 16 139 140 64 15 11 140 141 69 13 12 141 142 54 15 10 142 143 84 16 14 143 144 86 14 12 144 145 77 15 12 145 146 89 16 11 146 147 76 16 12 147 148 60 11 13 148 149 75 12 11 149 150 73 9 19 150 151 85 16 12 151 152 79 13 17 152 153 71 16 9 153 154 72 12 12 154 155 69 9 19 155 156 78 13 18 156 157 54 13 15 157 158 69 14 14 158 159 81 19 11 159 160 84 13 9 160 161 84 12 18 161 162 69 13 16 162 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) Happiness Depression t 62.55114 0.92560 -0.63535 0.04141 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -44.403 -4.789 1.538 6.197 19.052 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 62.55114 8.56179 7.306 1.28e-11 *** Happiness 0.92560 0.40514 2.285 0.0237 * Depression -0.63535 0.30012 -2.117 0.0358 * t 0.04141 0.01708 2.424 0.0165 * --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 10.07 on 158 degrees of freedom Multiple R-squared: 0.1338, Adjusted R-squared: 0.1173 F-statistic: 8.133 on 3 and 158 DF, p-value: 4.53e-05 > 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.80244338 0.3951132 0.19755662 [2,] 0.70330075 0.5933985 0.29669925 [3,] 0.61348992 0.7730202 0.38651008 [4,] 0.48822902 0.9764580 0.51177098 [5,] 0.39703539 0.7940708 0.60296461 [6,] 0.88082259 0.2383548 0.11917741 [7,] 0.83348179 0.3330364 0.16651821 [8,] 0.85822737 0.2835453 0.14177263 [9,] 0.89716556 0.2056689 0.10283444 [10,] 0.87630374 0.2473925 0.12369626 [11,] 0.86310818 0.2737836 0.13689182 [12,] 0.89328711 0.2134258 0.10671289 [13,] 0.87129710 0.2574058 0.12870290 [14,] 0.88360021 0.2327996 0.11639979 [15,] 0.86613657 0.2677269 0.13386343 [16,] 0.83837237 0.3232553 0.16162763 [17,] 0.84624924 0.3075015 0.15375076 [18,] 0.81519123 0.3696175 0.18480877 [19,] 0.87301377 0.2539725 0.12698623 [20,] 0.90638948 0.1872210 0.09361052 [21,] 0.88525593 0.2294881 0.11474407 [22,] 0.85462334 0.2907533 0.14537666 [23,] 0.84566289 0.3086742 0.15433711 [24,] 0.80749890 0.3850022 0.19250110 [25,] 0.77931547 0.4413691 0.22068453 [26,] 0.79696479 0.4060704 0.20303521 [27,] 0.75578345 0.4884331 0.24421655 [28,] 0.77765933 0.4446813 0.22234067 [29,] 0.74280021 0.5143996 0.25719979 [30,] 0.70400951 0.5919810 0.29599049 [31,] 0.65905694 0.6818861 0.34094306 [32,] 0.60786614 0.7842677 0.39213386 [33,] 0.55675361 0.8864928 0.44324639 [34,] 0.50541608 0.9891678 0.49458392 [35,] 0.45294337 0.9058867 0.54705663 [36,] 0.41048364 0.8209673 0.58951636 [37,] 0.56449101 0.8710180 0.43550899 [38,] 0.60528383 0.7894323 0.39471617 [39,] 0.55604140 0.8879172 0.44395860 [40,] 0.50840621 0.9831876 0.49159379 [41,] 0.47664230 0.9532846 0.52335770 [42,] 0.43830847 0.8766169 0.56169153 [43,] 0.39783159 0.7956632 0.60216841 [44,] 0.36826009 0.7365202 0.63173991 [45,] 0.32195392 0.6439078 0.67804608 [46,] 0.27882689 0.5576538 0.72117311 [47,] 0.23857058 0.4771412 0.76142942 [48,] 0.20741360 0.4148272 0.79258640 [49,] 0.18086092 0.3617218 0.81913908 [50,] 0.16126499 0.3225300 0.83873501 [51,] 0.13638879 0.2727776 0.86361121 [52,] 0.11713540 0.2342708 0.88286460 [53,] 0.09936827 0.1987365 0.90063173 [54,] 0.08313791 0.1662758 0.91686209 [55,] 0.07181610 0.1436322 0.92818390 [56,] 0.06762215 0.1352443 0.93237785 [57,] 0.06828341 0.1365668 0.93171659 [58,] 0.09913522 0.1982704 0.90086478 [59,] 0.12956748 0.2591350 0.87043252 [60,] 0.15085326 0.3017065 0.84914674 [61,] 0.12682813 0.2536563 0.87317187 [62,] 0.11026350 0.2205270 0.88973650 [63,] 0.09757088 0.1951418 0.90242912 [64,] 0.07910220 0.1582044 0.92089780 [65,] 0.06364306 0.1272861 0.93635694 [66,] 0.08224683 0.1644937 0.91775317 [67,] 0.08994202 0.1798840 0.91005798 [68,] 0.07362580 0.1472516 0.92637420 [69,] 0.09422195 0.1884439 0.90577805 [70,] 0.13233184 0.2646637 0.86766816 [71,] 0.11020110 0.2204022 0.88979890 [72,] 0.09178540 0.1835708 0.90821460 [73,] 0.08178288 0.1635658 0.91821712 [74,] 0.11741907 0.2348381 0.88258093 [75,] 0.10778579 0.2155716 0.89221421 [76,] 0.76021890 0.4795622 0.23978110 [77,] 0.72786124 0.5442775 0.27213876 [78,] 0.69244309 0.6151138 0.30755691 [79,] 0.65391630 0.6921674 0.34608370 [80,] 0.63271139 0.7345772 0.36728861 [81,] 0.59712105 0.8057579 0.40287895 [82,] 0.55498964 0.8900207 0.44501036 [83,] 0.60054798 0.7989040 0.39945202 [84,] 0.62219653 0.7556069 0.37780347 [85,] 0.58299567 0.8340087 0.41700433 [86,] 0.63138102 0.7372380 0.36861898 [87,] 0.60183887 0.7963223 0.39816113 [88,] 0.62518093 0.7496381 0.37481907 [89,] 0.61199492 0.7760102 0.38800508 [90,] 0.58344487 0.8331103 0.41655513 [91,] 0.53957599 0.9208480 0.46042401 [92,] 0.50921647 0.9815671 0.49078353 [93,] 0.47806646 0.9561329 0.52193354 [94,] 0.43382668 0.8676534 0.56617332 [95,] 0.38962151 0.7792430 0.61037849 [96,] 0.36186320 0.7237264 0.63813680 [97,] 0.37127314 0.7425463 0.62872686 [98,] 0.33059627 0.6611925 0.66940373 [99,] 0.32210891 0.6442178 0.67789109 [100,] 0.30842497 0.6168499 0.69157503 [101,] 0.26883432 0.5376686 0.73116568 [102,] 0.23228253 0.4645651 0.76771747 [103,] 0.23523314 0.4704663 0.76476686 [104,] 0.25664035 0.5132807 0.74335965 [105,] 0.26001249 0.5200250 0.73998751 [106,] 0.24750005 0.4950001 0.75249995 [107,] 0.33947037 0.6789407 0.66052963 [108,] 0.73970383 0.5205923 0.26029617 [109,] 0.69846861 0.6030628 0.30153139 [110,] 0.70573456 0.5885309 0.29426544 [111,] 0.78355011 0.4328998 0.21644989 [112,] 0.74432919 0.5113416 0.25567081 [113,] 0.70916931 0.5816614 0.29083069 [114,] 0.82107093 0.3578581 0.17892907 [115,] 0.85430533 0.2913893 0.14569467 [116,] 0.82749353 0.3450129 0.17250647 [117,] 0.87415058 0.2516988 0.12584942 [118,] 0.84338102 0.3132380 0.15661898 [119,] 0.80665098 0.3866980 0.19334902 [120,] 0.80226820 0.3954636 0.19773180 [121,] 0.84637089 0.3072582 0.15362911 [122,] 0.80914050 0.3817190 0.19085950 [123,] 0.77187962 0.4562408 0.22812038 [124,] 0.72531704 0.5493659 0.27468296 [125,] 0.68065932 0.6386814 0.31934068 [126,] 0.65265988 0.6946802 0.34734012 [127,] 0.62399450 0.7520110 0.37600550 [128,] 0.57696969 0.8460606 0.42303031 [129,] 0.52333038 0.9533392 0.47666962 [130,] 0.53475155 0.9304969 0.46524845 [131,] 0.52192578 0.9561484 0.47807422 [132,] 0.48508936 0.9701787 0.51491064 [133,] 0.53489283 0.9302143 0.46510717 [134,] 0.53471557 0.9305689 0.46528443 [135,] 0.46911423 0.9382285 0.53088577 [136,] 0.78531575 0.4293685 0.21468425 [137,] 0.73082949 0.5383410 0.26917051 [138,] 0.72382924 0.5523415 0.27617076 [139,] 0.64970163 0.7005967 0.35029837 [140,] 0.68451641 0.6309672 0.31548359 [141,] 0.59929974 0.8014005 0.40070026 [142,] 0.63029446 0.7394111 0.36970554 [143,] 0.53419020 0.9316196 0.46580980 [144,] 0.43940358 0.8788072 0.56059642 [145,] 0.42825387 0.8565077 0.57174613 [146,] 0.42141145 0.8428229 0.57858855 [147,] 0.30451996 0.6090399 0.69548004 [148,] 0.20188709 0.4037742 0.79811291 [149,] 0.12129994 0.2425999 0.87870006 > postscript(file="/var/www/html/rcomp/tmp/1v4ax1290561126.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/2v4ax1290561126.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/35vr01290561126.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/45vr01290561126.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/55vr01290561126.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 -14.9268223 13.6940121 2.0378709 0.8001681 11.7744732 6.1637375 7 8 9 10 11 12 -8.8217840 11.1479928 3.5456370 7.4102728 6.6116196 -21.5516865 13 14 15 16 17 18 4.1847672 -15.0456050 13.5203947 -9.2772092 7.6813854 15.9571289 19 20 21 22 23 24 -5.9428137 -12.9293845 -9.6340789 3.2511682 -14.8377412 -9.7572459 25 26 27 28 29 30 13.6672910 13.7600178 4.5100835 1.8612730 9.2589172 1.2845779 31 32 33 34 35 36 7.0737677 -12.3787453 -2.2992993 13.1458490 5.3007410 -2.7686064 37 38 39 40 41 42 3.2933762 0.6155744 2.4522683 -0.8867239 1.5853170 4.7950437 43 44 45 46 47 48 -20.0584442 -14.5853540 0.4671994 1.6220914 -7.6631154 3.5661733 49 50 51 52 53 54 3.2149496 5.3345691 -1.1189933 -1.7678038 -0.4910110 -4.9994080 55 56 57 58 59 60 -5.9468547 4.8702772 2.5386155 -6.1185749 3.2521767 3.3875066 61 62 63 64 65 66 -6.7747502 7.4730513 9.2828525 -17.2646686 -16.8670244 12.4488925 67 68 69 70 71 72 1.2939662 4.1502222 -8.0326460 -1.4387044 -3.1898535 -16.8117714 73 74 75 76 77 78 9.8017324 -4.1457143 13.2994340 15.2664085 -3.2150958 1.9873002 79 80 81 82 83 84 5.5532999 -18.1782872 6.1997950 -44.4025608 -3.1537100 -0.2146775 85 86 87 88 89 90 -0.3304796 6.1890654 3.2220567 -2.5290925 -14.7388534 11.2207905 91 92 93 94 95 96 -0.7947715 -14.8630696 4.9736243 12.1285163 7.8359788 5.6531106 97 98 99 100 101 102 1.4908537 5.4215064 5.6032911 1.7777452 -0.1148668 5.2838267 103 104 105 106 107 108 10.9986198 -4.0501162 8.3828006 4.8010562 1.1976512 0.2585844 109 110 111 112 113 114 -12.7901516 -15.1134333 9.8636741 6.1600289 15.7260286 -32.6995918 115 116 117 118 119 120 -0.3494516 10.1896554 -17.4591551 -2.1359076 -5.7187013 19.0519758 121 122 123 124 125 126 -15.1382230 4.3338179 14.4607680 -0.4866787 -1.6220428 6.1877583 127 128 129 130 131 132 11.5378985 -3.2328127 2.5099224 -1.5583757 -2.0192687 2.3598628 133 134 135 136 137 138 1.4113668 -7.4533032 -0.4007498 7.9029356 -9.7923296 -9.3286686 139 140 141 142 143 144 -14.3225700 -11.2431239 -3.7979757 -21.9612818 9.6130978 12.1522048 145 146 147 148 149 150 2.1851961 12.5828404 0.1767820 -10.6012598 2.1610373 7.9792184 151 152 153 154 155 156 9.0111604 8.9233003 -6.9776916 -0.4106426 3.7721914 8.3930257 157 158 159 160 161 162 -17.5544209 -4.1567767 1.2677602 8.5092804 15.1116020 -2.1261008 > postscript(file="/var/www/html/rcomp/tmp/63qfr1290561126.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 -14.9268223 NA 1 13.6940121 -14.9268223 2 2.0378709 13.6940121 3 0.8001681 2.0378709 4 11.7744732 0.8001681 5 6.1637375 11.7744732 6 -8.8217840 6.1637375 7 11.1479928 -8.8217840 8 3.5456370 11.1479928 9 7.4102728 3.5456370 10 6.6116196 7.4102728 11 -21.5516865 6.6116196 12 4.1847672 -21.5516865 13 -15.0456050 4.1847672 14 13.5203947 -15.0456050 15 -9.2772092 13.5203947 16 7.6813854 -9.2772092 17 15.9571289 7.6813854 18 -5.9428137 15.9571289 19 -12.9293845 -5.9428137 20 -9.6340789 -12.9293845 21 3.2511682 -9.6340789 22 -14.8377412 3.2511682 23 -9.7572459 -14.8377412 24 13.6672910 -9.7572459 25 13.7600178 13.6672910 26 4.5100835 13.7600178 27 1.8612730 4.5100835 28 9.2589172 1.8612730 29 1.2845779 9.2589172 30 7.0737677 1.2845779 31 -12.3787453 7.0737677 32 -2.2992993 -12.3787453 33 13.1458490 -2.2992993 34 5.3007410 13.1458490 35 -2.7686064 5.3007410 36 3.2933762 -2.7686064 37 0.6155744 3.2933762 38 2.4522683 0.6155744 39 -0.8867239 2.4522683 40 1.5853170 -0.8867239 41 4.7950437 1.5853170 42 -20.0584442 4.7950437 43 -14.5853540 -20.0584442 44 0.4671994 -14.5853540 45 1.6220914 0.4671994 46 -7.6631154 1.6220914 47 3.5661733 -7.6631154 48 3.2149496 3.5661733 49 5.3345691 3.2149496 50 -1.1189933 5.3345691 51 -1.7678038 -1.1189933 52 -0.4910110 -1.7678038 53 -4.9994080 -0.4910110 54 -5.9468547 -4.9994080 55 4.8702772 -5.9468547 56 2.5386155 4.8702772 57 -6.1185749 2.5386155 58 3.2521767 -6.1185749 59 3.3875066 3.2521767 60 -6.7747502 3.3875066 61 7.4730513 -6.7747502 62 9.2828525 7.4730513 63 -17.2646686 9.2828525 64 -16.8670244 -17.2646686 65 12.4488925 -16.8670244 66 1.2939662 12.4488925 67 4.1502222 1.2939662 68 -8.0326460 4.1502222 69 -1.4387044 -8.0326460 70 -3.1898535 -1.4387044 71 -16.8117714 -3.1898535 72 9.8017324 -16.8117714 73 -4.1457143 9.8017324 74 13.2994340 -4.1457143 75 15.2664085 13.2994340 76 -3.2150958 15.2664085 77 1.9873002 -3.2150958 78 5.5532999 1.9873002 79 -18.1782872 5.5532999 80 6.1997950 -18.1782872 81 -44.4025608 6.1997950 82 -3.1537100 -44.4025608 83 -0.2146775 -3.1537100 84 -0.3304796 -0.2146775 85 6.1890654 -0.3304796 86 3.2220567 6.1890654 87 -2.5290925 3.2220567 88 -14.7388534 -2.5290925 89 11.2207905 -14.7388534 90 -0.7947715 11.2207905 91 -14.8630696 -0.7947715 92 4.9736243 -14.8630696 93 12.1285163 4.9736243 94 7.8359788 12.1285163 95 5.6531106 7.8359788 96 1.4908537 5.6531106 97 5.4215064 1.4908537 98 5.6032911 5.4215064 99 1.7777452 5.6032911 100 -0.1148668 1.7777452 101 5.2838267 -0.1148668 102 10.9986198 5.2838267 103 -4.0501162 10.9986198 104 8.3828006 -4.0501162 105 4.8010562 8.3828006 106 1.1976512 4.8010562 107 0.2585844 1.1976512 108 -12.7901516 0.2585844 109 -15.1134333 -12.7901516 110 9.8636741 -15.1134333 111 6.1600289 9.8636741 112 15.7260286 6.1600289 113 -32.6995918 15.7260286 114 -0.3494516 -32.6995918 115 10.1896554 -0.3494516 116 -17.4591551 10.1896554 117 -2.1359076 -17.4591551 118 -5.7187013 -2.1359076 119 19.0519758 -5.7187013 120 -15.1382230 19.0519758 121 4.3338179 -15.1382230 122 14.4607680 4.3338179 123 -0.4866787 14.4607680 124 -1.6220428 -0.4866787 125 6.1877583 -1.6220428 126 11.5378985 6.1877583 127 -3.2328127 11.5378985 128 2.5099224 -3.2328127 129 -1.5583757 2.5099224 130 -2.0192687 -1.5583757 131 2.3598628 -2.0192687 132 1.4113668 2.3598628 133 -7.4533032 1.4113668 134 -0.4007498 -7.4533032 135 7.9029356 -0.4007498 136 -9.7923296 7.9029356 137 -9.3286686 -9.7923296 138 -14.3225700 -9.3286686 139 -11.2431239 -14.3225700 140 -3.7979757 -11.2431239 141 -21.9612818 -3.7979757 142 9.6130978 -21.9612818 143 12.1522048 9.6130978 144 2.1851961 12.1522048 145 12.5828404 2.1851961 146 0.1767820 12.5828404 147 -10.6012598 0.1767820 148 2.1610373 -10.6012598 149 7.9792184 2.1610373 150 9.0111604 7.9792184 151 8.9233003 9.0111604 152 -6.9776916 8.9233003 153 -0.4106426 -6.9776916 154 3.7721914 -0.4106426 155 8.3930257 3.7721914 156 -17.5544209 8.3930257 157 -4.1567767 -17.5544209 158 1.2677602 -4.1567767 159 8.5092804 1.2677602 160 15.1116020 8.5092804 161 -2.1261008 15.1116020 162 NA -2.1261008 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 13.6940121 -14.9268223 [2,] 2.0378709 13.6940121 [3,] 0.8001681 2.0378709 [4,] 11.7744732 0.8001681 [5,] 6.1637375 11.7744732 [6,] -8.8217840 6.1637375 [7,] 11.1479928 -8.8217840 [8,] 3.5456370 11.1479928 [9,] 7.4102728 3.5456370 [10,] 6.6116196 7.4102728 [11,] -21.5516865 6.6116196 [12,] 4.1847672 -21.5516865 [13,] -15.0456050 4.1847672 [14,] 13.5203947 -15.0456050 [15,] -9.2772092 13.5203947 [16,] 7.6813854 -9.2772092 [17,] 15.9571289 7.6813854 [18,] -5.9428137 15.9571289 [19,] -12.9293845 -5.9428137 [20,] -9.6340789 -12.9293845 [21,] 3.2511682 -9.6340789 [22,] -14.8377412 3.2511682 [23,] -9.7572459 -14.8377412 [24,] 13.6672910 -9.7572459 [25,] 13.7600178 13.6672910 [26,] 4.5100835 13.7600178 [27,] 1.8612730 4.5100835 [28,] 9.2589172 1.8612730 [29,] 1.2845779 9.2589172 [30,] 7.0737677 1.2845779 [31,] -12.3787453 7.0737677 [32,] -2.2992993 -12.3787453 [33,] 13.1458490 -2.2992993 [34,] 5.3007410 13.1458490 [35,] -2.7686064 5.3007410 [36,] 3.2933762 -2.7686064 [37,] 0.6155744 3.2933762 [38,] 2.4522683 0.6155744 [39,] -0.8867239 2.4522683 [40,] 1.5853170 -0.8867239 [41,] 4.7950437 1.5853170 [42,] -20.0584442 4.7950437 [43,] -14.5853540 -20.0584442 [44,] 0.4671994 -14.5853540 [45,] 1.6220914 0.4671994 [46,] -7.6631154 1.6220914 [47,] 3.5661733 -7.6631154 [48,] 3.2149496 3.5661733 [49,] 5.3345691 3.2149496 [50,] -1.1189933 5.3345691 [51,] -1.7678038 -1.1189933 [52,] -0.4910110 -1.7678038 [53,] -4.9994080 -0.4910110 [54,] -5.9468547 -4.9994080 [55,] 4.8702772 -5.9468547 [56,] 2.5386155 4.8702772 [57,] -6.1185749 2.5386155 [58,] 3.2521767 -6.1185749 [59,] 3.3875066 3.2521767 [60,] -6.7747502 3.3875066 [61,] 7.4730513 -6.7747502 [62,] 9.2828525 7.4730513 [63,] -17.2646686 9.2828525 [64,] -16.8670244 -17.2646686 [65,] 12.4488925 -16.8670244 [66,] 1.2939662 12.4488925 [67,] 4.1502222 1.2939662 [68,] -8.0326460 4.1502222 [69,] -1.4387044 -8.0326460 [70,] -3.1898535 -1.4387044 [71,] -16.8117714 -3.1898535 [72,] 9.8017324 -16.8117714 [73,] -4.1457143 9.8017324 [74,] 13.2994340 -4.1457143 [75,] 15.2664085 13.2994340 [76,] -3.2150958 15.2664085 [77,] 1.9873002 -3.2150958 [78,] 5.5532999 1.9873002 [79,] -18.1782872 5.5532999 [80,] 6.1997950 -18.1782872 [81,] -44.4025608 6.1997950 [82,] -3.1537100 -44.4025608 [83,] -0.2146775 -3.1537100 [84,] -0.3304796 -0.2146775 [85,] 6.1890654 -0.3304796 [86,] 3.2220567 6.1890654 [87,] -2.5290925 3.2220567 [88,] -14.7388534 -2.5290925 [89,] 11.2207905 -14.7388534 [90,] -0.7947715 11.2207905 [91,] -14.8630696 -0.7947715 [92,] 4.9736243 -14.8630696 [93,] 12.1285163 4.9736243 [94,] 7.8359788 12.1285163 [95,] 5.6531106 7.8359788 [96,] 1.4908537 5.6531106 [97,] 5.4215064 1.4908537 [98,] 5.6032911 5.4215064 [99,] 1.7777452 5.6032911 [100,] -0.1148668 1.7777452 [101,] 5.2838267 -0.1148668 [102,] 10.9986198 5.2838267 [103,] -4.0501162 10.9986198 [104,] 8.3828006 -4.0501162 [105,] 4.8010562 8.3828006 [106,] 1.1976512 4.8010562 [107,] 0.2585844 1.1976512 [108,] -12.7901516 0.2585844 [109,] -15.1134333 -12.7901516 [110,] 9.8636741 -15.1134333 [111,] 6.1600289 9.8636741 [112,] 15.7260286 6.1600289 [113,] -32.6995918 15.7260286 [114,] -0.3494516 -32.6995918 [115,] 10.1896554 -0.3494516 [116,] -17.4591551 10.1896554 [117,] -2.1359076 -17.4591551 [118,] -5.7187013 -2.1359076 [119,] 19.0519758 -5.7187013 [120,] -15.1382230 19.0519758 [121,] 4.3338179 -15.1382230 [122,] 14.4607680 4.3338179 [123,] -0.4866787 14.4607680 [124,] -1.6220428 -0.4866787 [125,] 6.1877583 -1.6220428 [126,] 11.5378985 6.1877583 [127,] -3.2328127 11.5378985 [128,] 2.5099224 -3.2328127 [129,] -1.5583757 2.5099224 [130,] -2.0192687 -1.5583757 [131,] 2.3598628 -2.0192687 [132,] 1.4113668 2.3598628 [133,] -7.4533032 1.4113668 [134,] -0.4007498 -7.4533032 [135,] 7.9029356 -0.4007498 [136,] -9.7923296 7.9029356 [137,] -9.3286686 -9.7923296 [138,] -14.3225700 -9.3286686 [139,] -11.2431239 -14.3225700 [140,] -3.7979757 -11.2431239 [141,] -21.9612818 -3.7979757 [142,] 9.6130978 -21.9612818 [143,] 12.1522048 9.6130978 [144,] 2.1851961 12.1522048 [145,] 12.5828404 2.1851961 [146,] 0.1767820 12.5828404 [147,] -10.6012598 0.1767820 [148,] 2.1610373 -10.6012598 [149,] 7.9792184 2.1610373 [150,] 9.0111604 7.9792184 [151,] 8.9233003 9.0111604 [152,] -6.9776916 8.9233003 [153,] -0.4106426 -6.9776916 [154,] 3.7721914 -0.4106426 [155,] 8.3930257 3.7721914 [156,] -17.5544209 8.3930257 [157,] -4.1567767 -17.5544209 [158,] 1.2677602 -4.1567767 [159,] 8.5092804 1.2677602 [160,] 15.1116020 8.5092804 [161,] -2.1261008 15.1116020 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 13.6940121 -14.9268223 2 2.0378709 13.6940121 3 0.8001681 2.0378709 4 11.7744732 0.8001681 5 6.1637375 11.7744732 6 -8.8217840 6.1637375 7 11.1479928 -8.8217840 8 3.5456370 11.1479928 9 7.4102728 3.5456370 10 6.6116196 7.4102728 11 -21.5516865 6.6116196 12 4.1847672 -21.5516865 13 -15.0456050 4.1847672 14 13.5203947 -15.0456050 15 -9.2772092 13.5203947 16 7.6813854 -9.2772092 17 15.9571289 7.6813854 18 -5.9428137 15.9571289 19 -12.9293845 -5.9428137 20 -9.6340789 -12.9293845 21 3.2511682 -9.6340789 22 -14.8377412 3.2511682 23 -9.7572459 -14.8377412 24 13.6672910 -9.7572459 25 13.7600178 13.6672910 26 4.5100835 13.7600178 27 1.8612730 4.5100835 28 9.2589172 1.8612730 29 1.2845779 9.2589172 30 7.0737677 1.2845779 31 -12.3787453 7.0737677 32 -2.2992993 -12.3787453 33 13.1458490 -2.2992993 34 5.3007410 13.1458490 35 -2.7686064 5.3007410 36 3.2933762 -2.7686064 37 0.6155744 3.2933762 38 2.4522683 0.6155744 39 -0.8867239 2.4522683 40 1.5853170 -0.8867239 41 4.7950437 1.5853170 42 -20.0584442 4.7950437 43 -14.5853540 -20.0584442 44 0.4671994 -14.5853540 45 1.6220914 0.4671994 46 -7.6631154 1.6220914 47 3.5661733 -7.6631154 48 3.2149496 3.5661733 49 5.3345691 3.2149496 50 -1.1189933 5.3345691 51 -1.7678038 -1.1189933 52 -0.4910110 -1.7678038 53 -4.9994080 -0.4910110 54 -5.9468547 -4.9994080 55 4.8702772 -5.9468547 56 2.5386155 4.8702772 57 -6.1185749 2.5386155 58 3.2521767 -6.1185749 59 3.3875066 3.2521767 60 -6.7747502 3.3875066 61 7.4730513 -6.7747502 62 9.2828525 7.4730513 63 -17.2646686 9.2828525 64 -16.8670244 -17.2646686 65 12.4488925 -16.8670244 66 1.2939662 12.4488925 67 4.1502222 1.2939662 68 -8.0326460 4.1502222 69 -1.4387044 -8.0326460 70 -3.1898535 -1.4387044 71 -16.8117714 -3.1898535 72 9.8017324 -16.8117714 73 -4.1457143 9.8017324 74 13.2994340 -4.1457143 75 15.2664085 13.2994340 76 -3.2150958 15.2664085 77 1.9873002 -3.2150958 78 5.5532999 1.9873002 79 -18.1782872 5.5532999 80 6.1997950 -18.1782872 81 -44.4025608 6.1997950 82 -3.1537100 -44.4025608 83 -0.2146775 -3.1537100 84 -0.3304796 -0.2146775 85 6.1890654 -0.3304796 86 3.2220567 6.1890654 87 -2.5290925 3.2220567 88 -14.7388534 -2.5290925 89 11.2207905 -14.7388534 90 -0.7947715 11.2207905 91 -14.8630696 -0.7947715 92 4.9736243 -14.8630696 93 12.1285163 4.9736243 94 7.8359788 12.1285163 95 5.6531106 7.8359788 96 1.4908537 5.6531106 97 5.4215064 1.4908537 98 5.6032911 5.4215064 99 1.7777452 5.6032911 100 -0.1148668 1.7777452 101 5.2838267 -0.1148668 102 10.9986198 5.2838267 103 -4.0501162 10.9986198 104 8.3828006 -4.0501162 105 4.8010562 8.3828006 106 1.1976512 4.8010562 107 0.2585844 1.1976512 108 -12.7901516 0.2585844 109 -15.1134333 -12.7901516 110 9.8636741 -15.1134333 111 6.1600289 9.8636741 112 15.7260286 6.1600289 113 -32.6995918 15.7260286 114 -0.3494516 -32.6995918 115 10.1896554 -0.3494516 116 -17.4591551 10.1896554 117 -2.1359076 -17.4591551 118 -5.7187013 -2.1359076 119 19.0519758 -5.7187013 120 -15.1382230 19.0519758 121 4.3338179 -15.1382230 122 14.4607680 4.3338179 123 -0.4866787 14.4607680 124 -1.6220428 -0.4866787 125 6.1877583 -1.6220428 126 11.5378985 6.1877583 127 -3.2328127 11.5378985 128 2.5099224 -3.2328127 129 -1.5583757 2.5099224 130 -2.0192687 -1.5583757 131 2.3598628 -2.0192687 132 1.4113668 2.3598628 133 -7.4533032 1.4113668 134 -0.4007498 -7.4533032 135 7.9029356 -0.4007498 136 -9.7923296 7.9029356 137 -9.3286686 -9.7923296 138 -14.3225700 -9.3286686 139 -11.2431239 -14.3225700 140 -3.7979757 -11.2431239 141 -21.9612818 -3.7979757 142 9.6130978 -21.9612818 143 12.1522048 9.6130978 144 2.1851961 12.1522048 145 12.5828404 2.1851961 146 0.1767820 12.5828404 147 -10.6012598 0.1767820 148 2.1610373 -10.6012598 149 7.9792184 2.1610373 150 9.0111604 7.9792184 151 8.9233003 9.0111604 152 -6.9776916 8.9233003 153 -0.4106426 -6.9776916 154 3.7721914 -0.4106426 155 8.3930257 3.7721914 156 -17.5544209 8.3930257 157 -4.1567767 -17.5544209 158 1.2677602 -4.1567767 159 8.5092804 1.2677602 160 15.1116020 8.5092804 161 -2.1261008 15.1116020 > 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/7rwqo1290561126.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/8rwqo1290561126.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/9rwqo1290561126.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/101n791290561126.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/11no5f1290561126.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/128om21290561126.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/13mg1t1290561126.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/14qh0z1290561126.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/15thzn1290561126.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/16x0xb1290561126.tab") + } > > try(system("convert tmp/1v4ax1290561126.ps tmp/1v4ax1290561126.png",intern=TRUE)) character(0) > try(system("convert tmp/2v4ax1290561126.ps tmp/2v4ax1290561126.png",intern=TRUE)) character(0) > try(system("convert tmp/35vr01290561126.ps tmp/35vr01290561126.png",intern=TRUE)) character(0) > try(system("convert tmp/45vr01290561126.ps tmp/45vr01290561126.png",intern=TRUE)) character(0) > try(system("convert tmp/55vr01290561126.ps tmp/55vr01290561126.png",intern=TRUE)) character(0) > try(system("convert tmp/63qfr1290561126.ps tmp/63qfr1290561126.png",intern=TRUE)) character(0) > try(system("convert tmp/7rwqo1290561126.ps tmp/7rwqo1290561126.png",intern=TRUE)) character(0) > try(system("convert tmp/8rwqo1290561126.ps tmp/8rwqo1290561126.png",intern=TRUE)) character(0) > try(system("convert tmp/9rwqo1290561126.ps tmp/9rwqo1290561126.png",intern=TRUE)) character(0) > try(system("convert tmp/101n791290561126.ps tmp/101n791290561126.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.911 1.718 9.375