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(13
+ ,13
+ ,0
+ ,14
+ ,0
+ ,13
+ ,0
+ ,3
+ ,0
+ ,0
+ ,12
+ ,12
+ ,12
+ ,8
+ ,8
+ ,13
+ ,13
+ ,5
+ ,5
+ ,1
+ ,10
+ ,10
+ ,0
+ ,10
+ ,0
+ ,11
+ ,0
+ ,5
+ ,0
+ ,0
+ ,15
+ ,13
+ ,13
+ ,16
+ ,16
+ ,18
+ ,18
+ ,8
+ ,8
+ ,1
+ ,9
+ ,12
+ ,12
+ ,11
+ ,11
+ ,11
+ ,11
+ ,4
+ ,4
+ ,1
+ ,12
+ ,12
+ ,12
+ ,14
+ ,14
+ ,14
+ ,14
+ ,4
+ ,4
+ ,1
+ ,11
+ ,5
+ ,0
+ ,16
+ ,0
+ ,14
+ ,0
+ ,6
+ ,0
+ ,0
+ ,11
+ ,12
+ ,12
+ ,11
+ ,11
+ ,12
+ ,12
+ ,6
+ ,6
+ ,1
+ ,15
+ ,11
+ ,11
+ ,16
+ ,16
+ ,11
+ ,11
+ ,5
+ ,5
+ ,1
+ ,7
+ ,14
+ ,0
+ ,12
+ ,0
+ ,12
+ ,0
+ ,4
+ ,0
+ ,0
+ ,11
+ ,14
+ ,0
+ ,7
+ ,0
+ ,13
+ ,0
+ ,6
+ ,0
+ ,0
+ ,11
+ ,12
+ ,12
+ ,13
+ ,13
+ ,11
+ ,11
+ ,4
+ ,4
+ ,1
+ ,10
+ ,12
+ ,12
+ ,11
+ ,11
+ ,12
+ ,12
+ ,6
+ ,6
+ ,1
+ ,14
+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j in 1:dim(x)[2])
+ {
+ y[i,j] <- as.numeric(x[i,j])
+ }
+ }
> par3 = 'No Linear Trend'
> par2 = 'Do not include Seasonal Dummies'
> par1 = '1'
> #'GNU S' R Code compiled by R2WASP v. 1.0.44 ()
> #Author: Prof. Dr. P. Wessa
> #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/
> #Source of accompanying publication: Office for Research, Development, and Education
> #Technical description: Write here your technical program description (don't use hard returns!)
> library(lattice)
> library(lmtest)
Loading required package: zoo
Attaching package: 'zoo'
The following object(s) are masked from package:base :
as.Date.numeric
> n25 <- 25 #minimum number of obs. for Goldfeld-Quandt test
> par1 <- as.numeric(par1)
> x <- t(y)
> k <- length(x[1,])
> n <- length(x[,1])
> x1 <- cbind(x[,par1], x[,1:k!=par1])
> mycolnames <- c(colnames(x)[par1], colnames(x)[1:k!=par1])
> colnames(x1) <- mycolnames #colnames(x)[par1]
> x <- x1
> if (par3 == 'First Differences'){
+ x2 <- array(0, dim=c(n-1,k), dimnames=list(1:(n-1), paste('(1-B)',colnames(x),sep='')))
+ for (i in 1:n-1) {
+ for (j in 1:k) {
+ x2[i,j] <- x[i+1,j] - x[i,j]
+ }
+ }
+ x <- x2
+ }
> if (par2 == 'Include Monthly Dummies'){
+ x2 <- array(0, dim=c(n,11), dimnames=list(1:n, paste('M', seq(1:11), sep ='')))
+ for (i in 1:11){
+ x2[seq(i,n,12),i] <- 1
+ }
+ x <- cbind(x, x2)
+ }
> if (par2 == 'Include Quarterly Dummies'){
+ x2 <- array(0, dim=c(n,3), dimnames=list(1:n, paste('Q', seq(1:3), sep ='')))
+ for (i in 1:3){
+ x2[seq(i,n,4),i] <- 1
+ }
+ x <- cbind(x, x2)
+ }
> k <- length(x[1,])
> if (par3 == 'Linear Trend'){
+ x <- cbind(x, c(1:n))
+ colnames(x)[k+1] <- 't'
+ }
> x
populair vrienden vrienden_G kennen kennen_G geliefd geliefd_G celebrity
1 13 13 0 14 0 13 0 3
2 12 12 12 8 8 13 13 5
3 10 10 0 10 0 11 0 5
4 15 13 13 16 16 18 18 8
5 9 12 12 11 11 11 11 4
6 12 12 12 14 14 14 14 4
7 11 5 0 16 0 14 0 6
8 11 12 12 11 11 12 12 6
9 15 11 11 16 16 11 11 5
10 7 14 0 12 0 12 0 4
11 11 14 0 7 0 13 0 6
12 11 12 12 13 13 11 11 4
13 10 12 12 11 11 12 12 6
14 14 11 0 15 0 16 0 6
15 10 11 11 7 7 9 9 4
16 6 7 0 9 0 11 0 4
17 11 9 9 7 7 13 13 2
18 15 11 0 14 0 15 0 7
19 11 11 11 15 15 10 10 5
20 12 12 0 7 0 11 0 4
21 14 12 12 15 15 13 13 6
22 15 11 0 17 0 16 0 6
23 9 11 0 15 0 15 0 7
24 13 8 8 14 14 14 14 5
25 13 9 0 14 0 14 0 6
26 13 10 10 8 8 8 8 4
27 12 10 0 14 0 13 0 7
28 14 12 12 14 14 15 15 7
29 11 8 0 8 0 13 0 4
30 9 12 12 11 11 11 11 4
31 16 11 0 16 0 15 0 6
32 13 11 11 14 14 13 13 6
33 16 11 11 16 16 16 16 7
34 15 9 9 5 5 11 11 3
35 5 15 15 8 8 12 12 3
36 11 11 11 8 8 12 12 6
37 16 11 0 13 0 14 0 7
38 17 11 11 15 15 14 14 5
39 9 15 0 6 0 8 0 4
40 9 11 11 12 12 13 13 5
41 13 12 12 16 16 16 16 6
42 6 9 0 15 0 11 0 6
43 12 12 0 12 0 14 0 5
44 8 12 0 8 0 13 0 4
45 14 13 0 13 0 13 0 5
46 12 11 11 14 14 13 13 5
47 16 9 9 16 16 16 16 6
48 8 11 0 10 0 15 0 2
49 15 11 11 15 15 15 15 8
50 7 12 0 8 0 12 0 3
51 16 12 0 16 0 14 0 6
52 14 9 9 19 19 12 12 6
53 16 11 11 14 14 15 15 6
54 9 9 9 6 6 12 12 5
55 11 12 0 15 0 12 0 6
56 5 14 0 4 0 5 0 2
57 15 11 11 14 14 13 13 5
58 13 12 12 13 13 13 13 5
59 11 11 0 11 0 14 0 5
60 11 6 0 14 0 17 0 6
61 12 13 13 14 14 12 12 5
62 14 12 12 8 8 14 14 4
63 6 12 12 6 6 11 11 2
64 7 12 0 7 0 12 0 4
65 14 6 6 13 13 12 12 6
66 14 11 11 13 13 16 16 6
67 10 10 10 11 11 12 12 5
68 13 12 0 5 0 12 0 3
69 12 13 0 12 0 12 0 6
70 9 11 0 8 0 10 0 4
71 12 7 7 11 11 15 15 5
72 10 11 0 9 0 12 0 4
73 10 11 11 13 13 15 15 6
74 16 12 12 16 16 16 16 7
75 15 10 10 16 16 13 13 6
76 8 7 7 4 4 13 13 6
77 8 13 0 7 0 10 0 3
78 13 12 0 11 0 13 0 6
79 16 11 11 17 17 16 16 7
80 16 12 12 15 15 15 15 7
81 14 14 0 17 0 18 0 6
82 11 10 10 5 5 13 13 3
83 14 13 13 10 10 16 16 8
84 9 10 10 11 11 13 13 3
85 8 10 10 10 10 14 14 3
86 8 7 7 9 9 15 15 4
87 11 10 10 12 12 14 14 5
88 12 8 8 15 15 13 13 7
89 14 12 12 13 13 15 15 6
90 16 11 0 14 0 14 0 6
91 16 12 12 14 14 14 14 6
92 14 12 0 15 0 14 0 6
93 14 11 0 12 0 12 0 4
94 14 11 0 16 0 12 0 5
95 8 11 0 9 0 12 0 4
96 16 12 0 15 0 14 0 6
97 12 12 12 6 6 14 14 5
98 12 12 12 15 15 13 13 6
99 16 12 0 14 0 16 0 8
100 15 11 11 12 12 13 13 6
101 10 12 12 8 8 16 16 4
102 12 12 12 9 9 13 13 4
103 14 11 0 15 0 14 0 6
104 19 12 12 15 15 15 15 6
105 15 12 12 14 14 16 16 4
106 8 10 0 10 0 6 0 4
107 8 12 0 8 0 14 0 5
108 10 15 0 15 0 15 0 6
109 15 11 0 16 0 14 0 6
110 16 12 12 12 12 15 15 8
111 13 11 11 12 12 13 13 7
celebrity_G geslacht(dummy)
1 0 0
2 5 1
3 0 0
4 8 1
5 4 1
6 4 1
7 0 0
8 6 1
9 5 1
10 0 0
11 0 0
12 4 1
13 6 1
14 0 0
15 4 1
16 0 0
17 2 1
18 0 0
19 5 1
20 0 0
21 6 1
22 0 0
23 0 0
24 5 1
25 0 0
26 4 1
27 0 0
28 7 1
29 0 0
30 4 1
31 0 0
32 6 1
33 7 1
34 3 1
35 3 1
36 6 1
37 0 0
38 5 1
39 0 0
40 5 1
41 6 1
42 0 0
43 0 0
44 0 0
45 0 0
46 5 1
47 6 1
48 0 0
49 8 1
50 0 0
51 0 0
52 6 1
53 6 1
54 5 1
55 0 0
56 0 0
57 5 1
58 5 1
59 0 0
60 0 0
61 5 1
62 4 1
63 2 1
64 0 0
65 6 1
66 6 1
67 5 1
68 0 0
69 0 0
70 0 0
71 5 1
72 0 0
73 6 1
74 7 1
75 6 1
76 6 1
77 0 0
78 0 0
79 7 1
80 7 1
81 0 0
82 3 1
83 8 1
84 3 1
85 3 1
86 4 1
87 5 1
88 7 1
89 6 1
90 0 0
91 6 1
92 0 0
93 0 0
94 0 0
95 0 0
96 0 0
97 5 1
98 6 1
99 0 0
100 6 1
101 4 1
102 4 1
103 0 0
104 6 1
105 4 1
106 0 0
107 0 0
108 0 0
109 0 0
110 8 1
111 7 1
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) vrienden vrienden_G kennen
-1.89772 0.25941 -0.29981 0.28096
kennen_G geliefd geliefd_G celebrity
0.02931 0.30943 -0.07447 0.60058
celebrity_G `geslacht(dummy)`
-0.03257 4.98633
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-5.6585 -1.5686 0.0784 1.3412 6.4351
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -1.89772 2.80986 -0.675 0.5010
vrienden 0.25941 0.16746 1.549 0.1245
vrienden_G -0.29981 0.24183 -1.240 0.2179
kennen 0.28096 0.14473 1.941 0.0550 .
kennen_G 0.02931 0.17644 0.166 0.8684
geliefd 0.30943 0.18162 1.704 0.0915 .
geliefd_G -0.07447 0.25090 -0.297 0.7672
celebrity 0.60058 0.35150 1.709 0.0906 .
celebrity_G -0.03257 0.43768 -0.074 0.9408
`geslacht(dummy)` 4.98633 3.85462 1.294 0.1988
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 2.248 on 101 degrees of freedom
Multiple R-squared: 0.4939, Adjusted R-squared: 0.4488
F-statistic: 10.95 on 9 and 101 DF, p-value: 9.68e-12
> 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.1655973 0.3311946 0.83440271
[2,] 0.2103511 0.4207022 0.78964889
[3,] 0.1143487 0.2286973 0.88565133
[4,] 0.3582348 0.7164696 0.64176520
[5,] 0.3628063 0.7256126 0.63719371
[6,] 0.2950140 0.5900280 0.70498601
[7,] 0.2600264 0.5200528 0.73997362
[8,] 0.3956683 0.7913365 0.60433174
[9,] 0.3206838 0.6413676 0.67931619
[10,] 0.2435309 0.4870619 0.75646905
[11,] 0.4106534 0.8213067 0.58934664
[12,] 0.3671185 0.7342370 0.63288148
[13,] 0.3255534 0.6511069 0.67444656
[14,] 0.3853846 0.7707692 0.61461541
[15,] 0.3695971 0.7391943 0.63040286
[16,] 0.3036829 0.6073657 0.69631714
[17,] 0.2489686 0.4979372 0.75103139
[18,] 0.2238224 0.4476448 0.77617758
[19,] 0.2498217 0.4996435 0.75017826
[20,] 0.1967101 0.3934203 0.80328986
[21,] 0.1611405 0.3222809 0.83885955
[22,] 0.3745618 0.7491236 0.62543821
[23,] 0.4108177 0.8216354 0.58918228
[24,] 0.3772179 0.7544358 0.62278209
[25,] 0.4631941 0.9263882 0.53680589
[26,] 0.5739727 0.8520547 0.42602734
[27,] 0.5333261 0.9333477 0.46667386
[28,] 0.6291032 0.7417936 0.37089679
[29,] 0.6030832 0.7938335 0.39691677
[30,] 0.8048841 0.3902319 0.19511593
[31,] 0.7650114 0.4699772 0.23498860
[32,] 0.8036975 0.3926051 0.19630255
[33,] 0.8015938 0.3968125 0.19840625
[34,] 0.7659253 0.4681493 0.23407466
[35,] 0.7275215 0.5449569 0.27247845
[36,] 0.7424090 0.5151820 0.25759099
[37,] 0.6978120 0.6043760 0.30218799
[38,] 0.6890647 0.6218707 0.31093533
[39,] 0.7037957 0.5924086 0.29620431
[40,] 0.6718776 0.6562448 0.32812238
[41,] 0.6611847 0.6776307 0.33881533
[42,] 0.6876569 0.6246861 0.31234307
[43,] 0.6697455 0.6605089 0.33025446
[44,] 0.6303103 0.7393795 0.36968974
[45,] 0.6265577 0.7468846 0.37344229
[46,] 0.5762098 0.8475805 0.42379023
[47,] 0.5206024 0.9587953 0.47939765
[48,] 0.6439826 0.7120349 0.35601745
[49,] 0.6076046 0.7847907 0.39239536
[50,] 0.6843585 0.6312831 0.31564154
[51,] 0.6958462 0.6083076 0.30415381
[52,] 0.7133072 0.5733857 0.28669283
[53,] 0.7616201 0.4767597 0.23837987
[54,] 0.7112612 0.5774775 0.28873876
[55,] 0.6972489 0.6055022 0.30275108
[56,] 0.9053517 0.1892967 0.09464834
[57,] 0.8813750 0.2372500 0.11862500
[58,] 0.8482401 0.3035198 0.15175988
[59,] 0.8707878 0.2584243 0.12921216
[60,] 0.8337500 0.3325000 0.16625001
[61,] 0.9109821 0.1780358 0.08901788
[62,] 0.8859168 0.2281665 0.11408323
[63,] 0.8619343 0.2761314 0.13806571
[64,] 0.8496877 0.3006246 0.15031229
[65,] 0.8822777 0.2354445 0.11772227
[66,] 0.8775571 0.2448857 0.12244287
[67,] 0.8385616 0.3228768 0.16143839
[68,] 0.7998273 0.4003454 0.20017271
[69,] 0.7629767 0.4740466 0.23702331
[70,] 0.8432393 0.3135214 0.15676069
[71,] 0.8580424 0.2839152 0.14195760
[72,] 0.8206238 0.3587524 0.17937619
[73,] 0.8055364 0.3889272 0.19446361
[74,] 0.7767645 0.4464710 0.22323549
[75,] 0.7201739 0.5596522 0.27982609
[76,] 0.6765908 0.6468184 0.32340921
[77,] 0.6194161 0.7611678 0.38058392
[78,] 0.5826161 0.8347678 0.41738390
[79,] 0.5163726 0.9672548 0.48362738
[80,] 0.4187886 0.8375772 0.58121139
[81,] 0.5458706 0.9082588 0.45412940
[82,] 0.4442333 0.8884666 0.55576672
[83,] 0.3350501 0.6701001 0.66494993
[84,] 0.3507977 0.7015955 0.64920227
[85,] 0.2828483 0.5656965 0.71715174
[86,] 0.8216777 0.3566446 0.17832231
> postscript(file="/var/www/html/rcomp/tmp/1e7jy1290172702.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> plot(x[,1], type='l', main='Actuals and Interpolation', ylab='value of Actuals and Interpolation (dots)', xlab='time or index')
> points(x[,1]-mysum$resid)
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/2ph0j1290172702.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> plot(mysum$resid, type='b', pch=19, main='Residuals', ylab='value of Residuals', xlab='time or index')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/3ph0j1290172702.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> hist(mysum$resid, main='Residual Histogram', xlab='values of Residuals')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/4ph0j1290172702.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> densityplot(~mysum$resid,col='black',main='Residual Density Plot', xlab='values of Residuals')
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/50qhm1290172702.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> qqnorm(mysum$resid, main='Residual Normal Q-Q Plot')
> qqline(mysum$resid)
> grid()
> dev.off()
null device
1
> (myerror <- as.ts(mysum$resid))
Time Series:
Start = 1
End = 111
Frequency = 1
1 2 3 4 5 6
1.76765449 1.01957159 0.08742228 -1.30097891 -1.87331686 -0.50899330
7 8 9 10 11 12
-0.83011928 -1.24428405 1.96693333 -4.22099453 -0.32678412 -0.49385476
13 14 15 16 17 18
-2.24428405 0.27550937 0.79727226 -2.25280081 1.91265731 1.26531484
19 20 21 22 23 24
-1.48784119 3.01205072 0.27968362 0.71359201 -5.01564384 -0.23859758
25 26 27 28 29 30
0.69414542 3.68156010 -0.85642096 -0.44796582 2.14989366 -1.87331686
31 32 33 34 35 36
2.30397621 -0.45044717 0.65614001 6.43510294 -4.48826201 -0.35387695
37 38 39 40 41 42
2.85569904 3.57233268 0.44304647 -3.26190394 -1.73545492 -5.65853670
43 44 45 46 47 48
0.07840202 -1.88775900 1.84745570 -0.88244184 1.14334587 -1.60795676
49 50 51 52 53 54
-0.36663984 -1.97775474 2.35398857 -0.84763485 2.07963977 -1.24613319
55 56 57 58 59 60
-1.74620171 -0.60618897 2.11755816 0.46822685 -0.38122613 -1.45589164
61 62 63 64 65 66
-0.56668583 3.35262039 -2.18596146 -2.29737480 0.89277963 0.15495219
67 68 69 70 71 72
-1.75707820 4.86512130 -0.16273884 0.29993073 -0.58314700 0.40012101
73 74 75 76 77 78
-3.61009128 0.69653975 0.88861520 -2.50935663 -0.33735818 1.06820749
79 80 81 82 83 84
0.34587107 1.24176523 -1.68349853 2.00558962 0.03054784 -1.85602407
85 86 87 88 89 90
-2.78071165 -3.39460378 -1.53726021 -2.44992065 0.43030845 3.17531909
91 92 93 94 95 96
2.35499604 0.63494725 3.55724497 1.83283151 -1.59987899 2.63494725
97 98 99 100 101 102
1.40515295 -1.72031638 1.09589741 2.17009073 -1.11729268 1.27730797
103 104 105 106 107 108
0.89436041 4.80977056 2.02109363 0.23512861 -2.79776325 -4.45271777
109 110 111
1.61340173 1.60456674 -0.39791460
> postscript(file="/var/www/html/rcomp/tmp/60qhm1290172702.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> dum <- cbind(lag(myerror,k=1),myerror)
> dum
Time Series:
Start = 0
End = 111
Frequency = 1
lag(myerror, k = 1) myerror
0 1.76765449 NA
1 1.01957159 1.76765449
2 0.08742228 1.01957159
3 -1.30097891 0.08742228
4 -1.87331686 -1.30097891
5 -0.50899330 -1.87331686
6 -0.83011928 -0.50899330
7 -1.24428405 -0.83011928
8 1.96693333 -1.24428405
9 -4.22099453 1.96693333
10 -0.32678412 -4.22099453
11 -0.49385476 -0.32678412
12 -2.24428405 -0.49385476
13 0.27550937 -2.24428405
14 0.79727226 0.27550937
15 -2.25280081 0.79727226
16 1.91265731 -2.25280081
17 1.26531484 1.91265731
18 -1.48784119 1.26531484
19 3.01205072 -1.48784119
20 0.27968362 3.01205072
21 0.71359201 0.27968362
22 -5.01564384 0.71359201
23 -0.23859758 -5.01564384
24 0.69414542 -0.23859758
25 3.68156010 0.69414542
26 -0.85642096 3.68156010
27 -0.44796582 -0.85642096
28 2.14989366 -0.44796582
29 -1.87331686 2.14989366
30 2.30397621 -1.87331686
31 -0.45044717 2.30397621
32 0.65614001 -0.45044717
33 6.43510294 0.65614001
34 -4.48826201 6.43510294
35 -0.35387695 -4.48826201
36 2.85569904 -0.35387695
37 3.57233268 2.85569904
38 0.44304647 3.57233268
39 -3.26190394 0.44304647
40 -1.73545492 -3.26190394
41 -5.65853670 -1.73545492
42 0.07840202 -5.65853670
43 -1.88775900 0.07840202
44 1.84745570 -1.88775900
45 -0.88244184 1.84745570
46 1.14334587 -0.88244184
47 -1.60795676 1.14334587
48 -0.36663984 -1.60795676
49 -1.97775474 -0.36663984
50 2.35398857 -1.97775474
51 -0.84763485 2.35398857
52 2.07963977 -0.84763485
53 -1.24613319 2.07963977
54 -1.74620171 -1.24613319
55 -0.60618897 -1.74620171
56 2.11755816 -0.60618897
57 0.46822685 2.11755816
58 -0.38122613 0.46822685
59 -1.45589164 -0.38122613
60 -0.56668583 -1.45589164
61 3.35262039 -0.56668583
62 -2.18596146 3.35262039
63 -2.29737480 -2.18596146
64 0.89277963 -2.29737480
65 0.15495219 0.89277963
66 -1.75707820 0.15495219
67 4.86512130 -1.75707820
68 -0.16273884 4.86512130
69 0.29993073 -0.16273884
70 -0.58314700 0.29993073
71 0.40012101 -0.58314700
72 -3.61009128 0.40012101
73 0.69653975 -3.61009128
74 0.88861520 0.69653975
75 -2.50935663 0.88861520
76 -0.33735818 -2.50935663
77 1.06820749 -0.33735818
78 0.34587107 1.06820749
79 1.24176523 0.34587107
80 -1.68349853 1.24176523
81 2.00558962 -1.68349853
82 0.03054784 2.00558962
83 -1.85602407 0.03054784
84 -2.78071165 -1.85602407
85 -3.39460378 -2.78071165
86 -1.53726021 -3.39460378
87 -2.44992065 -1.53726021
88 0.43030845 -2.44992065
89 3.17531909 0.43030845
90 2.35499604 3.17531909
91 0.63494725 2.35499604
92 3.55724497 0.63494725
93 1.83283151 3.55724497
94 -1.59987899 1.83283151
95 2.63494725 -1.59987899
96 1.40515295 2.63494725
97 -1.72031638 1.40515295
98 1.09589741 -1.72031638
99 2.17009073 1.09589741
100 -1.11729268 2.17009073
101 1.27730797 -1.11729268
102 0.89436041 1.27730797
103 4.80977056 0.89436041
104 2.02109363 4.80977056
105 0.23512861 2.02109363
106 -2.79776325 0.23512861
107 -4.45271777 -2.79776325
108 1.61340173 -4.45271777
109 1.60456674 1.61340173
110 -0.39791460 1.60456674
111 NA -0.39791460
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 1.01957159 1.76765449
[2,] 0.08742228 1.01957159
[3,] -1.30097891 0.08742228
[4,] -1.87331686 -1.30097891
[5,] -0.50899330 -1.87331686
[6,] -0.83011928 -0.50899330
[7,] -1.24428405 -0.83011928
[8,] 1.96693333 -1.24428405
[9,] -4.22099453 1.96693333
[10,] -0.32678412 -4.22099453
[11,] -0.49385476 -0.32678412
[12,] -2.24428405 -0.49385476
[13,] 0.27550937 -2.24428405
[14,] 0.79727226 0.27550937
[15,] -2.25280081 0.79727226
[16,] 1.91265731 -2.25280081
[17,] 1.26531484 1.91265731
[18,] -1.48784119 1.26531484
[19,] 3.01205072 -1.48784119
[20,] 0.27968362 3.01205072
[21,] 0.71359201 0.27968362
[22,] -5.01564384 0.71359201
[23,] -0.23859758 -5.01564384
[24,] 0.69414542 -0.23859758
[25,] 3.68156010 0.69414542
[26,] -0.85642096 3.68156010
[27,] -0.44796582 -0.85642096
[28,] 2.14989366 -0.44796582
[29,] -1.87331686 2.14989366
[30,] 2.30397621 -1.87331686
[31,] -0.45044717 2.30397621
[32,] 0.65614001 -0.45044717
[33,] 6.43510294 0.65614001
[34,] -4.48826201 6.43510294
[35,] -0.35387695 -4.48826201
[36,] 2.85569904 -0.35387695
[37,] 3.57233268 2.85569904
[38,] 0.44304647 3.57233268
[39,] -3.26190394 0.44304647
[40,] -1.73545492 -3.26190394
[41,] -5.65853670 -1.73545492
[42,] 0.07840202 -5.65853670
[43,] -1.88775900 0.07840202
[44,] 1.84745570 -1.88775900
[45,] -0.88244184 1.84745570
[46,] 1.14334587 -0.88244184
[47,] -1.60795676 1.14334587
[48,] -0.36663984 -1.60795676
[49,] -1.97775474 -0.36663984
[50,] 2.35398857 -1.97775474
[51,] -0.84763485 2.35398857
[52,] 2.07963977 -0.84763485
[53,] -1.24613319 2.07963977
[54,] -1.74620171 -1.24613319
[55,] -0.60618897 -1.74620171
[56,] 2.11755816 -0.60618897
[57,] 0.46822685 2.11755816
[58,] -0.38122613 0.46822685
[59,] -1.45589164 -0.38122613
[60,] -0.56668583 -1.45589164
[61,] 3.35262039 -0.56668583
[62,] -2.18596146 3.35262039
[63,] -2.29737480 -2.18596146
[64,] 0.89277963 -2.29737480
[65,] 0.15495219 0.89277963
[66,] -1.75707820 0.15495219
[67,] 4.86512130 -1.75707820
[68,] -0.16273884 4.86512130
[69,] 0.29993073 -0.16273884
[70,] -0.58314700 0.29993073
[71,] 0.40012101 -0.58314700
[72,] -3.61009128 0.40012101
[73,] 0.69653975 -3.61009128
[74,] 0.88861520 0.69653975
[75,] -2.50935663 0.88861520
[76,] -0.33735818 -2.50935663
[77,] 1.06820749 -0.33735818
[78,] 0.34587107 1.06820749
[79,] 1.24176523 0.34587107
[80,] -1.68349853 1.24176523
[81,] 2.00558962 -1.68349853
[82,] 0.03054784 2.00558962
[83,] -1.85602407 0.03054784
[84,] -2.78071165 -1.85602407
[85,] -3.39460378 -2.78071165
[86,] -1.53726021 -3.39460378
[87,] -2.44992065 -1.53726021
[88,] 0.43030845 -2.44992065
[89,] 3.17531909 0.43030845
[90,] 2.35499604 3.17531909
[91,] 0.63494725 2.35499604
[92,] 3.55724497 0.63494725
[93,] 1.83283151 3.55724497
[94,] -1.59987899 1.83283151
[95,] 2.63494725 -1.59987899
[96,] 1.40515295 2.63494725
[97,] -1.72031638 1.40515295
[98,] 1.09589741 -1.72031638
[99,] 2.17009073 1.09589741
[100,] -1.11729268 2.17009073
[101,] 1.27730797 -1.11729268
[102,] 0.89436041 1.27730797
[103,] 4.80977056 0.89436041
[104,] 2.02109363 4.80977056
[105,] 0.23512861 2.02109363
[106,] -2.79776325 0.23512861
[107,] -4.45271777 -2.79776325
[108,] 1.61340173 -4.45271777
[109,] 1.60456674 1.61340173
[110,] -0.39791460 1.60456674
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 1.01957159 1.76765449
2 0.08742228 1.01957159
3 -1.30097891 0.08742228
4 -1.87331686 -1.30097891
5 -0.50899330 -1.87331686
6 -0.83011928 -0.50899330
7 -1.24428405 -0.83011928
8 1.96693333 -1.24428405
9 -4.22099453 1.96693333
10 -0.32678412 -4.22099453
11 -0.49385476 -0.32678412
12 -2.24428405 -0.49385476
13 0.27550937 -2.24428405
14 0.79727226 0.27550937
15 -2.25280081 0.79727226
16 1.91265731 -2.25280081
17 1.26531484 1.91265731
18 -1.48784119 1.26531484
19 3.01205072 -1.48784119
20 0.27968362 3.01205072
21 0.71359201 0.27968362
22 -5.01564384 0.71359201
23 -0.23859758 -5.01564384
24 0.69414542 -0.23859758
25 3.68156010 0.69414542
26 -0.85642096 3.68156010
27 -0.44796582 -0.85642096
28 2.14989366 -0.44796582
29 -1.87331686 2.14989366
30 2.30397621 -1.87331686
31 -0.45044717 2.30397621
32 0.65614001 -0.45044717
33 6.43510294 0.65614001
34 -4.48826201 6.43510294
35 -0.35387695 -4.48826201
36 2.85569904 -0.35387695
37 3.57233268 2.85569904
38 0.44304647 3.57233268
39 -3.26190394 0.44304647
40 -1.73545492 -3.26190394
41 -5.65853670 -1.73545492
42 0.07840202 -5.65853670
43 -1.88775900 0.07840202
44 1.84745570 -1.88775900
45 -0.88244184 1.84745570
46 1.14334587 -0.88244184
47 -1.60795676 1.14334587
48 -0.36663984 -1.60795676
49 -1.97775474 -0.36663984
50 2.35398857 -1.97775474
51 -0.84763485 2.35398857
52 2.07963977 -0.84763485
53 -1.24613319 2.07963977
54 -1.74620171 -1.24613319
55 -0.60618897 -1.74620171
56 2.11755816 -0.60618897
57 0.46822685 2.11755816
58 -0.38122613 0.46822685
59 -1.45589164 -0.38122613
60 -0.56668583 -1.45589164
61 3.35262039 -0.56668583
62 -2.18596146 3.35262039
63 -2.29737480 -2.18596146
64 0.89277963 -2.29737480
65 0.15495219 0.89277963
66 -1.75707820 0.15495219
67 4.86512130 -1.75707820
68 -0.16273884 4.86512130
69 0.29993073 -0.16273884
70 -0.58314700 0.29993073
71 0.40012101 -0.58314700
72 -3.61009128 0.40012101
73 0.69653975 -3.61009128
74 0.88861520 0.69653975
75 -2.50935663 0.88861520
76 -0.33735818 -2.50935663
77 1.06820749 -0.33735818
78 0.34587107 1.06820749
79 1.24176523 0.34587107
80 -1.68349853 1.24176523
81 2.00558962 -1.68349853
82 0.03054784 2.00558962
83 -1.85602407 0.03054784
84 -2.78071165 -1.85602407
85 -3.39460378 -2.78071165
86 -1.53726021 -3.39460378
87 -2.44992065 -1.53726021
88 0.43030845 -2.44992065
89 3.17531909 0.43030845
90 2.35499604 3.17531909
91 0.63494725 2.35499604
92 3.55724497 0.63494725
93 1.83283151 3.55724497
94 -1.59987899 1.83283151
95 2.63494725 -1.59987899
96 1.40515295 2.63494725
97 -1.72031638 1.40515295
98 1.09589741 -1.72031638
99 2.17009073 1.09589741
100 -1.11729268 2.17009073
101 1.27730797 -1.11729268
102 0.89436041 1.27730797
103 4.80977056 0.89436041
104 2.02109363 4.80977056
105 0.23512861 2.02109363
106 -2.79776325 0.23512861
107 -4.45271777 -2.79776325
108 1.61340173 -4.45271777
109 1.60456674 1.61340173
110 -0.39791460 1.60456674
> 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/7shy71290172702.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> acf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Autocorrelation Function')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/8shy71290172702.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> pacf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Partial Autocorrelation Function')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/93qfr1290172702.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> opar <- par(mfrow = c(2,2), oma = c(0, 0, 1.1, 0))
> plot(mylm, las = 1, sub='Residual Diagnostics')
> par(opar)
> dev.off()
null device
1
> if (n > n25) {
+ postscript(file="/var/www/html/rcomp/tmp/103qfr1290172702.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
+ plot(kp3:nmkm3,gqarr[,2], main='Goldfeld-Quandt test',ylab='2-sided p-value',xlab='breakpoint')
+ grid()
+ dev.off()
+ }
null device
1
>
> #Note: the /var/www/html/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/www/html/rcomp/createtable")
>
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Estimated Regression Equation', 1, TRUE)
> a<-table.row.end(a)
> myeq <- colnames(x)[1]
> myeq <- paste(myeq, '[t] = ', sep='')
> for (i in 1:k){
+ if (mysum$coefficients[i,1] > 0) myeq <- paste(myeq, '+', '')
+ myeq <- paste(myeq, mysum$coefficients[i,1], sep=' ')
+ if (rownames(mysum$coefficients)[i] != '(Intercept)') {
+ myeq <- paste(myeq, rownames(mysum$coefficients)[i], sep='')
+ if (rownames(mysum$coefficients)[i] != 't') myeq <- paste(myeq, '[t]', sep='')
+ }
+ }
> myeq <- paste(myeq, ' + e[t]')
> a<-table.row.start(a)
> a<-table.element(a, myeq)
> a<-table.row.end(a)
> a<-table.end(a)
> table.save(a,file="/var/www/html/rcomp/tmp/1169wx1290172702.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/12arvl1290172702.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/13yssx1290172702.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/142t831290172702.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/155tp91290172702.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/169c5f1290172702.tab")
+ }
>
> try(system("convert tmp/1e7jy1290172702.ps tmp/1e7jy1290172702.png",intern=TRUE))
character(0)
> try(system("convert tmp/2ph0j1290172702.ps tmp/2ph0j1290172702.png",intern=TRUE))
character(0)
> try(system("convert tmp/3ph0j1290172702.ps tmp/3ph0j1290172702.png",intern=TRUE))
character(0)
> try(system("convert tmp/4ph0j1290172702.ps tmp/4ph0j1290172702.png",intern=TRUE))
character(0)
> try(system("convert tmp/50qhm1290172702.ps tmp/50qhm1290172702.png",intern=TRUE))
character(0)
> try(system("convert tmp/60qhm1290172702.ps tmp/60qhm1290172702.png",intern=TRUE))
character(0)
> try(system("convert tmp/7shy71290172702.ps tmp/7shy71290172702.png",intern=TRUE))
character(0)
> try(system("convert tmp/8shy71290172702.ps tmp/8shy71290172702.png",intern=TRUE))
character(0)
> try(system("convert tmp/93qfr1290172702.ps tmp/93qfr1290172702.png",intern=TRUE))
character(0)
> try(system("convert tmp/103qfr1290172702.ps tmp/103qfr1290172702.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
3.311 1.648 7.840