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(5,12,6,17,5,10,6,14,7,14,8,14,5,18,5,17,10,16,5,11,5,13,5,14,5,16,5,9,5,15,5,13,5,15,5,16,6,12,5,13,5,14,5,11,5,12,6,12,5,8,7,13,5,10,6,12,5,15,5,14,6,15,6,13,5,15,7,13,6,15,5,16,4,16,5,15,5,17,7,15,6,12,6,11,5,9,7,15,6,10,6,14,8,16,6,17,5,13,5,9,4,15,5,15,5,11,7,14,5,13,5,16,5,15,5,11,5,12,7,9,10,16),dim=c(2,61),dimnames=list(c('Leeftijd','Happiness'),1:61)) > y <- array(NA,dim=c(2,61),dimnames=list(c('Leeftijd','Happiness'),1:61)) > 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 = '2' > #'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 Happiness Leeftijd 1 12 5 2 17 6 3 10 5 4 14 6 5 14 7 6 14 8 7 18 5 8 17 5 9 16 10 10 11 5 11 13 5 12 14 5 13 16 5 14 9 5 15 15 5 16 13 5 17 15 5 18 16 5 19 12 6 20 13 5 21 14 5 22 11 5 23 12 5 24 12 6 25 8 5 26 13 7 27 10 5 28 12 6 29 15 5 30 14 5 31 15 6 32 13 6 33 15 5 34 13 7 35 15 6 36 16 5 37 16 4 38 15 5 39 17 5 40 15 7 41 12 6 42 11 6 43 9 5 44 15 7 45 10 6 46 14 6 47 16 8 48 17 6 49 13 5 50 9 5 51 15 4 52 15 5 53 11 5 54 14 7 55 13 5 56 16 5 57 15 5 58 11 5 59 12 5 60 9 7 61 16 10 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) Leeftijd 11.7356 0.3096 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -5.2837 -1.5933 0.0971 1.7163 4.7163 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 11.7356 1.5158 7.742 1.49e-10 *** Leeftijd 0.3096 0.2617 1.183 0.242 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 2.391 on 59 degrees of freedom Multiple R-squared: 0.02317, Adjusted R-squared: 0.006614 F-statistic: 1.399 on 1 and 59 DF, p-value: 0.2416 > 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.5844520 0.8310959 0.4155480 [2,] 0.5310968 0.9378064 0.4689032 [3,] 0.8202034 0.3595932 0.1797966 [4,] 0.8341372 0.3317256 0.1658628 [5,] 0.7662579 0.4674842 0.2337421 [6,] 0.7906355 0.4187291 0.2093645 [7,] 0.7144114 0.5711771 0.2855886 [8,] 0.6249368 0.7501263 0.3750632 [9,] 0.6091321 0.7817359 0.3908679 [10,] 0.7974277 0.4051445 0.2025723 [11,] 0.7539919 0.4920162 0.2460081 [12,] 0.6831096 0.6337809 0.3168904 [13,] 0.6322717 0.7354567 0.3677283 [14,] 0.6302549 0.7394902 0.3697451 [15,] 0.6006265 0.7987470 0.3993735 [16,] 0.5246042 0.9507917 0.4753958 [17,] 0.4479780 0.8959561 0.5520220 [18,] 0.4515405 0.9030810 0.5484595 [19,] 0.3999096 0.7998191 0.6000904 [20,] 0.3630850 0.7261700 0.6369150 [21,] 0.6415035 0.7169930 0.3584965 [22,] 0.5791045 0.8417911 0.4208955 [23,] 0.6348490 0.7303020 0.3651510 [24,] 0.5925709 0.8148582 0.4074291 [25,] 0.5562454 0.8875093 0.4437546 [26,] 0.4876750 0.9753500 0.5123250 [27,] 0.4366087 0.8732173 0.5633913 [28,] 0.3677121 0.7354242 0.6322879 [29,] 0.3314309 0.6628617 0.6685691 [30,] 0.2742433 0.5484865 0.7257567 [31,] 0.2326672 0.4653345 0.7673328 [32,] 0.2449311 0.4898621 0.7550689 [33,] 0.2799725 0.5599450 0.7200275 [34,] 0.2519836 0.5039672 0.7480164 [35,] 0.3610953 0.7221907 0.6389047 [36,] 0.3068129 0.6136258 0.6931871 [37,] 0.2610157 0.5220313 0.7389843 [38,] 0.2569187 0.5138373 0.7430813 [39,] 0.3792959 0.7585917 0.6207041 [40,] 0.3175846 0.6351693 0.6824154 [41,] 0.3962841 0.7925681 0.6037159 [42,] 0.3159083 0.6318166 0.6840917 [43,] 0.2774666 0.5549333 0.7225334 [44,] 0.3696994 0.7393989 0.6303006 [45,] 0.2827094 0.5654188 0.7172906 [46,] 0.4372412 0.8744825 0.5627588 [47,] 0.4059864 0.8119729 0.5940136 [48,] 0.3754705 0.7509411 0.6245295 [49,] 0.3221402 0.6442804 0.6778598 [50,] 0.2200367 0.4400733 0.7799633 [51,] 0.1322506 0.2645012 0.8677494 [52,] 0.1813798 0.3627595 0.8186202 > postscript(file="/var/wessaorg/rcomp/tmp/19s321321996089.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/2w4iz1321996089.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/3fnwe1321996089.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/4y3o21321996089.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/5xaat1321996089.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 -1.28369352 3.40667976 -3.28369352 0.40667976 0.09705305 -0.21257367 7 8 9 10 11 12 4.71630648 3.71630648 1.16817289 -2.28369352 -0.28369352 0.71630648 13 14 15 16 17 18 2.71630648 -4.28369352 1.71630648 -0.28369352 1.71630648 2.71630648 19 20 21 22 23 24 -1.59332024 -0.28369352 0.71630648 -2.28369352 -1.28369352 -1.59332024 25 26 27 28 29 30 -5.28369352 -0.90294695 -3.28369352 -1.59332024 1.71630648 0.71630648 31 32 33 34 35 36 1.40667976 -0.59332024 1.71630648 -0.90294695 1.40667976 2.71630648 37 38 39 40 41 42 3.02593320 1.71630648 3.71630648 1.09705305 -1.59332024 -2.59332024 43 44 45 46 47 48 -4.28369352 1.09705305 -3.59332024 0.40667976 1.78742633 3.40667976 49 50 51 52 53 54 -0.28369352 -4.28369352 2.02593320 1.71630648 -2.28369352 0.09705305 55 56 57 58 59 60 -0.28369352 2.71630648 1.71630648 -2.28369352 -1.28369352 -4.90294695 61 1.16817289 > postscript(file="/var/wessaorg/rcomp/tmp/6rvtd1321996089.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 -1.28369352 NA 1 3.40667976 -1.28369352 2 -3.28369352 3.40667976 3 0.40667976 -3.28369352 4 0.09705305 0.40667976 5 -0.21257367 0.09705305 6 4.71630648 -0.21257367 7 3.71630648 4.71630648 8 1.16817289 3.71630648 9 -2.28369352 1.16817289 10 -0.28369352 -2.28369352 11 0.71630648 -0.28369352 12 2.71630648 0.71630648 13 -4.28369352 2.71630648 14 1.71630648 -4.28369352 15 -0.28369352 1.71630648 16 1.71630648 -0.28369352 17 2.71630648 1.71630648 18 -1.59332024 2.71630648 19 -0.28369352 -1.59332024 20 0.71630648 -0.28369352 21 -2.28369352 0.71630648 22 -1.28369352 -2.28369352 23 -1.59332024 -1.28369352 24 -5.28369352 -1.59332024 25 -0.90294695 -5.28369352 26 -3.28369352 -0.90294695 27 -1.59332024 -3.28369352 28 1.71630648 -1.59332024 29 0.71630648 1.71630648 30 1.40667976 0.71630648 31 -0.59332024 1.40667976 32 1.71630648 -0.59332024 33 -0.90294695 1.71630648 34 1.40667976 -0.90294695 35 2.71630648 1.40667976 36 3.02593320 2.71630648 37 1.71630648 3.02593320 38 3.71630648 1.71630648 39 1.09705305 3.71630648 40 -1.59332024 1.09705305 41 -2.59332024 -1.59332024 42 -4.28369352 -2.59332024 43 1.09705305 -4.28369352 44 -3.59332024 1.09705305 45 0.40667976 -3.59332024 46 1.78742633 0.40667976 47 3.40667976 1.78742633 48 -0.28369352 3.40667976 49 -4.28369352 -0.28369352 50 2.02593320 -4.28369352 51 1.71630648 2.02593320 52 -2.28369352 1.71630648 53 0.09705305 -2.28369352 54 -0.28369352 0.09705305 55 2.71630648 -0.28369352 56 1.71630648 2.71630648 57 -2.28369352 1.71630648 58 -1.28369352 -2.28369352 59 -4.90294695 -1.28369352 60 1.16817289 -4.90294695 61 NA 1.16817289 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 3.40667976 -1.28369352 [2,] -3.28369352 3.40667976 [3,] 0.40667976 -3.28369352 [4,] 0.09705305 0.40667976 [5,] -0.21257367 0.09705305 [6,] 4.71630648 -0.21257367 [7,] 3.71630648 4.71630648 [8,] 1.16817289 3.71630648 [9,] -2.28369352 1.16817289 [10,] -0.28369352 -2.28369352 [11,] 0.71630648 -0.28369352 [12,] 2.71630648 0.71630648 [13,] -4.28369352 2.71630648 [14,] 1.71630648 -4.28369352 [15,] -0.28369352 1.71630648 [16,] 1.71630648 -0.28369352 [17,] 2.71630648 1.71630648 [18,] -1.59332024 2.71630648 [19,] -0.28369352 -1.59332024 [20,] 0.71630648 -0.28369352 [21,] -2.28369352 0.71630648 [22,] -1.28369352 -2.28369352 [23,] -1.59332024 -1.28369352 [24,] -5.28369352 -1.59332024 [25,] -0.90294695 -5.28369352 [26,] -3.28369352 -0.90294695 [27,] -1.59332024 -3.28369352 [28,] 1.71630648 -1.59332024 [29,] 0.71630648 1.71630648 [30,] 1.40667976 0.71630648 [31,] -0.59332024 1.40667976 [32,] 1.71630648 -0.59332024 [33,] -0.90294695 1.71630648 [34,] 1.40667976 -0.90294695 [35,] 2.71630648 1.40667976 [36,] 3.02593320 2.71630648 [37,] 1.71630648 3.02593320 [38,] 3.71630648 1.71630648 [39,] 1.09705305 3.71630648 [40,] -1.59332024 1.09705305 [41,] -2.59332024 -1.59332024 [42,] -4.28369352 -2.59332024 [43,] 1.09705305 -4.28369352 [44,] -3.59332024 1.09705305 [45,] 0.40667976 -3.59332024 [46,] 1.78742633 0.40667976 [47,] 3.40667976 1.78742633 [48,] -0.28369352 3.40667976 [49,] -4.28369352 -0.28369352 [50,] 2.02593320 -4.28369352 [51,] 1.71630648 2.02593320 [52,] -2.28369352 1.71630648 [53,] 0.09705305 -2.28369352 [54,] -0.28369352 0.09705305 [55,] 2.71630648 -0.28369352 [56,] 1.71630648 2.71630648 [57,] -2.28369352 1.71630648 [58,] -1.28369352 -2.28369352 [59,] -4.90294695 -1.28369352 [60,] 1.16817289 -4.90294695 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 3.40667976 -1.28369352 2 -3.28369352 3.40667976 3 0.40667976 -3.28369352 4 0.09705305 0.40667976 5 -0.21257367 0.09705305 6 4.71630648 -0.21257367 7 3.71630648 4.71630648 8 1.16817289 3.71630648 9 -2.28369352 1.16817289 10 -0.28369352 -2.28369352 11 0.71630648 -0.28369352 12 2.71630648 0.71630648 13 -4.28369352 2.71630648 14 1.71630648 -4.28369352 15 -0.28369352 1.71630648 16 1.71630648 -0.28369352 17 2.71630648 1.71630648 18 -1.59332024 2.71630648 19 -0.28369352 -1.59332024 20 0.71630648 -0.28369352 21 -2.28369352 0.71630648 22 -1.28369352 -2.28369352 23 -1.59332024 -1.28369352 24 -5.28369352 -1.59332024 25 -0.90294695 -5.28369352 26 -3.28369352 -0.90294695 27 -1.59332024 -3.28369352 28 1.71630648 -1.59332024 29 0.71630648 1.71630648 30 1.40667976 0.71630648 31 -0.59332024 1.40667976 32 1.71630648 -0.59332024 33 -0.90294695 1.71630648 34 1.40667976 -0.90294695 35 2.71630648 1.40667976 36 3.02593320 2.71630648 37 1.71630648 3.02593320 38 3.71630648 1.71630648 39 1.09705305 3.71630648 40 -1.59332024 1.09705305 41 -2.59332024 -1.59332024 42 -4.28369352 -2.59332024 43 1.09705305 -4.28369352 44 -3.59332024 1.09705305 45 0.40667976 -3.59332024 46 1.78742633 0.40667976 47 3.40667976 1.78742633 48 -0.28369352 3.40667976 49 -4.28369352 -0.28369352 50 2.02593320 -4.28369352 51 1.71630648 2.02593320 52 -2.28369352 1.71630648 53 0.09705305 -2.28369352 54 -0.28369352 0.09705305 55 2.71630648 -0.28369352 56 1.71630648 2.71630648 57 -2.28369352 1.71630648 58 -1.28369352 -2.28369352 59 -4.90294695 -1.28369352 60 1.16817289 -4.90294695 > 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/7i1c01321996089.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/8sn121321996089.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/9g55c1321996089.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/109nbp1321996089.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/11a8391321996089.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/12bsc91321996089.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/133m2v1321996089.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/14iw801321996089.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/15yk1q1321996089.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/1682to1321996090.tab") + } > > try(system("convert tmp/19s321321996089.ps tmp/19s321321996089.png",intern=TRUE)) character(0) > try(system("convert tmp/2w4iz1321996089.ps tmp/2w4iz1321996089.png",intern=TRUE)) character(0) > try(system("convert tmp/3fnwe1321996089.ps tmp/3fnwe1321996089.png",intern=TRUE)) character(0) > try(system("convert tmp/4y3o21321996089.ps tmp/4y3o21321996089.png",intern=TRUE)) character(0) > try(system("convert tmp/5xaat1321996089.ps tmp/5xaat1321996089.png",intern=TRUE)) character(0) > try(system("convert tmp/6rvtd1321996089.ps tmp/6rvtd1321996089.png",intern=TRUE)) character(0) > try(system("convert tmp/7i1c01321996089.ps tmp/7i1c01321996089.png",intern=TRUE)) character(0) > try(system("convert tmp/8sn121321996089.ps tmp/8sn121321996089.png",intern=TRUE)) character(0) > try(system("convert tmp/9g55c1321996089.ps tmp/9g55c1321996089.png",intern=TRUE)) character(0) > try(system("convert tmp/109nbp1321996089.ps tmp/109nbp1321996089.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.376 0.489 3.901