R version 2.9.0 (2009-04-17) Copyright (C) 2009 The R Foundation for Statistical Computing ISBN 3-900051-07-0 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > x <- array(list(645,3,1.194,42,3,2.116,60,1,2.526,25,3,2.803,624,4,1.361,180,4,2.282,35,1,2.981,392,4,1.825,63,1,2.674,230,1,2.272,112,4,2.526,281,5,1.361,0,2,2.332,365,5,1.131,42,1,2.128,28,2,2.152,42,2,2.370,120,2,2.370,0,1,1.808,0,1,2.896,400,5,0,148,5,1.335,16,2,2.667,252,1,2.485,310,1,1.825,63,1,2.565,28,3,2.625,68,4,2.104,336,5,1.065,100,1,2.380,33,4,0,21.5,4,2.208,50,1,2.991,267,1,2.079,30,1,2.361,45,3,2.416,19,3,2.580,30,3,2.549,12,1,2.965,120,1,2.856,440,5,0,140,2,2.833,170,4,2.389,17,2,2.617,115,4,2.128,31,5,2.128,63,2,2.526,21,3,2.580,52,1,2.282,164,2,2.262,225,2,1.887,225,3,1.686,150,5,0.956,151,5,1.335,90,2,2.398,0,2,2.332,60,2,2.588,200,3,1.686,46,2,2.760,210,4,2.332,14,1,2.965,38,1,0),dim=c(3,62),dimnames=list(c('aantal-dagen-dat-baby-in-buik-is','danger-high-voltage','slaap'),1:62)) > y <- array(NA,dim=c(3,62),dimnames=list(c('aantal-dagen-dat-baby-in-buik-is','danger-high-voltage','slaap'),1:62)) > 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 = '3' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Prof. Dr. P. Wessa > #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/ > #Source of accompanying publication: Office for Research, Development, and Education > #Technical description: Write here your technical program description (don't use hard returns!) > library(lattice) > library(lmtest) Loading required package: zoo Attaching package: 'zoo' The following object(s) are masked from package:base : as.Date.numeric > n25 <- 25 #minimum number of obs. for Goldfeld-Quandt test > par1 <- as.numeric(par1) > x <- t(y) > k <- length(x[1,]) > n <- length(x[,1]) > x1 <- cbind(x[,par1], x[,1:k!=par1]) > mycolnames <- c(colnames(x)[par1], colnames(x)[1:k!=par1]) > colnames(x1) <- mycolnames #colnames(x)[par1] > x <- x1 > if (par3 == 'First Differences'){ + x2 <- array(0, dim=c(n-1,k), dimnames=list(1:(n-1), paste('(1-B)',colnames(x),sep=''))) + for (i in 1:n-1) { + for (j in 1:k) { + x2[i,j] <- x[i+1,j] - x[i,j] + } + } + x <- x2 + } > if (par2 == 'Include Monthly Dummies'){ + x2 <- array(0, dim=c(n,11), dimnames=list(1:n, paste('M', seq(1:11), sep =''))) + for (i in 1:11){ + x2[seq(i,n,12),i] <- 1 + } + x <- cbind(x, x2) + } > if (par2 == 'Include Quarterly Dummies'){ + x2 <- array(0, dim=c(n,3), dimnames=list(1:n, paste('Q', seq(1:3), sep =''))) + for (i in 1:3){ + x2[seq(i,n,4),i] <- 1 + } + x <- cbind(x, x2) + } > k <- length(x[1,]) > if (par3 == 'Linear Trend'){ + x <- cbind(x, c(1:n)) + colnames(x)[k+1] <- 't' + } > x slaap aantal-dagen-dat-baby-in-buik-is danger-high-voltage 1 1.194 645.0 3 2 2.116 42.0 3 3 2.526 60.0 1 4 2.803 25.0 3 5 1.361 624.0 4 6 2.282 180.0 4 7 2.981 35.0 1 8 1.825 392.0 4 9 2.674 63.0 1 10 2.272 230.0 1 11 2.526 112.0 4 12 1.361 281.0 5 13 2.332 0.0 2 14 1.131 365.0 5 15 2.128 42.0 1 16 2.152 28.0 2 17 2.370 42.0 2 18 2.370 120.0 2 19 1.808 0.0 1 20 2.896 0.0 1 21 0.000 400.0 5 22 1.335 148.0 5 23 2.667 16.0 2 24 2.485 252.0 1 25 1.825 310.0 1 26 2.565 63.0 1 27 2.625 28.0 3 28 2.104 68.0 4 29 1.065 336.0 5 30 2.380 100.0 1 31 0.000 33.0 4 32 2.208 21.5 4 33 2.991 50.0 1 34 2.079 267.0 1 35 2.361 30.0 1 36 2.416 45.0 3 37 2.580 19.0 3 38 2.549 30.0 3 39 2.965 12.0 1 40 2.856 120.0 1 41 0.000 440.0 5 42 2.833 140.0 2 43 2.389 170.0 4 44 2.617 17.0 2 45 2.128 115.0 4 46 2.128 31.0 5 47 2.526 63.0 2 48 2.580 21.0 3 49 2.282 52.0 1 50 2.262 164.0 2 51 1.887 225.0 2 52 1.686 225.0 3 53 0.956 150.0 5 54 1.335 151.0 5 55 2.398 90.0 2 56 2.332 0.0 2 57 2.588 60.0 2 58 1.686 200.0 3 59 2.760 46.0 2 60 2.332 210.0 4 61 2.965 14.0 1 62 0.000 38.0 1 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) `aantal-dagen-dat-baby-in-buik-is` 2.888165 -0.001944 `danger-high-voltage` -0.204810 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -2.6095 -0.1493 0.1190 0.3312 0.6748 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 2.8881647 0.1541285 18.739 < 2e-16 *** `aantal-dagen-dat-baby-in-buik-is` -0.0019443 0.0005562 -3.495 0.000905 *** `danger-high-voltage` -0.2048102 0.0564330 -3.629 0.000595 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 0.5801 on 59 degrees of freedom Multiple R-squared: 0.4207, Adjusted R-squared: 0.401 F-statistic: 21.42 on 2 and 59 DF, p-value: 1.014e-07 > 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.1194065343 0.238813069 0.8805935 [2,] 0.0899117499 0.179823500 0.9100883 [3,] 0.0400325494 0.080065099 0.9599675 [4,] 0.0152709440 0.030541888 0.9847291 [5,] 0.0055005057 0.011001011 0.9944995 [6,] 0.0025342871 0.005068574 0.9974657 [7,] 0.0064323170 0.012864634 0.9935677 [8,] 0.0052318360 0.010463672 0.9947682 [9,] 0.0056161975 0.011232395 0.9943838 [10,] 0.0086622158 0.017324432 0.9913378 [11,] 0.0066476306 0.013295261 0.9933524 [12,] 0.0032364969 0.006472994 0.9967635 [13,] 0.0014986287 0.002997257 0.9985014 [14,] 0.0075200361 0.015040072 0.9924800 [15,] 0.0052386753 0.010477351 0.9947613 [16,] 0.0848809163 0.169761833 0.9151191 [17,] 0.0637599545 0.127519909 0.9362400 [18,] 0.0445051691 0.089010338 0.9554948 [19,] 0.0318842252 0.063768450 0.9681158 [20,] 0.0226122560 0.045224512 0.9773877 [21,] 0.0136726275 0.027345255 0.9863274 [22,] 0.0104179505 0.020835901 0.9895820 [23,] 0.0061785201 0.012357040 0.9938215 [24,] 0.0038382880 0.007676576 0.9961617 [25,] 0.0021471189 0.004294238 0.9978529 [26,] 0.2633359532 0.526671906 0.7366640 [27,] 0.2149343693 0.429868739 0.7850656 [28,] 0.1868308771 0.373661754 0.8131691 [29,] 0.1472947550 0.294589510 0.8527052 [30,] 0.1142954155 0.228590831 0.8857046 [31,] 0.0857337053 0.171467411 0.9142663 [32,] 0.0661490540 0.132298108 0.9338509 [33,] 0.0494810401 0.098962080 0.9505190 [34,] 0.0361135338 0.072227068 0.9638865 [35,] 0.0315055327 0.063011065 0.9684945 [36,] 0.0602582473 0.120516495 0.9397418 [37,] 0.0662556635 0.132511327 0.9337443 [38,] 0.0665967637 0.133193527 0.9334032 [39,] 0.0471131296 0.094226259 0.9528869 [40,] 0.0323039295 0.064607859 0.9676961 [41,] 0.0215127697 0.043025539 0.9784872 [42,] 0.0141512029 0.028302406 0.9858488 [43,] 0.0108126013 0.021625203 0.9891874 [44,] 0.0063929435 0.012785887 0.9936071 [45,] 0.0035336291 0.007067258 0.9964664 [46,] 0.0017302684 0.003460537 0.9982697 [47,] 0.0007881051 0.001576210 0.9992119 [48,] 0.0009083103 0.001816621 0.9990917 [49,] 0.0048812801 0.009762560 0.9951187 [50,] 0.0028675300 0.005735060 0.9971325 [51,] 0.0043164911 0.008632982 0.9956835 > postscript(file="/var/www/html/rcomp/tmp/1rodz1292354159.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/rcomp/tmp/21fvk1292354159.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/rcomp/tmp/31fvk1292354159.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/rcomp/tmp/4c6u51292354159.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/rcomp/tmp/5c6u51292354159.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 = 62 Frequency = 1 1 2 3 4 5 6 0.174326988 -0.076074201 -0.040697610 0.577873029 0.505307326 0.563046749 7 8 9 10 11 12 0.365695375 0.518234232 0.113135231 0.035830088 0.674835670 0.043229317 13 14 15 16 17 18 -0.146544215 -0.023451114 -0.473694661 -0.272104359 -0.026884431 0.124769454 19 20 21 22 23 24 -0.875354445 0.212645555 -1.086401294 -0.241360000 0.219564274 0.291604261 25 26 27 28 29 30 -0.255627466 0.004135231 0.405705871 0.167287324 -0.145835251 -0.108926387 31 32 33 34 35 36 -2.004762496 0.180878277 0.404859584 -0.085231531 -0.264026028 0.229758641 37 38 39 40 41 42 0.343207346 0.333594432 0.304976922 0.405959224 -1.008630071 0.626655066 43 44 45 46 47 48 0.650603943 0.171508555 0.282668511 0.324159173 0.169945461 0.347095907 49 50 51 52 53 54 -0.300251855 0.102317800 -0.154081085 -0.150270855 -0.616471438 -0.235527158 55 56 57 58 59 60 0.094441037 -0.146544215 0.226112620 -0.198877869 0.370892692 0.671375166 61 62 0.308865483 -2.609471783 > postscript(file="/var/www/html/rcomp/tmp/6c6u51292354159.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 = 62 Frequency = 1 lag(myerror, k = 1) myerror 0 0.174326988 NA 1 -0.076074201 0.174326988 2 -0.040697610 -0.076074201 3 0.577873029 -0.040697610 4 0.505307326 0.577873029 5 0.563046749 0.505307326 6 0.365695375 0.563046749 7 0.518234232 0.365695375 8 0.113135231 0.518234232 9 0.035830088 0.113135231 10 0.674835670 0.035830088 11 0.043229317 0.674835670 12 -0.146544215 0.043229317 13 -0.023451114 -0.146544215 14 -0.473694661 -0.023451114 15 -0.272104359 -0.473694661 16 -0.026884431 -0.272104359 17 0.124769454 -0.026884431 18 -0.875354445 0.124769454 19 0.212645555 -0.875354445 20 -1.086401294 0.212645555 21 -0.241360000 -1.086401294 22 0.219564274 -0.241360000 23 0.291604261 0.219564274 24 -0.255627466 0.291604261 25 0.004135231 -0.255627466 26 0.405705871 0.004135231 27 0.167287324 0.405705871 28 -0.145835251 0.167287324 29 -0.108926387 -0.145835251 30 -2.004762496 -0.108926387 31 0.180878277 -2.004762496 32 0.404859584 0.180878277 33 -0.085231531 0.404859584 34 -0.264026028 -0.085231531 35 0.229758641 -0.264026028 36 0.343207346 0.229758641 37 0.333594432 0.343207346 38 0.304976922 0.333594432 39 0.405959224 0.304976922 40 -1.008630071 0.405959224 41 0.626655066 -1.008630071 42 0.650603943 0.626655066 43 0.171508555 0.650603943 44 0.282668511 0.171508555 45 0.324159173 0.282668511 46 0.169945461 0.324159173 47 0.347095907 0.169945461 48 -0.300251855 0.347095907 49 0.102317800 -0.300251855 50 -0.154081085 0.102317800 51 -0.150270855 -0.154081085 52 -0.616471438 -0.150270855 53 -0.235527158 -0.616471438 54 0.094441037 -0.235527158 55 -0.146544215 0.094441037 56 0.226112620 -0.146544215 57 -0.198877869 0.226112620 58 0.370892692 -0.198877869 59 0.671375166 0.370892692 60 0.308865483 0.671375166 61 -2.609471783 0.308865483 62 NA -2.609471783 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -0.076074201 0.174326988 [2,] -0.040697610 -0.076074201 [3,] 0.577873029 -0.040697610 [4,] 0.505307326 0.577873029 [5,] 0.563046749 0.505307326 [6,] 0.365695375 0.563046749 [7,] 0.518234232 0.365695375 [8,] 0.113135231 0.518234232 [9,] 0.035830088 0.113135231 [10,] 0.674835670 0.035830088 [11,] 0.043229317 0.674835670 [12,] -0.146544215 0.043229317 [13,] -0.023451114 -0.146544215 [14,] -0.473694661 -0.023451114 [15,] -0.272104359 -0.473694661 [16,] -0.026884431 -0.272104359 [17,] 0.124769454 -0.026884431 [18,] -0.875354445 0.124769454 [19,] 0.212645555 -0.875354445 [20,] -1.086401294 0.212645555 [21,] -0.241360000 -1.086401294 [22,] 0.219564274 -0.241360000 [23,] 0.291604261 0.219564274 [24,] -0.255627466 0.291604261 [25,] 0.004135231 -0.255627466 [26,] 0.405705871 0.004135231 [27,] 0.167287324 0.405705871 [28,] -0.145835251 0.167287324 [29,] -0.108926387 -0.145835251 [30,] -2.004762496 -0.108926387 [31,] 0.180878277 -2.004762496 [32,] 0.404859584 0.180878277 [33,] -0.085231531 0.404859584 [34,] -0.264026028 -0.085231531 [35,] 0.229758641 -0.264026028 [36,] 0.343207346 0.229758641 [37,] 0.333594432 0.343207346 [38,] 0.304976922 0.333594432 [39,] 0.405959224 0.304976922 [40,] -1.008630071 0.405959224 [41,] 0.626655066 -1.008630071 [42,] 0.650603943 0.626655066 [43,] 0.171508555 0.650603943 [44,] 0.282668511 0.171508555 [45,] 0.324159173 0.282668511 [46,] 0.169945461 0.324159173 [47,] 0.347095907 0.169945461 [48,] -0.300251855 0.347095907 [49,] 0.102317800 -0.300251855 [50,] -0.154081085 0.102317800 [51,] -0.150270855 -0.154081085 [52,] -0.616471438 -0.150270855 [53,] -0.235527158 -0.616471438 [54,] 0.094441037 -0.235527158 [55,] -0.146544215 0.094441037 [56,] 0.226112620 -0.146544215 [57,] -0.198877869 0.226112620 [58,] 0.370892692 -0.198877869 [59,] 0.671375166 0.370892692 [60,] 0.308865483 0.671375166 [61,] -2.609471783 0.308865483 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -0.076074201 0.174326988 2 -0.040697610 -0.076074201 3 0.577873029 -0.040697610 4 0.505307326 0.577873029 5 0.563046749 0.505307326 6 0.365695375 0.563046749 7 0.518234232 0.365695375 8 0.113135231 0.518234232 9 0.035830088 0.113135231 10 0.674835670 0.035830088 11 0.043229317 0.674835670 12 -0.146544215 0.043229317 13 -0.023451114 -0.146544215 14 -0.473694661 -0.023451114 15 -0.272104359 -0.473694661 16 -0.026884431 -0.272104359 17 0.124769454 -0.026884431 18 -0.875354445 0.124769454 19 0.212645555 -0.875354445 20 -1.086401294 0.212645555 21 -0.241360000 -1.086401294 22 0.219564274 -0.241360000 23 0.291604261 0.219564274 24 -0.255627466 0.291604261 25 0.004135231 -0.255627466 26 0.405705871 0.004135231 27 0.167287324 0.405705871 28 -0.145835251 0.167287324 29 -0.108926387 -0.145835251 30 -2.004762496 -0.108926387 31 0.180878277 -2.004762496 32 0.404859584 0.180878277 33 -0.085231531 0.404859584 34 -0.264026028 -0.085231531 35 0.229758641 -0.264026028 36 0.343207346 0.229758641 37 0.333594432 0.343207346 38 0.304976922 0.333594432 39 0.405959224 0.304976922 40 -1.008630071 0.405959224 41 0.626655066 -1.008630071 42 0.650603943 0.626655066 43 0.171508555 0.650603943 44 0.282668511 0.171508555 45 0.324159173 0.282668511 46 0.169945461 0.324159173 47 0.347095907 0.169945461 48 -0.300251855 0.347095907 49 0.102317800 -0.300251855 50 -0.154081085 0.102317800 51 -0.150270855 -0.154081085 52 -0.616471438 -0.150270855 53 -0.235527158 -0.616471438 54 0.094441037 -0.235527158 55 -0.146544215 0.094441037 56 0.226112620 -0.146544215 57 -0.198877869 0.226112620 58 0.370892692 -0.198877869 59 0.671375166 0.370892692 60 0.308865483 0.671375166 61 -2.609471783 0.308865483 > 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/75yb81292354159.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/rcomp/tmp/85yb81292354159.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/rcomp/tmp/9gpbb1292354159.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/rcomp/tmp/10gpbb1292354159.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/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/11j79z1292354159.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/1248741292354159.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/13tr4g1292354159.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/14m0mj1292354159.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/15ht5k1292354160.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/16e33b1292354160.tab") + } > > try(system("convert tmp/1rodz1292354159.ps tmp/1rodz1292354159.png",intern=TRUE)) character(0) > try(system("convert tmp/21fvk1292354159.ps tmp/21fvk1292354159.png",intern=TRUE)) character(0) > try(system("convert tmp/31fvk1292354159.ps tmp/31fvk1292354159.png",intern=TRUE)) character(0) > try(system("convert tmp/4c6u51292354159.ps tmp/4c6u51292354159.png",intern=TRUE)) character(0) > try(system("convert tmp/5c6u51292354159.ps tmp/5c6u51292354159.png",intern=TRUE)) character(0) > try(system("convert tmp/6c6u51292354159.ps tmp/6c6u51292354159.png",intern=TRUE)) character(0) > try(system("convert tmp/75yb81292354159.ps tmp/75yb81292354159.png",intern=TRUE)) character(0) > try(system("convert tmp/85yb81292354159.ps tmp/85yb81292354159.png",intern=TRUE)) character(0) > try(system("convert tmp/9gpbb1292354159.ps tmp/9gpbb1292354159.png",intern=TRUE)) character(0) > try(system("convert tmp/10gpbb1292354159.ps tmp/10gpbb1292354159.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.729 1.718 8.224