R version 2.8.0 (2008-10-20) 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. Natural language support but running in an English locale 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(595,0,597,0,593,0,590,0,580,0,574,0,573,0,573,0,620,0,626,0,620,0,588,0,566,0,557,0,561,0,549,0,532,0,526,0,511,0,499,0,555,0,565,0,542,0,527,0,510,0,514,0,517,0,508,0,493,0,490,0,469,0,478,0,528,0,534,0,518,0,506,0,502,1,516,1,528,1,533,1,536,1,537,1,524,1,536,1,587,1,597,1,581,1,564,1,558,1,575,1,580,1,575,1,563,1,552,1,537,1,545,1,601,1,604,1,586,1,564,1,549,1),dim=c(2,61),dimnames=list(c('werkloosheid','X'),1:61)) > y <- array(NA,dim=c(2,61),dimnames=list(c('werkloosheid','X'),1:61)) > for (i in 1:dim(x)[1]) + { + for (j in 1:dim(x)[2]) + { + y[i,j] <- as.numeric(x[i,j]) + } + } > par20 = '' > par19 = '' > par18 = '' > par17 = '' > par16 = '' > par15 = '' > par14 = '' > par13 = '' > par12 = '' > par11 = '' > par10 = '' > par9 = '' > par8 = '' > par7 = '' > par6 = '' > par5 = '' > par4 = '' > par3 = 'No Linear Trend' > par2 = 'Include Monthly Dummies' > par1 = '1' > ylab = '' > xlab = '' > main = '' > #'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 werkloosheid X M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11 1 595 0 1 0 0 0 0 0 0 0 0 0 0 2 597 0 0 1 0 0 0 0 0 0 0 0 0 3 593 0 0 0 1 0 0 0 0 0 0 0 0 4 590 0 0 0 0 1 0 0 0 0 0 0 0 5 580 0 0 0 0 0 1 0 0 0 0 0 0 6 574 0 0 0 0 0 0 1 0 0 0 0 0 7 573 0 0 0 0 0 0 0 1 0 0 0 0 8 573 0 0 0 0 0 0 0 0 1 0 0 0 9 620 0 0 0 0 0 0 0 0 0 1 0 0 10 626 0 0 0 0 0 0 0 0 0 0 1 0 11 620 0 0 0 0 0 0 0 0 0 0 0 1 12 588 0 0 0 0 0 0 0 0 0 0 0 0 13 566 0 1 0 0 0 0 0 0 0 0 0 0 14 557 0 0 1 0 0 0 0 0 0 0 0 0 15 561 0 0 0 1 0 0 0 0 0 0 0 0 16 549 0 0 0 0 1 0 0 0 0 0 0 0 17 532 0 0 0 0 0 1 0 0 0 0 0 0 18 526 0 0 0 0 0 0 1 0 0 0 0 0 19 511 0 0 0 0 0 0 0 1 0 0 0 0 20 499 0 0 0 0 0 0 0 0 1 0 0 0 21 555 0 0 0 0 0 0 0 0 0 1 0 0 22 565 0 0 0 0 0 0 0 0 0 0 1 0 23 542 0 0 0 0 0 0 0 0 0 0 0 1 24 527 0 0 0 0 0 0 0 0 0 0 0 0 25 510 0 1 0 0 0 0 0 0 0 0 0 0 26 514 0 0 1 0 0 0 0 0 0 0 0 0 27 517 0 0 0 1 0 0 0 0 0 0 0 0 28 508 0 0 0 0 1 0 0 0 0 0 0 0 29 493 0 0 0 0 0 1 0 0 0 0 0 0 30 490 0 0 0 0 0 0 1 0 0 0 0 0 31 469 0 0 0 0 0 0 0 1 0 0 0 0 32 478 0 0 0 0 0 0 0 0 1 0 0 0 33 528 0 0 0 0 0 0 0 0 0 1 0 0 34 534 0 0 0 0 0 0 0 0 0 0 1 0 35 518 0 0 0 0 0 0 0 0 0 0 0 1 36 506 0 0 0 0 0 0 0 0 0 0 0 0 37 502 1 1 0 0 0 0 0 0 0 0 0 0 38 516 1 0 1 0 0 0 0 0 0 0 0 0 39 528 1 0 0 1 0 0 0 0 0 0 0 0 40 533 1 0 0 0 1 0 0 0 0 0 0 0 41 536 1 0 0 0 0 1 0 0 0 0 0 0 42 537 1 0 0 0 0 0 1 0 0 0 0 0 43 524 1 0 0 0 0 0 0 1 0 0 0 0 44 536 1 0 0 0 0 0 0 0 1 0 0 0 45 587 1 0 0 0 0 0 0 0 0 1 0 0 46 597 1 0 0 0 0 0 0 0 0 0 1 0 47 581 1 0 0 0 0 0 0 0 0 0 0 1 48 564 1 0 0 0 0 0 0 0 0 0 0 0 49 558 1 1 0 0 0 0 0 0 0 0 0 0 50 575 1 0 1 0 0 0 0 0 0 0 0 0 51 580 1 0 0 1 0 0 0 0 0 0 0 0 52 575 1 0 0 0 1 0 0 0 0 0 0 0 53 563 1 0 0 0 0 1 0 0 0 0 0 0 54 552 1 0 0 0 0 0 1 0 0 0 0 0 55 537 1 0 0 0 0 0 0 1 0 0 0 0 56 545 1 0 0 0 0 0 0 0 1 0 0 0 57 601 1 0 0 0 0 0 0 0 0 1 0 0 58 604 1 0 0 0 0 0 0 0 0 0 1 0 59 586 1 0 0 0 0 0 0 0 0 0 0 1 60 564 1 0 0 0 0 0 0 0 0 0 0 0 61 549 1 1 0 0 0 0 0 0 0 0 0 0 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) X M1 M2 M3 M4 545.544 10.639 -4.197 2.000 6.000 1.200 M5 M6 M7 M8 M9 M10 -9.000 -14.000 -27.000 -23.600 28.400 35.400 M11 19.600 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -49.986 -24.384 3.416 16.816 54.856 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 545.544 16.159 33.761 <2e-16 *** X 10.639 9.178 1.159 0.252 M1 -4.197 21.327 -0.197 0.845 M2 2.000 22.255 0.090 0.929 M3 6.000 22.255 0.270 0.789 M4 1.200 22.255 0.054 0.957 M5 -9.000 22.255 -0.404 0.688 M6 -14.000 22.255 -0.629 0.532 M7 -27.000 22.255 -1.213 0.231 M8 -23.600 22.255 -1.060 0.294 M9 28.400 22.255 1.276 0.208 M10 35.400 22.255 1.591 0.118 M11 19.600 22.255 0.881 0.383 --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 Residual standard error: 35.19 on 48 degrees of freedom Multiple R-squared: 0.269, Adjusted R-squared: 0.08624 F-statistic: 1.472 on 12 and 48 DF, p-value: 0.1681 > 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.9193260 0.1613479953 8.067400e-02 [2,] 0.9550165 0.0899670593 4.498353e-02 [3,] 0.9738513 0.0522974719 2.614874e-02 [4,] 0.9920488 0.0159024045 7.951202e-03 [5,] 0.9975433 0.0049134209 2.456710e-03 [6,] 0.9985839 0.0028322239 1.416112e-03 [7,] 0.9990113 0.0019773576 9.886788e-04 [8,] 0.9994906 0.0010187302 5.093651e-04 [9,] 0.9995162 0.0009675605 4.837803e-04 [10,] 0.9997858 0.0004284682 2.142341e-04 [11,] 0.9998439 0.0003121887 1.560944e-04 [12,] 0.9998524 0.0002951863 1.475931e-04 [13,] 0.9998257 0.0003486067 1.743034e-04 [14,] 0.9997562 0.0004875750 2.437875e-04 [15,] 0.9996317 0.0007365940 3.682970e-04 [16,] 0.9995036 0.0009927485 4.963742e-04 [17,] 0.9991291 0.0017418215 8.709107e-04 [18,] 0.9984805 0.0030390425 1.519521e-03 [19,] 0.9973834 0.0052332113 2.616606e-03 [20,] 0.9955325 0.0089350858 4.467543e-03 [21,] 0.9915956 0.0168087932 8.404397e-03 [22,] 0.9950524 0.0098951116 4.947556e-03 [23,] 0.9981520 0.0036960209 1.848010e-03 [24,] 0.9995134 0.0009731662 4.865831e-04 [25,] 0.9999020 0.0001959721 9.798604e-05 [26,] 0.9999488 0.0001024660 5.123302e-05 [27,] 0.9998868 0.0002264978 1.132489e-04 [28,] 0.9996893 0.0006213899 3.106949e-04 [29,] 0.9986513 0.0026973655 1.348683e-03 [30,] 0.9973411 0.0053178011 2.658901e-03 > postscript(file="/var/www/html/freestat/rcomp/tmp/1lnu21293210230.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/www/html/freestat/rcomp/tmp/2lnu21293210230.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/www/html/freestat/rcomp/tmp/3lnu21293210230.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/www/html/freestat/rcomp/tmp/4exu51293210230.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/www/html/freestat/rcomp/tmp/5exu51293210230.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 = 61 Frequency = 1 1 2 3 4 5 6 7 53.653061 49.455782 41.455782 43.255782 43.455782 42.455782 54.455782 8 9 10 11 12 13 14 51.055782 46.055782 45.055782 54.855782 42.455782 24.653061 9.455782 15 16 17 18 19 20 21 9.455782 2.255782 -4.544218 -5.544218 -7.544218 -22.944218 -18.944218 22 23 24 25 26 27 28 -15.944218 -23.144218 -18.544218 -31.346939 -33.544218 -34.544218 -38.744218 29 30 31 32 33 34 35 -43.544218 -41.544218 -49.544218 -43.944218 -45.944218 -46.944218 -47.144218 36 37 38 39 40 41 42 -39.544218 -49.986395 -42.183673 -34.183673 -24.383673 -11.183673 -5.183673 43 44 45 46 47 48 49 -5.183673 3.416327 2.416327 5.416327 5.216327 7.816327 6.013605 50 51 52 53 54 55 56 16.816327 17.816327 17.616327 15.816327 9.816327 7.816327 12.416327 57 58 59 60 61 16.416327 12.416327 10.216327 7.816327 -2.986395 > postscript(file="/var/www/html/freestat/rcomp/tmp/6exu51293210230.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 = 61 Frequency = 1 lag(myerror, k = 1) myerror 0 53.653061 NA 1 49.455782 53.653061 2 41.455782 49.455782 3 43.255782 41.455782 4 43.455782 43.255782 5 42.455782 43.455782 6 54.455782 42.455782 7 51.055782 54.455782 8 46.055782 51.055782 9 45.055782 46.055782 10 54.855782 45.055782 11 42.455782 54.855782 12 24.653061 42.455782 13 9.455782 24.653061 14 9.455782 9.455782 15 2.255782 9.455782 16 -4.544218 2.255782 17 -5.544218 -4.544218 18 -7.544218 -5.544218 19 -22.944218 -7.544218 20 -18.944218 -22.944218 21 -15.944218 -18.944218 22 -23.144218 -15.944218 23 -18.544218 -23.144218 24 -31.346939 -18.544218 25 -33.544218 -31.346939 26 -34.544218 -33.544218 27 -38.744218 -34.544218 28 -43.544218 -38.744218 29 -41.544218 -43.544218 30 -49.544218 -41.544218 31 -43.944218 -49.544218 32 -45.944218 -43.944218 33 -46.944218 -45.944218 34 -47.144218 -46.944218 35 -39.544218 -47.144218 36 -49.986395 -39.544218 37 -42.183673 -49.986395 38 -34.183673 -42.183673 39 -24.383673 -34.183673 40 -11.183673 -24.383673 41 -5.183673 -11.183673 42 -5.183673 -5.183673 43 3.416327 -5.183673 44 2.416327 3.416327 45 5.416327 2.416327 46 5.216327 5.416327 47 7.816327 5.216327 48 6.013605 7.816327 49 16.816327 6.013605 50 17.816327 16.816327 51 17.616327 17.816327 52 15.816327 17.616327 53 9.816327 15.816327 54 7.816327 9.816327 55 12.416327 7.816327 56 16.416327 12.416327 57 12.416327 16.416327 58 10.216327 12.416327 59 7.816327 10.216327 60 -2.986395 7.816327 61 NA -2.986395 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 49.455782 53.653061 [2,] 41.455782 49.455782 [3,] 43.255782 41.455782 [4,] 43.455782 43.255782 [5,] 42.455782 43.455782 [6,] 54.455782 42.455782 [7,] 51.055782 54.455782 [8,] 46.055782 51.055782 [9,] 45.055782 46.055782 [10,] 54.855782 45.055782 [11,] 42.455782 54.855782 [12,] 24.653061 42.455782 [13,] 9.455782 24.653061 [14,] 9.455782 9.455782 [15,] 2.255782 9.455782 [16,] -4.544218 2.255782 [17,] -5.544218 -4.544218 [18,] -7.544218 -5.544218 [19,] -22.944218 -7.544218 [20,] -18.944218 -22.944218 [21,] -15.944218 -18.944218 [22,] -23.144218 -15.944218 [23,] -18.544218 -23.144218 [24,] -31.346939 -18.544218 [25,] -33.544218 -31.346939 [26,] -34.544218 -33.544218 [27,] -38.744218 -34.544218 [28,] -43.544218 -38.744218 [29,] -41.544218 -43.544218 [30,] -49.544218 -41.544218 [31,] -43.944218 -49.544218 [32,] -45.944218 -43.944218 [33,] -46.944218 -45.944218 [34,] -47.144218 -46.944218 [35,] -39.544218 -47.144218 [36,] -49.986395 -39.544218 [37,] -42.183673 -49.986395 [38,] -34.183673 -42.183673 [39,] -24.383673 -34.183673 [40,] -11.183673 -24.383673 [41,] -5.183673 -11.183673 [42,] -5.183673 -5.183673 [43,] 3.416327 -5.183673 [44,] 2.416327 3.416327 [45,] 5.416327 2.416327 [46,] 5.216327 5.416327 [47,] 7.816327 5.216327 [48,] 6.013605 7.816327 [49,] 16.816327 6.013605 [50,] 17.816327 16.816327 [51,] 17.616327 17.816327 [52,] 15.816327 17.616327 [53,] 9.816327 15.816327 [54,] 7.816327 9.816327 [55,] 12.416327 7.816327 [56,] 16.416327 12.416327 [57,] 12.416327 16.416327 [58,] 10.216327 12.416327 [59,] 7.816327 10.216327 [60,] -2.986395 7.816327 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 49.455782 53.653061 2 41.455782 49.455782 3 43.255782 41.455782 4 43.455782 43.255782 5 42.455782 43.455782 6 54.455782 42.455782 7 51.055782 54.455782 8 46.055782 51.055782 9 45.055782 46.055782 10 54.855782 45.055782 11 42.455782 54.855782 12 24.653061 42.455782 13 9.455782 24.653061 14 9.455782 9.455782 15 2.255782 9.455782 16 -4.544218 2.255782 17 -5.544218 -4.544218 18 -7.544218 -5.544218 19 -22.944218 -7.544218 20 -18.944218 -22.944218 21 -15.944218 -18.944218 22 -23.144218 -15.944218 23 -18.544218 -23.144218 24 -31.346939 -18.544218 25 -33.544218 -31.346939 26 -34.544218 -33.544218 27 -38.744218 -34.544218 28 -43.544218 -38.744218 29 -41.544218 -43.544218 30 -49.544218 -41.544218 31 -43.944218 -49.544218 32 -45.944218 -43.944218 33 -46.944218 -45.944218 34 -47.144218 -46.944218 35 -39.544218 -47.144218 36 -49.986395 -39.544218 37 -42.183673 -49.986395 38 -34.183673 -42.183673 39 -24.383673 -34.183673 40 -11.183673 -24.383673 41 -5.183673 -11.183673 42 -5.183673 -5.183673 43 3.416327 -5.183673 44 2.416327 3.416327 45 5.416327 2.416327 46 5.216327 5.416327 47 7.816327 5.216327 48 6.013605 7.816327 49 16.816327 6.013605 50 17.816327 16.816327 51 17.616327 17.816327 52 15.816327 17.616327 53 9.816327 15.816327 54 7.816327 9.816327 55 12.416327 7.816327 56 16.416327 12.416327 57 12.416327 16.416327 58 10.216327 12.416327 59 7.816327 10.216327 60 -2.986395 7.816327 > 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/freestat/rcomp/tmp/7potp1293210230.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/www/html/freestat/rcomp/tmp/8hfas1293210230.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/www/html/freestat/rcomp/tmp/9hfas1293210230.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/www/html/freestat/rcomp/tmp/10hfas1293210230.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/www/html/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/freestat/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/freestat/rcomp/tmp/11w7qj1293210230.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/freestat/rcomp/tmp/126y741293210230.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/freestat/rcomp/tmp/13vhmg1293210230.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/freestat/rcomp/tmp/14orl11293210230.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/freestat/rcomp/tmp/15992p1293210230.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/freestat/rcomp/tmp/16510f1293210230.tab") + } > > try(system("convert tmp/1lnu21293210230.ps tmp/1lnu21293210230.png",intern=TRUE)) character(0) > try(system("convert tmp/2lnu21293210230.ps tmp/2lnu21293210230.png",intern=TRUE)) character(0) > try(system("convert tmp/3lnu21293210230.ps tmp/3lnu21293210230.png",intern=TRUE)) character(0) > try(system("convert tmp/4exu51293210230.ps tmp/4exu51293210230.png",intern=TRUE)) character(0) > try(system("convert tmp/5exu51293210230.ps tmp/5exu51293210230.png",intern=TRUE)) character(0) > try(system("convert tmp/6exu51293210230.ps tmp/6exu51293210230.png",intern=TRUE)) character(0) > try(system("convert tmp/7potp1293210230.ps tmp/7potp1293210230.png",intern=TRUE)) character(0) > try(system("convert tmp/8hfas1293210230.ps tmp/8hfas1293210230.png",intern=TRUE)) character(0) > try(system("convert tmp/9hfas1293210230.ps tmp/9hfas1293210230.png",intern=TRUE)) character(0) > try(system("convert tmp/10hfas1293210230.ps tmp/10hfas1293210230.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.759 2.459 6.097