R version 2.13.0 (2011-04-13) Copyright (C) 2011 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: i486-pc-linux-gnu (32-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > x <- array(list(108,392.5,19,46.2,13,15.7,124,422.2,40,119.4,57,170.9,23,56.9,14,77.5,45,214,10,65.3,5,20.9,48,248.1,11,23.5,23,39.6,7,48.8,2,6.6,24,134.9,6,50.9,3,4.4,23,113,6,14.8,9,48.7,9,52.1,3,13.2,29,103.9,7,77.5,4,11.8,20,98.1,7,27.9,4,38.1,0,0,25,69.2,6,14.6,5,40.3,22,161.5,11,57.2,61,217.6,12,58.1,4,12.6,16,59.6,13,89.9,60,202.4,41,181.3,37,152.8,55,162.8,41,73.4,11,21.3,27,92.6,8,76.1,3,39.9,17,142.1,13,93,13,31.9,15,32.1,8,55.6,29,133.3,30,194.5,24,137.9,9,87.4,31,209.8,14,95.5,53,244.6,26,187.5),dim=c(2,63),dimnames=list(c('Claims','Payments'),1:63)) > y <- array(NA,dim=c(2,63),dimnames=list(c('Claims','Payments'),1:63)) > for (i in 1:dim(x)[1]) + { + for (j in 1:dim(x)[2]) + { + y[i,j] <- as.numeric(x[i,j]) + } + } > par3 = 'No Linear Trend' > par2 = 'Do not include Seasonal Dummies' > par1 = '1' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Prof. Dr. P. Wessa > #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/ > #Source of accompanying publication: Office for Research, Development, and Education > #Technical description: Write here your technical program description (don't use hard returns!) > library(lattice) > library(lmtest) Loading required package: zoo > n25 <- 25 #minimum number of obs. for Goldfeld-Quandt test > par1 <- as.numeric(par1) > x <- t(y) > k <- length(x[1,]) > n <- length(x[,1]) > x1 <- cbind(x[,par1], x[,1:k!=par1]) > mycolnames <- c(colnames(x)[par1], colnames(x)[1:k!=par1]) > colnames(x1) <- mycolnames #colnames(x)[par1] > x <- x1 > if (par3 == 'First Differences'){ + x2 <- array(0, dim=c(n-1,k), dimnames=list(1:(n-1), paste('(1-B)',colnames(x),sep=''))) + for (i in 1:n-1) { + for (j in 1:k) { + x2[i,j] <- x[i+1,j] - x[i,j] + } + } + x <- x2 + } > if (par2 == 'Include Monthly Dummies'){ + x2 <- array(0, dim=c(n,11), dimnames=list(1:n, paste('M', seq(1:11), sep =''))) + for (i in 1:11){ + x2[seq(i,n,12),i] <- 1 + } + x <- cbind(x, x2) + } > if (par2 == 'Include Quarterly Dummies'){ + x2 <- array(0, dim=c(n,3), dimnames=list(1:n, paste('Q', seq(1:3), sep =''))) + for (i in 1:3){ + x2[seq(i,n,4),i] <- 1 + } + x <- cbind(x, x2) + } > k <- length(x[1,]) > if (par3 == 'Linear Trend'){ + x <- cbind(x, c(1:n)) + colnames(x)[k+1] <- 't' + } > x Claims Payments 1 108 392.5 2 19 46.2 3 13 15.7 4 124 422.2 5 40 119.4 6 57 170.9 7 23 56.9 8 14 77.5 9 45 214.0 10 10 65.3 11 5 20.9 12 48 248.1 13 11 23.5 14 23 39.6 15 7 48.8 16 2 6.6 17 24 134.9 18 6 50.9 19 3 4.4 20 23 113.0 21 6 14.8 22 9 48.7 23 9 52.1 24 3 13.2 25 29 103.9 26 7 77.5 27 4 11.8 28 20 98.1 29 7 27.9 30 4 38.1 31 0 0.0 32 25 69.2 33 6 14.6 34 5 40.3 35 22 161.5 36 11 57.2 37 61 217.6 38 12 58.1 39 4 12.6 40 16 59.6 41 13 89.9 42 60 202.4 43 41 181.3 44 37 152.8 45 55 162.8 46 41 73.4 47 11 21.3 48 27 92.6 49 8 76.1 50 3 39.9 51 17 142.1 52 13 93.0 53 13 31.9 54 15 32.1 55 8 55.6 56 29 133.3 57 30 194.5 58 24 137.9 59 9 87.4 60 31 209.8 61 14 95.5 62 53 244.6 63 26 187.5 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) Payments -1.0637 0.2441 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -19.151 -5.661 -1.119 6.302 24.146 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) -1.06369 1.83018 -0.581 0.563 Payments 0.24411 0.01398 17.465 <2e-16 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 9.611 on 61 degrees of freedom Multiple R-squared: 0.8333, Adjusted R-squared: 0.8306 F-statistic: 305 on 1 and 61 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.07615877 0.15231753 0.9238412 [2,] 0.04891099 0.09782198 0.9510890 [3,] 0.01819644 0.03639287 0.9818036 [4,] 0.25173356 0.50346712 0.7482664 [5,] 0.63655261 0.72689479 0.3634474 [6,] 0.66604043 0.66791914 0.3339596 [7,] 0.57097484 0.85805032 0.4290252 [8,] 0.82747909 0.34504181 0.1725209 [9,] 0.77150889 0.45698222 0.2284911 [10,] 0.80223443 0.39553114 0.1977656 [11,] 0.77807659 0.44384683 0.2219234 [12,] 0.70957428 0.58085143 0.2904257 [13,] 0.74294206 0.51411589 0.2570579 [14,] 0.71760750 0.56478500 0.2823925 [15,] 0.64552355 0.70895290 0.3544765 [16,] 0.60110184 0.79779632 0.3988982 [17,] 0.52540653 0.94918694 0.4745935 [18,] 0.45764389 0.91528777 0.5423561 [19,] 0.39628977 0.79257954 0.6037102 [20,] 0.32337869 0.64675738 0.6766213 [21,] 0.27064256 0.54128512 0.7293574 [22,] 0.32231880 0.64463760 0.6776812 [23,] 0.25840014 0.51680028 0.7415999 [24,] 0.21307021 0.42614042 0.7869298 [25,] 0.16236264 0.32472528 0.8376374 [26,] 0.13283212 0.26566424 0.8671679 [27,] 0.09727574 0.19455148 0.9027243 [28,] 0.09264656 0.18529312 0.9073534 [29,] 0.06716113 0.13432227 0.9328389 [30,] 0.05116890 0.10233779 0.9488311 [31,] 0.11664392 0.23328784 0.8833561 [32,] 0.08605530 0.17211060 0.9139447 [33,] 0.10189036 0.20378072 0.8981096 [34,] 0.07330568 0.14661136 0.9266943 [35,] 0.05094427 0.10188853 0.9490557 [36,] 0.03443339 0.06886678 0.9655666 [37,] 0.03127588 0.06255177 0.9687241 [38,] 0.06386122 0.12772243 0.9361388 [39,] 0.05118724 0.10237448 0.9488128 [40,] 0.03984857 0.07969714 0.9601514 [41,] 0.21327802 0.42655604 0.7867220 [42,] 0.84535094 0.30929812 0.1546491 [43,] 0.82071283 0.35857434 0.1792872 [44,] 0.87010831 0.25978339 0.1298917 [45,] 0.85411808 0.29176383 0.1458819 [46,] 0.81970111 0.36059778 0.1802989 [47,] 0.85658013 0.28683974 0.1434199 [48,] 0.81842340 0.36315321 0.1815766 [49,] 0.78304442 0.43391117 0.2169556 [50,] 0.86214149 0.27571702 0.1378585 [51,] 0.78716265 0.42567469 0.2128373 [52,] 0.81586619 0.36826763 0.1841338 [53,] 0.75014033 0.49971934 0.2498597 [54,] 0.62189535 0.75620931 0.3781047 > postscript(file="/var/wessaorg/rcomp/tmp/1lcfc1321394363.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(x[,1], type='l', main='Actuals and Interpolation', ylab='value of Actuals and Interpolation (dots)', xlab='time or index') > points(x[,1]-mysum$resid) > grid() > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/2pimy1321394363.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(mysum$resid, type='b', pch=19, main='Residuals', ylab='value of Residuals', xlab='time or index') > grid() > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/312u91321394363.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > hist(mysum$resid, main='Residual Histogram', xlab='values of Residuals') > grid() > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/4fbsm1321394363.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > densityplot(~mysum$resid,col='black',main='Residual Density Plot', xlab='values of Residuals') > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/52mj71321394363.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > qqnorm(mysum$resid, main='Residual Normal Q-Q Plot') > qqline(mysum$resid) > grid() > dev.off() null device 1 > (myerror <- as.ts(mysum$resid)) Time Series: Start = 1 End = 63 Frequency = 1 1 2 3 4 5 6 13.2507202 8.7858309 10.2311699 22.0006689 11.9170175 16.3453796 7 8 9 10 11 12 10.1738595 -3.8547956 -6.1757387 -4.8766600 0.9618006 -11.4998718 13 14 15 16 17 18 6.3271160 14.3969534 -3.8488537 1.4525661 -7.8666794 -5.3614836 19 20 21 22 23 24 2.9896069 -3.5206819 3.4508684 -1.8244428 -2.6544150 0.8414435 25 26 27 28 29 30 4.7007143 -10.8547956 2.1831968 -2.8834508 1.2530343 -4.2368823 31 32 33 34 35 36 1.0636886 9.1713130 3.4996903 -3.7739232 -16.3599914 -1.8993733 37 38 39 40 41 42 8.9454672 -1.1190718 1.9879092 2.5147640 -7.8817531 11.6559312 43 44 45 46 47 48 -2.1933590 0.7637610 16.3226663 24.1460532 6.8641568 5.4591513 49 50 51 52 53 54 -9.5130423 -5.6762794 -16.6242676 -8.6384924 6.2765964 8.2277745 55 56 57 58 59 60 -4.5087981 -2.4761042 -16.4156040 -8.5990078 -11.2714794 -19.1504790 61 62 63 -8.2487661 -5.6454886 -18.7068377 > postscript(file="/var/wessaorg/rcomp/tmp/6xzh91321394363.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > dum <- cbind(lag(myerror,k=1),myerror) > dum Time Series: Start = 0 End = 63 Frequency = 1 lag(myerror, k = 1) myerror 0 13.2507202 NA 1 8.7858309 13.2507202 2 10.2311699 8.7858309 3 22.0006689 10.2311699 4 11.9170175 22.0006689 5 16.3453796 11.9170175 6 10.1738595 16.3453796 7 -3.8547956 10.1738595 8 -6.1757387 -3.8547956 9 -4.8766600 -6.1757387 10 0.9618006 -4.8766600 11 -11.4998718 0.9618006 12 6.3271160 -11.4998718 13 14.3969534 6.3271160 14 -3.8488537 14.3969534 15 1.4525661 -3.8488537 16 -7.8666794 1.4525661 17 -5.3614836 -7.8666794 18 2.9896069 -5.3614836 19 -3.5206819 2.9896069 20 3.4508684 -3.5206819 21 -1.8244428 3.4508684 22 -2.6544150 -1.8244428 23 0.8414435 -2.6544150 24 4.7007143 0.8414435 25 -10.8547956 4.7007143 26 2.1831968 -10.8547956 27 -2.8834508 2.1831968 28 1.2530343 -2.8834508 29 -4.2368823 1.2530343 30 1.0636886 -4.2368823 31 9.1713130 1.0636886 32 3.4996903 9.1713130 33 -3.7739232 3.4996903 34 -16.3599914 -3.7739232 35 -1.8993733 -16.3599914 36 8.9454672 -1.8993733 37 -1.1190718 8.9454672 38 1.9879092 -1.1190718 39 2.5147640 1.9879092 40 -7.8817531 2.5147640 41 11.6559312 -7.8817531 42 -2.1933590 11.6559312 43 0.7637610 -2.1933590 44 16.3226663 0.7637610 45 24.1460532 16.3226663 46 6.8641568 24.1460532 47 5.4591513 6.8641568 48 -9.5130423 5.4591513 49 -5.6762794 -9.5130423 50 -16.6242676 -5.6762794 51 -8.6384924 -16.6242676 52 6.2765964 -8.6384924 53 8.2277745 6.2765964 54 -4.5087981 8.2277745 55 -2.4761042 -4.5087981 56 -16.4156040 -2.4761042 57 -8.5990078 -16.4156040 58 -11.2714794 -8.5990078 59 -19.1504790 -11.2714794 60 -8.2487661 -19.1504790 61 -5.6454886 -8.2487661 62 -18.7068377 -5.6454886 63 NA -18.7068377 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 8.7858309 13.2507202 [2,] 10.2311699 8.7858309 [3,] 22.0006689 10.2311699 [4,] 11.9170175 22.0006689 [5,] 16.3453796 11.9170175 [6,] 10.1738595 16.3453796 [7,] -3.8547956 10.1738595 [8,] -6.1757387 -3.8547956 [9,] -4.8766600 -6.1757387 [10,] 0.9618006 -4.8766600 [11,] -11.4998718 0.9618006 [12,] 6.3271160 -11.4998718 [13,] 14.3969534 6.3271160 [14,] -3.8488537 14.3969534 [15,] 1.4525661 -3.8488537 [16,] -7.8666794 1.4525661 [17,] -5.3614836 -7.8666794 [18,] 2.9896069 -5.3614836 [19,] -3.5206819 2.9896069 [20,] 3.4508684 -3.5206819 [21,] -1.8244428 3.4508684 [22,] -2.6544150 -1.8244428 [23,] 0.8414435 -2.6544150 [24,] 4.7007143 0.8414435 [25,] -10.8547956 4.7007143 [26,] 2.1831968 -10.8547956 [27,] -2.8834508 2.1831968 [28,] 1.2530343 -2.8834508 [29,] -4.2368823 1.2530343 [30,] 1.0636886 -4.2368823 [31,] 9.1713130 1.0636886 [32,] 3.4996903 9.1713130 [33,] -3.7739232 3.4996903 [34,] -16.3599914 -3.7739232 [35,] -1.8993733 -16.3599914 [36,] 8.9454672 -1.8993733 [37,] -1.1190718 8.9454672 [38,] 1.9879092 -1.1190718 [39,] 2.5147640 1.9879092 [40,] -7.8817531 2.5147640 [41,] 11.6559312 -7.8817531 [42,] -2.1933590 11.6559312 [43,] 0.7637610 -2.1933590 [44,] 16.3226663 0.7637610 [45,] 24.1460532 16.3226663 [46,] 6.8641568 24.1460532 [47,] 5.4591513 6.8641568 [48,] -9.5130423 5.4591513 [49,] -5.6762794 -9.5130423 [50,] -16.6242676 -5.6762794 [51,] -8.6384924 -16.6242676 [52,] 6.2765964 -8.6384924 [53,] 8.2277745 6.2765964 [54,] -4.5087981 8.2277745 [55,] -2.4761042 -4.5087981 [56,] -16.4156040 -2.4761042 [57,] -8.5990078 -16.4156040 [58,] -11.2714794 -8.5990078 [59,] -19.1504790 -11.2714794 [60,] -8.2487661 -19.1504790 [61,] -5.6454886 -8.2487661 [62,] -18.7068377 -5.6454886 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 8.7858309 13.2507202 2 10.2311699 8.7858309 3 22.0006689 10.2311699 4 11.9170175 22.0006689 5 16.3453796 11.9170175 6 10.1738595 16.3453796 7 -3.8547956 10.1738595 8 -6.1757387 -3.8547956 9 -4.8766600 -6.1757387 10 0.9618006 -4.8766600 11 -11.4998718 0.9618006 12 6.3271160 -11.4998718 13 14.3969534 6.3271160 14 -3.8488537 14.3969534 15 1.4525661 -3.8488537 16 -7.8666794 1.4525661 17 -5.3614836 -7.8666794 18 2.9896069 -5.3614836 19 -3.5206819 2.9896069 20 3.4508684 -3.5206819 21 -1.8244428 3.4508684 22 -2.6544150 -1.8244428 23 0.8414435 -2.6544150 24 4.7007143 0.8414435 25 -10.8547956 4.7007143 26 2.1831968 -10.8547956 27 -2.8834508 2.1831968 28 1.2530343 -2.8834508 29 -4.2368823 1.2530343 30 1.0636886 -4.2368823 31 9.1713130 1.0636886 32 3.4996903 9.1713130 33 -3.7739232 3.4996903 34 -16.3599914 -3.7739232 35 -1.8993733 -16.3599914 36 8.9454672 -1.8993733 37 -1.1190718 8.9454672 38 1.9879092 -1.1190718 39 2.5147640 1.9879092 40 -7.8817531 2.5147640 41 11.6559312 -7.8817531 42 -2.1933590 11.6559312 43 0.7637610 -2.1933590 44 16.3226663 0.7637610 45 24.1460532 16.3226663 46 6.8641568 24.1460532 47 5.4591513 6.8641568 48 -9.5130423 5.4591513 49 -5.6762794 -9.5130423 50 -16.6242676 -5.6762794 51 -8.6384924 -16.6242676 52 6.2765964 -8.6384924 53 8.2277745 6.2765964 54 -4.5087981 8.2277745 55 -2.4761042 -4.5087981 56 -16.4156040 -2.4761042 57 -8.5990078 -16.4156040 58 -11.2714794 -8.5990078 59 -19.1504790 -11.2714794 60 -8.2487661 -19.1504790 61 -5.6454886 -8.2487661 62 -18.7068377 -5.6454886 > plot(z,main=paste('Residual Lag plot, lowess, and regression line'), ylab='values of Residuals', xlab='lagged values of Residuals') > lines(lowess(z)) > abline(lm(z)) > grid() > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/7wkq21321394363.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > acf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Autocorrelation Function') > grid() > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/86aps1321394363.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > pacf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Partial Autocorrelation Function') > grid() > dev.off() null device 1 > postscript(file="/var/wessaorg/rcomp/tmp/9m44b1321394363.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > opar <- par(mfrow = c(2,2), oma = c(0, 0, 1.1, 0)) > plot(mylm, las = 1, sub='Residual Diagnostics') > par(opar) > dev.off() null device 1 > if (n > n25) { + postscript(file="/var/wessaorg/rcomp/tmp/10nqap1321394363.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) + plot(kp3:nmkm3,gqarr[,2], main='Goldfeld-Quandt test',ylab='2-sided p-value',xlab='breakpoint') + grid() + dev.off() + } null device 1 > > #Note: the /var/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/wessaorg/rcomp/createtable") > > a<-table.start() > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Estimated Regression Equation', 1, TRUE) > a<-table.row.end(a) > myeq <- colnames(x)[1] > myeq <- paste(myeq, '[t] = ', sep='') > for (i in 1:k){ + if (mysum$coefficients[i,1] > 0) myeq <- paste(myeq, '+', '') + myeq <- paste(myeq, mysum$coefficients[i,1], sep=' ') + if (rownames(mysum$coefficients)[i] != '(Intercept)') { + myeq <- paste(myeq, rownames(mysum$coefficients)[i], sep='') + if (rownames(mysum$coefficients)[i] != 't') myeq <- paste(myeq, '[t]', sep='') + } + } > myeq <- paste(myeq, ' + e[t]') > a<-table.row.start(a) > a<-table.element(a, myeq) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/wessaorg/rcomp/tmp/11t4y91321394363.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,hyperlink('http://www.xycoon.com/ols1.htm','Multiple Linear Regression - Ordinary Least Squares',''), 6, TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Variable',header=TRUE) > a<-table.element(a,'Parameter',header=TRUE) > a<-table.element(a,'S.D.',header=TRUE) > a<-table.element(a,'T-STAT
H0: parameter = 0',header=TRUE) > a<-table.element(a,'2-tail p-value',header=TRUE) > a<-table.element(a,'1-tail p-value',header=TRUE) > a<-table.row.end(a) > for (i in 1:k){ + a<-table.row.start(a) + a<-table.element(a,rownames(mysum$coefficients)[i],header=TRUE) + a<-table.element(a,mysum$coefficients[i,1]) + a<-table.element(a, round(mysum$coefficients[i,2],6)) + a<-table.element(a, round(mysum$coefficients[i,3],4)) + a<-table.element(a, round(mysum$coefficients[i,4],6)) + a<-table.element(a, round(mysum$coefficients[i,4]/2,6)) + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/wessaorg/rcomp/tmp/12grvi1321394363.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Regression Statistics', 2, TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Multiple R',1,TRUE) > a<-table.element(a, sqrt(mysum$r.squared)) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'R-squared',1,TRUE) > a<-table.element(a, mysum$r.squared) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Adjusted R-squared',1,TRUE) > a<-table.element(a, mysum$adj.r.squared) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'F-TEST (value)',1,TRUE) > a<-table.element(a, mysum$fstatistic[1]) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'F-TEST (DF numerator)',1,TRUE) > a<-table.element(a, mysum$fstatistic[2]) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'F-TEST (DF denominator)',1,TRUE) > a<-table.element(a, mysum$fstatistic[3]) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'p-value',1,TRUE) > a<-table.element(a, 1-pf(mysum$fstatistic[1],mysum$fstatistic[2],mysum$fstatistic[3])) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Residual Statistics', 2, TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Residual Standard Deviation',1,TRUE) > a<-table.element(a, mysum$sigma) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Sum Squared Residuals',1,TRUE) > a<-table.element(a, sum(myerror*myerror)) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/wessaorg/rcomp/tmp/13dfqa1321394363.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Actuals, Interpolation, and Residuals', 4, TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a, 'Time or Index', 1, TRUE) > a<-table.element(a, 'Actuals', 1, TRUE) > a<-table.element(a, 'Interpolation
Forecast', 1, TRUE) > a<-table.element(a, 'Residuals
Prediction Error', 1, TRUE) > a<-table.row.end(a) > for (i in 1:n) { + a<-table.row.start(a) + a<-table.element(a,i, 1, TRUE) + a<-table.element(a,x[i]) + a<-table.element(a,x[i]-mysum$resid[i]) + a<-table.element(a,mysum$resid[i]) + a<-table.row.end(a) + } > a<-table.end(a) > table.save(a,file="/var/wessaorg/rcomp/tmp/14e7ka1321394364.tab") > if (n > n25) { + a<-table.start() + a<-table.row.start(a) + a<-table.element(a,'Goldfeld-Quandt test for Heteroskedasticity',4,TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'p-values',header=TRUE) + a<-table.element(a,'Alternative Hypothesis',3,header=TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'breakpoint index',header=TRUE) + a<-table.element(a,'greater',header=TRUE) + a<-table.element(a,'2-sided',header=TRUE) + a<-table.element(a,'less',header=TRUE) + a<-table.row.end(a) + for (mypoint in kp3:nmkm3) { + a<-table.row.start(a) + a<-table.element(a,mypoint,header=TRUE) + a<-table.element(a,gqarr[mypoint-kp3+1,1]) + a<-table.element(a,gqarr[mypoint-kp3+1,2]) + a<-table.element(a,gqarr[mypoint-kp3+1,3]) + a<-table.row.end(a) + } + a<-table.end(a) + table.save(a,file="/var/wessaorg/rcomp/tmp/15sacy1321394364.tab") + a<-table.start() + a<-table.row.start(a) + a<-table.element(a,'Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity',4,TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'Description',header=TRUE) + a<-table.element(a,'# significant tests',header=TRUE) + a<-table.element(a,'% significant tests',header=TRUE) + a<-table.element(a,'OK/NOK',header=TRUE) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'1% type I error level',header=TRUE) + a<-table.element(a,numsignificant1) + a<-table.element(a,numsignificant1/numgqtests) + if (numsignificant1/numgqtests < 0.01) dum <- 'OK' else dum <- 'NOK' + a<-table.element(a,dum) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'5% type I error level',header=TRUE) + a<-table.element(a,numsignificant5) + a<-table.element(a,numsignificant5/numgqtests) + if (numsignificant5/numgqtests < 0.05) dum <- 'OK' else dum <- 'NOK' + a<-table.element(a,dum) + a<-table.row.end(a) + a<-table.row.start(a) + a<-table.element(a,'10% type I error level',header=TRUE) + a<-table.element(a,numsignificant10) + a<-table.element(a,numsignificant10/numgqtests) + if (numsignificant10/numgqtests < 0.1) dum <- 'OK' else dum <- 'NOK' + a<-table.element(a,dum) + a<-table.row.end(a) + a<-table.end(a) + table.save(a,file="/var/wessaorg/rcomp/tmp/16k2r71321394364.tab") + } > > try(system("convert tmp/1lcfc1321394363.ps tmp/1lcfc1321394363.png",intern=TRUE)) character(0) > try(system("convert tmp/2pimy1321394363.ps tmp/2pimy1321394363.png",intern=TRUE)) character(0) > try(system("convert tmp/312u91321394363.ps tmp/312u91321394363.png",intern=TRUE)) character(0) > try(system("convert tmp/4fbsm1321394363.ps tmp/4fbsm1321394363.png",intern=TRUE)) character(0) > try(system("convert tmp/52mj71321394363.ps tmp/52mj71321394363.png",intern=TRUE)) character(0) > try(system("convert tmp/6xzh91321394363.ps tmp/6xzh91321394363.png",intern=TRUE)) character(0) > try(system("convert tmp/7wkq21321394363.ps tmp/7wkq21321394363.png",intern=TRUE)) character(0) > try(system("convert tmp/86aps1321394363.ps tmp/86aps1321394363.png",intern=TRUE)) character(0) > try(system("convert tmp/9m44b1321394363.ps tmp/9m44b1321394363.png",intern=TRUE)) character(0) > try(system("convert tmp/10nqap1321394363.ps tmp/10nqap1321394363.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.396 0.496 3.926