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(38
+ ,23
+ ,10
+ ,11
+ ,35
+ ,37
+ ,12
+ ,36
+ ,15
+ ,10
+ ,11
+ ,35
+ ,37
+ ,12
+ ,23
+ ,25
+ ,10
+ ,11
+ ,35
+ ,37
+ ,12
+ ,30
+ ,18
+ ,10
+ ,11
+ ,35
+ ,37
+ ,12
+ ,26
+ ,21
+ ,10
+ ,11
+ ,35
+ ,37
+ ,12
+ ,26
+ ,19
+ ,10
+ ,11
+ ,35
+ ,37
+ ,12
+ ,30
+ ,15
+ ,13
+ ,12
+ ,38
+ ,34
+ ,12
+ ,27
+ ,22
+ ,10
+ ,11
+ ,35
+ ,37
+ ,12
+ ,34
+ ,19
+ ,10
+ ,11
+ ,35
+ ,37
+ ,14
+ ,28
+ ,20
+ ,13
+ ,9
+ ,34
+ ,32
+ ,12
+ ,36
+ ,26
+ ,10
+ ,11
+ ,35
+ ,37
+ ,12
+ ,42
+ ,26
+ ,10
+ ,11
+ ,35
+ ,37
+ ,12
+ ,31
+ ,21
+ ,10
+ ,11
+ ,35
+ ,37
+ ,14
+ ,26
+ ,19
+ ,10
+ ,11
+ ,35
+ ,37
+ ,12
+ ,16
+ ,19
+ ,13
+ ,12
+ ,38
+ ,34
+ ,12
+ ,23
+ ,19
+ ,10
+ ,11
+ ,35
+ ,37
+ ,14
+ ,45
+ ,28
+ ,10
+ ,11
+ ,35
+ ,37
+ ,12
+ ,30
+ ,27
+ ,10
+ ,11
+ ,35
+ ,37
+ ,15
+ ,45
+ ,18
+ ,10
+ ,11
+ ,35
+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+ ,13
+ ,12
+ ,38
+ ,34
+ ,12
+ ,45
+ ,17
+ ,13
+ ,16
+ ,34
+ ,36
+ ,12
+ ,29
+ ,18
+ ,10
+ ,11
+ ,35
+ ,37
+ ,14
+ ,25
+ ,21
+ ,10
+ ,11
+ ,35
+ ,37
+ ,12
+ ,30
+ ,24
+ ,10
+ ,11
+ ,35
+ ,37
+ ,12
+ ,27
+ ,20
+ ,10
+ ,11
+ ,35
+ ,37
+ ,16
+ ,44
+ ,24
+ ,10
+ ,11
+ ,35
+ ,37
+ ,14
+ ,31
+ ,33
+ ,10
+ ,11
+ ,35
+ ,37
+ ,12
+ ,35
+ ,25
+ ,10
+ ,11
+ ,35
+ ,37
+ ,12
+ ,47
+ ,35
+ ,10
+ ,11
+ ,35
+ ,37
+ ,12)
+ ,dim=c(7
+ ,126)
+ ,dimnames=list(c('CM+D'
+ ,'PE+PC'
+ ,'happiness'
+ ,'depression'
+ ,'connected'
+ ,'separated'
+ ,'populariteit')
+ ,1:126))
> y <- array(NA,dim=c(7,126),dimnames=list(c('CM+D','PE+PC','happiness','depression','connected','separated','populariteit'),1:126))
> 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 = '3'
> #'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
happiness CM+D PE+PC depression connected separated populariteit
1 10 38 23 11 35 37 12
2 10 36 15 11 35 37 12
3 10 23 25 11 35 37 12
4 10 30 18 11 35 37 12
5 10 26 21 11 35 37 12
6 10 26 19 11 35 37 12
7 13 30 15 12 38 34 12
8 10 27 22 11 35 37 12
9 10 34 19 11 35 37 14
10 13 28 20 9 34 32 12
11 10 36 26 11 35 37 12
12 10 42 26 11 35 37 12
13 10 31 21 11 35 37 14
14 10 26 19 11 35 37 12
15 13 16 19 12 38 34 12
16 10 23 19 11 35 37 14
17 10 45 28 11 35 37 12
18 10 30 27 11 35 37 15
19 10 45 18 11 35 37 12
20 10 30 19 11 35 37 15
21 10 24 24 11 35 37 12
22 13 29 21 12 38 34 12
23 13 30 22 9 34 32 12
24 10 31 25 11 35 37 14
25 10 34 15 11 35 37 14
26 10 41 34 11 35 37 12
27 10 37 23 11 35 37 12
28 10 33 19 11 35 37 12
29 10 48 15 11 35 37 14
30 10 44 15 11 35 37 15
31 10 29 17 11 35 37 14
32 13 44 30 9 34 32 12
33 10 43 28 11 35 37 14
34 10 31 23 11 35 37 14
35 10 28 23 11 35 37 12
36 10 26 21 11 35 37 14
37 10 30 18 11 35 37 12
38 15 27 19 11 33 36 12
39 10 34 24 11 35 37 12
40 10 47 15 11 35 37 12
41 13 37 24 16 34 36 12
42 10 27 20 11 35 37 12
43 10 30 20 11 35 37 12
44 10 36 44 11 35 37 14
45 10 39 20 11 35 37 12
46 10 32 20 11 35 37 12
47 10 25 20 11 35 37 12
48 10 19 11 11 35 37 12
49 10 29 21 11 35 37 12
50 13 26 21 9 34 32 12
51 13 31 19 12 38 34 12
52 10 31 21 11 35 37 12
53 10 31 17 11 35 37 15
54 10 39 19 11 35 37 12
55 10 28 21 11 35 37 12
56 10 22 16 11 35 37 12
57 10 31 19 11 35 37 12
58 10 36 19 11 35 37 14
59 10 28 16 11 35 37 12
60 10 39 24 11 35 37 12
61 10 35 21 11 35 37 12
62 10 33 20 11 35 37 12
63 10 27 19 11 35 37 12
64 10 33 23 11 35 37 12
65 10 31 18 11 35 37 12
66 10 39 19 11 35 37 14
67 10 37 23 11 35 37 14
68 10 24 19 11 35 37 15
69 13 28 26 12 38 34 12
70 13 37 13 12 38 34 12
71 10 32 23 11 35 37 14
72 13 31 16 12 38 34 12
73 13 29 17 12 38 34 12
74 10 40 30 11 35 37 12
75 10 40 22 11 35 37 14
76 10 15 14 11 35 37 12
77 13 27 14 9 34 32 12
78 13 32 21 9 34 32 12
79 10 28 21 11 35 37 12
80 10 41 33 11 35 37 14
81 10 47 23 11 35 37 12
82 10 42 30 11 35 37 12
83 11 32 21 17 36 35 12
84 10 33 25 11 35 37 15
85 10 29 29 11 35 37 12
86 10 37 21 11 35 37 14
87 10 39 16 11 35 37 15
88 10 29 17 11 35 37 12
89 10 33 23 11 35 37 12
90 13 31 18 9 34 32 12
91 10 21 19 11 35 37 15
92 10 36 28 11 35 37 14
93 10 32 29 11 35 37 14
94 10 15 19 11 35 37 12
95 13 25 25 9 34 32 12
96 10 28 15 11 35 37 12
97 10 39 24 11 35 37 12
98 13 31 12 9 34 32 12
99 10 40 11 11 35 37 12
100 10 25 19 11 35 37 12
101 10 36 25 11 35 37 14
102 10 23 12 11 35 37 14
103 10 39 15 11 35 37 12
104 10 31 25 11 35 37 14
105 10 23 14 11 35 37 12
106 10 31 19 11 35 37 14
107 13 28 23 9 34 32 12
108 13 47 19 9 34 32 12
109 10 25 20 11 35 37 15
110 13 26 16 9 34 32 12
111 12 24 13 18 32 35 12
112 10 30 22 11 35 37 15
113 13 25 21 16 34 36 12
114 15 44 18 13 34 31 12
115 10 38 44 11 35 37 15
116 10 36 12 11 35 37 12
117 13 34 28 12 38 34 12
118 13 45 17 16 34 36 12
119 10 29 18 11 35 37 14
120 10 25 21 11 35 37 12
121 10 30 24 11 35 37 12
122 10 27 20 11 35 37 16
123 10 44 24 11 35 37 14
124 10 31 33 11 35 37 12
125 10 35 25 11 35 37 12
126 10 47 35 11 35 37 12
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) `CM+D` `PE+PC` depression connected
32.7257088 -0.0011688 -0.0006239 0.2575914 0.0551379
separated populariteit
-0.7293139 -0.0312671
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-2.138036 -0.084528 -0.069566 -0.006447 4.295148
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 32.7257088 1.9346933 16.915 < 2e-16 ***
`CM+D` -0.0011688 0.0065104 -0.180 0.858
`PE+PC` -0.0006239 0.0082624 -0.076 0.940
depression 0.2575914 0.0344342 7.481 1.39e-11 ***
connected 0.0551379 0.0471942 1.168 0.245
separated -0.7293139 0.0285189 -25.573 < 2e-16 ***
populariteit -0.0312671 0.0418162 -0.748 0.456
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 0.4916 on 119 degrees of freedom
Multiple R-squared: 0.8654, Adjusted R-squared: 0.8586
F-statistic: 127.5 on 6 and 119 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,] 8.830131e-43 1.766026e-42 1.000000e+00
[2,] 1.084656e-58 2.169312e-58 1.000000e+00
[3,] 1.096592e-69 2.193183e-69 1.000000e+00
[4,] 2.984559e-79 5.969118e-79 1.000000e+00
[5,] 5.108048e-95 1.021610e-94 1.000000e+00
[6,] 5.994344e-110 1.198869e-109 1.000000e+00
[7,] 5.660250e-132 1.132050e-131 1.000000e+00
[8,] 2.013215e-148 4.026430e-148 1.000000e+00
[9,] 1.547334e-148 3.094668e-148 1.000000e+00
[10,] 1.031390e-157 2.062781e-157 1.000000e+00
[11,] 3.883787e-179 7.767574e-179 1.000000e+00
[12,] 2.794284e-183 5.588569e-183 1.000000e+00
[13,] 1.168923e-196 2.337846e-196 1.000000e+00
[14,] 1.812492e-211 3.624985e-211 1.000000e+00
[15,] 2.691615e-230 5.383230e-230 1.000000e+00
[16,] 5.912564e-250 1.182513e-249 1.000000e+00
[17,] 1.874320e-250 3.748639e-250 1.000000e+00
[18,] 2.884423e-258 5.768846e-258 1.000000e+00
[19,] 9.102352e-276 1.820470e-275 1.000000e+00
[20,] 1.098480e-290 2.196960e-290 1.000000e+00
[21,] 3.559176e-302 7.118352e-302 1.000000e+00
[22,] 2.281963e-305 4.563926e-305 1.000000e+00
[23,] 9.828398e-319 1.965680e-318 1.000000e+00
[24,] 0.000000e+00 0.000000e+00 1.000000e+00
[25,] 0.000000e+00 0.000000e+00 1.000000e+00
[26,] 0.000000e+00 0.000000e+00 1.000000e+00
[27,] 0.000000e+00 0.000000e+00 1.000000e+00
[28,] 0.000000e+00 0.000000e+00 1.000000e+00
[29,] 0.000000e+00 0.000000e+00 1.000000e+00
[30,] 0.000000e+00 0.000000e+00 1.000000e+00
[31,] 0.000000e+00 0.000000e+00 1.000000e+00
[32,] 9.999999e-01 1.509854e-07 7.549270e-08
[33,] 9.999999e-01 2.849871e-07 1.424935e-07
[34,] 9.999997e-01 5.528574e-07 2.764287e-07
[35,] 9.999996e-01 8.671348e-07 4.335674e-07
[36,] 9.999991e-01 1.713052e-06 8.565262e-07
[37,] 9.999984e-01 3.253525e-06 1.626763e-06
[38,] 9.999971e-01 5.764301e-06 2.882150e-06
[39,] 9.999956e-01 8.793916e-06 4.396958e-06
[40,] 9.999920e-01 1.602481e-05 8.012406e-06
[41,] 9.999892e-01 2.164336e-05 1.082168e-05
[42,] 9.999860e-01 2.798846e-05 1.399423e-05
[43,] 9.999751e-01 4.974478e-05 2.487239e-05
[44,] 9.999561e-01 8.789602e-05 4.394801e-05
[45,] 9.999243e-01 1.513121e-04 7.565607e-05
[46,] 9.998731e-01 2.538036e-04 1.269018e-04
[47,] 9.997983e-01 4.033624e-04 2.016812e-04
[48,] 9.996703e-01 6.594931e-04 3.297465e-04
[49,] 9.994642e-01 1.071647e-03 5.358233e-04
[50,] 9.991621e-01 1.675792e-03 8.378959e-04
[51,] 9.986876e-01 2.624837e-03 1.312419e-03
[52,] 9.979771e-01 4.045829e-03 2.022914e-03
[53,] 9.969372e-01 6.125513e-03 3.062756e-03
[54,] 9.954727e-01 9.054585e-03 4.527292e-03
[55,] 9.933378e-01 1.332438e-02 6.662189e-03
[56,] 9.904137e-01 1.917251e-02 9.586255e-03
[57,] 9.863650e-01 2.726997e-02 1.363498e-02
[58,] 9.808677e-01 3.826451e-02 1.913225e-02
[59,] 9.736986e-01 5.260271e-02 2.630136e-02
[60,] 9.693732e-01 6.125360e-02 3.062680e-02
[61,] 9.622233e-01 7.555348e-02 3.777674e-02
[62,] 9.494132e-01 1.011736e-01 5.058678e-02
[63,] 9.411345e-01 1.177310e-01 5.886552e-02
[64,] 9.414922e-01 1.170155e-01 5.850777e-02
[65,] 9.240480e-01 1.519040e-01 7.595202e-02
[66,] 9.024515e-01 1.950970e-01 9.754850e-02
[67,] 8.797901e-01 2.404199e-01 1.202099e-01
[68,] 8.586655e-01 2.826691e-01 1.413345e-01
[69,] 8.293806e-01 3.412388e-01 1.706194e-01
[70,] 7.914982e-01 4.170036e-01 2.085018e-01
[71,] 7.499991e-01 5.000017e-01 2.500009e-01
[72,] 7.068729e-01 5.862542e-01 2.931271e-01
[73,] 6.590744e-01 6.818512e-01 3.409256e-01
[74,] 9.999974e-01 5.249390e-06 2.624695e-06
[75,] 9.999944e-01 1.120699e-05 5.603497e-06
[76,] 9.999883e-01 2.339948e-05 1.169974e-05
[77,] 9.999762e-01 4.768058e-05 2.384029e-05
[78,] 9.999525e-01 9.490559e-05 4.745280e-05
[79,] 9.999073e-01 1.854957e-04 9.274784e-05
[80,] 9.998224e-01 3.551406e-04 1.775703e-04
[81,] 9.996831e-01 6.337442e-04 3.168721e-04
[82,] 9.994204e-01 1.159104e-03 5.795521e-04
[83,] 9.989507e-01 2.098537e-03 1.049269e-03
[84,] 9.981340e-01 3.732051e-03 1.866026e-03
[85,] 9.968446e-01 6.310763e-03 3.155382e-03
[86,] 9.950418e-01 9.916484e-03 4.958242e-03
[87,] 9.917562e-01 1.648763e-02 8.243813e-03
[88,] 9.868236e-01 2.635285e-02 1.317642e-02
[89,] 9.799266e-01 4.014684e-02 2.007342e-02
[90,] 9.699975e-01 6.000504e-02 3.000252e-02
[91,] 9.543545e-01 9.129090e-02 4.564545e-02
[92,] 9.325156e-01 1.349688e-01 6.748438e-02
[93,] 9.026742e-01 1.946516e-01 9.732578e-02
[94,] 8.676343e-01 2.647315e-01 1.323657e-01
[95,] 8.178116e-01 3.643768e-01 1.821884e-01
[96,] 7.568049e-01 4.863902e-01 2.431951e-01
[97,] 6.842071e-01 6.315859e-01 3.157929e-01
[98,] 6.220935e-01 7.558129e-01 3.779065e-01
[99,] 5.329572e-01 9.340857e-01 4.670428e-01
[100,] 4.403383e-01 8.806766e-01 5.596617e-01
[101,] 4.388126e-01 8.776251e-01 5.611874e-01
[102,] 1.000000e+00 3.729514e-109 1.864757e-109
[103,] 1.000000e+00 4.037366e-104 2.018683e-104
[104,] 1.000000e+00 2.098563e-90 1.049281e-90
[105,] 1.000000e+00 6.319326e-72 3.159663e-72
[106,] 1.000000e+00 2.320623e-56 1.160311e-56
[107,] 1.000000e+00 7.371557e-46 3.685778e-46
> postscript(file="/var/www/html/rcomp/tmp/1o43q1290258579.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/2o43q1290258579.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/3hv3b1290258579.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/4hv3b1290258579.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/5hv3b1290258579.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 = 126
Frequency = 1
1 2 3 4 5
-0.0704619565 -0.0777903056 -0.0867455024 -0.0829312407 -0.0857346748
6 7 8 9 10
-0.0869823868 0.3042504381 -0.0839420683 -0.0150981598 -0.1602695626
11 12 13 14 15
-0.0709278895 -0.0639153863 -0.0173566993 -0.0869823868 0.2903833547
16 17 18 19 20
-0.0279544156 -0.0591614227 0.0164847976 -0.0653999828 0.0114939496
21 22 23 24 25
-0.0862006079 0.3068248236 -0.1566843496 -0.0148612753 -0.0175935838
26 27 28 29 30
-0.0600932888 -0.0716307070 -0.0788011331 -0.0012310764 0.0253610329
31 32 33 34 35
-0.0221896244 -0.1353309941 0.0010352991 -0.0161089873 -0.0821494618
36 37 38 39 40
-0.0232004520 -0.0829312407 4.2951483164 -0.0745131026 -0.0649340498
41 42 43 44 45
0.9668600022 -0.0851897803 -0.0816835287 0.0028357415 -0.0711647740
46 47 48 49 50
-0.0793460277 -0.0875272814 -0.1001544886 -0.0822284232 -0.1619832077
51 52 53 54 55
0.3079146126 -0.0798909222 0.0114149881 -0.0717886300 -0.0833971738
56 57 58 59 60
-0.0935289570 -0.0811386342 -0.0127606587 -0.0865164538 -0.0686693499
61 62 63 64 65
-0.0752159201 -0.0781772771 -0.0858136363 -0.0763057091 -0.0817624902
66 67 68 69 70
-0.0092544071 -0.0090964841 0.0044814464 0.3087753531 0.3111839797
71 72 73 74 75
-0.0149402368 0.3060430446 0.3043293995 -0.0637574634 -0.0062140886
76 77 78 79 80
-0.1029579227 -0.1651814492 -0.1549707045 -0.0833971738 0.0018170781
81 82 83 84 85
-0.0599432017 -0.0614199623 -2.1380364365 0.0187433372 -0.0772375752
86 87 88 89 90
-0.0103441962 0.0201411363 -0.0847238473 -0.0763057091 -0.1580110231
91 92 93 94 95
0.0009751948 -0.0071459546 -0.0111971007 -0.0998386427 -0.1606565342
96 97 98 99 100
-0.0871403098 -0.0686693499 -0.1617541591 -0.0756107275 -0.0881511374
101 102 103 104 105
-0.0090175227 -0.0323214076 -0.0742840540 -0.0148612753 -0.0936079185
106 107 108 109 110
-0.0186044113 -0.1583979946 -0.1386871586 0.0062740529 -0.1651024877
111 112 113 114 115
-1.1894170946 0.0133655176 0.9509634279 0.0975031172 0.0364403540
116 117 118 119 120
-0.0796618736 0.3170355683 0.9718430144 -0.0215657684 -0.0869034254
121 122 123 124 125
-0.0791881047 0.0398786654 -0.0002913744 -0.0724046501 -0.0727204960
126
-0.0524569296
> postscript(file="/var/www/html/rcomp/tmp/6s42e1290258579.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 = 126
Frequency = 1
lag(myerror, k = 1) myerror
0 -0.0704619565 NA
1 -0.0777903056 -0.0704619565
2 -0.0867455024 -0.0777903056
3 -0.0829312407 -0.0867455024
4 -0.0857346748 -0.0829312407
5 -0.0869823868 -0.0857346748
6 0.3042504381 -0.0869823868
7 -0.0839420683 0.3042504381
8 -0.0150981598 -0.0839420683
9 -0.1602695626 -0.0150981598
10 -0.0709278895 -0.1602695626
11 -0.0639153863 -0.0709278895
12 -0.0173566993 -0.0639153863
13 -0.0869823868 -0.0173566993
14 0.2903833547 -0.0869823868
15 -0.0279544156 0.2903833547
16 -0.0591614227 -0.0279544156
17 0.0164847976 -0.0591614227
18 -0.0653999828 0.0164847976
19 0.0114939496 -0.0653999828
20 -0.0862006079 0.0114939496
21 0.3068248236 -0.0862006079
22 -0.1566843496 0.3068248236
23 -0.0148612753 -0.1566843496
24 -0.0175935838 -0.0148612753
25 -0.0600932888 -0.0175935838
26 -0.0716307070 -0.0600932888
27 -0.0788011331 -0.0716307070
28 -0.0012310764 -0.0788011331
29 0.0253610329 -0.0012310764
30 -0.0221896244 0.0253610329
31 -0.1353309941 -0.0221896244
32 0.0010352991 -0.1353309941
33 -0.0161089873 0.0010352991
34 -0.0821494618 -0.0161089873
35 -0.0232004520 -0.0821494618
36 -0.0829312407 -0.0232004520
37 4.2951483164 -0.0829312407
38 -0.0745131026 4.2951483164
39 -0.0649340498 -0.0745131026
40 0.9668600022 -0.0649340498
41 -0.0851897803 0.9668600022
42 -0.0816835287 -0.0851897803
43 0.0028357415 -0.0816835287
44 -0.0711647740 0.0028357415
45 -0.0793460277 -0.0711647740
46 -0.0875272814 -0.0793460277
47 -0.1001544886 -0.0875272814
48 -0.0822284232 -0.1001544886
49 -0.1619832077 -0.0822284232
50 0.3079146126 -0.1619832077
51 -0.0798909222 0.3079146126
52 0.0114149881 -0.0798909222
53 -0.0717886300 0.0114149881
54 -0.0833971738 -0.0717886300
55 -0.0935289570 -0.0833971738
56 -0.0811386342 -0.0935289570
57 -0.0127606587 -0.0811386342
58 -0.0865164538 -0.0127606587
59 -0.0686693499 -0.0865164538
60 -0.0752159201 -0.0686693499
61 -0.0781772771 -0.0752159201
62 -0.0858136363 -0.0781772771
63 -0.0763057091 -0.0858136363
64 -0.0817624902 -0.0763057091
65 -0.0092544071 -0.0817624902
66 -0.0090964841 -0.0092544071
67 0.0044814464 -0.0090964841
68 0.3087753531 0.0044814464
69 0.3111839797 0.3087753531
70 -0.0149402368 0.3111839797
71 0.3060430446 -0.0149402368
72 0.3043293995 0.3060430446
73 -0.0637574634 0.3043293995
74 -0.0062140886 -0.0637574634
75 -0.1029579227 -0.0062140886
76 -0.1651814492 -0.1029579227
77 -0.1549707045 -0.1651814492
78 -0.0833971738 -0.1549707045
79 0.0018170781 -0.0833971738
80 -0.0599432017 0.0018170781
81 -0.0614199623 -0.0599432017
82 -2.1380364365 -0.0614199623
83 0.0187433372 -2.1380364365
84 -0.0772375752 0.0187433372
85 -0.0103441962 -0.0772375752
86 0.0201411363 -0.0103441962
87 -0.0847238473 0.0201411363
88 -0.0763057091 -0.0847238473
89 -0.1580110231 -0.0763057091
90 0.0009751948 -0.1580110231
91 -0.0071459546 0.0009751948
92 -0.0111971007 -0.0071459546
93 -0.0998386427 -0.0111971007
94 -0.1606565342 -0.0998386427
95 -0.0871403098 -0.1606565342
96 -0.0686693499 -0.0871403098
97 -0.1617541591 -0.0686693499
98 -0.0756107275 -0.1617541591
99 -0.0881511374 -0.0756107275
100 -0.0090175227 -0.0881511374
101 -0.0323214076 -0.0090175227
102 -0.0742840540 -0.0323214076
103 -0.0148612753 -0.0742840540
104 -0.0936079185 -0.0148612753
105 -0.0186044113 -0.0936079185
106 -0.1583979946 -0.0186044113
107 -0.1386871586 -0.1583979946
108 0.0062740529 -0.1386871586
109 -0.1651024877 0.0062740529
110 -1.1894170946 -0.1651024877
111 0.0133655176 -1.1894170946
112 0.9509634279 0.0133655176
113 0.0975031172 0.9509634279
114 0.0364403540 0.0975031172
115 -0.0796618736 0.0364403540
116 0.3170355683 -0.0796618736
117 0.9718430144 0.3170355683
118 -0.0215657684 0.9718430144
119 -0.0869034254 -0.0215657684
120 -0.0791881047 -0.0869034254
121 0.0398786654 -0.0791881047
122 -0.0002913744 0.0398786654
123 -0.0724046501 -0.0002913744
124 -0.0727204960 -0.0724046501
125 -0.0524569296 -0.0727204960
126 NA -0.0524569296
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -0.0777903056 -0.0704619565
[2,] -0.0867455024 -0.0777903056
[3,] -0.0829312407 -0.0867455024
[4,] -0.0857346748 -0.0829312407
[5,] -0.0869823868 -0.0857346748
[6,] 0.3042504381 -0.0869823868
[7,] -0.0839420683 0.3042504381
[8,] -0.0150981598 -0.0839420683
[9,] -0.1602695626 -0.0150981598
[10,] -0.0709278895 -0.1602695626
[11,] -0.0639153863 -0.0709278895
[12,] -0.0173566993 -0.0639153863
[13,] -0.0869823868 -0.0173566993
[14,] 0.2903833547 -0.0869823868
[15,] -0.0279544156 0.2903833547
[16,] -0.0591614227 -0.0279544156
[17,] 0.0164847976 -0.0591614227
[18,] -0.0653999828 0.0164847976
[19,] 0.0114939496 -0.0653999828
[20,] -0.0862006079 0.0114939496
[21,] 0.3068248236 -0.0862006079
[22,] -0.1566843496 0.3068248236
[23,] -0.0148612753 -0.1566843496
[24,] -0.0175935838 -0.0148612753
[25,] -0.0600932888 -0.0175935838
[26,] -0.0716307070 -0.0600932888
[27,] -0.0788011331 -0.0716307070
[28,] -0.0012310764 -0.0788011331
[29,] 0.0253610329 -0.0012310764
[30,] -0.0221896244 0.0253610329
[31,] -0.1353309941 -0.0221896244
[32,] 0.0010352991 -0.1353309941
[33,] -0.0161089873 0.0010352991
[34,] -0.0821494618 -0.0161089873
[35,] -0.0232004520 -0.0821494618
[36,] -0.0829312407 -0.0232004520
[37,] 4.2951483164 -0.0829312407
[38,] -0.0745131026 4.2951483164
[39,] -0.0649340498 -0.0745131026
[40,] 0.9668600022 -0.0649340498
[41,] -0.0851897803 0.9668600022
[42,] -0.0816835287 -0.0851897803
[43,] 0.0028357415 -0.0816835287
[44,] -0.0711647740 0.0028357415
[45,] -0.0793460277 -0.0711647740
[46,] -0.0875272814 -0.0793460277
[47,] -0.1001544886 -0.0875272814
[48,] -0.0822284232 -0.1001544886
[49,] -0.1619832077 -0.0822284232
[50,] 0.3079146126 -0.1619832077
[51,] -0.0798909222 0.3079146126
[52,] 0.0114149881 -0.0798909222
[53,] -0.0717886300 0.0114149881
[54,] -0.0833971738 -0.0717886300
[55,] -0.0935289570 -0.0833971738
[56,] -0.0811386342 -0.0935289570
[57,] -0.0127606587 -0.0811386342
[58,] -0.0865164538 -0.0127606587
[59,] -0.0686693499 -0.0865164538
[60,] -0.0752159201 -0.0686693499
[61,] -0.0781772771 -0.0752159201
[62,] -0.0858136363 -0.0781772771
[63,] -0.0763057091 -0.0858136363
[64,] -0.0817624902 -0.0763057091
[65,] -0.0092544071 -0.0817624902
[66,] -0.0090964841 -0.0092544071
[67,] 0.0044814464 -0.0090964841
[68,] 0.3087753531 0.0044814464
[69,] 0.3111839797 0.3087753531
[70,] -0.0149402368 0.3111839797
[71,] 0.3060430446 -0.0149402368
[72,] 0.3043293995 0.3060430446
[73,] -0.0637574634 0.3043293995
[74,] -0.0062140886 -0.0637574634
[75,] -0.1029579227 -0.0062140886
[76,] -0.1651814492 -0.1029579227
[77,] -0.1549707045 -0.1651814492
[78,] -0.0833971738 -0.1549707045
[79,] 0.0018170781 -0.0833971738
[80,] -0.0599432017 0.0018170781
[81,] -0.0614199623 -0.0599432017
[82,] -2.1380364365 -0.0614199623
[83,] 0.0187433372 -2.1380364365
[84,] -0.0772375752 0.0187433372
[85,] -0.0103441962 -0.0772375752
[86,] 0.0201411363 -0.0103441962
[87,] -0.0847238473 0.0201411363
[88,] -0.0763057091 -0.0847238473
[89,] -0.1580110231 -0.0763057091
[90,] 0.0009751948 -0.1580110231
[91,] -0.0071459546 0.0009751948
[92,] -0.0111971007 -0.0071459546
[93,] -0.0998386427 -0.0111971007
[94,] -0.1606565342 -0.0998386427
[95,] -0.0871403098 -0.1606565342
[96,] -0.0686693499 -0.0871403098
[97,] -0.1617541591 -0.0686693499
[98,] -0.0756107275 -0.1617541591
[99,] -0.0881511374 -0.0756107275
[100,] -0.0090175227 -0.0881511374
[101,] -0.0323214076 -0.0090175227
[102,] -0.0742840540 -0.0323214076
[103,] -0.0148612753 -0.0742840540
[104,] -0.0936079185 -0.0148612753
[105,] -0.0186044113 -0.0936079185
[106,] -0.1583979946 -0.0186044113
[107,] -0.1386871586 -0.1583979946
[108,] 0.0062740529 -0.1386871586
[109,] -0.1651024877 0.0062740529
[110,] -1.1894170946 -0.1651024877
[111,] 0.0133655176 -1.1894170946
[112,] 0.9509634279 0.0133655176
[113,] 0.0975031172 0.9509634279
[114,] 0.0364403540 0.0975031172
[115,] -0.0796618736 0.0364403540
[116,] 0.3170355683 -0.0796618736
[117,] 0.9718430144 0.3170355683
[118,] -0.0215657684 0.9718430144
[119,] -0.0869034254 -0.0215657684
[120,] -0.0791881047 -0.0869034254
[121,] 0.0398786654 -0.0791881047
[122,] -0.0002913744 0.0398786654
[123,] -0.0724046501 -0.0002913744
[124,] -0.0727204960 -0.0724046501
[125,] -0.0524569296 -0.0727204960
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -0.0777903056 -0.0704619565
2 -0.0867455024 -0.0777903056
3 -0.0829312407 -0.0867455024
4 -0.0857346748 -0.0829312407
5 -0.0869823868 -0.0857346748
6 0.3042504381 -0.0869823868
7 -0.0839420683 0.3042504381
8 -0.0150981598 -0.0839420683
9 -0.1602695626 -0.0150981598
10 -0.0709278895 -0.1602695626
11 -0.0639153863 -0.0709278895
12 -0.0173566993 -0.0639153863
13 -0.0869823868 -0.0173566993
14 0.2903833547 -0.0869823868
15 -0.0279544156 0.2903833547
16 -0.0591614227 -0.0279544156
17 0.0164847976 -0.0591614227
18 -0.0653999828 0.0164847976
19 0.0114939496 -0.0653999828
20 -0.0862006079 0.0114939496
21 0.3068248236 -0.0862006079
22 -0.1566843496 0.3068248236
23 -0.0148612753 -0.1566843496
24 -0.0175935838 -0.0148612753
25 -0.0600932888 -0.0175935838
26 -0.0716307070 -0.0600932888
27 -0.0788011331 -0.0716307070
28 -0.0012310764 -0.0788011331
29 0.0253610329 -0.0012310764
30 -0.0221896244 0.0253610329
31 -0.1353309941 -0.0221896244
32 0.0010352991 -0.1353309941
33 -0.0161089873 0.0010352991
34 -0.0821494618 -0.0161089873
35 -0.0232004520 -0.0821494618
36 -0.0829312407 -0.0232004520
37 4.2951483164 -0.0829312407
38 -0.0745131026 4.2951483164
39 -0.0649340498 -0.0745131026
40 0.9668600022 -0.0649340498
41 -0.0851897803 0.9668600022
42 -0.0816835287 -0.0851897803
43 0.0028357415 -0.0816835287
44 -0.0711647740 0.0028357415
45 -0.0793460277 -0.0711647740
46 -0.0875272814 -0.0793460277
47 -0.1001544886 -0.0875272814
48 -0.0822284232 -0.1001544886
49 -0.1619832077 -0.0822284232
50 0.3079146126 -0.1619832077
51 -0.0798909222 0.3079146126
52 0.0114149881 -0.0798909222
53 -0.0717886300 0.0114149881
54 -0.0833971738 -0.0717886300
55 -0.0935289570 -0.0833971738
56 -0.0811386342 -0.0935289570
57 -0.0127606587 -0.0811386342
58 -0.0865164538 -0.0127606587
59 -0.0686693499 -0.0865164538
60 -0.0752159201 -0.0686693499
61 -0.0781772771 -0.0752159201
62 -0.0858136363 -0.0781772771
63 -0.0763057091 -0.0858136363
64 -0.0817624902 -0.0763057091
65 -0.0092544071 -0.0817624902
66 -0.0090964841 -0.0092544071
67 0.0044814464 -0.0090964841
68 0.3087753531 0.0044814464
69 0.3111839797 0.3087753531
70 -0.0149402368 0.3111839797
71 0.3060430446 -0.0149402368
72 0.3043293995 0.3060430446
73 -0.0637574634 0.3043293995
74 -0.0062140886 -0.0637574634
75 -0.1029579227 -0.0062140886
76 -0.1651814492 -0.1029579227
77 -0.1549707045 -0.1651814492
78 -0.0833971738 -0.1549707045
79 0.0018170781 -0.0833971738
80 -0.0599432017 0.0018170781
81 -0.0614199623 -0.0599432017
82 -2.1380364365 -0.0614199623
83 0.0187433372 -2.1380364365
84 -0.0772375752 0.0187433372
85 -0.0103441962 -0.0772375752
86 0.0201411363 -0.0103441962
87 -0.0847238473 0.0201411363
88 -0.0763057091 -0.0847238473
89 -0.1580110231 -0.0763057091
90 0.0009751948 -0.1580110231
91 -0.0071459546 0.0009751948
92 -0.0111971007 -0.0071459546
93 -0.0998386427 -0.0111971007
94 -0.1606565342 -0.0998386427
95 -0.0871403098 -0.1606565342
96 -0.0686693499 -0.0871403098
97 -0.1617541591 -0.0686693499
98 -0.0756107275 -0.1617541591
99 -0.0881511374 -0.0756107275
100 -0.0090175227 -0.0881511374
101 -0.0323214076 -0.0090175227
102 -0.0742840540 -0.0323214076
103 -0.0148612753 -0.0742840540
104 -0.0936079185 -0.0148612753
105 -0.0186044113 -0.0936079185
106 -0.1583979946 -0.0186044113
107 -0.1386871586 -0.1583979946
108 0.0062740529 -0.1386871586
109 -0.1651024877 0.0062740529
110 -1.1894170946 -0.1651024877
111 0.0133655176 -1.1894170946
112 0.9509634279 0.0133655176
113 0.0975031172 0.9509634279
114 0.0364403540 0.0975031172
115 -0.0796618736 0.0364403540
116 0.3170355683 -0.0796618736
117 0.9718430144 0.3170355683
118 -0.0215657684 0.9718430144
119 -0.0869034254 -0.0215657684
120 -0.0791881047 -0.0869034254
121 0.0398786654 -0.0791881047
122 -0.0002913744 0.0398786654
123 -0.0724046501 -0.0002913744
124 -0.0727204960 -0.0724046501
125 -0.0524569296 -0.0727204960
> 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/72e1h1290258579.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/82e1h1290258579.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/92e1h1290258579.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/10vnj31290258579.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/11zoh81290258579.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/12kofe1290258579.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/13gyv51290258579.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/14jyct1290258579.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/15u8be1290258579.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/16qhr41290258579.tab")
+ }
>
> try(system("convert tmp/1o43q1290258579.ps tmp/1o43q1290258579.png",intern=TRUE))
character(0)
> try(system("convert tmp/2o43q1290258579.ps tmp/2o43q1290258579.png",intern=TRUE))
character(0)
> try(system("convert tmp/3hv3b1290258579.ps tmp/3hv3b1290258579.png",intern=TRUE))
character(0)
> try(system("convert tmp/4hv3b1290258579.ps tmp/4hv3b1290258579.png",intern=TRUE))
character(0)
> try(system("convert tmp/5hv3b1290258579.ps tmp/5hv3b1290258579.png",intern=TRUE))
character(0)
> try(system("convert tmp/6s42e1290258579.ps tmp/6s42e1290258579.png",intern=TRUE))
character(0)
> try(system("convert tmp/72e1h1290258579.ps tmp/72e1h1290258579.png",intern=TRUE))
character(0)
> try(system("convert tmp/82e1h1290258579.ps tmp/82e1h1290258579.png",intern=TRUE))
character(0)
> try(system("convert tmp/92e1h1290258579.ps tmp/92e1h1290258579.png",intern=TRUE))
character(0)
> try(system("convert tmp/10vnj31290258579.ps tmp/10vnj31290258579.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
3.479 1.723 8.530