R version 2.15.1 (2012-06-22) -- "Roasted Marshmallows"
Copyright (C) 2012 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: i686-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(18.2
+ ,2687
+ ,1870
+ ,1890
+ ,145.7
+ ,352.2
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,143.8
+ ,13271
+ ,9115
+ ,8190
+ ,-279
+ ,83
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,23.4
+ ,13621
+ ,4848
+ ,4572
+ ,485
+ ,898.9
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,1.1
+ ,3614
+ ,367
+ ,90
+ ,14.1
+ ,24.6
+ ,1
+ ,0
+ ,3614
+ ,367
+ ,90
+ ,14.1
+ ,24.6
+ ,0
+ ,0
+ ,0
+ ,0
+ ,49.5
+ ,6425
+ ,6131
+ ,2448
+ ,345.8
+ ,682.5
+ ,1
+ ,0
+ ,6425
+ ,6131
+ ,2448
+ ,345.8
+ ,682.5
+ ,0
+ ,0
+ ,0
+ ,0
+ ,4.8
+ ,1022
+ ,1754
+ ,1370
+ ,72
+ ,119.5
+ ,0
+ ,1
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,1022
+ ,1754
+ ,1370
+ ,72
+ ,20.8
+ ,1093
+ ,1679
+ ,1070
+ ,100.9
+ ,164.5
+ ,0
+ ,1
+ ,0
+ ,0
+ ,0
+ ,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,0
+ ,0
+ ,0)
+ ,dim=c(17
+ ,79)
+ ,dimnames=list(c('wn'
+ ,'ta'
+ ,'omzet'
+ ,'mw'
+ ,'winst'
+ ,'cf'
+ ,'dienst'
+ ,'product'
+ ,'ta_d'
+ ,'omzet_d'
+ ,'mw_d'
+ ,'winst_d'
+ ,'cf_d'
+ ,'ta_p'
+ ,'omzet_p'
+ ,'mw_p'
+ ,'cf_p')
+ ,1:79))
> y <- array(NA,dim=c(17,79),dimnames=list(c('wn','ta','omzet','mw','winst','cf','dienst','product','ta_d','omzet_d','mw_d','winst_d','cf_d','ta_p','omzet_p','mw_p','cf_p'),1:79))
> 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'
> 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, 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
wn ta omzet mw winst cf dienst product ta_d omzet_d mw_d
1 18.2 2687 1870 1890 145.7 352.2 0 0 0 0 0
2 143.8 13271 9115 8190 -279.0 83.0 0 0 0 0 0
3 23.4 13621 4848 4572 485.0 898.9 0 0 0 0 0
4 1.1 3614 367 90 14.1 24.6 1 0 3614 367 90
5 49.5 6425 6131 2448 345.8 682.5 1 0 6425 6131 2448
6 4.8 1022 1754 1370 72.0 119.5 0 1 0 0 0
7 20.8 1093 1679 1070 100.9 164.5 0 1 0 0 0
8 19.4 1529 1295 444 25.6 137.0 0 0 0 0 0
9 2.1 2788 271 304 23.5 28.9 1 0 2788 271 304
10 79.4 19788 9084 10636 1092.9 2576.8 1 0 19788 9084 10636
11 2.8 327 542 959 54.1 72.5 1 0 327 542 959
12 3.8 1117 1038 478 59.7 91.7 0 0 0 0 0
13 4.1 5401 550 376 25.6 37.5 1 0 5401 550 376
14 13.2 1128 1516 430 -47.0 26.7 0 1 0 0 0
15 2.8 1633 701 679 74.3 135.9 0 0 0 0 0
16 48.5 44736 16197 4653 -732.5 -651.9 1 0 44736 16197 4653
17 6.2 5651 1254 2002 310.7 407.9 0 0 0 0 0
18 10.8 5835 4053 1601 -93.8 173.8 0 0 0 0 0
19 3.8 278 205 853 44.8 50.5 1 0 278 205 853
20 21.9 5074 2557 1892 239.9 578.3 1 0 5074 2557 1892
21 12.6 866 1487 944 71.7 115.4 0 0 0 0 0
22 128.0 4418 8793 4459 283.6 456.5 1 0 4418 8793 4459
23 87.3 6914 7029 7957 400.6 754.7 0 1 0 0 0
24 16.0 862 1601 1093 66.9 106.8 1 0 862 1601 1093
25 0.7 401 176 1084 55.6 57.0 1 0 401 176 1084
26 22.5 430 1155 1045 55.7 70.8 0 1 0 0 0
27 15.4 799 1140 683 57.6 89.2 0 0 0 0 0
28 3.0 4789 453 367 40.2 51.4 1 0 4789 453 367
29 2.1 2548 264 181 22.2 26.2 1 0 2548 264 181
30 4.1 5249 527 346 37.8 56.2 1 0 5249 527 346
31 6.4 3494 1653 1442 160.9 320.3 0 0 0 0 0
32 26.6 1804 2564 483 70.5 164.9 0 1 0 0 0
33 304.0 26432 28285 33172 2336.0 3562.0 0 1 0 0 0
34 18.6 623 2247 797 57.0 93.8 1 0 623 2247 797
35 65.0 1608 6615 829 56.1 134.0 1 0 1608 6615 829
36 66.2 4662 4781 2988 28.7 371.5 0 1 0 0 0
37 83.0 5769 6571 9462 482.0 792.0 0 1 0 0 0
38 62.0 6259 4152 3090 283.7 524.5 1 0 6259 4152 3090
39 1.6 1654 451 779 84.8 130.4 0 0 0 0 0
40 400.2 52634 50056 95697 6555.0 9874.0 0 1 0 0 0
41 23.3 999 1878 393 -173.5 -108.1 1 0 999 1878 393
42 4.6 1679 1354 687 93.8 154.6 0 0 0 0 0
43 164.6 4178 17124 2091 180.8 390.4 1 0 4178 17124 2091
44 1.9 223 557 1040 60.6 63.7 0 0 0 0 0
45 57.5 6307 8199 598 -771.5 -524.3 0 1 0 0 0
46 2.4 3720 356 211 26.6 34.8 1 0 3720 356 211
47 77.3 3442 5080 2673 235.4 361.5 1 0 3442 5080 2673
48 15.8 33406 3222 1413 201.7 246.7 1 0 33406 3222 1413
49 0.6 1257 355 181 167.5 304.0 0 0 0 0 0
50 3.5 1743 597 717 121.6 172.4 0 0 0 0 0
51 9.0 12505 1302 702 108.4 131.4 1 0 12505 1302 702
52 62.0 3940 4317 3940 315.2 566.3 0 1 0 0 0
53 7.4 8998 882 988 93.0 119.0 1 0 8998 882 988
54 15.6 21419 2516 930 107.6 164.7 1 0 21419 2516 930
55 25.2 2366 3305 1117 131.2 256.5 0 1 0 0 0
56 25.4 2448 3484 1036 48.8 257.1 1 0 2448 3484 1036
57 3.5 1440 1617 639 81.7 126.4 0 0 0 0 0
58 27.3 14045 15636 2754 418.0 1462.0 0 0 0 0 0
59 37.5 4084 4346 3023 302.7 521.7 0 1 0 0 0
60 3.4 3010 749 1120 146.3 209.2 0 0 0 0 0
61 14.3 1286 1734 361 69.2 145.7 1 0 1286 1734 361
62 6.1 707 706 275 61.4 77.8 1 0 707 706 275
63 4.9 3086 1739 1507 202.7 335.2 0 0 0 0 0
64 3.3 252 312 883 41.7 60.6 1 0 252 312 883
65 7.0 11052 1097 606 64.9 97.6 1 0 11052 1097 606
66 8.2 9672 1037 829 92.6 118.2 1 0 9672 1037 829
67 43.5 1112 3689 542 30.3 96.9 1 0 1112 3689 542
68 48.5 1104 5123 910 63.7 133.3 1 0 1104 5123 910
69 5.4 478 672 866 67.1 101.6 0 1 0 0 0
70 49.5 10348 5721 1915 223.6 322.5 0 1 0 0 0
71 29.1 2769 3725 663 -208.4 12.4 1 0 2769 3725 663
72 2.6 752 2149 101 11.1 15.2 0 1 0 0 0
73 0.8 4989 518 53 -3.1 -0.3 1 0 4989 518 53
74 184.8 10528 14992 5377 312.7 710.7 0 1 0 0 0
75 2.3 1995 2662 341 34.7 100.7 0 0 0 0 0
76 8.0 2286 2235 2306 195.3 219.0 0 0 0 0 0
77 10.3 952 1307 309 35.4 92.8 1 0 952 1307 309
78 50.0 2957 2806 457 40.6 93.5 1 0 2957 2806 457
79 118.1 2535 5958 1921 177.0 288.0 1 0 2535 5958 1921
winst_d cf_d ta_p omzet_p mw_p cf_p
1 0.0 0.0 0 0 0 0.0
2 0.0 0.0 0 0 0 0.0
3 0.0 0.0 0 0 0 0.0
4 14.1 24.6 0 0 0 0.0
5 345.8 682.5 0 0 0 0.0
6 0.0 0.0 1022 1754 1370 72.0
7 0.0 0.0 1093 1679 1070 100.9
8 0.0 0.0 0 0 0 0.0
9 23.5 28.9 0 0 0 0.0
10 1092.9 2576.8 0 0 0 0.0
11 54.1 72.5 0 0 0 0.0
12 0.0 0.0 0 0 0 0.0
13 25.6 37.5 0 0 0 0.0
14 0.0 0.0 1128 1516 430 -47.0
15 0.0 0.0 0 0 0 0.0
16 -732.5 -651.9 0 0 0 0.0
17 0.0 0.0 0 0 0 0.0
18 0.0 0.0 0 0 0 0.0
19 44.8 50.5 0 0 0 0.0
20 239.9 578.3 0 0 0 0.0
21 0.0 0.0 0 0 0 0.0
22 283.6 456.5 0 0 0 0.0
23 0.0 0.0 6914 7029 7957 400.6
24 66.9 106.8 0 0 0 0.0
25 55.6 57.0 0 0 0 0.0
26 0.0 0.0 430 1155 1045 55.7
27 0.0 0.0 0 0 0 0.0
28 40.2 51.4 0 0 0 0.0
29 22.2 26.2 0 0 0 0.0
30 37.8 56.2 0 0 0 0.0
31 0.0 0.0 0 0 0 0.0
32 0.0 0.0 1804 2564 483 70.5
33 0.0 0.0 26432 28285 33172 2336.0
34 57.0 93.8 0 0 0 0.0
35 56.1 134.0 0 0 0 0.0
36 0.0 0.0 4662 4781 2988 28.7
37 0.0 0.0 5769 6571 9462 482.0
38 283.7 524.5 0 0 0 0.0
39 0.0 0.0 0 0 0 0.0
40 0.0 0.0 52634 50056 95697 6555.0
41 -173.5 -108.1 0 0 0 0.0
42 0.0 0.0 0 0 0 0.0
43 180.8 390.4 0 0 0 0.0
44 0.0 0.0 0 0 0 0.0
45 0.0 0.0 6307 8199 598 -771.5
46 26.6 34.8 0 0 0 0.0
47 235.4 361.5 0 0 0 0.0
48 201.7 246.7 0 0 0 0.0
49 0.0 0.0 0 0 0 0.0
50 0.0 0.0 0 0 0 0.0
51 108.4 131.4 0 0 0 0.0
52 0.0 0.0 3940 4317 3940 315.2
53 93.0 119.0 0 0 0 0.0
54 107.6 164.7 0 0 0 0.0
55 0.0 0.0 2366 3305 1117 131.2
56 48.8 257.1 0 0 0 0.0
57 0.0 0.0 0 0 0 0.0
58 0.0 0.0 0 0 0 0.0
59 0.0 0.0 4084 4346 3023 302.7
60 0.0 0.0 0 0 0 0.0
61 69.2 145.7 0 0 0 0.0
62 61.4 77.8 0 0 0 0.0
63 0.0 0.0 0 0 0 0.0
64 41.7 60.6 0 0 0 0.0
65 64.9 97.6 0 0 0 0.0
66 92.6 118.2 0 0 0 0.0
67 30.3 96.9 0 0 0 0.0
68 63.7 133.3 0 0 0 0.0
69 0.0 0.0 478 672 866 67.1
70 0.0 0.0 10348 5721 1915 223.6
71 -208.4 12.4 0 0 0 0.0
72 0.0 0.0 752 2149 101 11.1
73 -3.1 -0.3 0 0 0 0.0
74 0.0 0.0 10528 14992 5377 312.7
75 0.0 0.0 0 0 0 0.0
76 0.0 0.0 0 0 0 0.0
77 35.4 92.8 0 0 0 0.0
78 40.6 93.5 0 0 0 0.0
79 177.0 288.0 0 0 0 0.0
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) ta omzet mw winst cf
-0.4825897 -0.0019640 0.0009189 0.0155106 -0.0940278 0.0246743
dienst product ta_d omzet_d mw_d winst_d
4.0335988 -2.5600629 0.0005686 0.0091751 -0.0112623 0.2538548
cf_d ta_p omzet_p mw_p cf_p
-0.1040447 -0.0011651 0.0146517 -0.0215121 0.1137191
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-25.453 -7.701 -1.263 4.768 44.354
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -0.4825897 4.7853575 -0.101 0.919997
ta -0.0019640 0.0027026 -0.727 0.470140
omzet 0.0009189 0.0026603 0.345 0.730950
mw 0.0155106 0.0044184 3.510 0.000840 ***
winst -0.0940278 0.0537007 -1.751 0.084899 .
cf 0.0246743 0.0414045 0.596 0.553389
dienst 4.0335988 5.6503095 0.714 0.477985
product -2.5600629 6.7471821 -0.379 0.705667
ta_d 0.0005686 0.0027196 0.209 0.835073
omzet_d 0.0091751 0.0027733 3.308 0.001566 **
mw_d -0.0112623 0.0054973 -2.049 0.044730 *
winst_d 0.2538548 0.0629385 4.033 0.000153 ***
cf_d -0.1040447 0.0472962 -2.200 0.031554 *
ta_p -0.0011651 0.0034473 -0.338 0.736530
omzet_p 0.0146517 0.0029742 4.926 6.55e-06 ***
mw_p -0.0215121 0.0054092 -3.977 0.000185 ***
cf_p 0.1137191 0.0325763 3.491 0.000893 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 13.05 on 62 degrees of freedom
Multiple R-squared: 0.9674, Adjusted R-squared: 0.959
F-statistic: 115.2 on 16 and 62 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.41511798 0.83023597 0.5848820
[2,] 0.25613739 0.51227478 0.7438626
[3,] 0.47045365 0.94090729 0.5295464
[4,] 0.37864702 0.75729405 0.6213530
[5,] 0.28039028 0.56078057 0.7196097
[6,] 0.26920589 0.53841177 0.7307941
[7,] 0.19391891 0.38783781 0.8060811
[8,] 0.14154537 0.28309075 0.8584546
[9,] 0.08920393 0.17840786 0.9107961
[10,] 0.05720040 0.11440080 0.9427996
[11,] 0.03343977 0.06687954 0.9665602
[12,] 0.01959625 0.03919250 0.9804038
[13,] 0.03337799 0.06675598 0.9666220
[14,] 0.02686587 0.05373174 0.9731341
[15,] 0.01799654 0.03599309 0.9820035
[16,] 0.01374486 0.02748971 0.9862551
[17,] 0.01917315 0.03834631 0.9808268
[18,] 0.05473769 0.10947538 0.9452623
[19,] 0.04096352 0.08192704 0.9590365
[20,] 0.02890852 0.05781705 0.9710915
[21,] 0.05828278 0.11656555 0.9417172
[22,] 0.17153038 0.34306076 0.8284696
[23,] 0.12348568 0.24697135 0.8765143
[24,] 0.29664773 0.59329545 0.7033523
[25,] 0.32738547 0.65477094 0.6726145
[26,] 0.70975523 0.58048954 0.2902448
[27,] 0.63769972 0.72460056 0.3623003
[28,] 0.65506470 0.68987061 0.3449353
[29,] 0.64345282 0.71309435 0.3565472
[30,] 0.59656657 0.80686685 0.4034334
[31,] 0.50232673 0.99534653 0.4976733
[32,] 0.40467342 0.80934684 0.5953266
[33,] 0.31352391 0.62704782 0.6864761
[34,] 0.23925257 0.47850514 0.7607474
[35,] 0.18857191 0.37714381 0.8114281
[36,] 0.16471087 0.32942174 0.8352891
[37,] 0.18935901 0.37871801 0.8106410
[38,] 0.11828007 0.23656014 0.8817199
[39,] 0.06424584 0.12849168 0.9357542
[40,] 0.04382448 0.08764896 0.9561755
> postscript(file="/var/fisher/rcomp/tmp/15o9s1351701377.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/fisher/rcomp/tmp/2p2s11351701377.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/fisher/rcomp/tmp/36xz21351701377.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/fisher/rcomp/tmp/4ftc91351701377.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/fisher/rcomp/tmp/5yxvt1351701377.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 = 79
Frequency = 1
1 2 3 4 5 6
-2.06404578 6.65711523 -1.31165386 -1.79603040 -18.47006929 -12.41450483
7 8 9 10 11 12
1.49556723 13.83554098 -3.04979696 -3.57176204 -12.73209532 1.45927738
13 14 15 16 17 18
-0.17884691 -0.98543210 -1.05306121 -10.55647492 4.72629131 -18.92263122
19 20 21 22 23 24
-8.20821018 -0.86172397 2.66933674 13.81924039 23.77555680 -9.36782864
25 26 27 28 29 30
-13.03542959 12.33197965 9.02555630 -2.34568489 -2.79801465 -0.49699493
31 32 33 34 35 36
-2.91462589 -7.19380488 14.53030496 -11.81412104 -4.93193696 17.58831258
37 38 39 40 41 42
29.53320826 8.43177239 -2.41014670 -9.84459575 19.66679537 1.48527485
43 44 45 46 47 48
-12.76548246 -9.69597161 -15.66812905 -1.93938798 6.98751026 7.68064392
49 50 51 52 53 54
8.66634371 2.91604413 -0.12255633 13.61923761 -2.11450669 8.46393425
55 56 57 58 59 60
-18.02353089 -1.69747970 -0.02320461 1.51206101 -15.03852500 0.32843397
61 62 63 64 65 66
-5.98904465 -8.39752265 -2.74043155 -8.65489806 2.59683327 -1.26268944
67 68 69 70 71 72
4.80932735 -8.68922604 0.84404704 -5.02461501 23.28794496 -25.45296870
73 74 75 76 77 78
-0.77170197 -4.07210793 -0.25648473 -11.88901843 -4.72056838 21.24187974
79
44.35420313
> postscript(file="/var/fisher/rcomp/tmp/6c1z11351701377.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 = 79
Frequency = 1
lag(myerror, k = 1) myerror
0 -2.06404578 NA
1 6.65711523 -2.06404578
2 -1.31165386 6.65711523
3 -1.79603040 -1.31165386
4 -18.47006929 -1.79603040
5 -12.41450483 -18.47006929
6 1.49556723 -12.41450483
7 13.83554098 1.49556723
8 -3.04979696 13.83554098
9 -3.57176204 -3.04979696
10 -12.73209532 -3.57176204
11 1.45927738 -12.73209532
12 -0.17884691 1.45927738
13 -0.98543210 -0.17884691
14 -1.05306121 -0.98543210
15 -10.55647492 -1.05306121
16 4.72629131 -10.55647492
17 -18.92263122 4.72629131
18 -8.20821018 -18.92263122
19 -0.86172397 -8.20821018
20 2.66933674 -0.86172397
21 13.81924039 2.66933674
22 23.77555680 13.81924039
23 -9.36782864 23.77555680
24 -13.03542959 -9.36782864
25 12.33197965 -13.03542959
26 9.02555630 12.33197965
27 -2.34568489 9.02555630
28 -2.79801465 -2.34568489
29 -0.49699493 -2.79801465
30 -2.91462589 -0.49699493
31 -7.19380488 -2.91462589
32 14.53030496 -7.19380488
33 -11.81412104 14.53030496
34 -4.93193696 -11.81412104
35 17.58831258 -4.93193696
36 29.53320826 17.58831258
37 8.43177239 29.53320826
38 -2.41014670 8.43177239
39 -9.84459575 -2.41014670
40 19.66679537 -9.84459575
41 1.48527485 19.66679537
42 -12.76548246 1.48527485
43 -9.69597161 -12.76548246
44 -15.66812905 -9.69597161
45 -1.93938798 -15.66812905
46 6.98751026 -1.93938798
47 7.68064392 6.98751026
48 8.66634371 7.68064392
49 2.91604413 8.66634371
50 -0.12255633 2.91604413
51 13.61923761 -0.12255633
52 -2.11450669 13.61923761
53 8.46393425 -2.11450669
54 -18.02353089 8.46393425
55 -1.69747970 -18.02353089
56 -0.02320461 -1.69747970
57 1.51206101 -0.02320461
58 -15.03852500 1.51206101
59 0.32843397 -15.03852500
60 -5.98904465 0.32843397
61 -8.39752265 -5.98904465
62 -2.74043155 -8.39752265
63 -8.65489806 -2.74043155
64 2.59683327 -8.65489806
65 -1.26268944 2.59683327
66 4.80932735 -1.26268944
67 -8.68922604 4.80932735
68 0.84404704 -8.68922604
69 -5.02461501 0.84404704
70 23.28794496 -5.02461501
71 -25.45296870 23.28794496
72 -0.77170197 -25.45296870
73 -4.07210793 -0.77170197
74 -0.25648473 -4.07210793
75 -11.88901843 -0.25648473
76 -4.72056838 -11.88901843
77 21.24187974 -4.72056838
78 44.35420313 21.24187974
79 NA 44.35420313
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 6.65711523 -2.06404578
[2,] -1.31165386 6.65711523
[3,] -1.79603040 -1.31165386
[4,] -18.47006929 -1.79603040
[5,] -12.41450483 -18.47006929
[6,] 1.49556723 -12.41450483
[7,] 13.83554098 1.49556723
[8,] -3.04979696 13.83554098
[9,] -3.57176204 -3.04979696
[10,] -12.73209532 -3.57176204
[11,] 1.45927738 -12.73209532
[12,] -0.17884691 1.45927738
[13,] -0.98543210 -0.17884691
[14,] -1.05306121 -0.98543210
[15,] -10.55647492 -1.05306121
[16,] 4.72629131 -10.55647492
[17,] -18.92263122 4.72629131
[18,] -8.20821018 -18.92263122
[19,] -0.86172397 -8.20821018
[20,] 2.66933674 -0.86172397
[21,] 13.81924039 2.66933674
[22,] 23.77555680 13.81924039
[23,] -9.36782864 23.77555680
[24,] -13.03542959 -9.36782864
[25,] 12.33197965 -13.03542959
[26,] 9.02555630 12.33197965
[27,] -2.34568489 9.02555630
[28,] -2.79801465 -2.34568489
[29,] -0.49699493 -2.79801465
[30,] -2.91462589 -0.49699493
[31,] -7.19380488 -2.91462589
[32,] 14.53030496 -7.19380488
[33,] -11.81412104 14.53030496
[34,] -4.93193696 -11.81412104
[35,] 17.58831258 -4.93193696
[36,] 29.53320826 17.58831258
[37,] 8.43177239 29.53320826
[38,] -2.41014670 8.43177239
[39,] -9.84459575 -2.41014670
[40,] 19.66679537 -9.84459575
[41,] 1.48527485 19.66679537
[42,] -12.76548246 1.48527485
[43,] -9.69597161 -12.76548246
[44,] -15.66812905 -9.69597161
[45,] -1.93938798 -15.66812905
[46,] 6.98751026 -1.93938798
[47,] 7.68064392 6.98751026
[48,] 8.66634371 7.68064392
[49,] 2.91604413 8.66634371
[50,] -0.12255633 2.91604413
[51,] 13.61923761 -0.12255633
[52,] -2.11450669 13.61923761
[53,] 8.46393425 -2.11450669
[54,] -18.02353089 8.46393425
[55,] -1.69747970 -18.02353089
[56,] -0.02320461 -1.69747970
[57,] 1.51206101 -0.02320461
[58,] -15.03852500 1.51206101
[59,] 0.32843397 -15.03852500
[60,] -5.98904465 0.32843397
[61,] -8.39752265 -5.98904465
[62,] -2.74043155 -8.39752265
[63,] -8.65489806 -2.74043155
[64,] 2.59683327 -8.65489806
[65,] -1.26268944 2.59683327
[66,] 4.80932735 -1.26268944
[67,] -8.68922604 4.80932735
[68,] 0.84404704 -8.68922604
[69,] -5.02461501 0.84404704
[70,] 23.28794496 -5.02461501
[71,] -25.45296870 23.28794496
[72,] -0.77170197 -25.45296870
[73,] -4.07210793 -0.77170197
[74,] -0.25648473 -4.07210793
[75,] -11.88901843 -0.25648473
[76,] -4.72056838 -11.88901843
[77,] 21.24187974 -4.72056838
[78,] 44.35420313 21.24187974
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 6.65711523 -2.06404578
2 -1.31165386 6.65711523
3 -1.79603040 -1.31165386
4 -18.47006929 -1.79603040
5 -12.41450483 -18.47006929
6 1.49556723 -12.41450483
7 13.83554098 1.49556723
8 -3.04979696 13.83554098
9 -3.57176204 -3.04979696
10 -12.73209532 -3.57176204
11 1.45927738 -12.73209532
12 -0.17884691 1.45927738
13 -0.98543210 -0.17884691
14 -1.05306121 -0.98543210
15 -10.55647492 -1.05306121
16 4.72629131 -10.55647492
17 -18.92263122 4.72629131
18 -8.20821018 -18.92263122
19 -0.86172397 -8.20821018
20 2.66933674 -0.86172397
21 13.81924039 2.66933674
22 23.77555680 13.81924039
23 -9.36782864 23.77555680
24 -13.03542959 -9.36782864
25 12.33197965 -13.03542959
26 9.02555630 12.33197965
27 -2.34568489 9.02555630
28 -2.79801465 -2.34568489
29 -0.49699493 -2.79801465
30 -2.91462589 -0.49699493
31 -7.19380488 -2.91462589
32 14.53030496 -7.19380488
33 -11.81412104 14.53030496
34 -4.93193696 -11.81412104
35 17.58831258 -4.93193696
36 29.53320826 17.58831258
37 8.43177239 29.53320826
38 -2.41014670 8.43177239
39 -9.84459575 -2.41014670
40 19.66679537 -9.84459575
41 1.48527485 19.66679537
42 -12.76548246 1.48527485
43 -9.69597161 -12.76548246
44 -15.66812905 -9.69597161
45 -1.93938798 -15.66812905
46 6.98751026 -1.93938798
47 7.68064392 6.98751026
48 8.66634371 7.68064392
49 2.91604413 8.66634371
50 -0.12255633 2.91604413
51 13.61923761 -0.12255633
52 -2.11450669 13.61923761
53 8.46393425 -2.11450669
54 -18.02353089 8.46393425
55 -1.69747970 -18.02353089
56 -0.02320461 -1.69747970
57 1.51206101 -0.02320461
58 -15.03852500 1.51206101
59 0.32843397 -15.03852500
60 -5.98904465 0.32843397
61 -8.39752265 -5.98904465
62 -2.74043155 -8.39752265
63 -8.65489806 -2.74043155
64 2.59683327 -8.65489806
65 -1.26268944 2.59683327
66 4.80932735 -1.26268944
67 -8.68922604 4.80932735
68 0.84404704 -8.68922604
69 -5.02461501 0.84404704
70 23.28794496 -5.02461501
71 -25.45296870 23.28794496
72 -0.77170197 -25.45296870
73 -4.07210793 -0.77170197
74 -0.25648473 -4.07210793
75 -11.88901843 -0.25648473
76 -4.72056838 -11.88901843
77 21.24187974 -4.72056838
78 44.35420313 21.24187974
> 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/fisher/rcomp/tmp/7908t1351701377.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/fisher/rcomp/tmp/83dn81351701377.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/fisher/rcomp/tmp/96kl41351701377.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')
Warning messages:
1: In sqrt(crit * p * (1 - hh)/hh) : NaNs produced
2: In sqrt(crit * p * (1 - hh)/hh) : NaNs produced
> par(opar)
> dev.off()
null device
1
> if (n > n25) {
+ postscript(file="/var/fisher/rcomp/tmp/104icl1351701377.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/fisher/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/fisher/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/fisher/rcomp/tmp/11pvzz1351701377.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/fisher/rcomp/tmp/12591x1351701377.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/fisher/rcomp/tmp/133ky11351701377.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/fisher/rcomp/tmp/14rlxt1351701377.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/fisher/rcomp/tmp/15gkpx1351701377.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/fisher/rcomp/tmp/16o9ug1351701377.tab")
+ }
>
> try(system("convert tmp/15o9s1351701377.ps tmp/15o9s1351701377.png",intern=TRUE))
character(0)
> try(system("convert tmp/2p2s11351701377.ps tmp/2p2s11351701377.png",intern=TRUE))
character(0)
> try(system("convert tmp/36xz21351701377.ps tmp/36xz21351701377.png",intern=TRUE))
character(0)
> try(system("convert tmp/4ftc91351701377.ps tmp/4ftc91351701377.png",intern=TRUE))
character(0)
> try(system("convert tmp/5yxvt1351701377.ps tmp/5yxvt1351701377.png",intern=TRUE))
character(0)
> try(system("convert tmp/6c1z11351701377.ps tmp/6c1z11351701377.png",intern=TRUE))
character(0)
> try(system("convert tmp/7908t1351701377.ps tmp/7908t1351701377.png",intern=TRUE))
character(0)
> try(system("convert tmp/83dn81351701377.ps tmp/83dn81351701377.png",intern=TRUE))
character(0)
> try(system("convert tmp/96kl41351701377.ps tmp/96kl41351701377.png",intern=TRUE))
character(0)
> try(system("convert tmp/104icl1351701377.ps tmp/104icl1351701377.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
6.794 1.092 7.887