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(66
+ ,4964
+ ,4818
+ ,4488
+ ,5
+ ,73
+ ,68
+ ,54
+ ,3132
+ ,3132
+ ,2916
+ ,12
+ ,58
+ ,54
+ ,82
+ ,2788
+ ,5576
+ ,3362
+ ,11
+ ,68
+ ,41
+ ,61
+ ,3038
+ ,3782
+ ,2989
+ ,6
+ ,62
+ ,49
+ ,65
+ ,3185
+ ,4225
+ ,3185
+ ,12
+ ,65
+ ,49
+ ,77
+ ,5832
+ ,6237
+ ,5544
+ ,11
+ ,81
+ ,72
+ ,66
+ ,5694
+ ,4818
+ ,5148
+ ,12
+ ,73
+ ,78
+ ,66
+ ,3712
+ ,4224
+ ,3828
+ ,7
+ ,64
+ ,58
+ ,66
+ ,3944
+ ,4488
+ ,3828
+ ,8
+ ,68
+ ,58
+ ,48
+ ,1173
+ ,2448
+ ,1104
+ ,13
+ ,51
+ ,23
+ ,57
+ ,2652
+ ,3876
+ ,2223
+ ,12
+ ,68
+ ,39
+ ,80
+ ,3843
+ ,4880
+ ,5040
+ ,13
+ ,61
+ ,63
+ ,60
+ ,3174
+ ,4140
+ ,2760
+ ,12
+ ,69
+ ,46
+ ,70
+ ,4234
+ ,5110
+ ,4060
+ ,12
+ ,73
+ ,58
+ ,85
+ ,2379
+ ,5185
+ ,3315
+ ,11
+ ,61
+ ,39
+ ,59
+ ,2728
+ ,3658
+ ,2596
+ ,12
+ ,62
+ ,44
+ ,72
+ ,3087
+ ,4536
+ ,3528
+ ,12
+ ,63
+ ,49
+ ,70
+ ,3933
+ ,4830
+ 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 ,3528
+ ,3816
+ ,12
+ ,49
+ ,53
+ ,66
+ ,2106
+ ,3564
+ ,2574
+ ,13
+ ,54
+ ,39
+ ,61
+ ,3366
+ ,4026
+ ,3111
+ ,6
+ ,66
+ ,51
+ ,86
+ ,4380
+ ,6278
+ ,5160
+ ,11
+ ,73
+ ,60
+ ,81
+ ,4410
+ ,5103
+ ,5670
+ ,10
+ ,63
+ ,70
+ ,79
+ ,2440
+ ,4819
+ ,3160
+ ,12
+ ,61
+ ,40
+ ,73
+ ,4514
+ ,5402
+ ,4453
+ ,11
+ ,74
+ ,61
+ ,59
+ ,2835
+ ,4779
+ ,2065
+ ,12
+ ,81
+ ,35
+ ,64
+ ,2418
+ ,3968
+ ,2496
+ ,12
+ ,62
+ ,39
+ ,75
+ ,1984
+ ,4800
+ ,2325
+ ,7
+ ,64
+ ,31
+ ,68
+ ,2232
+ ,4216
+ ,2448
+ ,12
+ ,62
+ ,36
+ ,84
+ ,4335
+ ,7140
+ ,4284
+ ,12
+ ,85
+ ,51
+ ,68
+ ,4070
+ ,5032
+ ,3740
+ ,9
+ ,74
+ ,55
+ ,68
+ ,3417
+ ,3468
+ ,4556
+ ,12
+ ,51
+ ,67
+ ,69
+ ,2640
+ ,4554
+ ,2760
+ ,12
+ ,66
+ ,40)
+ ,dim=c(7
+ ,146)
+ ,dimnames=list(c('Groepsgevoel'
+ ,'InteractieNV-U'
+ ,'InteractieGR_NV'
+ ,'interacteiGR_U'
+ ,'Vrienden_vinden'
+ ,'NV'
+ ,'Uitingsangst')
+ ,1:146))
> y <- array(NA,dim=c(7,146),dimnames=list(c('Groepsgevoel','InteractieNV-U','InteractieGR_NV','interacteiGR_U','Vrienden_vinden','NV','Uitingsangst'),1:146))
> 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 = '5'
> #'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
Vrienden_vinden Groepsgevoel InteractieNV-U InteractieGR_NV interacteiGR_U
1 5 66 4964 4818 4488
2 12 54 3132 3132 2916
3 11 82 2788 5576 3362
4 6 61 3038 3782 2989
5 12 65 3185 4225 3185
6 11 77 5832 6237 5544
7 12 66 5694 4818 5148
8 7 66 3712 4224 3828
9 8 66 3944 4488 3828
10 13 48 1173 2448 1104
11 12 57 2652 3876 2223
12 13 80 3843 4880 5040
13 12 60 3174 4140 2760
14 12 70 4234 5110 4060
15 11 85 2379 5185 3315
16 12 59 2728 3658 2596
17 12 72 3087 4536 3528
18 12 70 3933 4830 3990
19 11 74 3572 3478 5624
20 13 70 4158 4620 4410
21 9 51 1044 2958 918
22 11 70 2520 4410 2800
23 11 71 4071 4899 4189
24 11 72 3658 4248 4464
25 9 50 4130 2950 3500
26 11 69 4095 4347 4485
27 12 73 3640 4745 4088
28 12 66 2925 4290 2970
29 10 73 4047 5183 4161
30 12 58 3000 3480 2900
31 12 78 3240 6318 3120
32 12 83 3886 5561 4814
33 9 76 3234 5016 3724
34 9 77 3038 4774 3773
35 12 79 1701 4977 2133
36 14 71 3723 5183 3621
37 12 79 4125 4345 5925
38 11 60 3835 3540 3900
39 9 73 3008 4672 3431
40 11 70 3087 4410 3430
41 7 42 4160 2688 2730
42 15 74 4453 5402 4514
43 11 68 2484 3672 3128
44 12 83 5244 6308 5727
45 12 62 4070 4588 3410
46 9 79 4914 4977 6162
47 12 61 4234 4453 3538
48 11 86 2278 5762 2924
49 11 64 4556 4352 4288
50 8 75 2970 4950 3375
51 7 59 4216 3658 4012
52 12 82 3479 5822 4018
53 8 61 1197 3843 1159
54 10 69 5400 5175 4968
55 12 60 4543 4620 3540
56 15 59 2852 3658 2714
57 12 81 4144 5994 4536
58 12 65 3015 4355 2925
59 12 60 2968 3360 3180
60 12 60 4020 3600 4020
61 8 45 4234 2610 3285
62 10 75 2990 4875 3450
63 14 84 3430 4116 5880
64 10 77 2318 4697 2926
65 12 64 3564 4224 3456
66 14 54 2944 3456 2484
67 6 72 2990 4680 3312
68 11 56 2070 2576 2520
69 10 67 3055 4355 3149
70 14 81 2025 6561 2025
71 12 73 4536 5256 4599
72 13 67 2990 4355 3082
73 11 72 5106 5328 4968
74 11 69 2537 4071 2967
75 12 71 3381 4899 3479
76 13 77 2262 4466 3003
77 12 63 4615 4473 4095
78 8 49 4266 3871 2646
79 12 74 3400 5032 3700
80 11 76 2772 5016 3192
81 10 65 2790 4030 2925
82 12 65 3450 4485 3250
83 11 69 3465 4347 3795
84 12 71 2356 4402 2698
85 12 68 2440 4148 2720
86 10 49 3315 3185 2499
87 12 86 3136 5504 4214
88 12 63 2184 3528 2457
89 11 77 3192 4312 4389
90 10 52 1440 2496 1560
91 12 73 3774 5402 3723
92 11 63 3312 4347 3024
93 12 54 3472 3348 3024
94 12 56 4818 4088 3696
95 10 54 4608 3456 3888
96 11 61 1596 3477 1708
97 10 70 2964 3990 3640
98 11 68 3180 4080 3604
99 11 63 4270 3843 4410
100 12 76 4536 5472 4788
101 11 69 2622 3933 3174
102 11 71 2295 3621 3195
103 7 39 4284 2457 2652
104 12 54 2916 2916 2916
105 8 64 4320 4608 3840
106 10 70 3100 4340 3500
107 12 76 4488 5168 5016
108 11 71 3472 4402 3976
109 13 73 3402 4599 3942
110 9 81 5544 6237 5832
111 11 50 1938 2850 1700
112 13 42 2223 2394 1638
113 8 66 4026 4026 4356
114 12 77 1755 5005 2079
115 11 62 3969 3906 3906
116 11 66 4290 4356 4290
117 12 69 4284 4692 4347
118 13 72 3528 5184 3528
119 11 67 2856 4556 2814
120 10 59 3009 3481 3009
121 10 66 2800 3696 3300
122 10 68 3968 4216 4352
123 12 72 4896 5184 4896
124 12 73 4488 4964 4818
125 13 69 3953 4623 4071
126 11 57 1728 3078 1824
127 11 55 4278 3795 3410
128 12 72 3172 4392 3744
129 9 68 1870 3740 2312
130 11 83 4725 6225 5229
131 12 74 2640 4070 3552
132 12 72 2597 3528 3816
133 13 66 2106 3564 2574
134 6 61 3366 4026 3111
135 11 86 4380 6278 5160
136 10 81 4410 5103 5670
137 12 79 2440 4819 3160
138 11 73 4514 5402 4453
139 12 59 2835 4779 2065
140 12 64 2418 3968 2496
141 7 75 1984 4800 2325
142 12 68 2232 4216 2448
143 12 84 4335 7140 4284
144 9 68 4070 5032 3740
145 12 68 3417 3468 4556
146 12 69 2640 4554 2760
NV Uitingsangst
1 73 68
2 58 54
3 68 41
4 62 49
5 65 49
6 81 72
7 73 78
8 64 58
9 68 58
10 51 23
11 68 39
12 61 63
13 69 46
14 73 58
15 61 39
16 62 44
17 63 49
18 69 57
19 47 76
20 66 63
21 58 18
22 63 40
23 69 59
24 59 62
25 59 70
26 63 65
27 65 56
28 65 45
29 71 57
30 60 50
31 81 40
32 67 58
33 66 49
34 62 49
35 63 27
36 73 51
37 55 75
38 59 65
39 64 47
40 63 49
41 64 65
42 73 61
43 54 46
44 76 69
45 74 55
46 63 78
47 73 58
48 67 34
49 68 67
50 66 45
51 62 68
52 71 49
53 63 19
54 75 72
55 77 59
56 62 46
57 74 56
58 67 45
59 56 53
60 60 67
61 58 73
62 65 46
63 49 70
64 61 38
65 66 54
66 64 46
67 65 46
68 46 45
69 65 47
70 81 25
71 72 63
72 65 46
73 74 69
74 59 43
75 69 49
76 58 39
77 71 65
78 79 54
79 68 50
80 66 42
81 62 45
82 69 50
83 63 55
84 62 38
85 61 40
86 65 51
87 64 49
88 56 39
89 56 57
90 48 30
91 74 51
92 69 48
93 62 56
94 73 66
95 64 72
96 57 28
97 57 52
98 60 53
99 61 70
100 72 63
101 57 46
102 51 45
103 63 68
104 54 54
105 72 60
106 62 50
107 68 66
108 62 56
109 63 54
110 77 72
111 57 34
112 57 39
113 61 66
114 65 27
115 63 63
116 66 65
117 68 63
118 72 49
119 68 42
120 59 51
121 56 50
122 62 64
123 72 68
124 68 66
125 67 59
126 54 32
127 69 62
128 61 52
129 55 34
130 75 63
131 55 48
132 49 53
133 54 39
134 66 51
135 73 60
136 63 70
137 61 40
138 74 61
139 81 35
140 62 39
141 64 31
142 62 36
143 85 51
144 74 55
145 51 67
146 66 40
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Groepsgevoel `InteractieNV-U` InteractieGR_NV
14.834383 -0.189388 -0.002743 0.001344
interacteiGR_U NV Uitingsangst
0.002582 0.061053 -0.013405
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-5.3276 -0.8620 0.3075 1.0069 4.0696
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 14.834383 8.564361 1.732 0.0855 .
Groepsgevoel -0.189388 0.135808 -1.395 0.1654
`InteractieNV-U` -0.002743 0.001543 -1.778 0.0776 .
InteractieGR_NV 0.001344 0.001959 0.686 0.4938
interacteiGR_U 0.002582 0.001078 2.395 0.0180 *
NV 0.061053 0.141942 0.430 0.6678
Uitingsangst -0.013405 0.099466 -0.135 0.8930
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 1.742 on 139 degrees of freedom
Multiple R-squared: 0.09862, Adjusted R-squared: 0.05971
F-statistic: 2.535 on 6 and 139 DF, p-value: 0.02328
> 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.99864240 0.0027151998 0.0013575999
[2,] 0.99936225 0.0012755065 0.0006377533
[3,] 0.99979428 0.0004114448 0.0002057224
[4,] 0.99972511 0.0005497712 0.0002748856
[5,] 0.99954165 0.0009167030 0.0004583515
[6,] 0.99920990 0.0015802036 0.0007901018
[7,] 0.99876399 0.0024720269 0.0012360134
[8,] 0.99793466 0.0041306768 0.0020653384
[9,] 0.99688772 0.0062245567 0.0031122784
[10,] 0.99498045 0.0100390965 0.0050195482
[11,] 0.99580847 0.0083830571 0.0041915285
[12,] 0.99816792 0.0036641631 0.0018320815
[13,] 0.99682573 0.0063485491 0.0031742746
[14,] 0.99469542 0.0106091631 0.0053045815
[15,] 0.99144562 0.0171087617 0.0085543809
[16,] 0.98709212 0.0258157693 0.0129078846
[17,] 0.98058160 0.0388368067 0.0194184034
[18,] 0.97345058 0.0530988499 0.0265494249
[19,] 0.96626202 0.0674759569 0.0337379785
[20,] 0.95851731 0.0829653717 0.0414826858
[21,] 0.95206306 0.0958738730 0.0479369365
[22,] 0.93498747 0.1300250662 0.0650125331
[23,] 0.91336172 0.1732765639 0.0866382820
[24,] 0.92377619 0.1524476161 0.0762238080
[25,] 0.92827350 0.1434529946 0.0717264973
[26,] 0.91579548 0.1684090467 0.0842045233
[27,] 0.94275962 0.1144807552 0.0572403776
[28,] 0.92528440 0.1494311922 0.0747155961
[29,] 0.90521658 0.1895668427 0.0947834213
[30,] 0.91106593 0.1778681416 0.0889340708
[31,] 0.88650623 0.2269875447 0.1134937724
[32,] 0.88368989 0.2326202182 0.1163101091
[33,] 0.94759735 0.1048052929 0.0524026464
[34,] 0.93224867 0.1355026581 0.0677513290
[35,] 0.91666601 0.1666679792 0.0833339896
[36,] 0.91160496 0.1767900701 0.0883950350
[37,] 0.93695840 0.1260832011 0.0630416005
[38,] 0.93397794 0.1320441178 0.0660220589
[39,] 0.91624205 0.1675158984 0.0837579492
[40,] 0.89765660 0.2046867947 0.1023433973
[41,] 0.93949939 0.1210012213 0.0605006107
[42,] 0.96433002 0.0713399639 0.0356699820
[43,] 0.95339356 0.0932128869 0.0466064434
[44,] 0.98070788 0.0385842373 0.0192921186
[45,] 0.97430968 0.0513806405 0.0256903202
[46,] 0.97458065 0.0508387037 0.0254193519
[47,] 0.99401556 0.0119688897 0.0059844449
[48,] 0.99162019 0.0167596101 0.0083798050
[49,] 0.98917678 0.0216464447 0.0108232224
[50,] 0.98755625 0.0248875009 0.0124437504
[51,] 0.98663861 0.0267227735 0.0133613868
[52,] 0.98473942 0.0305211653 0.0152605826
[53,] 0.98193874 0.0361225111 0.0180612556
[54,] 0.98125231 0.0374953844 0.0187476922
[55,] 0.97668860 0.0466227901 0.0233113950
[56,] 0.97243495 0.0551300975 0.0275650487
[57,] 0.98530161 0.0293967757 0.0146983879
[58,] 0.99921515 0.0015696933 0.0007848466
[59,] 0.99886078 0.0022784379 0.0011392189
[60,] 0.99855723 0.0028855487 0.0014427743
[61,] 0.99813535 0.0037292959 0.0018646480
[62,] 0.99756419 0.0048716119 0.0024358059
[63,] 0.99775648 0.0044870312 0.0022435156
[64,] 0.99676046 0.0064790837 0.0032395419
[65,] 0.99535745 0.0092851058 0.0046425529
[66,] 0.99380412 0.0123917576 0.0061958788
[67,] 0.99507107 0.0098578578 0.0049289289
[68,] 0.99528106 0.0094378731 0.0047189366
[69,] 0.99560660 0.0087868011 0.0043934006
[70,] 0.99408391 0.0118321757 0.0059160878
[71,] 0.99165824 0.0166835246 0.0083417623
[72,] 0.98970383 0.0205923436 0.0102961718
[73,] 0.98710681 0.0257863853 0.0128931926
[74,] 0.98222334 0.0355533228 0.0177766614
[75,] 0.97781200 0.0443759937 0.0221879968
[76,] 0.97266456 0.0546708840 0.0273354420
[77,] 0.96452331 0.0709533738 0.0354766869
[78,] 0.95472841 0.0905431792 0.0452715896
[79,] 0.94694532 0.1061093562 0.0530546781
[80,] 0.93224430 0.1355114085 0.0677557043
[81,] 0.91995446 0.1600910854 0.0800455427
[82,] 0.90379797 0.1924040537 0.0962020269
[83,] 0.87943098 0.2411380322 0.1205690161
[84,] 0.87336285 0.2532742997 0.1266371498
[85,] 0.90995358 0.1800928415 0.0900464208
[86,] 0.89119330 0.2176133988 0.1088066994
[87,] 0.86434758 0.2713048379 0.1356524189
[88,] 0.84652467 0.3069506678 0.1534753339
[89,] 0.81218141 0.3756371748 0.1878185874
[90,] 0.77665720 0.4466855924 0.2233427962
[91,] 0.74962349 0.5007530109 0.2503765055
[92,] 0.70395515 0.5920897059 0.2960448530
[93,] 0.65544481 0.6891103712 0.3445551856
[94,] 0.64433515 0.7113297090 0.3556648545
[95,] 0.60702064 0.7859587243 0.3929793622
[96,] 0.64914719 0.7017056262 0.3508528131
[97,] 0.61507863 0.7698427453 0.3849213726
[98,] 0.57420100 0.8515980039 0.4257990020
[99,] 0.51635515 0.9672896981 0.4836448490
[100,] 0.52550273 0.9489945417 0.4744972708
[101,] 0.55176396 0.8964720722 0.4482360361
[102,] 0.49952262 0.9990452367 0.5004773817
[103,] 0.49741515 0.9948302939 0.5025848531
[104,] 0.59894735 0.8021052946 0.4010526473
[105,] 0.55784018 0.8843196429 0.4421598215
[106,] 0.49506545 0.9901309093 0.5049345454
[107,] 0.43103618 0.8620723672 0.5689638164
[108,] 0.38828558 0.7765711686 0.6117144157
[109,] 0.39986284 0.7997256843 0.6001371579
[110,] 0.33669239 0.6733847708 0.6633076146
[111,] 0.28878617 0.5775723496 0.7112138252
[112,] 0.25081710 0.5016341921 0.7491829039
[113,] 0.22079009 0.4415801825 0.7792099088
[114,] 0.19011025 0.3802205082 0.8098897459
[115,] 0.15680092 0.3136018350 0.8431990825
[116,] 0.17687588 0.3537517580 0.8231241210
[117,] 0.13280266 0.2656053222 0.8671973389
[118,] 0.15636269 0.3127253812 0.8436373094
[119,] 0.13096996 0.2619399197 0.8690300401
[120,] 0.14965764 0.2993152802 0.8503423599
[121,] 0.10385975 0.2077194937 0.8961402531
[122,] 0.07851475 0.1570294904 0.9214852548
[123,] 0.05206107 0.1041221377 0.9479389312
[124,] 0.04292363 0.0858472545 0.9570763728
[125,] 0.25075493 0.5015098531 0.7492450735
[126,] 0.15721561 0.3144312273 0.8427843864
[127,] 0.58948886 0.8210222869 0.4105111435
> postscript(file="/var/www/html/rcomp/tmp/1zqvn1291213752.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> plot(x[,1], type='l', main='Actuals and Interpolation', ylab='value of Actuals and Interpolation (dots)', xlab='time or index')
> points(x[,1]-mysum$resid)
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/2zqvn1291213752.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> plot(mysum$resid, type='b', pch=19, main='Residuals', ylab='value of Residuals', xlab='time or index')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/3zqvn1291213752.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> hist(mysum$resid, main='Residual Histogram', xlab='values of Residuals')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/4szv81291213752.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> densityplot(~mysum$resid,col='black',main='Residual Density Plot', xlab='values of Residuals')
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/5szv81291213752.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 = 146
Frequency = 1
1 2 3 4 5 6
-5.32762892 1.42766522 -0.43475852 -4.87794439 0.99812707 0.06784805
7 8 9 10 11 12
2.10480883 -3.84401334 -2.80670371 1.52734556 0.65670318 1.40581691
13 14 15 16 17 18
0.94817013 1.00595739 0.05898660 1.00727978 0.87346137 0.96821209
19 20 21 22 23 24
-1.06811979 2.04687518 -2.95806975 -0.13227394 -0.04359982 -0.17130415
25 26 27 28 29 30
-0.70204165 0.06797194 0.82468322 0.88842916 -1.18904394 1.22091735
31 32 33 34 35 36
-0.13211918 0.32668374 -2.30020410 -2.20546170 1.11132165 2.73512503
37 38 39 40 41 42
-0.04868873 0.48971991 -2.17408726 -0.08291049 -2.16685707 3.83974611
43 44 45 46 47 48
0.16527782 0.28834229 1.31966962 -2.79406466 1.53240325 -0.22811030
49 50 51 52 53 54
0.60907056 -3.27757513 -3.24528583 0.36037260 -3.74825365 -0.35118080
55 56 57 58 59 60
1.73017656 4.06956598 0.33717189 0.85262619 1.23470645 1.57246442
61 62 63 64 65 66
-1.25027225 -1.24108250 1.71510359 -0.97648921 1.15598669 3.11826776
67 68 69 70 71 72
-5.19081234 0.27510029 -1.08831183 1.40266891 0.94269295 1.89297127
73 74 75 76 77 78
0.22567886 0.03391124 0.76278433 2.17817118 1.70721864 -1.98697403
79 80 81 82 83 84
0.70813298 -0.28776168 -1.02242945 0.97691470 -0.01269578 0.91559986
85 86 87 88 89 90
0.95035357 -0.47944825 0.52581887 1.10551729 -0.27890274 -0.94758649
91 92 93 94 95 96
0.63500018 -0.03819665 1.57371419 2.37737893 0.40628321 -0.09228332
97 98 99 100 101 102
-0.99140645 0.02454250 0.47196017 0.73251455 0.08043959 0.28031574
103 104 105 106 107 108
-1.78169721 1.36972189 -2.56376550 -1.05943117 0.70523846 -0.08152435
109 110 111 112 113 114
1.84034226 -2.46400221 -0.29348751 1.81327102 -2.78938459 0.86035250
115 116 117 118 119 120
0.45756746 0.34293517 1.14688974 1.66262653 -0.28961642 -0.77332435
121 122 123 124 125 126
-0.89151889 -0.90264922 1.13779737 0.92252347 2.05172251 -0.01412014
127 128 129 130 131 132
1.02960170 0.90481766 -1.72544602 -0.75732903 1.06553770 1.04909586
133 134 135 136 137 138
2.23134610 -4.83859879 -0.94673660 -1.80411309 0.99558457 -0.08586701
139 140 141 142 143 144
-0.11574545 0.87831234 -4.13516767 0.87599400 -0.19918885 -1.99288473
145 146
0.77647082 0.73405837
> postscript(file="/var/www/html/rcomp/tmp/6szv81291213752.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 = 146
Frequency = 1
lag(myerror, k = 1) myerror
0 -5.32762892 NA
1 1.42766522 -5.32762892
2 -0.43475852 1.42766522
3 -4.87794439 -0.43475852
4 0.99812707 -4.87794439
5 0.06784805 0.99812707
6 2.10480883 0.06784805
7 -3.84401334 2.10480883
8 -2.80670371 -3.84401334
9 1.52734556 -2.80670371
10 0.65670318 1.52734556
11 1.40581691 0.65670318
12 0.94817013 1.40581691
13 1.00595739 0.94817013
14 0.05898660 1.00595739
15 1.00727978 0.05898660
16 0.87346137 1.00727978
17 0.96821209 0.87346137
18 -1.06811979 0.96821209
19 2.04687518 -1.06811979
20 -2.95806975 2.04687518
21 -0.13227394 -2.95806975
22 -0.04359982 -0.13227394
23 -0.17130415 -0.04359982
24 -0.70204165 -0.17130415
25 0.06797194 -0.70204165
26 0.82468322 0.06797194
27 0.88842916 0.82468322
28 -1.18904394 0.88842916
29 1.22091735 -1.18904394
30 -0.13211918 1.22091735
31 0.32668374 -0.13211918
32 -2.30020410 0.32668374
33 -2.20546170 -2.30020410
34 1.11132165 -2.20546170
35 2.73512503 1.11132165
36 -0.04868873 2.73512503
37 0.48971991 -0.04868873
38 -2.17408726 0.48971991
39 -0.08291049 -2.17408726
40 -2.16685707 -0.08291049
41 3.83974611 -2.16685707
42 0.16527782 3.83974611
43 0.28834229 0.16527782
44 1.31966962 0.28834229
45 -2.79406466 1.31966962
46 1.53240325 -2.79406466
47 -0.22811030 1.53240325
48 0.60907056 -0.22811030
49 -3.27757513 0.60907056
50 -3.24528583 -3.27757513
51 0.36037260 -3.24528583
52 -3.74825365 0.36037260
53 -0.35118080 -3.74825365
54 1.73017656 -0.35118080
55 4.06956598 1.73017656
56 0.33717189 4.06956598
57 0.85262619 0.33717189
58 1.23470645 0.85262619
59 1.57246442 1.23470645
60 -1.25027225 1.57246442
61 -1.24108250 -1.25027225
62 1.71510359 -1.24108250
63 -0.97648921 1.71510359
64 1.15598669 -0.97648921
65 3.11826776 1.15598669
66 -5.19081234 3.11826776
67 0.27510029 -5.19081234
68 -1.08831183 0.27510029
69 1.40266891 -1.08831183
70 0.94269295 1.40266891
71 1.89297127 0.94269295
72 0.22567886 1.89297127
73 0.03391124 0.22567886
74 0.76278433 0.03391124
75 2.17817118 0.76278433
76 1.70721864 2.17817118
77 -1.98697403 1.70721864
78 0.70813298 -1.98697403
79 -0.28776168 0.70813298
80 -1.02242945 -0.28776168
81 0.97691470 -1.02242945
82 -0.01269578 0.97691470
83 0.91559986 -0.01269578
84 0.95035357 0.91559986
85 -0.47944825 0.95035357
86 0.52581887 -0.47944825
87 1.10551729 0.52581887
88 -0.27890274 1.10551729
89 -0.94758649 -0.27890274
90 0.63500018 -0.94758649
91 -0.03819665 0.63500018
92 1.57371419 -0.03819665
93 2.37737893 1.57371419
94 0.40628321 2.37737893
95 -0.09228332 0.40628321
96 -0.99140645 -0.09228332
97 0.02454250 -0.99140645
98 0.47196017 0.02454250
99 0.73251455 0.47196017
100 0.08043959 0.73251455
101 0.28031574 0.08043959
102 -1.78169721 0.28031574
103 1.36972189 -1.78169721
104 -2.56376550 1.36972189
105 -1.05943117 -2.56376550
106 0.70523846 -1.05943117
107 -0.08152435 0.70523846
108 1.84034226 -0.08152435
109 -2.46400221 1.84034226
110 -0.29348751 -2.46400221
111 1.81327102 -0.29348751
112 -2.78938459 1.81327102
113 0.86035250 -2.78938459
114 0.45756746 0.86035250
115 0.34293517 0.45756746
116 1.14688974 0.34293517
117 1.66262653 1.14688974
118 -0.28961642 1.66262653
119 -0.77332435 -0.28961642
120 -0.89151889 -0.77332435
121 -0.90264922 -0.89151889
122 1.13779737 -0.90264922
123 0.92252347 1.13779737
124 2.05172251 0.92252347
125 -0.01412014 2.05172251
126 1.02960170 -0.01412014
127 0.90481766 1.02960170
128 -1.72544602 0.90481766
129 -0.75732903 -1.72544602
130 1.06553770 -0.75732903
131 1.04909586 1.06553770
132 2.23134610 1.04909586
133 -4.83859879 2.23134610
134 -0.94673660 -4.83859879
135 -1.80411309 -0.94673660
136 0.99558457 -1.80411309
137 -0.08586701 0.99558457
138 -0.11574545 -0.08586701
139 0.87831234 -0.11574545
140 -4.13516767 0.87831234
141 0.87599400 -4.13516767
142 -0.19918885 0.87599400
143 -1.99288473 -0.19918885
144 0.77647082 -1.99288473
145 0.73405837 0.77647082
146 NA 0.73405837
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 1.42766522 -5.32762892
[2,] -0.43475852 1.42766522
[3,] -4.87794439 -0.43475852
[4,] 0.99812707 -4.87794439
[5,] 0.06784805 0.99812707
[6,] 2.10480883 0.06784805
[7,] -3.84401334 2.10480883
[8,] -2.80670371 -3.84401334
[9,] 1.52734556 -2.80670371
[10,] 0.65670318 1.52734556
[11,] 1.40581691 0.65670318
[12,] 0.94817013 1.40581691
[13,] 1.00595739 0.94817013
[14,] 0.05898660 1.00595739
[15,] 1.00727978 0.05898660
[16,] 0.87346137 1.00727978
[17,] 0.96821209 0.87346137
[18,] -1.06811979 0.96821209
[19,] 2.04687518 -1.06811979
[20,] -2.95806975 2.04687518
[21,] -0.13227394 -2.95806975
[22,] -0.04359982 -0.13227394
[23,] -0.17130415 -0.04359982
[24,] -0.70204165 -0.17130415
[25,] 0.06797194 -0.70204165
[26,] 0.82468322 0.06797194
[27,] 0.88842916 0.82468322
[28,] -1.18904394 0.88842916
[29,] 1.22091735 -1.18904394
[30,] -0.13211918 1.22091735
[31,] 0.32668374 -0.13211918
[32,] -2.30020410 0.32668374
[33,] -2.20546170 -2.30020410
[34,] 1.11132165 -2.20546170
[35,] 2.73512503 1.11132165
[36,] -0.04868873 2.73512503
[37,] 0.48971991 -0.04868873
[38,] -2.17408726 0.48971991
[39,] -0.08291049 -2.17408726
[40,] -2.16685707 -0.08291049
[41,] 3.83974611 -2.16685707
[42,] 0.16527782 3.83974611
[43,] 0.28834229 0.16527782
[44,] 1.31966962 0.28834229
[45,] -2.79406466 1.31966962
[46,] 1.53240325 -2.79406466
[47,] -0.22811030 1.53240325
[48,] 0.60907056 -0.22811030
[49,] -3.27757513 0.60907056
[50,] -3.24528583 -3.27757513
[51,] 0.36037260 -3.24528583
[52,] -3.74825365 0.36037260
[53,] -0.35118080 -3.74825365
[54,] 1.73017656 -0.35118080
[55,] 4.06956598 1.73017656
[56,] 0.33717189 4.06956598
[57,] 0.85262619 0.33717189
[58,] 1.23470645 0.85262619
[59,] 1.57246442 1.23470645
[60,] -1.25027225 1.57246442
[61,] -1.24108250 -1.25027225
[62,] 1.71510359 -1.24108250
[63,] -0.97648921 1.71510359
[64,] 1.15598669 -0.97648921
[65,] 3.11826776 1.15598669
[66,] -5.19081234 3.11826776
[67,] 0.27510029 -5.19081234
[68,] -1.08831183 0.27510029
[69,] 1.40266891 -1.08831183
[70,] 0.94269295 1.40266891
[71,] 1.89297127 0.94269295
[72,] 0.22567886 1.89297127
[73,] 0.03391124 0.22567886
[74,] 0.76278433 0.03391124
[75,] 2.17817118 0.76278433
[76,] 1.70721864 2.17817118
[77,] -1.98697403 1.70721864
[78,] 0.70813298 -1.98697403
[79,] -0.28776168 0.70813298
[80,] -1.02242945 -0.28776168
[81,] 0.97691470 -1.02242945
[82,] -0.01269578 0.97691470
[83,] 0.91559986 -0.01269578
[84,] 0.95035357 0.91559986
[85,] -0.47944825 0.95035357
[86,] 0.52581887 -0.47944825
[87,] 1.10551729 0.52581887
[88,] -0.27890274 1.10551729
[89,] -0.94758649 -0.27890274
[90,] 0.63500018 -0.94758649
[91,] -0.03819665 0.63500018
[92,] 1.57371419 -0.03819665
[93,] 2.37737893 1.57371419
[94,] 0.40628321 2.37737893
[95,] -0.09228332 0.40628321
[96,] -0.99140645 -0.09228332
[97,] 0.02454250 -0.99140645
[98,] 0.47196017 0.02454250
[99,] 0.73251455 0.47196017
[100,] 0.08043959 0.73251455
[101,] 0.28031574 0.08043959
[102,] -1.78169721 0.28031574
[103,] 1.36972189 -1.78169721
[104,] -2.56376550 1.36972189
[105,] -1.05943117 -2.56376550
[106,] 0.70523846 -1.05943117
[107,] -0.08152435 0.70523846
[108,] 1.84034226 -0.08152435
[109,] -2.46400221 1.84034226
[110,] -0.29348751 -2.46400221
[111,] 1.81327102 -0.29348751
[112,] -2.78938459 1.81327102
[113,] 0.86035250 -2.78938459
[114,] 0.45756746 0.86035250
[115,] 0.34293517 0.45756746
[116,] 1.14688974 0.34293517
[117,] 1.66262653 1.14688974
[118,] -0.28961642 1.66262653
[119,] -0.77332435 -0.28961642
[120,] -0.89151889 -0.77332435
[121,] -0.90264922 -0.89151889
[122,] 1.13779737 -0.90264922
[123,] 0.92252347 1.13779737
[124,] 2.05172251 0.92252347
[125,] -0.01412014 2.05172251
[126,] 1.02960170 -0.01412014
[127,] 0.90481766 1.02960170
[128,] -1.72544602 0.90481766
[129,] -0.75732903 -1.72544602
[130,] 1.06553770 -0.75732903
[131,] 1.04909586 1.06553770
[132,] 2.23134610 1.04909586
[133,] -4.83859879 2.23134610
[134,] -0.94673660 -4.83859879
[135,] -1.80411309 -0.94673660
[136,] 0.99558457 -1.80411309
[137,] -0.08586701 0.99558457
[138,] -0.11574545 -0.08586701
[139,] 0.87831234 -0.11574545
[140,] -4.13516767 0.87831234
[141,] 0.87599400 -4.13516767
[142,] -0.19918885 0.87599400
[143,] -1.99288473 -0.19918885
[144,] 0.77647082 -1.99288473
[145,] 0.73405837 0.77647082
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 1.42766522 -5.32762892
2 -0.43475852 1.42766522
3 -4.87794439 -0.43475852
4 0.99812707 -4.87794439
5 0.06784805 0.99812707
6 2.10480883 0.06784805
7 -3.84401334 2.10480883
8 -2.80670371 -3.84401334
9 1.52734556 -2.80670371
10 0.65670318 1.52734556
11 1.40581691 0.65670318
12 0.94817013 1.40581691
13 1.00595739 0.94817013
14 0.05898660 1.00595739
15 1.00727978 0.05898660
16 0.87346137 1.00727978
17 0.96821209 0.87346137
18 -1.06811979 0.96821209
19 2.04687518 -1.06811979
20 -2.95806975 2.04687518
21 -0.13227394 -2.95806975
22 -0.04359982 -0.13227394
23 -0.17130415 -0.04359982
24 -0.70204165 -0.17130415
25 0.06797194 -0.70204165
26 0.82468322 0.06797194
27 0.88842916 0.82468322
28 -1.18904394 0.88842916
29 1.22091735 -1.18904394
30 -0.13211918 1.22091735
31 0.32668374 -0.13211918
32 -2.30020410 0.32668374
33 -2.20546170 -2.30020410
34 1.11132165 -2.20546170
35 2.73512503 1.11132165
36 -0.04868873 2.73512503
37 0.48971991 -0.04868873
38 -2.17408726 0.48971991
39 -0.08291049 -2.17408726
40 -2.16685707 -0.08291049
41 3.83974611 -2.16685707
42 0.16527782 3.83974611
43 0.28834229 0.16527782
44 1.31966962 0.28834229
45 -2.79406466 1.31966962
46 1.53240325 -2.79406466
47 -0.22811030 1.53240325
48 0.60907056 -0.22811030
49 -3.27757513 0.60907056
50 -3.24528583 -3.27757513
51 0.36037260 -3.24528583
52 -3.74825365 0.36037260
53 -0.35118080 -3.74825365
54 1.73017656 -0.35118080
55 4.06956598 1.73017656
56 0.33717189 4.06956598
57 0.85262619 0.33717189
58 1.23470645 0.85262619
59 1.57246442 1.23470645
60 -1.25027225 1.57246442
61 -1.24108250 -1.25027225
62 1.71510359 -1.24108250
63 -0.97648921 1.71510359
64 1.15598669 -0.97648921
65 3.11826776 1.15598669
66 -5.19081234 3.11826776
67 0.27510029 -5.19081234
68 -1.08831183 0.27510029
69 1.40266891 -1.08831183
70 0.94269295 1.40266891
71 1.89297127 0.94269295
72 0.22567886 1.89297127
73 0.03391124 0.22567886
74 0.76278433 0.03391124
75 2.17817118 0.76278433
76 1.70721864 2.17817118
77 -1.98697403 1.70721864
78 0.70813298 -1.98697403
79 -0.28776168 0.70813298
80 -1.02242945 -0.28776168
81 0.97691470 -1.02242945
82 -0.01269578 0.97691470
83 0.91559986 -0.01269578
84 0.95035357 0.91559986
85 -0.47944825 0.95035357
86 0.52581887 -0.47944825
87 1.10551729 0.52581887
88 -0.27890274 1.10551729
89 -0.94758649 -0.27890274
90 0.63500018 -0.94758649
91 -0.03819665 0.63500018
92 1.57371419 -0.03819665
93 2.37737893 1.57371419
94 0.40628321 2.37737893
95 -0.09228332 0.40628321
96 -0.99140645 -0.09228332
97 0.02454250 -0.99140645
98 0.47196017 0.02454250
99 0.73251455 0.47196017
100 0.08043959 0.73251455
101 0.28031574 0.08043959
102 -1.78169721 0.28031574
103 1.36972189 -1.78169721
104 -2.56376550 1.36972189
105 -1.05943117 -2.56376550
106 0.70523846 -1.05943117
107 -0.08152435 0.70523846
108 1.84034226 -0.08152435
109 -2.46400221 1.84034226
110 -0.29348751 -2.46400221
111 1.81327102 -0.29348751
112 -2.78938459 1.81327102
113 0.86035250 -2.78938459
114 0.45756746 0.86035250
115 0.34293517 0.45756746
116 1.14688974 0.34293517
117 1.66262653 1.14688974
118 -0.28961642 1.66262653
119 -0.77332435 -0.28961642
120 -0.89151889 -0.77332435
121 -0.90264922 -0.89151889
122 1.13779737 -0.90264922
123 0.92252347 1.13779737
124 2.05172251 0.92252347
125 -0.01412014 2.05172251
126 1.02960170 -0.01412014
127 0.90481766 1.02960170
128 -1.72544602 0.90481766
129 -0.75732903 -1.72544602
130 1.06553770 -0.75732903
131 1.04909586 1.06553770
132 2.23134610 1.04909586
133 -4.83859879 2.23134610
134 -0.94673660 -4.83859879
135 -1.80411309 -0.94673660
136 0.99558457 -1.80411309
137 -0.08586701 0.99558457
138 -0.11574545 -0.08586701
139 0.87831234 -0.11574545
140 -4.13516767 0.87831234
141 0.87599400 -4.13516767
142 -0.19918885 0.87599400
143 -1.99288473 -0.19918885
144 0.77647082 -1.99288473
145 0.73405837 0.77647082
> 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/73rut1291213752.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> acf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Autocorrelation Function')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/8dibe1291213752.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> pacf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Partial Autocorrelation Function')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/9dibe1291213752.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> opar <- par(mfrow = c(2,2), oma = c(0, 0, 1.1, 0))
> plot(mylm, las = 1, sub='Residual Diagnostics')
> par(opar)
> dev.off()
null device
1
> if (n > n25) {
+ postscript(file="/var/www/html/rcomp/tmp/10dibe1291213752.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
+ plot(kp3:nmkm3,gqarr[,2], main='Goldfeld-Quandt test',ylab='2-sided p-value',xlab='breakpoint')
+ grid()
+ dev.off()
+ }
null device
1
>
> #Note: the /var/www/html/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/www/html/rcomp/createtable")
>
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Estimated Regression Equation', 1, TRUE)
> a<-table.row.end(a)
> myeq <- colnames(x)[1]
> myeq <- paste(myeq, '[t] = ', sep='')
> for (i in 1:k){
+ if (mysum$coefficients[i,1] > 0) myeq <- paste(myeq, '+', '')
+ myeq <- paste(myeq, mysum$coefficients[i,1], sep=' ')
+ if (rownames(mysum$coefficients)[i] != '(Intercept)') {
+ myeq <- paste(myeq, rownames(mysum$coefficients)[i], sep='')
+ if (rownames(mysum$coefficients)[i] != 't') myeq <- paste(myeq, '[t]', sep='')
+ }
+ }
> myeq <- paste(myeq, ' + e[t]')
> a<-table.row.start(a)
> a<-table.element(a, myeq)
> a<-table.row.end(a)
> a<-table.end(a)
> table.save(a,file="/var/www/html/rcomp/tmp/11ra951291213752.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/12vapa1291213752.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/139k511291213752.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/14ck4p1291213752.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/15nu3a1291213752.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/16131j1291213752.tab")
+ }
>
> try(system("convert tmp/1zqvn1291213752.ps tmp/1zqvn1291213752.png",intern=TRUE))
character(0)
> try(system("convert tmp/2zqvn1291213752.ps tmp/2zqvn1291213752.png",intern=TRUE))
character(0)
> try(system("convert tmp/3zqvn1291213752.ps tmp/3zqvn1291213752.png",intern=TRUE))
character(0)
> try(system("convert tmp/4szv81291213752.ps tmp/4szv81291213752.png",intern=TRUE))
character(0)
> try(system("convert tmp/5szv81291213752.ps tmp/5szv81291213752.png",intern=TRUE))
character(0)
> try(system("convert tmp/6szv81291213752.ps tmp/6szv81291213752.png",intern=TRUE))
character(0)
> try(system("convert tmp/73rut1291213752.ps tmp/73rut1291213752.png",intern=TRUE))
character(0)
> try(system("convert tmp/8dibe1291213752.ps tmp/8dibe1291213752.png",intern=TRUE))
character(0)
> try(system("convert tmp/9dibe1291213752.ps tmp/9dibe1291213752.png",intern=TRUE))
character(0)
> try(system("convert tmp/10dibe1291213752.ps tmp/10dibe1291213752.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
4.020 1.822 8.921