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(2529,314,2196,318,3202,320,2718,323,2728,325,2354,327,2697,330,2651,331,2067,332,2641,334,2539,334,2294,334,2712,339,2314,345,3092,346,2677,352,2813,355,2668,358,2939,361,2617,363,2231,364,2481,365,2421,366,2408,370,2560,371,2100,371,3315,372,2801,373,2403,373,3024,374,2507,375,2980,375,2211,376,2471,376,2594,377,2452,377,2232,378,2373,379,3127,380,2802,384,2641,389,2787,390,2619,391,2806,392,2193,393,2323,394,2529,394,2412,395,2262,396,2154,397,3230,398,2295,399,2715,400,2733,400,2317,401,2730,401,1913,406,2390,407,2484,423,1960,427),dim=c(2,60),dimnames=list(c('Y','X'),1:60))
> y <- array(NA,dim=c(2,60),dimnames=list(c('Y','X'),1:60))
> 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
Y X
1 2529 314
2 2196 318
3 3202 320
4 2718 323
5 2728 325
6 2354 327
7 2697 330
8 2651 331
9 2067 332
10 2641 334
11 2539 334
12 2294 334
13 2712 339
14 2314 345
15 3092 346
16 2677 352
17 2813 355
18 2668 358
19 2939 361
20 2617 363
21 2231 364
22 2481 365
23 2421 366
24 2408 370
25 2560 371
26 2100 371
27 3315 372
28 2801 373
29 2403 373
30 3024 374
31 2507 375
32 2980 375
33 2211 376
34 2471 376
35 2594 377
36 2452 377
37 2232 378
38 2373 379
39 3127 380
40 2802 384
41 2641 389
42 2787 390
43 2619 391
44 2806 392
45 2193 393
46 2323 394
47 2529 394
48 2412 395
49 2262 396
50 2154 397
51 3230 398
52 2295 399
53 2715 400
54 2733 400
55 2317 401
56 2730 401
57 1913 406
58 2390 407
59 2484 423
60 1960 427
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) X
3255.268 -1.886
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-576.661 -193.933 9.952 217.310 761.224
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 3255.268 535.850 6.075 1.02e-07 ***
X -1.886 1.444 -1.306 0.197
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 310 on 58 degrees of freedom
Multiple R-squared: 0.02858, Adjusted R-squared: 0.01183
F-statistic: 1.706 on 1 and 58 DF, p-value: 0.1966
> 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.8083562 0.3832876 0.1916438
[2,] 0.8179567 0.3640866 0.1820433
[3,] 0.7120789 0.5758421 0.2879211
[4,] 0.5918514 0.8162972 0.4081486
[5,] 0.7487928 0.5024143 0.2512072
[6,] 0.6680697 0.6638605 0.3319303
[7,] 0.5709491 0.8581018 0.4290509
[8,] 0.5431696 0.9136608 0.4568304
[9,] 0.4910473 0.9820945 0.5089527
[10,] 0.4502643 0.9005286 0.5497357
[11,] 0.6231667 0.7536665 0.3768333
[12,] 0.5378661 0.9242679 0.4621339
[13,] 0.4675052 0.9350105 0.5324948
[14,] 0.3830420 0.7660839 0.6169580
[15,] 0.3478287 0.6956573 0.6521713
[16,] 0.2838565 0.5677129 0.7161435
[17,] 0.3673855 0.7347710 0.6326145
[18,] 0.3136775 0.6273549 0.6863225
[19,] 0.2768947 0.5537893 0.7231053
[20,] 0.2414456 0.4828912 0.7585544
[21,] 0.1867325 0.3734649 0.8132675
[22,] 0.2924063 0.5848126 0.7075937
[23,] 0.6076927 0.7846145 0.3923073
[24,] 0.5548739 0.8902522 0.4451261
[25,] 0.5216597 0.9566806 0.4783403
[26,] 0.5639170 0.8721659 0.4360830
[27,] 0.5001395 0.9997209 0.4998605
[28,] 0.5196376 0.9607247 0.4803624
[29,] 0.5793712 0.8412576 0.4206288
[30,] 0.5245908 0.9508184 0.4754092
[31,] 0.4491371 0.8982743 0.5508629
[32,] 0.4036084 0.8072167 0.5963916
[33,] 0.4844258 0.9688516 0.5155742
[34,] 0.5095184 0.9809632 0.4904816
[35,] 0.5856674 0.8286652 0.4143326
[36,] 0.5240654 0.9518692 0.4759346
[37,] 0.4424488 0.8848976 0.5575512
[38,] 0.3930192 0.7860383 0.6069808
[39,] 0.3165479 0.6330958 0.6834521
[40,] 0.2916787 0.5833575 0.7083213
[41,] 0.3107684 0.6215367 0.6892316
[42,] 0.2729761 0.5459522 0.7270239
[43,] 0.2020172 0.4040344 0.7979828
[44,] 0.1521246 0.3042491 0.8478754
[45,] 0.1428746 0.2857492 0.8571254
[46,] 0.1942760 0.3885520 0.8057240
[47,] 0.5049971 0.9900059 0.4950029
[48,] 0.4515264 0.9030528 0.5484736
[49,] 0.3715016 0.7430032 0.6284984
[50,] 0.3321020 0.6642039 0.6678980
[51,] 0.2131822 0.4263644 0.7868178
> postscript(file="/var/www/html/rcomp/tmp/1ao9x1258718279.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/2c87l1258718279.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/3tu2y1258718280.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/4rykl1258718280.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/5t6ml1258718280.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 = 60
Frequency = 1
1 2 3 4 5 6
-134.148512 -459.605592 550.165869 71.823059 85.594520 -284.634020
7 8 9 10 11 12
64.023171 19.908901 -562.205369 15.566091 -86.433909 -331.433909
13 14 15 16 17 18
95.994742 -290.690876 489.194854 85.509235 227.166425 87.823616
19 20 21 22 23 24
364.480807 46.252267 -337.862003 -85.976273 -144.090542 -149.547622
25 26 27 28 29 30
4.338108 -455.661892 761.223839 249.109569 -148.890431 473.995299
31 32 33 34 35 36
-41.118971 431.881029 -335.233241 -75.233241 49.652490 -92.347510
37 38 39 40 41 42
-310.461780 -167.576050 588.309680 270.852601 119.281252 267.166982
43 44 45 46 47 48
101.052712 289.938443 -321.175827 -189.290097 16.709903 -98.404367
49 50 51 52 53 54
-246.518637 -352.632907 725.252824 -207.861446 214.024284 232.024284
55 56 57 58 59 60
-182.089986 230.910014 -576.661335 -97.775605 26.396078 -490.061001
> postscript(file="/var/www/html/rcomp/tmp/6be061258718280.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 = 60
Frequency = 1
lag(myerror, k = 1) myerror
0 -134.148512 NA
1 -459.605592 -134.148512
2 550.165869 -459.605592
3 71.823059 550.165869
4 85.594520 71.823059
5 -284.634020 85.594520
6 64.023171 -284.634020
7 19.908901 64.023171
8 -562.205369 19.908901
9 15.566091 -562.205369
10 -86.433909 15.566091
11 -331.433909 -86.433909
12 95.994742 -331.433909
13 -290.690876 95.994742
14 489.194854 -290.690876
15 85.509235 489.194854
16 227.166425 85.509235
17 87.823616 227.166425
18 364.480807 87.823616
19 46.252267 364.480807
20 -337.862003 46.252267
21 -85.976273 -337.862003
22 -144.090542 -85.976273
23 -149.547622 -144.090542
24 4.338108 -149.547622
25 -455.661892 4.338108
26 761.223839 -455.661892
27 249.109569 761.223839
28 -148.890431 249.109569
29 473.995299 -148.890431
30 -41.118971 473.995299
31 431.881029 -41.118971
32 -335.233241 431.881029
33 -75.233241 -335.233241
34 49.652490 -75.233241
35 -92.347510 49.652490
36 -310.461780 -92.347510
37 -167.576050 -310.461780
38 588.309680 -167.576050
39 270.852601 588.309680
40 119.281252 270.852601
41 267.166982 119.281252
42 101.052712 267.166982
43 289.938443 101.052712
44 -321.175827 289.938443
45 -189.290097 -321.175827
46 16.709903 -189.290097
47 -98.404367 16.709903
48 -246.518637 -98.404367
49 -352.632907 -246.518637
50 725.252824 -352.632907
51 -207.861446 725.252824
52 214.024284 -207.861446
53 232.024284 214.024284
54 -182.089986 232.024284
55 230.910014 -182.089986
56 -576.661335 230.910014
57 -97.775605 -576.661335
58 26.396078 -97.775605
59 -490.061001 26.396078
60 NA -490.061001
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -459.605592 -134.148512
[2,] 550.165869 -459.605592
[3,] 71.823059 550.165869
[4,] 85.594520 71.823059
[5,] -284.634020 85.594520
[6,] 64.023171 -284.634020
[7,] 19.908901 64.023171
[8,] -562.205369 19.908901
[9,] 15.566091 -562.205369
[10,] -86.433909 15.566091
[11,] -331.433909 -86.433909
[12,] 95.994742 -331.433909
[13,] -290.690876 95.994742
[14,] 489.194854 -290.690876
[15,] 85.509235 489.194854
[16,] 227.166425 85.509235
[17,] 87.823616 227.166425
[18,] 364.480807 87.823616
[19,] 46.252267 364.480807
[20,] -337.862003 46.252267
[21,] -85.976273 -337.862003
[22,] -144.090542 -85.976273
[23,] -149.547622 -144.090542
[24,] 4.338108 -149.547622
[25,] -455.661892 4.338108
[26,] 761.223839 -455.661892
[27,] 249.109569 761.223839
[28,] -148.890431 249.109569
[29,] 473.995299 -148.890431
[30,] -41.118971 473.995299
[31,] 431.881029 -41.118971
[32,] -335.233241 431.881029
[33,] -75.233241 -335.233241
[34,] 49.652490 -75.233241
[35,] -92.347510 49.652490
[36,] -310.461780 -92.347510
[37,] -167.576050 -310.461780
[38,] 588.309680 -167.576050
[39,] 270.852601 588.309680
[40,] 119.281252 270.852601
[41,] 267.166982 119.281252
[42,] 101.052712 267.166982
[43,] 289.938443 101.052712
[44,] -321.175827 289.938443
[45,] -189.290097 -321.175827
[46,] 16.709903 -189.290097
[47,] -98.404367 16.709903
[48,] -246.518637 -98.404367
[49,] -352.632907 -246.518637
[50,] 725.252824 -352.632907
[51,] -207.861446 725.252824
[52,] 214.024284 -207.861446
[53,] 232.024284 214.024284
[54,] -182.089986 232.024284
[55,] 230.910014 -182.089986
[56,] -576.661335 230.910014
[57,] -97.775605 -576.661335
[58,] 26.396078 -97.775605
[59,] -490.061001 26.396078
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -459.605592 -134.148512
2 550.165869 -459.605592
3 71.823059 550.165869
4 85.594520 71.823059
5 -284.634020 85.594520
6 64.023171 -284.634020
7 19.908901 64.023171
8 -562.205369 19.908901
9 15.566091 -562.205369
10 -86.433909 15.566091
11 -331.433909 -86.433909
12 95.994742 -331.433909
13 -290.690876 95.994742
14 489.194854 -290.690876
15 85.509235 489.194854
16 227.166425 85.509235
17 87.823616 227.166425
18 364.480807 87.823616
19 46.252267 364.480807
20 -337.862003 46.252267
21 -85.976273 -337.862003
22 -144.090542 -85.976273
23 -149.547622 -144.090542
24 4.338108 -149.547622
25 -455.661892 4.338108
26 761.223839 -455.661892
27 249.109569 761.223839
28 -148.890431 249.109569
29 473.995299 -148.890431
30 -41.118971 473.995299
31 431.881029 -41.118971
32 -335.233241 431.881029
33 -75.233241 -335.233241
34 49.652490 -75.233241
35 -92.347510 49.652490
36 -310.461780 -92.347510
37 -167.576050 -310.461780
38 588.309680 -167.576050
39 270.852601 588.309680
40 119.281252 270.852601
41 267.166982 119.281252
42 101.052712 267.166982
43 289.938443 101.052712
44 -321.175827 289.938443
45 -189.290097 -321.175827
46 16.709903 -189.290097
47 -98.404367 16.709903
48 -246.518637 -98.404367
49 -352.632907 -246.518637
50 725.252824 -352.632907
51 -207.861446 725.252824
52 214.024284 -207.861446
53 232.024284 214.024284
54 -182.089986 232.024284
55 230.910014 -182.089986
56 -576.661335 230.910014
57 -97.775605 -576.661335
58 26.396078 -97.775605
59 -490.061001 26.396078
> 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/75hpg1258718280.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/85dpv1258718280.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/986e71258718280.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/10jkaw1258718280.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/115yjs1258718280.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/12ep7k1258718280.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/13uhpb1258718280.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/14pvqs1258718280.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/1505931258718280.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/16gzc51258718280.tab")
+ }
> system("convert tmp/1ao9x1258718279.ps tmp/1ao9x1258718279.png")
> system("convert tmp/2c87l1258718279.ps tmp/2c87l1258718279.png")
> system("convert tmp/3tu2y1258718280.ps tmp/3tu2y1258718280.png")
> system("convert tmp/4rykl1258718280.ps tmp/4rykl1258718280.png")
> system("convert tmp/5t6ml1258718280.ps tmp/5t6ml1258718280.png")
> system("convert tmp/6be061258718280.ps tmp/6be061258718280.png")
> system("convert tmp/75hpg1258718280.ps tmp/75hpg1258718280.png")
> system("convert tmp/85dpv1258718280.ps tmp/85dpv1258718280.png")
> system("convert tmp/986e71258718280.ps tmp/986e71258718280.png")
> system("convert tmp/10jkaw1258718280.ps tmp/10jkaw1258718280.png")
>
>
> proc.time()
user system elapsed
2.507 1.596 3.054