R version 2.8.0 (2008-10-20)
Copyright (C) 2008 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.
Natural language support but running in an English locale
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(10.81
+ ,-0.2643
+ ,0
+ ,0
+ ,24563400
+ ,24.45
+ ,9.12
+ ,-0.2643
+ ,0
+ ,0
+ ,14163200
+ ,23.62
+ ,11.03
+ ,-0.2643
+ ,0
+ ,0
+ ,18184800
+ ,21.90
+ ,12.74
+ ,-0.1918
+ ,0
+ ,0
+ ,20810300
+ ,27.12
+ ,9.98
+ ,-0.1918
+ ,0
+ ,0
+ ,12843000
+ ,27.70
+ ,11.62
+ ,-0.1918
+ ,0
+ ,0
+ ,13866700
+ ,29.23
+ ,9.40
+ ,-0.2246
+ ,0
+ ,0
+ ,15119200
+ ,26.50
+ ,9.27
+ ,-0.2246
+ ,0
+ ,0
+ ,8301600
+ ,22.84
+ ,7.76
+ ,-0.2246
+ ,0
+ ,0
+ ,14039600
+ ,20.49
+ ,8.78
+ ,0.3654
+ ,0
+ ,0
+ ,12139700
+ ,23.28
+ ,10.65
+ ,0.3654
+ ,0
+ ,0
+ ,9649000
+ ,25.71
+ ,10.95
+ ,0.3654
+ ,0
+ ,0
+ ,8513600
+ ,26.52
+ ,12.36
+ ,0.0447
+ ,0
+ ,0
+ ,15278600
+ ,25.51
+ ,10.85
+ ,0.0447
+ ,0
+ ,0
+ ,15590900
+ ,23.36
+ ,11.84
+ ,0.0447
+ ,0
+ ,0
+ ,9691100
+ ,24.15
+ ,12.14
+ ,-0.0312
+ ,0
+ ,0
+ ,10882700
+ ,20.92
+ ,11.65
+ ,-0.0312
+ ,0
+ ,0
+ ,10294800
+ ,20.38
+ ,8.86
+ ,-0.0312
+ ,0
+ ,0
+ ,16031900
+ ,21.90
+ ,7.63
+ ,-0.0048
+ ,0
+ ,0
+ ,13683600
+ ,19.21
+ ,7.38
+ ,-0.0048
+ ,0
+ ,0
+ ,8677200
+ ,19.65
+ ,7.25
+ ,-0.0048
+ ,0
+ ,0
+ ,9874100
+ ,17.51
+ ,8.03
+ ,0.0705
+ ,0
+ ,0
+ ,10725500
+ ,21.41
+ ,7.75
+ ,0.0705
+ ,0
+ ,0
+ ,8348400
+ ,23.09
+ ,7.16
+ ,0.0705
+ ,0
+ ,0
+ ,8046200
+ ,20.70
+ ,7.18
+ ,-0.0134
+ ,0
+ ,0
+ ,10862300
+ ,19.00
+ ,7.51
+ ,-0.0134
+ ,0
+ ,0
+ ,8100300
+ ,19.04
+ ,7.07
+ ,-0.0134
+ ,0
+ ,0
+ ,7287500
+ ,19.45
+ ,7.11
+ ,0.0812
+ ,0
+ ,0
+ ,14002500
+ ,20.54
+ ,8.98
+ ,0.0812
+ ,0
+ ,0
+ ,19037900
+ ,19.77
+ ,9.53
+ ,0.0812
+ ,0
+ ,0
+ ,10774600
+ ,20.60
+ ,10.54
+ ,0.1885
+ ,0
+ ,0
+ ,8960600
+ ,21.21
+ ,11.31
+ ,0.1885
+ ,0
+ ,0
+ ,7773300
+ ,21.30
+ ,10.36
+ ,0.1885
+ ,0
+ ,0
+ ,9579700
+ ,22.33
+ ,11.44
+ ,0.3628
+ ,0
+ ,0
+ ,11270700
+ ,21.12
+ ,10.45
+ ,0.3628
+ ,0
+ ,0
+ ,9492800
+ ,20.77
+ ,10.69
+ ,0.3628
+ ,0
+ ,0
+ ,9136800
+ ,22.11
+ ,11.28
+ ,0.2942
+ ,0
+ ,0
+ ,14487600
+ ,22.34
+ ,11.96
+ ,0.2942
+ ,0
+ ,0
+ ,10133200
+ ,21.43
+ ,13.52
+ ,0.2942
+ ,0
+ ,0
+ ,18659700
+ ,20.14
+ ,12.89
+ ,0.3036
+ ,0
+ ,0
+ ,15980700
+ ,21.11
+ ,14.03
+ ,0.3036
+ ,0
+ ,0
+ ,9732100
+ ,21.19
+ ,16.27
+ ,0.3036
+ ,0
+ ,0
+ ,14626300
+ ,23.07
+ ,16.17
+ ,0.3703
+ ,0
+ ,0
+ ,16904000
+ ,23.01
+ ,17.25
+ ,0.3703
+ ,0
+ ,0
+ ,13616700
+ ,22.12
+ ,19.38
+ ,0.3703
+ ,0
+ ,0
+ ,13772900
+ ,22.40
+ ,26.20
+ ,0.7398
+ ,0
+ ,0
+ ,28749200
+ ,22.66
+ ,33.53
+ ,0.7398
+ ,0
+ ,0
+ ,31408300
+ ,24.21
+ ,32.20
+ ,0.7398
+ ,0
+ ,0
+ ,26342800
+ ,24.13
+ ,38.45
+ ,0.6988
+ ,0
+ ,0
+ ,48909500
+ ,23.73
+ ,44.86
+ ,0.6988
+ ,0
+ ,0
+ ,41542400
+ ,22.79
+ ,41.67
+ ,0.6988
+ ,0
+ ,0
+ ,24857200
+ ,21.89
+ ,36.06
+ ,0.7478
+ ,0
+ ,0
+ ,34093700
+ ,22.92
+ ,39.76
+ ,0.7478
+ ,0
+ ,0
+ ,22555200
+ ,23.44
+ ,36.81
+ ,0.7478
+ ,0
+ ,0
+ ,19067500
+ ,22.57
+ ,42.65
+ ,0.5651
+ ,0
+ ,0
+ ,19029100
+ ,23.27
+ ,46.89
+ ,0.5651
+ ,0
+ ,0
+ ,15223200
+ ,24.95
+ ,53.61
+ ,0.5651
+ ,0
+ ,0
+ ,21903700
+ ,23.45
+ ,57.59
+ ,0.6473
+ ,0
+ ,0
+ ,33306600
+ ,23.42
+ ,67.82
+ ,0.6473
+ ,0
+ ,0
+ ,23898100
+ ,25.30
+ ,71.89
+ ,0.6473
+ ,0
+ ,0
+ ,23279600
+ ,23.90
+ ,75.51
+ ,0.3441
+ ,0
+ ,0
+ ,40699800
+ ,25.73
+ ,68.49
+ ,0.3441
+ ,0
+ ,0
+ ,37646000
+ ,24.64
+ ,62.72
+ ,0.3441
+ ,0
+ ,0
+ ,37277000
+ ,24.95
+ ,70.39
+ ,0.2415
+ ,0
+ ,0
+ ,39246800
+ ,22.15
+ ,59.77
+ ,0.2415
+ ,0
+ ,0
+ ,27418400
+ ,20.85
+ ,57.27
+ ,0.2415
+ ,0
+ ,0
+ ,30318700
+ ,21.45
+ ,67.96
+ ,0.3151
+ ,0
+ ,0
+ ,32808100
+ ,22.15
+ ,67.85
+ ,0.3151
+ ,0
+ ,0
+ ,28668200
+ ,23.75
+ ,76.98
+ ,0.3151
+ ,0
+ ,0
+ ,32370300
+ ,25.27
+ ,81.08
+ ,0.239
+ ,0
+ ,0
+ ,24171100
+ ,26.53
+ ,91.66
+ ,0.239
+ ,0
+ ,0
+ ,25009100
+ ,27.22
+ ,84.84
+ ,0.239
+ ,0
+ ,0
+ ,32084300
+ ,27.69
+ ,85.73
+ ,0.2127
+ ,0
+ ,0
+ ,50117500
+ ,28.61
+ ,84.61
+ ,0.2127
+ ,0
+ ,0
+ ,27522200
+ ,26.21
+ ,92.91
+ ,0.2127
+ ,0
+ ,0
+ ,26816800
+ ,25.93
+ ,99.80
+ ,0.273
+ ,0
+ ,0
+ ,25136100
+ ,27.86
+ ,121.19
+ ,0.273
+ ,0
+ ,0
+ ,30295600
+ ,28.65
+ ,122.04
+ ,0.273
+ ,0.273
+ ,0
+ ,41526100
+ ,27.51
+ ,131.76
+ ,0.3657
+ ,0.3657
+ ,0
+ ,43845100
+ ,27.06
+ ,138.48
+ ,0.3657
+ ,0.3657
+ ,0
+ ,39188900
+ ,26.91
+ ,153.47
+ ,0.3657
+ ,0.3657
+ ,0
+ ,40496400
+ ,27.60
+ ,189.95
+ ,0.4643
+ ,0.4643
+ ,0
+ ,37438400
+ ,34.48
+ ,182.22
+ ,0.4643
+ ,0.4643
+ ,0
+ ,46553700
+ ,31.58
+ ,198.08
+ ,0.4643
+ ,0.4643
+ ,0
+ ,31771400
+ ,33.46
+ ,135.36
+ ,0.5096
+ ,0.5096
+ ,0
+ ,62108100
+ ,30.64
+ ,125.02
+ ,0.5096
+ ,0.5096
+ ,0
+ ,46645400
+ ,25.66
+ ,143.50
+ ,0.5096
+ ,0.5096
+ ,0
+ ,42313100
+ ,26.78
+ ,173.95
+ ,0.3592
+ ,0.3592
+ ,0
+ ,38841700
+ ,26.91
+ ,188.75
+ ,0.3592
+ ,0.3592
+ ,0
+ ,32650300
+ ,26.82
+ ,167.44
+ ,0.3592
+ ,0.3592
+ ,0
+ ,34281100
+ ,26.05
+ ,158.95
+ ,0.7439
+ ,0.7439
+ ,0
+ ,33096200
+ ,24.36
+ ,169.53
+ ,0.7439
+ ,0.7439
+ ,0
+ ,23273800
+ ,25.94
+ ,113.66
+ ,0.7439
+ ,0.7439
+ ,0
+ ,43697600
+ ,25.37
+ ,107.59
+ ,0.139
+ ,0.139
+ ,0
+ ,66902300
+ ,21.23
+ ,92.67
+ ,0.139
+ ,0.139
+ ,0
+ ,44957200
+ ,19.35
+ ,85.35
+ ,0.139
+ ,0.139
+ ,0
+ ,33800900
+ ,18.61
+ ,90.13
+ ,0.1383
+ ,0.1383
+ ,0
+ ,33487900
+ ,16.37
+ ,89.31
+ ,0.1383
+ ,0.1383
+ ,0
+ ,27394900
+ ,15.56
+ ,105.12
+ ,0.1383
+ ,0.1383
+ ,0
+ ,25963400
+ ,17.70
+ ,125.83
+ ,0.2874
+ ,0.2874
+ ,0
+ ,20952600
+ ,19.52
+ ,135.81
+ ,0.2874
+ ,0.2874
+ ,0
+ ,17702900
+ ,20.26
+ ,142.43
+ ,0.2874
+ ,0.2874
+ ,0
+ ,21282100
+ ,23.05
+ ,163.39
+ ,0.0596
+ ,0.0596
+ ,0
+ ,18449100
+ ,22.81
+ ,168.21
+ ,0.0596
+ ,0.0596
+ ,0
+ ,14415700
+ ,24.04
+ ,185.35
+ ,0.0596
+ ,0.0596
+ ,0
+ ,17906300
+ ,25.08
+ ,188.50
+ ,0.3201
+ ,0.3201
+ ,0
+ ,22197500
+ ,27.04
+ ,199.91
+ ,0.3201
+ ,0.3201
+ ,0
+ ,15856500
+ ,28.81
+ ,210.73
+ ,0.3201
+ ,0.3201
+ ,0
+ ,19068700
+ ,29.86
+ ,192.06
+ ,0.486
+ ,0.486
+ ,0
+ ,30855100
+ ,27.61
+ ,204.62
+ ,0.486
+ ,0.486
+ ,0
+ ,21209000
+ ,28.22
+ ,235.00
+ ,0.486
+ ,0.486
+ ,0
+ ,19541600
+ ,28.83
+ ,261.09
+ ,0.6129
+ ,0.6129
+ ,0.6129
+ ,21955000
+ ,30.06
+ ,256.88
+ ,0.6129
+ ,0.6129
+ ,0.6129
+ ,33725900
+ ,25.51
+ ,251.53
+ ,0.6129
+ ,0.6129
+ ,0.6129
+ ,28192800
+ ,22.75
+ ,257.25
+ ,0.6665
+ ,0.6665
+ ,0.6665
+ ,27377000
+ ,25.52
+ ,243.10
+ ,0.6665
+ ,0.6665
+ ,0.6665
+ ,16228100
+ ,23.33
+ ,283.75
+ ,0.6665
+ ,0.6665
+ ,0.6665
+ ,21278900
+ ,24.34)
+ ,dim=c(6
+ ,117)
+ ,dimnames=list(c('Apple'
+ ,'Omzetgroei'
+ ,'Omzetgroei_iPhone'
+ ,'Omzetgroei_iPad'
+ ,'Volume'
+ ,'Microsoft')
+ ,1:117))
> y <- array(NA,dim=c(6,117),dimnames=list(c('Apple','Omzetgroei','Omzetgroei_iPhone','Omzetgroei_iPad','Volume','Microsoft'),1:117))
> for (i in 1:dim(x)[1])
+ {
+ for (j in 1:dim(x)[2])
+ {
+ y[i,j] <- as.numeric(x[i,j])
+ }
+ }
> par3 = '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
Apple Omzetgroei Omzetgroei_iPhone Omzetgroei_iPad Volume Microsoft t
1 10.81 -0.2643 0.0000 0.0000 24563400 24.45 1
2 9.12 -0.2643 0.0000 0.0000 14163200 23.62 2
3 11.03 -0.2643 0.0000 0.0000 18184800 21.90 3
4 12.74 -0.1918 0.0000 0.0000 20810300 27.12 4
5 9.98 -0.1918 0.0000 0.0000 12843000 27.70 5
6 11.62 -0.1918 0.0000 0.0000 13866700 29.23 6
7 9.40 -0.2246 0.0000 0.0000 15119200 26.50 7
8 9.27 -0.2246 0.0000 0.0000 8301600 22.84 8
9 7.76 -0.2246 0.0000 0.0000 14039600 20.49 9
10 8.78 0.3654 0.0000 0.0000 12139700 23.28 10
11 10.65 0.3654 0.0000 0.0000 9649000 25.71 11
12 10.95 0.3654 0.0000 0.0000 8513600 26.52 12
13 12.36 0.0447 0.0000 0.0000 15278600 25.51 13
14 10.85 0.0447 0.0000 0.0000 15590900 23.36 14
15 11.84 0.0447 0.0000 0.0000 9691100 24.15 15
16 12.14 -0.0312 0.0000 0.0000 10882700 20.92 16
17 11.65 -0.0312 0.0000 0.0000 10294800 20.38 17
18 8.86 -0.0312 0.0000 0.0000 16031900 21.90 18
19 7.63 -0.0048 0.0000 0.0000 13683600 19.21 19
20 7.38 -0.0048 0.0000 0.0000 8677200 19.65 20
21 7.25 -0.0048 0.0000 0.0000 9874100 17.51 21
22 8.03 0.0705 0.0000 0.0000 10725500 21.41 22
23 7.75 0.0705 0.0000 0.0000 8348400 23.09 23
24 7.16 0.0705 0.0000 0.0000 8046200 20.70 24
25 7.18 -0.0134 0.0000 0.0000 10862300 19.00 25
26 7.51 -0.0134 0.0000 0.0000 8100300 19.04 26
27 7.07 -0.0134 0.0000 0.0000 7287500 19.45 27
28 7.11 0.0812 0.0000 0.0000 14002500 20.54 28
29 8.98 0.0812 0.0000 0.0000 19037900 19.77 29
30 9.53 0.0812 0.0000 0.0000 10774600 20.60 30
31 10.54 0.1885 0.0000 0.0000 8960600 21.21 31
32 11.31 0.1885 0.0000 0.0000 7773300 21.30 32
33 10.36 0.1885 0.0000 0.0000 9579700 22.33 33
34 11.44 0.3628 0.0000 0.0000 11270700 21.12 34
35 10.45 0.3628 0.0000 0.0000 9492800 20.77 35
36 10.69 0.3628 0.0000 0.0000 9136800 22.11 36
37 11.28 0.2942 0.0000 0.0000 14487600 22.34 37
38 11.96 0.2942 0.0000 0.0000 10133200 21.43 38
39 13.52 0.2942 0.0000 0.0000 18659700 20.14 39
40 12.89 0.3036 0.0000 0.0000 15980700 21.11 40
41 14.03 0.3036 0.0000 0.0000 9732100 21.19 41
42 16.27 0.3036 0.0000 0.0000 14626300 23.07 42
43 16.17 0.3703 0.0000 0.0000 16904000 23.01 43
44 17.25 0.3703 0.0000 0.0000 13616700 22.12 44
45 19.38 0.3703 0.0000 0.0000 13772900 22.40 45
46 26.20 0.7398 0.0000 0.0000 28749200 22.66 46
47 33.53 0.7398 0.0000 0.0000 31408300 24.21 47
48 32.20 0.7398 0.0000 0.0000 26342800 24.13 48
49 38.45 0.6988 0.0000 0.0000 48909500 23.73 49
50 44.86 0.6988 0.0000 0.0000 41542400 22.79 50
51 41.67 0.6988 0.0000 0.0000 24857200 21.89 51
52 36.06 0.7478 0.0000 0.0000 34093700 22.92 52
53 39.76 0.7478 0.0000 0.0000 22555200 23.44 53
54 36.81 0.7478 0.0000 0.0000 19067500 22.57 54
55 42.65 0.5651 0.0000 0.0000 19029100 23.27 55
56 46.89 0.5651 0.0000 0.0000 15223200 24.95 56
57 53.61 0.5651 0.0000 0.0000 21903700 23.45 57
58 57.59 0.6473 0.0000 0.0000 33306600 23.42 58
59 67.82 0.6473 0.0000 0.0000 23898100 25.30 59
60 71.89 0.6473 0.0000 0.0000 23279600 23.90 60
61 75.51 0.3441 0.0000 0.0000 40699800 25.73 61
62 68.49 0.3441 0.0000 0.0000 37646000 24.64 62
63 62.72 0.3441 0.0000 0.0000 37277000 24.95 63
64 70.39 0.2415 0.0000 0.0000 39246800 22.15 64
65 59.77 0.2415 0.0000 0.0000 27418400 20.85 65
66 57.27 0.2415 0.0000 0.0000 30318700 21.45 66
67 67.96 0.3151 0.0000 0.0000 32808100 22.15 67
68 67.85 0.3151 0.0000 0.0000 28668200 23.75 68
69 76.98 0.3151 0.0000 0.0000 32370300 25.27 69
70 81.08 0.2390 0.0000 0.0000 24171100 26.53 70
71 91.66 0.2390 0.0000 0.0000 25009100 27.22 71
72 84.84 0.2390 0.0000 0.0000 32084300 27.69 72
73 85.73 0.2127 0.0000 0.0000 50117500 28.61 73
74 84.61 0.2127 0.0000 0.0000 27522200 26.21 74
75 92.91 0.2127 0.0000 0.0000 26816800 25.93 75
76 99.80 0.2730 0.0000 0.0000 25136100 27.86 76
77 121.19 0.2730 0.0000 0.0000 30295600 28.65 77
78 122.04 0.2730 0.2730 0.0000 41526100 27.51 78
79 131.76 0.3657 0.3657 0.0000 43845100 27.06 79
80 138.48 0.3657 0.3657 0.0000 39188900 26.91 80
81 153.47 0.3657 0.3657 0.0000 40496400 27.60 81
82 189.95 0.4643 0.4643 0.0000 37438400 34.48 82
83 182.22 0.4643 0.4643 0.0000 46553700 31.58 83
84 198.08 0.4643 0.4643 0.0000 31771400 33.46 84
85 135.36 0.5096 0.5096 0.0000 62108100 30.64 85
86 125.02 0.5096 0.5096 0.0000 46645400 25.66 86
87 143.50 0.5096 0.5096 0.0000 42313100 26.78 87
88 173.95 0.3592 0.3592 0.0000 38841700 26.91 88
89 188.75 0.3592 0.3592 0.0000 32650300 26.82 89
90 167.44 0.3592 0.3592 0.0000 34281100 26.05 90
91 158.95 0.7439 0.7439 0.0000 33096200 24.36 91
92 169.53 0.7439 0.7439 0.0000 23273800 25.94 92
93 113.66 0.7439 0.7439 0.0000 43697600 25.37 93
94 107.59 0.1390 0.1390 0.0000 66902300 21.23 94
95 92.67 0.1390 0.1390 0.0000 44957200 19.35 95
96 85.35 0.1390 0.1390 0.0000 33800900 18.61 96
97 90.13 0.1383 0.1383 0.0000 33487900 16.37 97
98 89.31 0.1383 0.1383 0.0000 27394900 15.56 98
99 105.12 0.1383 0.1383 0.0000 25963400 17.70 99
100 125.83 0.2874 0.2874 0.0000 20952600 19.52 100
101 135.81 0.2874 0.2874 0.0000 17702900 20.26 101
102 142.43 0.2874 0.2874 0.0000 21282100 23.05 102
103 163.39 0.0596 0.0596 0.0000 18449100 22.81 103
104 168.21 0.0596 0.0596 0.0000 14415700 24.04 104
105 185.35 0.0596 0.0596 0.0000 17906300 25.08 105
106 188.50 0.3201 0.3201 0.0000 22197500 27.04 106
107 199.91 0.3201 0.3201 0.0000 15856500 28.81 107
108 210.73 0.3201 0.3201 0.0000 19068700 29.86 108
109 192.06 0.4860 0.4860 0.0000 30855100 27.61 109
110 204.62 0.4860 0.4860 0.0000 21209000 28.22 110
111 235.00 0.4860 0.4860 0.0000 19541600 28.83 111
112 261.09 0.6129 0.6129 0.6129 21955000 30.06 112
113 256.88 0.6129 0.6129 0.6129 33725900 25.51 113
114 251.53 0.6129 0.6129 0.6129 28192800 22.75 114
115 257.25 0.6665 0.6665 0.6665 27377000 25.52 115
116 243.10 0.6665 0.6665 0.6665 16228100 23.33 116
117 283.75 0.6665 0.6665 0.6665 21278900 24.34 117
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Omzetgroei Omzetgroei_iPhone Omzetgroei_iPad
-1.356e+02 -3.729e+01 8.288e+01 9.440e+01
Volume Microsoft t
-4.245e-07 5.429e+00 1.558e+00
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-48.7473 -9.8155 0.2771 8.5517 37.5508
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -1.356e+02 1.008e+01 -13.454 < 2e-16 ***
Omzetgroei -3.729e+01 5.857e+00 -6.367 4.58e-09 ***
Omzetgroei_iPhone 8.288e+01 9.656e+00 8.584 6.71e-14 ***
Omzetgroei_iPad 9.440e+01 1.131e+01 8.344 2.32e-13 ***
Volume -4.245e-07 1.324e-07 -3.206 0.00176 **
Microsoft 5.429e+00 4.324e-01 12.556 < 2e-16 ***
t 1.558e+00 6.094e-02 25.566 < 2e-16 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 13.83 on 110 degrees of freedom
Multiple R-squared: 0.9686, Adjusted R-squared: 0.9669
F-statistic: 565.5 on 6 and 110 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,] 1.837443e-03 3.674885e-03 0.99816256
[2,] 2.217018e-04 4.434036e-04 0.99977830
[3,] 2.334519e-05 4.669039e-05 0.99997665
[4,] 3.573365e-06 7.146730e-06 0.99999643
[5,] 3.063940e-07 6.127881e-07 0.99999969
[6,] 4.995615e-08 9.991231e-08 0.99999995
[7,] 1.143234e-08 2.286468e-08 0.99999999
[8,] 1.295166e-09 2.590332e-09 1.00000000
[9,] 1.491772e-09 2.983544e-09 1.00000000
[10,] 6.202923e-10 1.240585e-09 1.00000000
[11,] 1.524988e-10 3.049976e-10 1.00000000
[12,] 3.076873e-11 6.153746e-11 1.00000000
[13,] 5.927149e-12 1.185430e-11 1.00000000
[14,] 1.249531e-12 2.499061e-12 1.00000000
[15,] 2.045363e-13 4.090726e-13 1.00000000
[16,] 3.066882e-14 6.133764e-14 1.00000000
[17,] 4.021786e-15 8.043573e-15 1.00000000
[18,] 5.123631e-16 1.024726e-15 1.00000000
[19,] 8.258695e-17 1.651739e-16 1.00000000
[20,] 1.313911e-17 2.627823e-17 1.00000000
[21,] 2.644378e-18 5.288756e-18 1.00000000
[22,] 8.211128e-19 1.642226e-18 1.00000000
[23,] 3.937039e-19 7.874079e-19 1.00000000
[24,] 4.986557e-20 9.973114e-20 1.00000000
[25,] 1.131717e-20 2.263435e-20 1.00000000
[26,] 1.574900e-21 3.149801e-21 1.00000000
[27,] 1.753907e-22 3.507814e-22 1.00000000
[28,] 1.888411e-23 3.776823e-23 1.00000000
[29,] 3.875633e-24 7.751266e-24 1.00000000
[30,] 1.729335e-24 3.458671e-24 1.00000000
[31,] 2.698674e-25 5.397348e-25 1.00000000
[32,] 2.150783e-25 4.301566e-25 1.00000000
[33,] 1.414701e-25 2.829403e-25 1.00000000
[34,] 3.151133e-26 6.302267e-26 1.00000000
[35,] 3.519715e-26 7.039430e-26 1.00000000
[36,] 1.697487e-25 3.394974e-25 1.00000000
[37,] 7.602304e-25 1.520461e-24 1.00000000
[38,] 2.748565e-23 5.497130e-23 1.00000000
[39,] 1.057996e-22 2.115991e-22 1.00000000
[40,] 2.205603e-23 4.411206e-23 1.00000000
[41,] 3.810517e-21 7.621033e-21 1.00000000
[42,] 2.595516e-17 5.191032e-17 1.00000000
[43,] 7.793788e-18 1.558758e-17 1.00000000
[44,] 1.381050e-16 2.762100e-16 1.00000000
[45,] 5.589180e-16 1.117836e-15 1.00000000
[46,] 3.891208e-14 7.782416e-14 1.00000000
[47,] 3.237090e-12 6.474179e-12 1.00000000
[48,] 1.493828e-10 2.987656e-10 1.00000000
[49,] 9.036852e-10 1.807370e-09 1.00000000
[50,] 5.635422e-08 1.127084e-07 0.99999994
[51,] 9.287184e-06 1.857437e-05 0.99999071
[52,] 1.352889e-05 2.705778e-05 0.99998647
[53,] 1.194355e-05 2.388710e-05 0.99998806
[54,] 7.196056e-06 1.439211e-05 0.99999280
[55,] 1.179236e-05 2.358472e-05 0.99998821
[56,] 9.346317e-06 1.869263e-05 0.99999065
[57,] 5.541265e-06 1.108253e-05 0.99999446
[58,] 1.242726e-05 2.485451e-05 0.99998757
[59,] 1.068684e-05 2.137369e-05 0.99998931
[60,] 1.225412e-05 2.450825e-05 0.99998775
[61,] 8.782982e-06 1.756596e-05 0.99999122
[62,] 8.912141e-06 1.782428e-05 0.99999109
[63,] 5.508653e-06 1.101731e-05 0.99999449
[64,] 6.988380e-06 1.397676e-05 0.99999301
[65,] 5.397007e-06 1.079401e-05 0.99999460
[66,] 5.048015e-06 1.009603e-05 0.99999495
[67,] 6.625993e-06 1.325199e-05 0.99999337
[68,] 2.920187e-05 5.840373e-05 0.99997080
[69,] 2.870379e-05 5.740759e-05 0.99997130
[70,] 1.653054e-05 3.306107e-05 0.99998347
[71,] 1.051299e-05 2.102598e-05 0.99998949
[72,] 1.105705e-05 2.211409e-05 0.99998894
[73,] 1.384355e-05 2.768710e-05 0.99998616
[74,] 9.684836e-06 1.936967e-05 0.99999032
[75,] 1.245265e-05 2.490529e-05 0.99998755
[76,] 1.364633e-03 2.729266e-03 0.99863537
[77,] 3.029142e-03 6.058284e-03 0.99697086
[78,] 2.713378e-03 5.426755e-03 0.99728662
[79,] 5.974074e-03 1.194815e-02 0.99402593
[80,] 5.668247e-02 1.133649e-01 0.94331753
[81,] 1.142841e-01 2.285681e-01 0.88571595
[82,] 2.320544e-01 4.641088e-01 0.76794562
[83,] 8.682908e-01 2.634183e-01 0.13170917
[84,] 9.679961e-01 6.400782e-02 0.03200391
[85,] 9.648128e-01 7.037443e-02 0.03518722
[86,] 9.507864e-01 9.842711e-02 0.04921355
[87,] 9.380055e-01 1.239891e-01 0.06199454
[88,] 9.048982e-01 1.902035e-01 0.09510177
[89,] 8.732622e-01 2.534756e-01 0.12673778
[90,] 8.506877e-01 2.986246e-01 0.14931228
[91,] 7.970502e-01 4.058996e-01 0.20294981
[92,] 8.040099e-01 3.919802e-01 0.19599010
[93,] 7.663505e-01 4.672989e-01 0.23364947
[94,] 7.434220e-01 5.131560e-01 0.25657799
[95,] 6.520444e-01 6.959112e-01 0.34795561
[96,] 5.913963e-01 8.172073e-01 0.40860367
[97,] 5.097712e-01 9.804576e-01 0.49022878
[98,] 4.094380e-01 8.188760e-01 0.59056201
> postscript(file="/var/www/html/freestat/rcomp/tmp/1dce31293008334.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/freestat/rcomp/tmp/25md61293008334.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/freestat/rcomp/tmp/35md61293008334.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/freestat/rcomp/tmp/45md61293008334.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/freestat/rcomp/tmp/5gdu91293008334.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 = 117
Frequency = 1
1 2 3 4 5 6
12.6566779 9.5000594 20.8969863 -3.4714341 -14.3200696 -22.1096191
7 8 9 10 11 12
-11.7581910 3.5297261 15.6554429 21.1679604 7.2305962 1.0933485
13 14 15 16 17 18
-2.6599185 6.0768946 -1.2841880 12.6684632 13.3026315 3.1381351
19 20 21 22 23 24
14.9417331 8.6199987 19.0580216 0.2770909 -11.6903792 -0.9914764
25 26 27 28 29 30
4.7661846 2.1487214 -2.4200289 -3.4769777 3.1528392 -5.8686678
31 32 33 34 35 36
-6.4965377 -8.2770104 -15.6098676 -2.3006253 -3.7030837 -12.4468037
37 38 39 40 41 42
-14.9503744 -12.7363341 -2.1115738 -10.3521147 -13.8567405 -21.3034376
43 44 45 46 47 48
-19.1812235 -16.2227941 -17.1044625 6.8835038 5.3695780 0.7657829
49 50 51 52 53 54
15.6796122 22.5076756 15.5631963 8.5517089 2.9728891 1.7076739
55 56 57 58 59 60
-4.6403618 -12.6943351 3.4468957 13.9378047 8.4098366 18.2598670
61 62 63 64 65 66
6.4741436 2.5174695 -6.6500050 11.6728025 1.5315172 -4.5525710
67 68 69 70 71 72
4.5808738 -7.5305654 -6.6388873 -17.2556890 -11.6237918 -19.5499441
73 74 75 76 77 78
-18.5384354 -17.7783137 -9.8155355 -13.4257868 4.3076294 -8.0710629
79 80 81 82 83 84
-0.7076101 3.2923591 13.5335516 5.3117662 15.6369869 13.4579253
85 86 87 88 89 90
-24.6981716 -16.1238194 -7.1210589 26.4482491 37.5508162 19.5554340
91 92 93 94 95 96
0.6415449 -3.0834482 -48.7472770 3.5269502 -12.0599549 -21.6561266
97 98 99 100 101 102
-6.3742309 -6.9410887 -4.9144591 -4.5671750 -1.5418870 -10.1070771
103 104 105 106 107 108
19.7804585 14.6529187 26.0706889 6.9679281 4.5192441 9.4445489
109 110 111 112 113 114
-1.1282951 2.4675784 27.2702845 -17.4907279 6.4394332 12.1665931
115 116 117
-6.5587545 -15.1098845 20.6430330
> postscript(file="/var/www/html/freestat/rcomp/tmp/6gdu91293008334.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 = 117
Frequency = 1
lag(myerror, k = 1) myerror
0 12.6566779 NA
1 9.5000594 12.6566779
2 20.8969863 9.5000594
3 -3.4714341 20.8969863
4 -14.3200696 -3.4714341
5 -22.1096191 -14.3200696
6 -11.7581910 -22.1096191
7 3.5297261 -11.7581910
8 15.6554429 3.5297261
9 21.1679604 15.6554429
10 7.2305962 21.1679604
11 1.0933485 7.2305962
12 -2.6599185 1.0933485
13 6.0768946 -2.6599185
14 -1.2841880 6.0768946
15 12.6684632 -1.2841880
16 13.3026315 12.6684632
17 3.1381351 13.3026315
18 14.9417331 3.1381351
19 8.6199987 14.9417331
20 19.0580216 8.6199987
21 0.2770909 19.0580216
22 -11.6903792 0.2770909
23 -0.9914764 -11.6903792
24 4.7661846 -0.9914764
25 2.1487214 4.7661846
26 -2.4200289 2.1487214
27 -3.4769777 -2.4200289
28 3.1528392 -3.4769777
29 -5.8686678 3.1528392
30 -6.4965377 -5.8686678
31 -8.2770104 -6.4965377
32 -15.6098676 -8.2770104
33 -2.3006253 -15.6098676
34 -3.7030837 -2.3006253
35 -12.4468037 -3.7030837
36 -14.9503744 -12.4468037
37 -12.7363341 -14.9503744
38 -2.1115738 -12.7363341
39 -10.3521147 -2.1115738
40 -13.8567405 -10.3521147
41 -21.3034376 -13.8567405
42 -19.1812235 -21.3034376
43 -16.2227941 -19.1812235
44 -17.1044625 -16.2227941
45 6.8835038 -17.1044625
46 5.3695780 6.8835038
47 0.7657829 5.3695780
48 15.6796122 0.7657829
49 22.5076756 15.6796122
50 15.5631963 22.5076756
51 8.5517089 15.5631963
52 2.9728891 8.5517089
53 1.7076739 2.9728891
54 -4.6403618 1.7076739
55 -12.6943351 -4.6403618
56 3.4468957 -12.6943351
57 13.9378047 3.4468957
58 8.4098366 13.9378047
59 18.2598670 8.4098366
60 6.4741436 18.2598670
61 2.5174695 6.4741436
62 -6.6500050 2.5174695
63 11.6728025 -6.6500050
64 1.5315172 11.6728025
65 -4.5525710 1.5315172
66 4.5808738 -4.5525710
67 -7.5305654 4.5808738
68 -6.6388873 -7.5305654
69 -17.2556890 -6.6388873
70 -11.6237918 -17.2556890
71 -19.5499441 -11.6237918
72 -18.5384354 -19.5499441
73 -17.7783137 -18.5384354
74 -9.8155355 -17.7783137
75 -13.4257868 -9.8155355
76 4.3076294 -13.4257868
77 -8.0710629 4.3076294
78 -0.7076101 -8.0710629
79 3.2923591 -0.7076101
80 13.5335516 3.2923591
81 5.3117662 13.5335516
82 15.6369869 5.3117662
83 13.4579253 15.6369869
84 -24.6981716 13.4579253
85 -16.1238194 -24.6981716
86 -7.1210589 -16.1238194
87 26.4482491 -7.1210589
88 37.5508162 26.4482491
89 19.5554340 37.5508162
90 0.6415449 19.5554340
91 -3.0834482 0.6415449
92 -48.7472770 -3.0834482
93 3.5269502 -48.7472770
94 -12.0599549 3.5269502
95 -21.6561266 -12.0599549
96 -6.3742309 -21.6561266
97 -6.9410887 -6.3742309
98 -4.9144591 -6.9410887
99 -4.5671750 -4.9144591
100 -1.5418870 -4.5671750
101 -10.1070771 -1.5418870
102 19.7804585 -10.1070771
103 14.6529187 19.7804585
104 26.0706889 14.6529187
105 6.9679281 26.0706889
106 4.5192441 6.9679281
107 9.4445489 4.5192441
108 -1.1282951 9.4445489
109 2.4675784 -1.1282951
110 27.2702845 2.4675784
111 -17.4907279 27.2702845
112 6.4394332 -17.4907279
113 12.1665931 6.4394332
114 -6.5587545 12.1665931
115 -15.1098845 -6.5587545
116 20.6430330 -15.1098845
117 NA 20.6430330
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 9.5000594 12.6566779
[2,] 20.8969863 9.5000594
[3,] -3.4714341 20.8969863
[4,] -14.3200696 -3.4714341
[5,] -22.1096191 -14.3200696
[6,] -11.7581910 -22.1096191
[7,] 3.5297261 -11.7581910
[8,] 15.6554429 3.5297261
[9,] 21.1679604 15.6554429
[10,] 7.2305962 21.1679604
[11,] 1.0933485 7.2305962
[12,] -2.6599185 1.0933485
[13,] 6.0768946 -2.6599185
[14,] -1.2841880 6.0768946
[15,] 12.6684632 -1.2841880
[16,] 13.3026315 12.6684632
[17,] 3.1381351 13.3026315
[18,] 14.9417331 3.1381351
[19,] 8.6199987 14.9417331
[20,] 19.0580216 8.6199987
[21,] 0.2770909 19.0580216
[22,] -11.6903792 0.2770909
[23,] -0.9914764 -11.6903792
[24,] 4.7661846 -0.9914764
[25,] 2.1487214 4.7661846
[26,] -2.4200289 2.1487214
[27,] -3.4769777 -2.4200289
[28,] 3.1528392 -3.4769777
[29,] -5.8686678 3.1528392
[30,] -6.4965377 -5.8686678
[31,] -8.2770104 -6.4965377
[32,] -15.6098676 -8.2770104
[33,] -2.3006253 -15.6098676
[34,] -3.7030837 -2.3006253
[35,] -12.4468037 -3.7030837
[36,] -14.9503744 -12.4468037
[37,] -12.7363341 -14.9503744
[38,] -2.1115738 -12.7363341
[39,] -10.3521147 -2.1115738
[40,] -13.8567405 -10.3521147
[41,] -21.3034376 -13.8567405
[42,] -19.1812235 -21.3034376
[43,] -16.2227941 -19.1812235
[44,] -17.1044625 -16.2227941
[45,] 6.8835038 -17.1044625
[46,] 5.3695780 6.8835038
[47,] 0.7657829 5.3695780
[48,] 15.6796122 0.7657829
[49,] 22.5076756 15.6796122
[50,] 15.5631963 22.5076756
[51,] 8.5517089 15.5631963
[52,] 2.9728891 8.5517089
[53,] 1.7076739 2.9728891
[54,] -4.6403618 1.7076739
[55,] -12.6943351 -4.6403618
[56,] 3.4468957 -12.6943351
[57,] 13.9378047 3.4468957
[58,] 8.4098366 13.9378047
[59,] 18.2598670 8.4098366
[60,] 6.4741436 18.2598670
[61,] 2.5174695 6.4741436
[62,] -6.6500050 2.5174695
[63,] 11.6728025 -6.6500050
[64,] 1.5315172 11.6728025
[65,] -4.5525710 1.5315172
[66,] 4.5808738 -4.5525710
[67,] -7.5305654 4.5808738
[68,] -6.6388873 -7.5305654
[69,] -17.2556890 -6.6388873
[70,] -11.6237918 -17.2556890
[71,] -19.5499441 -11.6237918
[72,] -18.5384354 -19.5499441
[73,] -17.7783137 -18.5384354
[74,] -9.8155355 -17.7783137
[75,] -13.4257868 -9.8155355
[76,] 4.3076294 -13.4257868
[77,] -8.0710629 4.3076294
[78,] -0.7076101 -8.0710629
[79,] 3.2923591 -0.7076101
[80,] 13.5335516 3.2923591
[81,] 5.3117662 13.5335516
[82,] 15.6369869 5.3117662
[83,] 13.4579253 15.6369869
[84,] -24.6981716 13.4579253
[85,] -16.1238194 -24.6981716
[86,] -7.1210589 -16.1238194
[87,] 26.4482491 -7.1210589
[88,] 37.5508162 26.4482491
[89,] 19.5554340 37.5508162
[90,] 0.6415449 19.5554340
[91,] -3.0834482 0.6415449
[92,] -48.7472770 -3.0834482
[93,] 3.5269502 -48.7472770
[94,] -12.0599549 3.5269502
[95,] -21.6561266 -12.0599549
[96,] -6.3742309 -21.6561266
[97,] -6.9410887 -6.3742309
[98,] -4.9144591 -6.9410887
[99,] -4.5671750 -4.9144591
[100,] -1.5418870 -4.5671750
[101,] -10.1070771 -1.5418870
[102,] 19.7804585 -10.1070771
[103,] 14.6529187 19.7804585
[104,] 26.0706889 14.6529187
[105,] 6.9679281 26.0706889
[106,] 4.5192441 6.9679281
[107,] 9.4445489 4.5192441
[108,] -1.1282951 9.4445489
[109,] 2.4675784 -1.1282951
[110,] 27.2702845 2.4675784
[111,] -17.4907279 27.2702845
[112,] 6.4394332 -17.4907279
[113,] 12.1665931 6.4394332
[114,] -6.5587545 12.1665931
[115,] -15.1098845 -6.5587545
[116,] 20.6430330 -15.1098845
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 9.5000594 12.6566779
2 20.8969863 9.5000594
3 -3.4714341 20.8969863
4 -14.3200696 -3.4714341
5 -22.1096191 -14.3200696
6 -11.7581910 -22.1096191
7 3.5297261 -11.7581910
8 15.6554429 3.5297261
9 21.1679604 15.6554429
10 7.2305962 21.1679604
11 1.0933485 7.2305962
12 -2.6599185 1.0933485
13 6.0768946 -2.6599185
14 -1.2841880 6.0768946
15 12.6684632 -1.2841880
16 13.3026315 12.6684632
17 3.1381351 13.3026315
18 14.9417331 3.1381351
19 8.6199987 14.9417331
20 19.0580216 8.6199987
21 0.2770909 19.0580216
22 -11.6903792 0.2770909
23 -0.9914764 -11.6903792
24 4.7661846 -0.9914764
25 2.1487214 4.7661846
26 -2.4200289 2.1487214
27 -3.4769777 -2.4200289
28 3.1528392 -3.4769777
29 -5.8686678 3.1528392
30 -6.4965377 -5.8686678
31 -8.2770104 -6.4965377
32 -15.6098676 -8.2770104
33 -2.3006253 -15.6098676
34 -3.7030837 -2.3006253
35 -12.4468037 -3.7030837
36 -14.9503744 -12.4468037
37 -12.7363341 -14.9503744
38 -2.1115738 -12.7363341
39 -10.3521147 -2.1115738
40 -13.8567405 -10.3521147
41 -21.3034376 -13.8567405
42 -19.1812235 -21.3034376
43 -16.2227941 -19.1812235
44 -17.1044625 -16.2227941
45 6.8835038 -17.1044625
46 5.3695780 6.8835038
47 0.7657829 5.3695780
48 15.6796122 0.7657829
49 22.5076756 15.6796122
50 15.5631963 22.5076756
51 8.5517089 15.5631963
52 2.9728891 8.5517089
53 1.7076739 2.9728891
54 -4.6403618 1.7076739
55 -12.6943351 -4.6403618
56 3.4468957 -12.6943351
57 13.9378047 3.4468957
58 8.4098366 13.9378047
59 18.2598670 8.4098366
60 6.4741436 18.2598670
61 2.5174695 6.4741436
62 -6.6500050 2.5174695
63 11.6728025 -6.6500050
64 1.5315172 11.6728025
65 -4.5525710 1.5315172
66 4.5808738 -4.5525710
67 -7.5305654 4.5808738
68 -6.6388873 -7.5305654
69 -17.2556890 -6.6388873
70 -11.6237918 -17.2556890
71 -19.5499441 -11.6237918
72 -18.5384354 -19.5499441
73 -17.7783137 -18.5384354
74 -9.8155355 -17.7783137
75 -13.4257868 -9.8155355
76 4.3076294 -13.4257868
77 -8.0710629 4.3076294
78 -0.7076101 -8.0710629
79 3.2923591 -0.7076101
80 13.5335516 3.2923591
81 5.3117662 13.5335516
82 15.6369869 5.3117662
83 13.4579253 15.6369869
84 -24.6981716 13.4579253
85 -16.1238194 -24.6981716
86 -7.1210589 -16.1238194
87 26.4482491 -7.1210589
88 37.5508162 26.4482491
89 19.5554340 37.5508162
90 0.6415449 19.5554340
91 -3.0834482 0.6415449
92 -48.7472770 -3.0834482
93 3.5269502 -48.7472770
94 -12.0599549 3.5269502
95 -21.6561266 -12.0599549
96 -6.3742309 -21.6561266
97 -6.9410887 -6.3742309
98 -4.9144591 -6.9410887
99 -4.5671750 -4.9144591
100 -1.5418870 -4.5671750
101 -10.1070771 -1.5418870
102 19.7804585 -10.1070771
103 14.6529187 19.7804585
104 26.0706889 14.6529187
105 6.9679281 26.0706889
106 4.5192441 6.9679281
107 9.4445489 4.5192441
108 -1.1282951 9.4445489
109 2.4675784 -1.1282951
110 27.2702845 2.4675784
111 -17.4907279 27.2702845
112 6.4394332 -17.4907279
113 12.1665931 6.4394332
114 -6.5587545 12.1665931
115 -15.1098845 -6.5587545
116 20.6430330 -15.1098845
> 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/freestat/rcomp/tmp/7r4cc1293008334.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/freestat/rcomp/tmp/8r4cc1293008334.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/freestat/rcomp/tmp/9r4cc1293008334.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/freestat/rcomp/tmp/10ketx1293008334.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/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/www/html/freestat/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/freestat/rcomp/tmp/11nwr31293008334.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/freestat/rcomp/tmp/12qeqr1293008334.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/freestat/rcomp/tmp/134o6h1293008334.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/freestat/rcomp/tmp/14q7451293008334.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/freestat/rcomp/tmp/15b73t1293008334.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/freestat/rcomp/tmp/16fq1h1293008334.tab")
+ }
>
> try(system("convert tmp/1dce31293008334.ps tmp/1dce31293008334.png",intern=TRUE))
character(0)
> try(system("convert tmp/25md61293008334.ps tmp/25md61293008334.png",intern=TRUE))
character(0)
> try(system("convert tmp/35md61293008334.ps tmp/35md61293008334.png",intern=TRUE))
character(0)
> try(system("convert tmp/45md61293008334.ps tmp/45md61293008334.png",intern=TRUE))
character(0)
> try(system("convert tmp/5gdu91293008334.ps tmp/5gdu91293008334.png",intern=TRUE))
character(0)
> try(system("convert tmp/6gdu91293008334.ps tmp/6gdu91293008334.png",intern=TRUE))
character(0)
> try(system("convert tmp/7r4cc1293008334.ps tmp/7r4cc1293008334.png",intern=TRUE))
character(0)
> try(system("convert tmp/8r4cc1293008334.ps tmp/8r4cc1293008334.png",intern=TRUE))
character(0)
> try(system("convert tmp/9r4cc1293008334.ps tmp/9r4cc1293008334.png",intern=TRUE))
character(0)
> try(system("convert tmp/10ketx1293008334.ps tmp/10ketx1293008334.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
5.015 2.673 12.423