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(7291,4071,6820,4351,8031,4871,7862,4649,7357,4922,7213,4879,7079,4853,7012,4545,7319,4733,8148,5191,7599,4983,6908,4593,7878,4656,7407,4513,7911,4857,7323,4681,7179,4897,6758,4547,6934,4692,6696,4390,7688,5341,8296,5415,7697,4890,7907,5120,7592,4422,7710,4797,9011,5689,8225,5171,7733,4265,8062,5215,7859,4874,8221,4590,8330,4994,8868,4988,9053,5110,8811,5141,8120,4395,7953,4523,8878,5306,8601,5365,8361,5496,9116,5647,9310,5443,9891,5546,10147,5912,10317,5665,10682,5963,10276,5861,10614,5366,9413,5619,11068,6721,9772,6054,10350,6619,10541,6856,10049,6193,10714,6317,10759,6618,11684,6585,11462,6852,10485,6586,11056,6154,10184,6193,11082,7606,10554,6588,11315,7143,10847,7629,11104,7041,11026,7146,11073,7200,12073,7739,12328,7953,11172,7082),dim=c(2,72),dimnames=list(c('UivEU','InvnietEU'),1:72)) > y <- array(NA,dim=c(2,72),dimnames=list(c('UivEU','InvnietEU'),1:72)) > 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 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 UivEU InvnietEU 1 7291 4071 2 6820 4351 3 8031 4871 4 7862 4649 5 7357 4922 6 7213 4879 7 7079 4853 8 7012 4545 9 7319 4733 10 8148 5191 11 7599 4983 12 6908 4593 13 7878 4656 14 7407 4513 15 7911 4857 16 7323 4681 17 7179 4897 18 6758 4547 19 6934 4692 20 6696 4390 21 7688 5341 22 8296 5415 23 7697 4890 24 7907 5120 25 7592 4422 26 7710 4797 27 9011 5689 28 8225 5171 29 7733 4265 30 8062 5215 31 7859 4874 32 8221 4590 33 8330 4994 34 8868 4988 35 9053 5110 36 8811 5141 37 8120 4395 38 7953 4523 39 8878 5306 40 8601 5365 41 8361 5496 42 9116 5647 43 9310 5443 44 9891 5546 45 10147 5912 46 10317 5665 47 10682 5963 48 10276 5861 49 10614 5366 50 9413 5619 51 11068 6721 52 9772 6054 53 10350 6619 54 10541 6856 55 10049 6193 56 10714 6317 57 10759 6618 58 11684 6585 59 11462 6852 60 10485 6586 61 11056 6154 62 10184 6193 63 11082 7606 64 10554 6588 65 11315 7143 66 10847 7629 67 11104 7041 68 11026 7146 69 11073 7200 70 12073 7739 71 12328 7953 72 11172 7082 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) InvnietEU 803.321 1.478 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -1228.71 -420.89 -66.74 424.68 1882.03 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 803.32051 414.63001 1.937 0.0567 . InvnietEU 1.47757 0.07334 20.147 <2e-16 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 611.2 on 70 degrees of freedom Multiple R-squared: 0.8529, Adjusted R-squared: 0.8508 F-statistic: 405.9 on 1 and 70 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.34988666 0.699773311 0.650113344 [2,] 0.28650492 0.573009845 0.713495078 [3,] 0.24678025 0.493560507 0.753219747 [4,] 0.17919495 0.358389896 0.820805052 [5,] 0.10823918 0.216478357 0.891760822 [6,] 0.09978976 0.199579519 0.900210240 [7,] 0.06021605 0.120432098 0.939783951 [8,] 0.05386416 0.107728312 0.946135844 [9,] 0.05539638 0.110792763 0.944603619 [10,] 0.03331660 0.066633196 0.966683402 [11,] 0.02515582 0.050311648 0.974844176 [12,] 0.01526550 0.030530999 0.984734501 [13,] 0.01590127 0.031802531 0.984098735 [14,] 0.02191504 0.043830078 0.978084961 [15,] 0.02632621 0.052652423 0.973673789 [16,] 0.02860480 0.057209590 0.971395205 [17,] 0.03238216 0.064764311 0.967617845 [18,] 0.03100011 0.062000221 0.968999890 [19,] 0.02569215 0.051384291 0.974307855 [20,] 0.02302786 0.046055714 0.976972143 [21,] 0.02420690 0.048413790 0.975793105 [22,] 0.02180700 0.043614002 0.978192999 [23,] 0.03097644 0.061952874 0.969023563 [24,] 0.02997382 0.059947635 0.970026182 [25,] 0.04949919 0.098998377 0.950500812 [26,] 0.05483622 0.109672442 0.945163779 [27,] 0.05915763 0.118315255 0.940842373 [28,] 0.09942354 0.198847087 0.900576456 [29,] 0.11322706 0.226454113 0.886772943 [30,] 0.19954860 0.399097201 0.800451400 [31,] 0.29059031 0.581180626 0.709409687 [32,] 0.30852299 0.617045970 0.691477015 [33,] 0.34818451 0.696369026 0.651815487 [34,] 0.35645134 0.712902680 0.643548660 [35,] 0.36369128 0.727382551 0.636308724 [36,] 0.41297969 0.825959387 0.587020306 [37,] 0.65505190 0.689896206 0.344948103 [38,] 0.73679705 0.526405907 0.263202954 [39,] 0.78921372 0.421572567 0.210786283 [40,] 0.83034330 0.339313407 0.169656704 [41,] 0.82136990 0.357260208 0.178630104 [42,] 0.85351616 0.292967681 0.146483841 [43,] 0.86706080 0.265878392 0.132939196 [44,] 0.84023619 0.319527616 0.159763808 [45,] 0.95860325 0.082793499 0.041396750 [46,] 0.95114924 0.097701524 0.048850762 [47,] 0.93304525 0.133909497 0.066954749 [48,] 0.93117712 0.137645756 0.068822878 [49,] 0.92724943 0.145501146 0.072750573 [50,] 0.92548197 0.149036052 0.074518026 [51,] 0.92145329 0.157093417 0.078546708 [52,] 0.88540155 0.229196897 0.114598448 [53,] 0.83738562 0.325228769 0.162614385 [54,] 0.91968886 0.160622279 0.080311139 [55,] 0.91879190 0.162416206 0.081208103 [56,] 0.88652583 0.226948343 0.113474171 [57,] 0.94764704 0.104705916 0.052352958 [58,] 0.90683956 0.186320887 0.093160443 [59,] 0.92974512 0.140509754 0.070254877 [60,] 0.87121960 0.257560808 0.128780404 [61,] 0.79770568 0.404588637 0.202294319 [62,] 0.99652978 0.006940445 0.003470223 [63,] 0.98825850 0.023482994 0.011741497 > postscript(file="/var/www/html/rcomp/tmp/142fp1258559504.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(x[,1], type='l', main='Actuals and Interpolation', ylab='value of Actuals and Interpolation (dots)', xlab='time or index') > points(x[,1]-mysum$resid) > grid() > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/22jtq1258559504.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(mysum$resid, type='b', pch=19, main='Residuals', ylab='value of Residuals', xlab='time or index') > grid() > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/38e5l1258559504.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > hist(mysum$resid, main='Residual Histogram', xlab='values of Residuals') > grid() > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/4qs2q1258559504.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > densityplot(~mysum$resid,col='black',main='Residual Density Plot', xlab='values of Residuals') > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/5n1sb1258559504.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > qqnorm(mysum$resid, main='Residual Normal Q-Q Plot') > qqline(mysum$resid) > grid() > dev.off() null device 1 > (myerror <- as.ts(mysum$resid)) Time Series: Start = 1 End = 72 Frequency = 1 1 2 3 4 5 6 472.48576 -412.23427 30.42853 189.44941 -718.92762 -799.39205 7 8 9 10 11 12 -894.97519 -506.88315 -477.66660 -325.39437 -567.05949 -681.80659 13 14 15 16 17 18 195.10641 -64.60086 -68.88547 -396.83288 -859.98833 -763.83830 19 20 21 22 23 24 -802.08617 -593.85956 -1007.03010 -508.37039 -331.64533 -461.48679 25 26 27 28 29 30 254.85815 -181.23118 -198.22499 -218.84294 627.83688 -446.85608 31 32 33 34 35 36 -146.00419 635.62613 147.68723 694.55266 699.28893 411.48421 37 38 39 40 41 42 822.75258 466.62342 234.68491 -129.49181 -563.05369 -31.16699 43 44 45 46 47 48 464.25761 893.06774 608.27655 1143.23672 1067.92040 812.63270 49 50 51 52 53 54 1882.03061 307.20501 333.92118 23.46139 -233.36652 -392.55098 55 56 57 58 59 60 95.07895 576.86008 177.11105 1150.87091 534.35931 -49.60666 61 62 63 64 65 66 1159.70424 230.07895 -959.72963 16.43819 -42.61401 -1228.71378 67 68 69 70 71 72 -102.90171 -336.04673 -368.83559 -165.24665 -226.44696 -95.48215 > postscript(file="/var/www/html/rcomp/tmp/6r61d1258559504.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > dum <- cbind(lag(myerror,k=1),myerror) > dum Time Series: Start = 0 End = 72 Frequency = 1 lag(myerror, k = 1) myerror 0 472.48576 NA 1 -412.23427 472.48576 2 30.42853 -412.23427 3 189.44941 30.42853 4 -718.92762 189.44941 5 -799.39205 -718.92762 6 -894.97519 -799.39205 7 -506.88315 -894.97519 8 -477.66660 -506.88315 9 -325.39437 -477.66660 10 -567.05949 -325.39437 11 -681.80659 -567.05949 12 195.10641 -681.80659 13 -64.60086 195.10641 14 -68.88547 -64.60086 15 -396.83288 -68.88547 16 -859.98833 -396.83288 17 -763.83830 -859.98833 18 -802.08617 -763.83830 19 -593.85956 -802.08617 20 -1007.03010 -593.85956 21 -508.37039 -1007.03010 22 -331.64533 -508.37039 23 -461.48679 -331.64533 24 254.85815 -461.48679 25 -181.23118 254.85815 26 -198.22499 -181.23118 27 -218.84294 -198.22499 28 627.83688 -218.84294 29 -446.85608 627.83688 30 -146.00419 -446.85608 31 635.62613 -146.00419 32 147.68723 635.62613 33 694.55266 147.68723 34 699.28893 694.55266 35 411.48421 699.28893 36 822.75258 411.48421 37 466.62342 822.75258 38 234.68491 466.62342 39 -129.49181 234.68491 40 -563.05369 -129.49181 41 -31.16699 -563.05369 42 464.25761 -31.16699 43 893.06774 464.25761 44 608.27655 893.06774 45 1143.23672 608.27655 46 1067.92040 1143.23672 47 812.63270 1067.92040 48 1882.03061 812.63270 49 307.20501 1882.03061 50 333.92118 307.20501 51 23.46139 333.92118 52 -233.36652 23.46139 53 -392.55098 -233.36652 54 95.07895 -392.55098 55 576.86008 95.07895 56 177.11105 576.86008 57 1150.87091 177.11105 58 534.35931 1150.87091 59 -49.60666 534.35931 60 1159.70424 -49.60666 61 230.07895 1159.70424 62 -959.72963 230.07895 63 16.43819 -959.72963 64 -42.61401 16.43819 65 -1228.71378 -42.61401 66 -102.90171 -1228.71378 67 -336.04673 -102.90171 68 -368.83559 -336.04673 69 -165.24665 -368.83559 70 -226.44696 -165.24665 71 -95.48215 -226.44696 72 NA -95.48215 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -412.23427 472.48576 [2,] 30.42853 -412.23427 [3,] 189.44941 30.42853 [4,] -718.92762 189.44941 [5,] -799.39205 -718.92762 [6,] -894.97519 -799.39205 [7,] -506.88315 -894.97519 [8,] -477.66660 -506.88315 [9,] -325.39437 -477.66660 [10,] -567.05949 -325.39437 [11,] -681.80659 -567.05949 [12,] 195.10641 -681.80659 [13,] -64.60086 195.10641 [14,] -68.88547 -64.60086 [15,] -396.83288 -68.88547 [16,] -859.98833 -396.83288 [17,] -763.83830 -859.98833 [18,] -802.08617 -763.83830 [19,] -593.85956 -802.08617 [20,] -1007.03010 -593.85956 [21,] -508.37039 -1007.03010 [22,] -331.64533 -508.37039 [23,] -461.48679 -331.64533 [24,] 254.85815 -461.48679 [25,] -181.23118 254.85815 [26,] -198.22499 -181.23118 [27,] -218.84294 -198.22499 [28,] 627.83688 -218.84294 [29,] -446.85608 627.83688 [30,] -146.00419 -446.85608 [31,] 635.62613 -146.00419 [32,] 147.68723 635.62613 [33,] 694.55266 147.68723 [34,] 699.28893 694.55266 [35,] 411.48421 699.28893 [36,] 822.75258 411.48421 [37,] 466.62342 822.75258 [38,] 234.68491 466.62342 [39,] -129.49181 234.68491 [40,] -563.05369 -129.49181 [41,] -31.16699 -563.05369 [42,] 464.25761 -31.16699 [43,] 893.06774 464.25761 [44,] 608.27655 893.06774 [45,] 1143.23672 608.27655 [46,] 1067.92040 1143.23672 [47,] 812.63270 1067.92040 [48,] 1882.03061 812.63270 [49,] 307.20501 1882.03061 [50,] 333.92118 307.20501 [51,] 23.46139 333.92118 [52,] -233.36652 23.46139 [53,] -392.55098 -233.36652 [54,] 95.07895 -392.55098 [55,] 576.86008 95.07895 [56,] 177.11105 576.86008 [57,] 1150.87091 177.11105 [58,] 534.35931 1150.87091 [59,] -49.60666 534.35931 [60,] 1159.70424 -49.60666 [61,] 230.07895 1159.70424 [62,] -959.72963 230.07895 [63,] 16.43819 -959.72963 [64,] -42.61401 16.43819 [65,] -1228.71378 -42.61401 [66,] -102.90171 -1228.71378 [67,] -336.04673 -102.90171 [68,] -368.83559 -336.04673 [69,] -165.24665 -368.83559 [70,] -226.44696 -165.24665 [71,] -95.48215 -226.44696 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -412.23427 472.48576 2 30.42853 -412.23427 3 189.44941 30.42853 4 -718.92762 189.44941 5 -799.39205 -718.92762 6 -894.97519 -799.39205 7 -506.88315 -894.97519 8 -477.66660 -506.88315 9 -325.39437 -477.66660 10 -567.05949 -325.39437 11 -681.80659 -567.05949 12 195.10641 -681.80659 13 -64.60086 195.10641 14 -68.88547 -64.60086 15 -396.83288 -68.88547 16 -859.98833 -396.83288 17 -763.83830 -859.98833 18 -802.08617 -763.83830 19 -593.85956 -802.08617 20 -1007.03010 -593.85956 21 -508.37039 -1007.03010 22 -331.64533 -508.37039 23 -461.48679 -331.64533 24 254.85815 -461.48679 25 -181.23118 254.85815 26 -198.22499 -181.23118 27 -218.84294 -198.22499 28 627.83688 -218.84294 29 -446.85608 627.83688 30 -146.00419 -446.85608 31 635.62613 -146.00419 32 147.68723 635.62613 33 694.55266 147.68723 34 699.28893 694.55266 35 411.48421 699.28893 36 822.75258 411.48421 37 466.62342 822.75258 38 234.68491 466.62342 39 -129.49181 234.68491 40 -563.05369 -129.49181 41 -31.16699 -563.05369 42 464.25761 -31.16699 43 893.06774 464.25761 44 608.27655 893.06774 45 1143.23672 608.27655 46 1067.92040 1143.23672 47 812.63270 1067.92040 48 1882.03061 812.63270 49 307.20501 1882.03061 50 333.92118 307.20501 51 23.46139 333.92118 52 -233.36652 23.46139 53 -392.55098 -233.36652 54 95.07895 -392.55098 55 576.86008 95.07895 56 177.11105 576.86008 57 1150.87091 177.11105 58 534.35931 1150.87091 59 -49.60666 534.35931 60 1159.70424 -49.60666 61 230.07895 1159.70424 62 -959.72963 230.07895 63 16.43819 -959.72963 64 -42.61401 16.43819 65 -1228.71378 -42.61401 66 -102.90171 -1228.71378 67 -336.04673 -102.90171 68 -368.83559 -336.04673 69 -165.24665 -368.83559 70 -226.44696 -165.24665 71 -95.48215 -226.44696 > 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/78c0l1258559504.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > acf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Autocorrelation Function') > grid() > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/8p6j11258559504.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > pacf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Partial Autocorrelation Function') > grid() > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/99pe41258559504.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > opar <- par(mfrow = c(2,2), oma = c(0, 0, 1.1, 0)) > plot(mylm, las = 1, sub='Residual Diagnostics') > par(opar) > dev.off() null device 1 > if (n > n25) { + postscript(file="/var/www/html/rcomp/tmp/1072lr1258559504.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) + plot(kp3:nmkm3,gqarr[,2], main='Goldfeld-Quandt test',ylab='2-sided p-value',xlab='breakpoint') + grid() + dev.off() + } null device 1 > > #Note: the /var/www/html/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/rcomp/createtable") > > a<-table.start() > a<-table.row.start(a) > a<-table.element(a, 'Multiple Linear Regression - Estimated Regression Equation', 1, TRUE) > a<-table.row.end(a) > myeq <- colnames(x)[1] > myeq <- paste(myeq, '[t] = ', sep='') > for (i in 1:k){ + if (mysum$coefficients[i,1] > 0) myeq <- paste(myeq, '+', '') + myeq <- paste(myeq, mysum$coefficients[i,1], sep=' ') + if (rownames(mysum$coefficients)[i] != '(Intercept)') { + myeq <- paste(myeq, rownames(mysum$coefficients)[i], sep='') + if (rownames(mysum$coefficients)[i] != 't') myeq <- paste(myeq, '[t]', sep='') + } + } > myeq <- paste(myeq, ' + e[t]') > a<-table.row.start(a) > a<-table.element(a, myeq) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/var/www/html/rcomp/tmp/11jbj11258559504.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/12985y1258559504.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/13ekv81258559504.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/1486np1258559504.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/15khow1258559504.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/16omra1258559504.tab") + } > > system("convert tmp/142fp1258559504.ps tmp/142fp1258559504.png") > system("convert tmp/22jtq1258559504.ps tmp/22jtq1258559504.png") > system("convert tmp/38e5l1258559504.ps tmp/38e5l1258559504.png") > system("convert tmp/4qs2q1258559504.ps tmp/4qs2q1258559504.png") > system("convert tmp/5n1sb1258559504.ps tmp/5n1sb1258559504.png") > system("convert tmp/6r61d1258559504.ps tmp/6r61d1258559504.png") > system("convert tmp/78c0l1258559504.ps tmp/78c0l1258559504.png") > system("convert tmp/8p6j11258559504.ps tmp/8p6j11258559504.png") > system("convert tmp/99pe41258559504.ps tmp/99pe41258559504.png") > system("convert tmp/1072lr1258559504.ps tmp/1072lr1258559504.png") > > > proc.time() user system elapsed 2.636 1.606 3.547