R version 2.7.0 (2008-04-22) Copyright (C) 2008 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(1778.8 + ,0 + ,1264.9 + ,0 + ,1749.1 + ,0 + ,1795.6 + ,0 + ,1759 + ,0 + ,1645.1 + ,0 + ,1589.9 + ,0 + ,1712.6 + ,0 + ,1782.5 + ,0 + ,1606.6 + ,0 + ,1882.1 + ,0 + ,1846.9 + ,0 + ,1873.2 + ,0 + ,1368.3 + ,0 + ,1843.5 + ,0 + ,2074.5 + ,0 + ,1848.5 + ,0 + ,1909.3 + ,0 + ,1932.9 + ,0 + ,2119.1 + ,0 + ,2202 + ,0 + ,2260.8 + ,0 + ,2097.1 + ,0 + ,2026.2 + ,0 + ,2475.2 + ,0 + ,1732.3 + ,0 + ,2385.2 + ,0 + ,2362.2 + ,0 + ,2119 + ,0 + ,2260.3 + ,0 + ,2006.5 + ,0 + ,2073.2 + ,0 + ,2207.8 + ,0 + ,2018.9 + ,0 + ,2082.8 + ,0 + ,2314.3 + ,0 + ,2252.7 + ,0 + ,1633.1 + ,0 + ,2161.1 + ,0 + ,1987.9 + ,0 + ,1870.3 + ,0 + ,1984.6 + ,0 + ,1735.9 + ,0 + ,1910 + ,0 + ,2410.1 + ,0 + ,1994.6 + ,0 + ,2152.3 + ,0 + ,2554 + ,0 + ,2754.5 + ,0 + ,1812.3 + ,0 + ,2549.9 + ,0 + ,2558.4 + ,0 + ,2279.2 + ,0 + ,2591.8 + ,0 + ,2442.4 + ,0 + ,2607.7 + ,0 + ,3106.7 + ,0 + ,2447.5 + ,0 + ,3129.5 + ,0 + ,2606.6 + ,0 + ,2964.4 + ,0 + ,2211.6 + ,0 + ,3246.1 + ,0 + ,3141.8 + ,0 + ,3125.9 + ,0 + ,2890.5 + ,0 + ,2554.3 + ,0 + ,2771.1 + ,0 + ,2950 + ,0 + ,2512.1 + ,0 + ,2800 + ,0 + ,2877.2 + ,0 + ,3048.7 + ,0 + ,2082.7 + ,0 + ,2454.8 + ,0 + ,2807.8 + ,0 + ,2627.6 + ,0 + ,2515.9 + ,0 + ,2690.3 + ,0 + ,2770.8 + ,0 + ,2907.7 + ,0 + ,2906.3 + ,0 + ,3104.6 + ,0 + ,2862.1 + ,0 + ,3189.1 + ,0 + ,2071.8 + ,0 + ,2907.7 + ,0 + ,3194.5 + ,0 + ,2722.9 + ,0 + ,2854.8 + ,0 + ,2803 + ,0 + ,2744.9 + ,0 + ,2574.2 + ,0 + ,2740.9 + ,0 + ,2635.9 + ,0 + ,2612.7 + ,0 + ,3094.2 + ,0 + ,2029 + ,0 + ,2931.1 + ,0 + ,2952.2 + ,0 + ,2601.9 + ,0 + ,2874 + ,0 + ,2570.9 + ,0 + ,2849.8 + ,0 + ,3171.5 + ,0 + ,2843.6 + ,0 + ,2831.5 + ,0 + ,3284.4 + ,0 + ,3230.1 + ,0 + ,2412.2 + ,0 + ,3052.7 + ,0 + ,3048.9 + ,0 + ,2819.9 + ,0 + ,2962.7 + ,0 + ,2796.6 + ,0 + ,2857.2 + ,0 + ,3213.1 + ,0 + ,3116.2 + ,0 + ,3340.1 + ,0 + ,3602 + ,0 + ,3626.4 + ,0 + ,2741.6 + ,1 + ,3756.2 + ,1 + ,3140 + ,1 + ,3421.6 + ,1 + ,3243.7 + ,1 + ,3085.2 + ,1 + ,3152.8 + ,1 + ,3543.6 + ,1 + ,2959.3 + ,1 + ,3594.1 + ,1 + ,3207.9 + ,1 + ,3366.7 + ,1 + ,2658.4 + ,1 + ,3340.4 + ,1 + ,3368.4 + ,1 + ,3422.1 + ,1 + ,3268 + ,1 + ,3234.4 + ,1 + ,3365.1 + ,1 + ,3923.6 + ,1 + ,3147.3 + ,1 + ,3447.7 + ,1 + ,3719.8 + ,1 + ,4090.4 + ,1 + ,3386.7 + ,1 + ,3436.8 + ,1 + ,3744.9 + ,1 + ,3325.8 + ,1 + ,3322.1 + ,1 + ,3338.6 + ,1 + ,3464.2 + ,1 + ,3404.1 + ,1 + ,3942 + ,1 + ,3859.9 + ,1 + ,3895.4 + ,1 + ,4472.2 + ,1 + ,3025.5 + ,1 + ,4285.9 + ,1) + ,dim=c(2 + ,159) + ,dimnames=list(c('x' + ,'y') + ,1:159)) > y <- array(NA,dim=c(2,159),dimnames=list(c('x','y'),1:159)) > 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 = '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 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 x y t 1 1778.8 0 1 2 1264.9 0 2 3 1749.1 0 3 4 1795.6 0 4 5 1759.0 0 5 6 1645.1 0 6 7 1589.9 0 7 8 1712.6 0 8 9 1782.5 0 9 10 1606.6 0 10 11 1882.1 0 11 12 1846.9 0 12 13 1873.2 0 13 14 1368.3 0 14 15 1843.5 0 15 16 2074.5 0 16 17 1848.5 0 17 18 1909.3 0 18 19 1932.9 0 19 20 2119.1 0 20 21 2202.0 0 21 22 2260.8 0 22 23 2097.1 0 23 24 2026.2 0 24 25 2475.2 0 25 26 1732.3 0 26 27 2385.2 0 27 28 2362.2 0 28 29 2119.0 0 29 30 2260.3 0 30 31 2006.5 0 31 32 2073.2 0 32 33 2207.8 0 33 34 2018.9 0 34 35 2082.8 0 35 36 2314.3 0 36 37 2252.7 0 37 38 1633.1 0 38 39 2161.1 0 39 40 1987.9 0 40 41 1870.3 0 41 42 1984.6 0 42 43 1735.9 0 43 44 1910.0 0 44 45 2410.1 0 45 46 1994.6 0 46 47 2152.3 0 47 48 2554.0 0 48 49 2754.5 0 49 50 1812.3 0 50 51 2549.9 0 51 52 2558.4 0 52 53 2279.2 0 53 54 2591.8 0 54 55 2442.4 0 55 56 2607.7 0 56 57 3106.7 0 57 58 2447.5 0 58 59 3129.5 0 59 60 2606.6 0 60 61 2964.4 0 61 62 2211.6 0 62 63 3246.1 0 63 64 3141.8 0 64 65 3125.9 0 65 66 2890.5 0 66 67 2554.3 0 67 68 2771.1 0 68 69 2950.0 0 69 70 2512.1 0 70 71 2800.0 0 71 72 2877.2 0 72 73 3048.7 0 73 74 2082.7 0 74 75 2454.8 0 75 76 2807.8 0 76 77 2627.6 0 77 78 2515.9 0 78 79 2690.3 0 79 80 2770.8 0 80 81 2907.7 0 81 82 2906.3 0 82 83 3104.6 0 83 84 2862.1 0 84 85 3189.1 0 85 86 2071.8 0 86 87 2907.7 0 87 88 3194.5 0 88 89 2722.9 0 89 90 2854.8 0 90 91 2803.0 0 91 92 2744.9 0 92 93 2574.2 0 93 94 2740.9 0 94 95 2635.9 0 95 96 2612.7 0 96 97 3094.2 0 97 98 2029.0 0 98 99 2931.1 0 99 100 2952.2 0 100 101 2601.9 0 101 102 2874.0 0 102 103 2570.9 0 103 104 2849.8 0 104 105 3171.5 0 105 106 2843.6 0 106 107 2831.5 0 107 108 3284.4 0 108 109 3230.1 0 109 110 2412.2 0 110 111 3052.7 0 111 112 3048.9 0 112 113 2819.9 0 113 114 2962.7 0 114 115 2796.6 0 115 116 2857.2 0 116 117 3213.1 0 117 118 3116.2 0 118 119 3340.1 0 119 120 3602.0 0 120 121 3626.4 0 121 122 2741.6 1 122 123 3756.2 1 123 124 3140.0 1 124 125 3421.6 1 125 126 3243.7 1 126 127 3085.2 1 127 128 3152.8 1 128 129 3543.6 1 129 130 2959.3 1 130 131 3594.1 1 131 132 3207.9 1 132 133 3366.7 1 133 134 2658.4 1 134 135 3340.4 1 135 136 3368.4 1 136 137 3422.1 1 137 138 3268.0 1 138 139 3234.4 1 139 140 3365.1 1 140 141 3923.6 1 141 142 3147.3 1 142 143 3447.7 1 143 144 3719.8 1 144 145 4090.4 1 145 146 3386.7 1 146 147 3436.8 1 147 148 3744.9 1 148 149 3325.8 1 149 150 3322.1 1 150 151 3338.6 1 151 152 3464.2 1 152 153 3404.1 1 153 154 3942.0 1 154 155 3859.9 1 155 156 3895.4 1 156 157 4472.2 1 157 158 3025.5 1 158 159 4285.9 1 159 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) y t 1727.1931 -0.5504 12.2663 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -900.29 -175.95 -27.35 193.47 819.74 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 1727.1931 55.6138 31.057 <2e-16 *** y -0.5504 84.8266 -0.006 0.995 t 12.2663 0.7882 15.563 <2e-16 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 307.5 on 156 degrees of freedom Multiple R-squared: 0.7735, Adjusted R-squared: 0.7706 F-statistic: 266.4 on 2 and 156 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.4323539713 0.8647079426 0.5676460 [2,] 0.2951861283 0.5903722565 0.7048139 [3,] 0.1747402842 0.3494805685 0.8252597 [4,] 0.0996807374 0.1993614749 0.9003193 [5,] 0.0615078542 0.1230157085 0.9384921 [6,] 0.0405055927 0.0810111854 0.9594944 [7,] 0.0211643538 0.0423287076 0.9788356 [8,] 0.0104975100 0.0209950200 0.9895025 [9,] 0.0440625352 0.0881250704 0.9559375 [10,] 0.0275387678 0.0550775355 0.9724612 [11,] 0.0301359609 0.0602719218 0.9698640 [12,] 0.0174563684 0.0349127368 0.9825436 [13,] 0.0098916026 0.0197832051 0.9901084 [14,] 0.0054413545 0.0108827089 0.9945586 [15,] 0.0041935858 0.0083871715 0.9958064 [16,] 0.0035995952 0.0071991904 0.9964004 [17,] 0.0030651325 0.0061302651 0.9969349 [18,] 0.0016345237 0.0032690473 0.9983655 [19,] 0.0009365301 0.0018730603 0.9990635 [20,] 0.0015940557 0.0031881114 0.9984059 [21,] 0.0054952149 0.0109904298 0.9945048 [22,] 0.0046725952 0.0093451904 0.9953274 [23,] 0.0032757228 0.0065514456 0.9967243 [24,] 0.0022287821 0.0044575641 0.9977712 [25,] 0.0013006769 0.0026013537 0.9986993 [26,] 0.0013875509 0.0027751017 0.9986124 [27,] 0.0011017213 0.0022034426 0.9988983 [28,] 0.0006555447 0.0013110894 0.9993445 [29,] 0.0006622506 0.0013245012 0.9993377 [30,] 0.0005105379 0.0010210757 0.9994895 [31,] 0.0002938510 0.0005877021 0.9997061 [32,] 0.0001668014 0.0003336028 0.9998332 [33,] 0.0026942480 0.0053884960 0.9973058 [34,] 0.0018048165 0.0036096329 0.9981952 [35,] 0.0018522646 0.0037045292 0.9981477 [36,] 0.0029314172 0.0058628344 0.9970686 [37,] 0.0028346531 0.0056693063 0.9971653 [38,] 0.0073844422 0.0147688844 0.9926156 [39,] 0.0084462835 0.0168925670 0.9915537 [40,] 0.0071496259 0.0142992518 0.9928504 [41,] 0.0070103785 0.0140207570 0.9929896 [42,] 0.0053338417 0.0106676833 0.9946662 [43,] 0.0058483799 0.0116967598 0.9941516 [44,] 0.0107956935 0.0215913870 0.9892043 [45,] 0.0244819949 0.0489639899 0.9755180 [46,] 0.0223846869 0.0447693738 0.9776153 [47,] 0.0196790420 0.0393580840 0.9803210 [48,] 0.0156446231 0.0312892462 0.9843554 [49,] 0.0135616908 0.0271233816 0.9864383 [50,] 0.0101218802 0.0202437605 0.9898781 [51,] 0.0083177034 0.0166354068 0.9916823 [52,] 0.0275137253 0.0550274506 0.9724863 [53,] 0.0211115565 0.0422231129 0.9788884 [54,] 0.0496696953 0.0993393905 0.9503303 [55,] 0.0386131115 0.0772262230 0.9613869 [56,] 0.0456454049 0.0912908098 0.9543546 [57,] 0.0550478264 0.1100956527 0.9449522 [58,] 0.1184194217 0.2368388435 0.8815806 [59,] 0.1662686479 0.3325372958 0.8337314 [60,] 0.2130916707 0.4261833414 0.7869083 [61,] 0.2006380815 0.4012761630 0.7993619 [62,] 0.1794342317 0.3588684633 0.8205658 [63,] 0.1562597479 0.3125194959 0.8437403 [64,] 0.1526463378 0.3052926756 0.8473537 [65,] 0.1435623908 0.2871247816 0.8564376 [66,] 0.1256051300 0.2512102601 0.8743949 [67,] 0.1142598261 0.2285196522 0.8857402 [68,] 0.1252197241 0.2504394483 0.8747803 [69,] 0.2507414227 0.5014828454 0.7492586 [70,] 0.2531775309 0.5063550618 0.7468225 [71,] 0.2271166317 0.4542332634 0.7728834 [72,] 0.2057454015 0.4114908030 0.7942546 [73,] 0.1990276291 0.3980552583 0.8009724 [74,] 0.1751821115 0.3503642230 0.8248179 [75,] 0.1521544704 0.3043089408 0.8478455 [76,] 0.1370917900 0.2741835801 0.8629082 [77,] 0.1234039209 0.2468078418 0.8765961 [78,] 0.1353657504 0.2707315009 0.8646342 [79,] 0.1216624204 0.2433248409 0.8783376 [80,] 0.1550854871 0.3101709741 0.8449145 [81,] 0.3310137057 0.6620274115 0.6689863 [82,] 0.3106537236 0.6213074472 0.6893463 [83,] 0.3664759934 0.7329519868 0.6335240 [84,] 0.3437454690 0.6874909380 0.6562545 [85,] 0.3221962083 0.6443924166 0.6778038 [86,] 0.2992577645 0.5985155289 0.7007422 [87,] 0.2776240901 0.5552481802 0.7223759 [88,] 0.2763682951 0.5527365902 0.7236317 [89,] 0.2532104643 0.5064209287 0.7467895 [90,] 0.2413357152 0.4826714304 0.7586643 [91,] 0.2332238845 0.4664477691 0.7667761 [92,] 0.2309291590 0.4618583179 0.7690708 [93,] 0.5079001794 0.9841996412 0.4920998 [94,] 0.4685945140 0.9371890280 0.5314055 [95,] 0.4303935971 0.8607871942 0.5696064 [96,] 0.4285737717 0.8571475435 0.5714262 [97,] 0.3861542567 0.7723085133 0.6138457 [98,] 0.4016484338 0.8032968675 0.5983516 [99,] 0.3611828798 0.7223657596 0.6388171 [100,] 0.3402517846 0.6805035692 0.6597482 [101,] 0.3046135031 0.6092270062 0.6953865 [102,] 0.2736010462 0.5472020923 0.7263990 [103,] 0.2690712375 0.5381424750 0.7309288 [104,] 0.2530271050 0.5060542100 0.7469729 [105,] 0.3748173851 0.7496347702 0.6251826 [106,] 0.3286416896 0.6572833793 0.6713583 [107,] 0.2847828000 0.5695656001 0.7152172 [108,] 0.2737339099 0.5474678199 0.7262661 [109,] 0.2435032442 0.4870064884 0.7564968 [110,] 0.2602094456 0.5204188912 0.7397906 [111,] 0.2813033203 0.5626066405 0.7186967 [112,] 0.2464741520 0.4929483039 0.7535258 [113,] 0.2362370743 0.4724741487 0.7637629 [114,] 0.2128234813 0.4256469626 0.7871765 [115,] 0.1951616498 0.3903232996 0.8048384 [116,] 0.1775493168 0.3550986336 0.8224507 [117,] 0.1812236948 0.3624473895 0.8187763 [118,] 0.3140129998 0.6280259995 0.6859870 [119,] 0.2676874175 0.5353748349 0.7323126 [120,] 0.2556528380 0.5113056759 0.7443472 [121,] 0.2173249020 0.4346498039 0.7826751 [122,] 0.1815373031 0.3630746062 0.8184627 [123,] 0.1469007056 0.2938014111 0.8530993 [124,] 0.1552824919 0.3105649838 0.8447175 [125,] 0.1404959354 0.2809918708 0.8595041 [126,] 0.1567060702 0.3134121404 0.8432939 [127,] 0.1240544123 0.2481088245 0.8759456 [128,] 0.1021655215 0.2043310429 0.8978345 [129,] 0.1838465672 0.3676931343 0.8161534 [130,] 0.1445922555 0.2891845111 0.8554077 [131,] 0.1113167909 0.2226335819 0.8886832 [132,] 0.0849210499 0.1698420997 0.9150790 [133,] 0.0629631752 0.1259263505 0.9370368 [134,] 0.0480132867 0.0960265734 0.9519867 [135,] 0.0335513797 0.0671027594 0.9664486 [136,] 0.0528226900 0.1056453799 0.9471773 [137,] 0.0456295933 0.0912591865 0.9543704 [138,] 0.0303190827 0.0606381653 0.9696809 [139,] 0.0243048526 0.0486097051 0.9756951 [140,] 0.0870894694 0.1741789388 0.9129105 [141,] 0.0592293222 0.1184586445 0.9407707 [142,] 0.0388127473 0.0776254947 0.9611873 [143,] 0.0479433947 0.0958867894 0.9520566 [144,] 0.0288456994 0.0576913987 0.9711543 [145,] 0.0160130436 0.0320260873 0.9839870 [146,] 0.0086070199 0.0172140398 0.9913930 [147,] 0.0040965123 0.0081930245 0.9959035 [148,] 0.0032585526 0.0065171053 0.9967414 > postscript(file="/var/www/html/rcomp/tmp/1871m1230123040.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/2kq981230123040.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/3j74q1230123040.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/4dv1h1230123040.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/5q4gl1230123040.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 = 159 Frequency = 1 1 2 3 4 5 6 39.340592 -486.825746 -14.892083 19.341579 -29.524759 -155.691096 7 8 9 10 11 12 -223.157434 -112.723772 -55.090109 -243.256447 19.977215 -27.489123 13 14 15 16 17 18 -13.455460 -530.621798 -67.688136 151.045527 -87.220811 -38.687149 19 20 21 22 23 24 -27.353486 146.580176 217.213838 263.747501 87.781163 4.614825 25 26 27 28 29 30 441.348487 -313.817850 326.815812 291.549474 36.083137 165.116799 31 32 33 34 35 36 -100.949539 -46.515876 75.817786 -125.348552 -73.714889 145.518773 37 38 39 40 41 42 71.652435 -560.213903 -44.480240 -229.946578 -359.812916 -257.779253 43 44 45 46 47 48 -518.745591 -356.911929 130.921734 -296.844604 -151.410942 238.022721 49 50 51 52 53 54 426.256383 -528.209955 197.123707 193.357370 -98.108968 202.224694 55 56 57 58 59 60 40.558357 193.592019 680.325681 8.859344 678.593006 143.426668 61 62 63 64 65 66 488.960331 -276.106007 746.127655 629.561318 601.394980 353.728642 67 68 69 70 71 72 5.262304 209.795967 376.429629 -73.736709 201.896954 266.830616 73 74 75 76 77 78 426.064278 -552.202059 -192.368397 148.365265 -44.101072 -168.067410 79 80 81 82 83 84 -5.933748 62.299914 186.933577 173.267239 359.300901 104.534564 85 86 87 88 89 90 419.268226 -710.298112 113.335551 387.869213 -95.997125 23.636538 91 92 93 94 95 96 -40.429800 -110.796138 -293.762476 -139.328813 -256.595151 -292.061489 97 98 99 100 101 102 177.172174 -900.294164 -10.460502 -1.626839 -364.193177 -104.359515 103 104 105 106 107 108 -419.725852 -153.092190 156.341472 -183.824866 -208.191203 232.442459 109 110 111 112 113 114 165.876121 -664.290216 -36.056554 -52.122892 -293.389229 -162.855567 115 116 117 118 119 120 -341.221905 -292.888242 50.745420 -58.420918 153.212745 402.846407 121 122 123 124 125 126 414.980069 -481.535911 520.797752 -107.668586 161.665076 -28.501261 127 128 129 130 131 132 -199.267599 -143.933937 234.599726 -361.966612 260.567050 -137.899288 133 134 135 136 137 138 8.634375 -711.931963 -42.198301 -26.464638 14.969024 -151.397314 139 140 141 142 143 144 -197.263651 -78.829989 467.403673 -321.162664 -33.029002 226.804660 145 146 147 148 149 150 585.138322 -130.828015 -92.994353 202.839309 -228.527028 -244.493366 151 152 153 154 155 156 -240.259704 -126.926041 -199.292379 326.341283 231.974946 255.208608 157 158 159 819.742270 -639.224067 608.909595 > postscript(file="/var/www/html/rcomp/tmp/6onfw1230123040.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 = 159 Frequency = 1 lag(myerror, k = 1) myerror 0 39.340592 NA 1 -486.825746 39.340592 2 -14.892083 -486.825746 3 19.341579 -14.892083 4 -29.524759 19.341579 5 -155.691096 -29.524759 6 -223.157434 -155.691096 7 -112.723772 -223.157434 8 -55.090109 -112.723772 9 -243.256447 -55.090109 10 19.977215 -243.256447 11 -27.489123 19.977215 12 -13.455460 -27.489123 13 -530.621798 -13.455460 14 -67.688136 -530.621798 15 151.045527 -67.688136 16 -87.220811 151.045527 17 -38.687149 -87.220811 18 -27.353486 -38.687149 19 146.580176 -27.353486 20 217.213838 146.580176 21 263.747501 217.213838 22 87.781163 263.747501 23 4.614825 87.781163 24 441.348487 4.614825 25 -313.817850 441.348487 26 326.815812 -313.817850 27 291.549474 326.815812 28 36.083137 291.549474 29 165.116799 36.083137 30 -100.949539 165.116799 31 -46.515876 -100.949539 32 75.817786 -46.515876 33 -125.348552 75.817786 34 -73.714889 -125.348552 35 145.518773 -73.714889 36 71.652435 145.518773 37 -560.213903 71.652435 38 -44.480240 -560.213903 39 -229.946578 -44.480240 40 -359.812916 -229.946578 41 -257.779253 -359.812916 42 -518.745591 -257.779253 43 -356.911929 -518.745591 44 130.921734 -356.911929 45 -296.844604 130.921734 46 -151.410942 -296.844604 47 238.022721 -151.410942 48 426.256383 238.022721 49 -528.209955 426.256383 50 197.123707 -528.209955 51 193.357370 197.123707 52 -98.108968 193.357370 53 202.224694 -98.108968 54 40.558357 202.224694 55 193.592019 40.558357 56 680.325681 193.592019 57 8.859344 680.325681 58 678.593006 8.859344 59 143.426668 678.593006 60 488.960331 143.426668 61 -276.106007 488.960331 62 746.127655 -276.106007 63 629.561318 746.127655 64 601.394980 629.561318 65 353.728642 601.394980 66 5.262304 353.728642 67 209.795967 5.262304 68 376.429629 209.795967 69 -73.736709 376.429629 70 201.896954 -73.736709 71 266.830616 201.896954 72 426.064278 266.830616 73 -552.202059 426.064278 74 -192.368397 -552.202059 75 148.365265 -192.368397 76 -44.101072 148.365265 77 -168.067410 -44.101072 78 -5.933748 -168.067410 79 62.299914 -5.933748 80 186.933577 62.299914 81 173.267239 186.933577 82 359.300901 173.267239 83 104.534564 359.300901 84 419.268226 104.534564 85 -710.298112 419.268226 86 113.335551 -710.298112 87 387.869213 113.335551 88 -95.997125 387.869213 89 23.636538 -95.997125 90 -40.429800 23.636538 91 -110.796138 -40.429800 92 -293.762476 -110.796138 93 -139.328813 -293.762476 94 -256.595151 -139.328813 95 -292.061489 -256.595151 96 177.172174 -292.061489 97 -900.294164 177.172174 98 -10.460502 -900.294164 99 -1.626839 -10.460502 100 -364.193177 -1.626839 101 -104.359515 -364.193177 102 -419.725852 -104.359515 103 -153.092190 -419.725852 104 156.341472 -153.092190 105 -183.824866 156.341472 106 -208.191203 -183.824866 107 232.442459 -208.191203 108 165.876121 232.442459 109 -664.290216 165.876121 110 -36.056554 -664.290216 111 -52.122892 -36.056554 112 -293.389229 -52.122892 113 -162.855567 -293.389229 114 -341.221905 -162.855567 115 -292.888242 -341.221905 116 50.745420 -292.888242 117 -58.420918 50.745420 118 153.212745 -58.420918 119 402.846407 153.212745 120 414.980069 402.846407 121 -481.535911 414.980069 122 520.797752 -481.535911 123 -107.668586 520.797752 124 161.665076 -107.668586 125 -28.501261 161.665076 126 -199.267599 -28.501261 127 -143.933937 -199.267599 128 234.599726 -143.933937 129 -361.966612 234.599726 130 260.567050 -361.966612 131 -137.899288 260.567050 132 8.634375 -137.899288 133 -711.931963 8.634375 134 -42.198301 -711.931963 135 -26.464638 -42.198301 136 14.969024 -26.464638 137 -151.397314 14.969024 138 -197.263651 -151.397314 139 -78.829989 -197.263651 140 467.403673 -78.829989 141 -321.162664 467.403673 142 -33.029002 -321.162664 143 226.804660 -33.029002 144 585.138322 226.804660 145 -130.828015 585.138322 146 -92.994353 -130.828015 147 202.839309 -92.994353 148 -228.527028 202.839309 149 -244.493366 -228.527028 150 -240.259704 -244.493366 151 -126.926041 -240.259704 152 -199.292379 -126.926041 153 326.341283 -199.292379 154 231.974946 326.341283 155 255.208608 231.974946 156 819.742270 255.208608 157 -639.224067 819.742270 158 608.909595 -639.224067 159 NA 608.909595 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -486.825746 39.340592 [2,] -14.892083 -486.825746 [3,] 19.341579 -14.892083 [4,] -29.524759 19.341579 [5,] -155.691096 -29.524759 [6,] -223.157434 -155.691096 [7,] -112.723772 -223.157434 [8,] -55.090109 -112.723772 [9,] -243.256447 -55.090109 [10,] 19.977215 -243.256447 [11,] -27.489123 19.977215 [12,] -13.455460 -27.489123 [13,] -530.621798 -13.455460 [14,] -67.688136 -530.621798 [15,] 151.045527 -67.688136 [16,] -87.220811 151.045527 [17,] -38.687149 -87.220811 [18,] -27.353486 -38.687149 [19,] 146.580176 -27.353486 [20,] 217.213838 146.580176 [21,] 263.747501 217.213838 [22,] 87.781163 263.747501 [23,] 4.614825 87.781163 [24,] 441.348487 4.614825 [25,] -313.817850 441.348487 [26,] 326.815812 -313.817850 [27,] 291.549474 326.815812 [28,] 36.083137 291.549474 [29,] 165.116799 36.083137 [30,] -100.949539 165.116799 [31,] -46.515876 -100.949539 [32,] 75.817786 -46.515876 [33,] -125.348552 75.817786 [34,] -73.714889 -125.348552 [35,] 145.518773 -73.714889 [36,] 71.652435 145.518773 [37,] -560.213903 71.652435 [38,] -44.480240 -560.213903 [39,] -229.946578 -44.480240 [40,] -359.812916 -229.946578 [41,] -257.779253 -359.812916 [42,] -518.745591 -257.779253 [43,] -356.911929 -518.745591 [44,] 130.921734 -356.911929 [45,] -296.844604 130.921734 [46,] -151.410942 -296.844604 [47,] 238.022721 -151.410942 [48,] 426.256383 238.022721 [49,] -528.209955 426.256383 [50,] 197.123707 -528.209955 [51,] 193.357370 197.123707 [52,] -98.108968 193.357370 [53,] 202.224694 -98.108968 [54,] 40.558357 202.224694 [55,] 193.592019 40.558357 [56,] 680.325681 193.592019 [57,] 8.859344 680.325681 [58,] 678.593006 8.859344 [59,] 143.426668 678.593006 [60,] 488.960331 143.426668 [61,] -276.106007 488.960331 [62,] 746.127655 -276.106007 [63,] 629.561318 746.127655 [64,] 601.394980 629.561318 [65,] 353.728642 601.394980 [66,] 5.262304 353.728642 [67,] 209.795967 5.262304 [68,] 376.429629 209.795967 [69,] -73.736709 376.429629 [70,] 201.896954 -73.736709 [71,] 266.830616 201.896954 [72,] 426.064278 266.830616 [73,] -552.202059 426.064278 [74,] -192.368397 -552.202059 [75,] 148.365265 -192.368397 [76,] -44.101072 148.365265 [77,] -168.067410 -44.101072 [78,] -5.933748 -168.067410 [79,] 62.299914 -5.933748 [80,] 186.933577 62.299914 [81,] 173.267239 186.933577 [82,] 359.300901 173.267239 [83,] 104.534564 359.300901 [84,] 419.268226 104.534564 [85,] -710.298112 419.268226 [86,] 113.335551 -710.298112 [87,] 387.869213 113.335551 [88,] -95.997125 387.869213 [89,] 23.636538 -95.997125 [90,] -40.429800 23.636538 [91,] -110.796138 -40.429800 [92,] -293.762476 -110.796138 [93,] -139.328813 -293.762476 [94,] -256.595151 -139.328813 [95,] -292.061489 -256.595151 [96,] 177.172174 -292.061489 [97,] -900.294164 177.172174 [98,] -10.460502 -900.294164 [99,] -1.626839 -10.460502 [100,] -364.193177 -1.626839 [101,] -104.359515 -364.193177 [102,] -419.725852 -104.359515 [103,] -153.092190 -419.725852 [104,] 156.341472 -153.092190 [105,] -183.824866 156.341472 [106,] -208.191203 -183.824866 [107,] 232.442459 -208.191203 [108,] 165.876121 232.442459 [109,] -664.290216 165.876121 [110,] -36.056554 -664.290216 [111,] -52.122892 -36.056554 [112,] -293.389229 -52.122892 [113,] -162.855567 -293.389229 [114,] -341.221905 -162.855567 [115,] -292.888242 -341.221905 [116,] 50.745420 -292.888242 [117,] -58.420918 50.745420 [118,] 153.212745 -58.420918 [119,] 402.846407 153.212745 [120,] 414.980069 402.846407 [121,] -481.535911 414.980069 [122,] 520.797752 -481.535911 [123,] -107.668586 520.797752 [124,] 161.665076 -107.668586 [125,] -28.501261 161.665076 [126,] -199.267599 -28.501261 [127,] -143.933937 -199.267599 [128,] 234.599726 -143.933937 [129,] -361.966612 234.599726 [130,] 260.567050 -361.966612 [131,] -137.899288 260.567050 [132,] 8.634375 -137.899288 [133,] -711.931963 8.634375 [134,] -42.198301 -711.931963 [135,] -26.464638 -42.198301 [136,] 14.969024 -26.464638 [137,] -151.397314 14.969024 [138,] -197.263651 -151.397314 [139,] -78.829989 -197.263651 [140,] 467.403673 -78.829989 [141,] -321.162664 467.403673 [142,] -33.029002 -321.162664 [143,] 226.804660 -33.029002 [144,] 585.138322 226.804660 [145,] -130.828015 585.138322 [146,] -92.994353 -130.828015 [147,] 202.839309 -92.994353 [148,] -228.527028 202.839309 [149,] -244.493366 -228.527028 [150,] -240.259704 -244.493366 [151,] -126.926041 -240.259704 [152,] -199.292379 -126.926041 [153,] 326.341283 -199.292379 [154,] 231.974946 326.341283 [155,] 255.208608 231.974946 [156,] 819.742270 255.208608 [157,] -639.224067 819.742270 [158,] 608.909595 -639.224067 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -486.825746 39.340592 2 -14.892083 -486.825746 3 19.341579 -14.892083 4 -29.524759 19.341579 5 -155.691096 -29.524759 6 -223.157434 -155.691096 7 -112.723772 -223.157434 8 -55.090109 -112.723772 9 -243.256447 -55.090109 10 19.977215 -243.256447 11 -27.489123 19.977215 12 -13.455460 -27.489123 13 -530.621798 -13.455460 14 -67.688136 -530.621798 15 151.045527 -67.688136 16 -87.220811 151.045527 17 -38.687149 -87.220811 18 -27.353486 -38.687149 19 146.580176 -27.353486 20 217.213838 146.580176 21 263.747501 217.213838 22 87.781163 263.747501 23 4.614825 87.781163 24 441.348487 4.614825 25 -313.817850 441.348487 26 326.815812 -313.817850 27 291.549474 326.815812 28 36.083137 291.549474 29 165.116799 36.083137 30 -100.949539 165.116799 31 -46.515876 -100.949539 32 75.817786 -46.515876 33 -125.348552 75.817786 34 -73.714889 -125.348552 35 145.518773 -73.714889 36 71.652435 145.518773 37 -560.213903 71.652435 38 -44.480240 -560.213903 39 -229.946578 -44.480240 40 -359.812916 -229.946578 41 -257.779253 -359.812916 42 -518.745591 -257.779253 43 -356.911929 -518.745591 44 130.921734 -356.911929 45 -296.844604 130.921734 46 -151.410942 -296.844604 47 238.022721 -151.410942 48 426.256383 238.022721 49 -528.209955 426.256383 50 197.123707 -528.209955 51 193.357370 197.123707 52 -98.108968 193.357370 53 202.224694 -98.108968 54 40.558357 202.224694 55 193.592019 40.558357 56 680.325681 193.592019 57 8.859344 680.325681 58 678.593006 8.859344 59 143.426668 678.593006 60 488.960331 143.426668 61 -276.106007 488.960331 62 746.127655 -276.106007 63 629.561318 746.127655 64 601.394980 629.561318 65 353.728642 601.394980 66 5.262304 353.728642 67 209.795967 5.262304 68 376.429629 209.795967 69 -73.736709 376.429629 70 201.896954 -73.736709 71 266.830616 201.896954 72 426.064278 266.830616 73 -552.202059 426.064278 74 -192.368397 -552.202059 75 148.365265 -192.368397 76 -44.101072 148.365265 77 -168.067410 -44.101072 78 -5.933748 -168.067410 79 62.299914 -5.933748 80 186.933577 62.299914 81 173.267239 186.933577 82 359.300901 173.267239 83 104.534564 359.300901 84 419.268226 104.534564 85 -710.298112 419.268226 86 113.335551 -710.298112 87 387.869213 113.335551 88 -95.997125 387.869213 89 23.636538 -95.997125 90 -40.429800 23.636538 91 -110.796138 -40.429800 92 -293.762476 -110.796138 93 -139.328813 -293.762476 94 -256.595151 -139.328813 95 -292.061489 -256.595151 96 177.172174 -292.061489 97 -900.294164 177.172174 98 -10.460502 -900.294164 99 -1.626839 -10.460502 100 -364.193177 -1.626839 101 -104.359515 -364.193177 102 -419.725852 -104.359515 103 -153.092190 -419.725852 104 156.341472 -153.092190 105 -183.824866 156.341472 106 -208.191203 -183.824866 107 232.442459 -208.191203 108 165.876121 232.442459 109 -664.290216 165.876121 110 -36.056554 -664.290216 111 -52.122892 -36.056554 112 -293.389229 -52.122892 113 -162.855567 -293.389229 114 -341.221905 -162.855567 115 -292.888242 -341.221905 116 50.745420 -292.888242 117 -58.420918 50.745420 118 153.212745 -58.420918 119 402.846407 153.212745 120 414.980069 402.846407 121 -481.535911 414.980069 122 520.797752 -481.535911 123 -107.668586 520.797752 124 161.665076 -107.668586 125 -28.501261 161.665076 126 -199.267599 -28.501261 127 -143.933937 -199.267599 128 234.599726 -143.933937 129 -361.966612 234.599726 130 260.567050 -361.966612 131 -137.899288 260.567050 132 8.634375 -137.899288 133 -711.931963 8.634375 134 -42.198301 -711.931963 135 -26.464638 -42.198301 136 14.969024 -26.464638 137 -151.397314 14.969024 138 -197.263651 -151.397314 139 -78.829989 -197.263651 140 467.403673 -78.829989 141 -321.162664 467.403673 142 -33.029002 -321.162664 143 226.804660 -33.029002 144 585.138322 226.804660 145 -130.828015 585.138322 146 -92.994353 -130.828015 147 202.839309 -92.994353 148 -228.527028 202.839309 149 -244.493366 -228.527028 150 -240.259704 -244.493366 151 -126.926041 -240.259704 152 -199.292379 -126.926041 153 326.341283 -199.292379 154 231.974946 326.341283 155 255.208608 231.974946 156 819.742270 255.208608 157 -639.224067 819.742270 158 608.909595 -639.224067 > 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/7u4ll1230123040.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/81kw81230123040.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/9qywx1230123040.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/10k6r41230123040.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/11bx0b1230123040.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/12oouo1230123040.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/13zzrr1230123041.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/14iqyh1230123041.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/15nuh61230123041.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/16vo3h1230123041.tab") + } > > system("convert tmp/1871m1230123040.ps tmp/1871m1230123040.png") > system("convert tmp/2kq981230123040.ps tmp/2kq981230123040.png") > system("convert tmp/3j74q1230123040.ps tmp/3j74q1230123040.png") > system("convert tmp/4dv1h1230123040.ps tmp/4dv1h1230123040.png") > system("convert tmp/5q4gl1230123040.ps tmp/5q4gl1230123040.png") > system("convert tmp/6onfw1230123040.ps tmp/6onfw1230123040.png") > system("convert tmp/7u4ll1230123040.ps tmp/7u4ll1230123040.png") > system("convert tmp/81kw81230123040.ps tmp/81kw81230123040.png") > system("convert tmp/9qywx1230123040.ps tmp/9qywx1230123040.png") > system("convert tmp/10k6r41230123040.ps tmp/10k6r41230123040.png") > > > proc.time() user system elapsed 7.254 2.898 7.651