R version 2.15.2 (2012-10-26) -- "Trick or Treat"
Copyright (C) 2012 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: i686-pc-linux-gnu (32-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> x <- array(list(12
+ ,41
+ ,38
+ ,13
+ ,12
+ ,53
+ ,32
+ ,11
+ ,39
+ ,32
+ ,16
+ ,11
+ ,86
+ ,51
+ ,14
+ ,30
+ ,35
+ ,19
+ ,15
+ ,66
+ ,42
+ ,12
+ ,31
+ ,33
+ ,15
+ ,6
+ ,67
+ ,41
+ ,21
+ ,34
+ ,37
+ ,14
+ ,13
+ ,76
+ ,46
+ ,12
+ ,35
+ ,29
+ ,13
+ ,10
+ ,78
+ ,47
+ ,22
+ ,39
+ ,31
+ ,19
+ ,12
+ ,53
+ ,37
+ ,11
+ ,34
+ ,36
+ ,15
+ ,14
+ ,80
+ ,49
+ ,10
+ ,36
+ ,35
+ ,14
+ ,12
+ ,74
+ ,45
+ ,13
+ ,37
+ ,38
+ ,15
+ ,6
+ ,76
+ ,47
+ ,10
+ ,38
+ ,31
+ ,16
+ ,10
+ ,79
+ ,49
+ ,8
+ ,36
+ ,34
+ ,16
+ ,12
+ ,54
+ ,33
+ ,15
+ ,38
+ ,35
+ ,16
+ ,12
+ ,67
+ ,42
+ ,14
+ ,39
+ ,38
+ ,16
+ ,11
+ ,54
+ ,33
+ ,10
+ ,33
+ ,37
+ ,17
+ ,15
+ ,87
+ ,53
+ ,14
+ ,32
+ ,33
+ ,15
+ ,12
+ ,58
+ ,36
+ ,14
+ ,36
+ ,32
+ ,15
+ ,10
+ ,75
+ ,45
+ ,11
+ ,38
+ ,38
+ ,20
+ ,12
+ ,88
+ ,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+ ,1:162))
> y <- array(NA,dim=c(7,162),dimnames=list(c('depression','connected','separate','learning','software','belonging','belonging_final
'),1:162))
> for (i in 1:dim(x)[1])
+ {
+ for (j in 1:dim(x)[2])
+ {
+ y[i,j] <- as.numeric(x[i,j])
+ }
+ }
> par3 = 'No Linear Trend'
> par2 = 'Do not include Seasonal Dummies'
> par1 = '1'
> par3 <- 'No Linear Trend'
> par2 <- 'Do not include Seasonal Dummies'
> par1 <- '1'
> #'GNU S' R Code compiled by R2WASP v. 1.0.44 ()
> #Author: Prof. Dr. P. Wessa
> #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/
> #Source of accompanying publication: Office for Research, Development, and Education
> #Technical description: Write here your technical program description (don't use hard returns!)
> library(lattice)
> library(lmtest)
Loading required package: zoo
Attaching package: 'zoo'
The following object(s) are masked from 'package:base':
as.Date, as.Date.numeric
> n25 <- 25 #minimum number of obs. for Goldfeld-Quandt test
> par1 <- as.numeric(par1)
> x <- t(y)
> k <- length(x[1,])
> n <- length(x[,1])
> x1 <- cbind(x[,par1], x[,1:k!=par1])
> mycolnames <- c(colnames(x)[par1], colnames(x)[1:k!=par1])
> colnames(x1) <- mycolnames #colnames(x)[par1]
> x <- x1
> if (par3 == 'First Differences'){
+ x2 <- array(0, dim=c(n-1,k), dimnames=list(1:(n-1), paste('(1-B)',colnames(x),sep='')))
+ for (i in 1:n-1) {
+ for (j in 1:k) {
+ x2[i,j] <- x[i+1,j] - x[i,j]
+ }
+ }
+ x <- x2
+ }
> if (par2 == 'Include Monthly Dummies'){
+ x2 <- array(0, dim=c(n,11), dimnames=list(1:n, paste('M', seq(1:11), sep ='')))
+ for (i in 1:11){
+ x2[seq(i,n,12),i] <- 1
+ }
+ x <- cbind(x, x2)
+ }
> if (par2 == 'Include Quarterly Dummies'){
+ x2 <- array(0, dim=c(n,3), dimnames=list(1:n, paste('Q', seq(1:3), sep ='')))
+ for (i in 1:3){
+ x2[seq(i,n,4),i] <- 1
+ }
+ x <- cbind(x, x2)
+ }
> k <- length(x[1,])
> if (par3 == 'Linear Trend'){
+ x <- cbind(x, c(1:n))
+ colnames(x)[k+1] <- 't'
+ }
> x
depression connected separate learning software belonging
1 12 41 38 13 12 53
2 11 39 32 16 11 86
3 14 30 35 19 15 66
4 12 31 33 15 6 67
5 21 34 37 14 13 76
6 12 35 29 13 10 78
7 22 39 31 19 12 53
8 11 34 36 15 14 80
9 10 36 35 14 12 74
10 13 37 38 15 6 76
11 10 38 31 16 10 79
12 8 36 34 16 12 54
13 15 38 35 16 12 67
14 14 39 38 16 11 54
15 10 33 37 17 15 87
16 14 32 33 15 12 58
17 14 36 32 15 10 75
18 11 38 38 20 12 88
19 10 39 38 18 11 64
20 13 32 32 16 12 57
21 7 32 33 16 11 66
22 14 31 31 16 12 68
23 12 39 38 19 13 54
24 14 37 39 16 11 56
25 11 39 32 17 9 86
26 9 41 32 17 13 80
27 11 36 35 16 10 76
28 15 33 37 15 14 69
29 14 33 33 16 12 78
30 13 34 33 14 10 67
31 9 31 28 15 12 80
32 15 27 32 12 8 54
33 10 37 31 14 10 71
34 11 34 37 16 12 84
35 13 34 30 14 12 74
36 8 32 33 7 7 71
37 20 29 31 10 6 63
38 12 36 33 14 12 71
39 10 29 31 16 10 76
40 10 35 33 16 10 69
41 9 37 32 16 10 74
42 14 34 33 14 12 75
43 8 38 32 20 15 54
44 14 35 33 14 10 52
45 11 38 28 14 10 69
46 13 37 35 11 12 68
47 9 38 39 14 13 65
48 11 33 34 15 11 75
49 15 36 38 16 11 74
50 11 38 32 14 12 75
51 10 32 38 16 14 72
52 14 32 30 14 10 67
53 18 32 33 12 12 63
54 14 34 38 16 13 62
55 11 32 32 9 5 63
56 12 37 32 14 6 76
57 13 39 34 16 12 74
58 9 29 34 16 12 67
59 10 37 36 15 11 73
60 15 35 34 16 10 70
61 20 30 28 12 7 53
62 12 38 34 16 12 77
63 12 34 35 16 14 77
64 14 31 35 14 11 52
65 13 34 31 16 12 54
66 11 35 37 17 13 80
67 17 36 35 18 14 66
68 12 30 27 18 11 73
69 13 39 40 12 12 63
70 14 35 37 16 12 69
71 13 38 36 10 8 67
72 15 31 38 14 11 54
73 13 34 39 18 14 81
74 10 38 41 18 14 69
75 11 34 27 16 12 84
76 19 39 30 17 9 80
77 13 37 37 16 13 70
78 17 34 31 16 11 69
79 13 28 31 13 12 77
80 9 37 27 16 12 54
81 11 33 36 16 12 79
82 10 37 38 20 12 30
83 9 35 37 16 12 71
84 12 37 33 15 12 73
85 12 32 34 15 11 72
86 13 33 31 16 10 77
87 13 38 39 14 9 75
88 12 33 34 16 12 69
89 15 29 32 16 12 54
90 22 33 33 15 12 70
91 13 31 36 12 9 73
92 15 36 32 17 15 54
93 13 35 41 16 12 77
94 15 32 28 15 12 82
95 10 29 30 13 12 80
96 11 39 36 16 10 80
97 16 37 35 16 13 69
98 11 35 31 16 9 78
99 11 37 34 16 12 81
100 10 32 36 14 10 76
101 10 38 36 16 14 76
102 16 37 35 16 11 73
103 12 36 37 20 15 85
104 11 32 28 15 11 66
105 16 33 39 16 11 79
106 19 40 32 13 12 68
107 11 38 35 17 12 76
108 16 41 39 16 12 71
109 15 36 35 16 11 54
110 24 43 42 12 7 46
111 14 30 34 16 12 82
112 15 31 33 16 14 74
113 11 32 41 17 11 88
114 15 32 33 13 11 38
115 12 37 34 12 10 76
116 10 37 32 18 13 86
117 14 33 40 14 13 54
118 13 34 40 14 8 70
119 9 33 35 13 11 69
120 15 38 36 16 12 90
121 15 33 37 13 11 54
122 14 31 27 16 13 76
123 11 38 39 13 12 89
124 8 37 38 16 14 76
125 11 33 31 15 13 73
126 11 31 33 16 15 79
127 8 39 32 15 10 90
128 10 44 39 17 11 74
129 11 33 36 15 9 81
130 13 35 33 12 11 72
131 11 32 33 16 10 71
132 20 28 32 10 11 66
133 10 40 37 16 8 77
134 15 27 30 12 11 65
135 12 37 38 14 12 74
136 14 32 29 15 12 82
137 23 28 22 13 9 54
138 14 34 35 15 11 63
139 16 30 35 11 10 54
140 11 35 34 12 8 64
141 12 31 35 8 9 69
142 10 32 34 16 8 54
143 14 30 34 15 9 84
144 12 30 35 17 15 86
145 12 31 23 16 11 77
146 11 40 31 10 8 89
147 12 32 27 18 13 76
148 13 36 36 13 12 60
149 11 32 31 16 12 75
150 19 35 32 13 9 73
151 12 38 39 10 7 85
152 17 42 37 15 13 79
153 9 34 38 16 9 71
154 12 35 39 16 6 72
155 19 35 34 14 8 69
156 18 33 31 10 8 78
157 15 36 32 17 15 54
158 14 32 37 13 6 69
159 11 33 36 15 9 81
160 9 34 32 16 11 84
161 18 32 35 12 8 84
162 16 34 36 13 8 69
belonging_final\r\r
1 32
2 51
3 42
4 41
5 46
6 47
7 37
8 49
9 45
10 47
11 49
12 33
13 42
14 33
15 53
16 36
17 45
18 54
19 41
20 36
21 41
22 44
23 33
24 37
25 52
26 47
27 43
28 44
29 45
30 44
31 49
32 33
33 43
34 54
35 42
36 44
37 37
38 43
39 46
40 42
41 45
42 44
43 33
44 31
45 42
46 40
47 43
48 46
49 42
50 45
51 44
52 40
53 37
54 46
55 36
56 47
57 45
58 42
59 43
60 43
61 32
62 45
63 45
64 31
65 33
66 49
67 42
68 41
69 38
70 42
71 44
72 33
73 48
74 40
75 50
76 49
77 43
78 44
79 47
80 33
81 46
82 0
83 45
84 43
85 44
86 47
87 45
88 42
89 33
90 43
91 46
92 33
93 46
94 48
95 47
96 47
97 43
98 46
99 48
100 46
101 45
102 45
103 52
104 42
105 47
106 41
107 47
108 43
109 33
110 30
111 49
112 44
113 55
114 11
115 47
116 53
117 33
118 44
119 42
120 55
121 33
122 46
123 54
124 47
125 45
126 47
127 55
128 44
129 53
130 44
131 42
132 40
133 46
134 40
135 46
136 53
137 33
138 42
139 35
140 40
141 41
142 33
143 51
144 53
145 46
146 55
147 47
148 38
149 46
150 46
151 53
152 47
153 41
154 44
155 43
156 51
157 33
158 43
159 53
160 51
161 50
162 46
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) connected separate
25.70538 -0.03240 -0.05725
learning software belonging
-0.24077 -0.02191 -0.20575
`belonging_final\\r\\r`
0.20150
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-7.1986 -1.6676 -0.4623 1.2658 8.8653
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 25.70538 3.36503 7.639 2.12e-12 ***
connected -0.03240 0.07693 -0.421 0.67422
separate -0.05725 0.07153 -0.800 0.42477
learning -0.24077 0.12814 -1.879 0.06212 .
software -0.02191 0.13142 -0.167 0.86784
belonging -0.20575 0.06961 -2.956 0.00361 **
`belonging_final\\r\\r` 0.20150 0.10189 1.978 0.04974 *
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 2.982 on 155 degrees of freedom
Multiple R-squared: 0.1463, Adjusted R-squared: 0.1132
F-statistic: 4.426 on 6 and 155 DF, p-value: 0.0003682
> 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.9833152 0.03336951 0.01668475
[2,] 0.9801164 0.03976728 0.01988364
[3,] 0.9772045 0.04559108 0.02279554
[4,] 0.9584909 0.08301826 0.04150913
[5,] 0.9442979 0.11140424 0.05570212
[6,] 0.9313269 0.13734619 0.06867309
[7,] 0.8955067 0.20898667 0.10449334
[8,] 0.8978590 0.20428204 0.10214102
[9,] 0.8542100 0.29157994 0.14578997
[10,] 0.8883016 0.22339688 0.11169844
[11,] 0.8512850 0.29743002 0.14871501
[12,] 0.9275105 0.14497891 0.07248945
[13,] 0.9051735 0.18965303 0.09482652
[14,] 0.8774919 0.24501615 0.12250808
[15,] 0.8510094 0.29798123 0.14899062
[16,] 0.8065329 0.38693427 0.19346713
[17,] 0.7627028 0.47459437 0.23729718
[18,] 0.7653699 0.46926028 0.23463014
[19,] 0.7153579 0.56928412 0.28464206
[20,] 0.7536359 0.49272821 0.24636411
[21,] 0.7197412 0.56051753 0.28025877
[22,] 0.7241733 0.55165345 0.27582673
[23,] 0.6885726 0.62285490 0.31142745
[24,] 0.6639173 0.67216540 0.33608270
[25,] 0.6367076 0.72658480 0.36329240
[26,] 0.6053814 0.78923726 0.39461863
[27,] 0.6988694 0.60226114 0.30113057
[28,] 0.8656494 0.26870128 0.13435064
[29,] 0.8343074 0.33138512 0.16569256
[30,] 0.8227383 0.35452350 0.17726175
[31,] 0.8110710 0.37785810 0.18892905
[32,] 0.8076463 0.38470731 0.19235365
[33,] 0.7866805 0.42663893 0.21331946
[34,] 0.8381212 0.32375766 0.16187883
[35,] 0.8062709 0.38745825 0.19372913
[36,] 0.7832698 0.43346043 0.21673021
[37,] 0.7451781 0.50964374 0.25482187
[38,] 0.7941831 0.41163385 0.20581693
[39,] 0.7642516 0.47149684 0.23574842
[40,] 0.7689871 0.46202583 0.23101292
[41,] 0.7370065 0.52598701 0.26299351
[42,] 0.7248309 0.55033816 0.27516908
[43,] 0.6870509 0.62589825 0.31294912
[44,] 0.7309152 0.53816967 0.26908484
[45,] 0.6950749 0.60985021 0.30492511
[46,] 0.7058719 0.58825625 0.29412813
[47,] 0.6696743 0.66065140 0.33032570
[48,] 0.6336471 0.73270571 0.36635285
[49,] 0.6811647 0.63767058 0.31883529
[50,] 0.6601278 0.67974435 0.33987218
[51,] 0.6456412 0.70871767 0.35435884
[52,] 0.7125272 0.57494554 0.28747277
[53,] 0.6724396 0.65512084 0.32756042
[54,] 0.6286883 0.74262342 0.37131171
[55,] 0.5855462 0.82890767 0.41445384
[56,] 0.5494331 0.90113382 0.45056691
[57,] 0.5028906 0.99421873 0.49710937
[58,] 0.5528696 0.89426082 0.44713041
[59,] 0.5059601 0.98807977 0.49403989
[60,] 0.4630693 0.92613864 0.53693068
[61,] 0.4266915 0.85338307 0.57330846
[62,] 0.4022975 0.80459495 0.59770252
[63,] 0.3582417 0.71648334 0.64175833
[64,] 0.3381505 0.67630105 0.66184947
[65,] 0.3092084 0.61841683 0.69079158
[66,] 0.2716652 0.54333042 0.72833479
[67,] 0.4861604 0.97232086 0.51383957
[68,] 0.4419373 0.88387467 0.55806267
[69,] 0.4643530 0.92870590 0.53564705
[70,] 0.4193659 0.83873186 0.58063407
[71,] 0.5374587 0.92508265 0.46254133
[72,] 0.4925073 0.98501459 0.50749270
[73,] 0.4552158 0.91043168 0.54478416
[74,] 0.4882175 0.97643504 0.51178248
[75,] 0.4458543 0.89170851 0.55414574
[76,] 0.4050728 0.81014556 0.59492722
[77,] 0.3616429 0.72328574 0.63835713
[78,] 0.3213542 0.64270833 0.67864583
[79,] 0.2851962 0.57039239 0.71480380
[80,] 0.2490845 0.49816900 0.75091550
[81,] 0.5862938 0.82741235 0.41370617
[82,] 0.5436126 0.91277479 0.45638740
[83,] 0.5047249 0.99055029 0.49527515
[84,] 0.4701956 0.94039123 0.52980439
[85,] 0.4692068 0.93841362 0.53079319
[86,] 0.4582053 0.91641054 0.54179473
[87,] 0.4121543 0.82430860 0.58784570
[88,] 0.4113162 0.82263234 0.58868383
[89,] 0.3713242 0.74264846 0.62867577
[90,] 0.3284726 0.65694520 0.67152740
[91,] 0.3185677 0.63713535 0.68143233
[92,] 0.2932974 0.58659472 0.70670264
[93,] 0.3038755 0.60775095 0.69612452
[94,] 0.2818375 0.56367493 0.71816254
[95,] 0.2961038 0.59220760 0.70389620
[96,] 0.3681508 0.73630151 0.63184925
[97,] 0.4556382 0.91127631 0.54436184
[98,] 0.4117624 0.82352477 0.58823762
[99,] 0.4479326 0.89586517 0.55206742
[100,] 0.4027395 0.80547906 0.59726047
[101,] 0.7560805 0.48783893 0.24391947
[102,] 0.7370666 0.52586673 0.26293337
[103,] 0.7312079 0.53758415 0.26879208
[104,] 0.6974065 0.60518695 0.30259347
[105,] 0.6567903 0.68641941 0.34320971
[106,] 0.6213996 0.75720076 0.37860038
[107,] 0.5727056 0.85458873 0.42729437
[108,] 0.5239053 0.95218948 0.47609474
[109,] 0.4740609 0.94812180 0.52593910
[110,] 0.5455175 0.90896496 0.45448248
[111,] 0.6359189 0.72816225 0.36408112
[112,] 0.5832948 0.83341049 0.41670525
[113,] 0.5351289 0.92974219 0.46487109
[114,] 0.4811027 0.96220546 0.51889727
[115,] 0.4829316 0.96586320 0.51706840
[116,] 0.4604061 0.92081217 0.53959391
[117,] 0.4080028 0.81600562 0.59199719
[118,] 0.4256805 0.85136104 0.57431948
[119,] 0.3729927 0.74598532 0.62700734
[120,] 0.3320121 0.66402426 0.66798787
[121,] 0.2914239 0.58284779 0.70857611
[122,] 0.2518940 0.50378795 0.74810603
[123,] 0.2976942 0.59538836 0.70230582
[124,] 0.2556785 0.51135703 0.74432148
[125,] 0.2077993 0.41559855 0.79220073
[126,] 0.1648971 0.32979430 0.83510285
[127,] 0.1286618 0.25732368 0.87133816
[128,] 0.3019807 0.60396139 0.69801931
[129,] 0.2453553 0.49071052 0.75464474
[130,] 0.1968270 0.39365404 0.80317298
[131,] 0.2031607 0.40632134 0.79683933
[132,] 0.2226848 0.44536966 0.77731517
[133,] 0.2618144 0.52362884 0.73818558
[134,] 0.2201009 0.44020187 0.77989906
[135,] 0.1759081 0.35181619 0.82409190
[136,] 0.1367050 0.27340991 0.86329504
[137,] 0.4733829 0.94676570 0.52661715
[138,] 0.3896317 0.77926344 0.61036828
[139,] 0.3417819 0.68356385 0.65821808
[140,] 0.2641365 0.52827301 0.73586350
[141,] 0.1938262 0.38765234 0.80617383
[142,] 0.4708681 0.94173628 0.52913186
[143,] 0.3513026 0.70260526 0.64869737
> postscript(file="/var/fisher/rcomp/tmp/13eon1352143003.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> plot(x[,1], type='l', main='Actuals and Interpolation', ylab='value of Actuals and Interpolation (dots)', xlab='time or index')
> points(x[,1]-mysum$resid)
> grid()
> dev.off()
null device
1
> postscript(file="/var/fisher/rcomp/tmp/22zw61352143003.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> plot(mysum$resid, type='b', pch=19, main='Residuals', ylab='value of Residuals', xlab='time or index')
> grid()
> dev.off()
null device
1
> postscript(file="/var/fisher/rcomp/tmp/3pyyc1352143003.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> hist(mysum$resid, main='Residual Histogram', xlab='values of Residuals')
> grid()
> dev.off()
null device
1
> postscript(file="/var/fisher/rcomp/tmp/418av1352143003.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> densityplot(~mysum$resid,col='black',main='Residual Density Plot', xlab='values of Residuals')
> dev.off()
null device
1
> postscript(file="/var/fisher/rcomp/tmp/5w2dp1352143003.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 = 162
Frequency = 1
1 2 3 4 5 6
-2.35202835 -0.09868999 1.28989497 -1.54517740 8.53781686 -0.98424390
7 8 9 10 11 12
7.61955017 -1.03826089 -2.74377895 0.57819159 -2.24749378 -6.01645481
13 14 15 16 17 18
1.96681851 0.28782632 -0.87572493 -0.22558284 1.48719378 1.00436776
19 20 21 22 23 24
-2.78515443 -1.24780935 -6.36822898 0.31377173 -0.94604793 -0.11424487
25 26 27 28 29 30
-0.10323474 -2.17779616 -0.49153396 1.73084222 2.34907654 -1.20564015
31 32 33 34 35 36
-3.63724443 -0.47325979 -3.19842018 -0.96857276 0.50970332 -7.19855186
37 38 39 40 41 42
5.05468501 -1.07251658 -2.55183736 -2.87718350 -3.44538593 1.48418409
43 44 45 46 47 48
-5.03734387 -0.63994911 -2.54775716 -0.66067778 -4.87684158 -1.67511407
49 50 51 52 53 54
3.49211256 -1.64496564 -2.38628545 0.36383987 3.87935577 -0.80391647
55 56 57 58 59 60
-3.85203950 -1.00605819 0.77771891 -4.38203158 -2.23800791 2.18430951
61 62 63 64 65 66
4.36880367 0.36257336 0.33402935 -0.63315237 -1.25299478 -0.48897673
67 68 69 70 71 72
4.22162032 0.14529627 -0.69462167 1.39561328 -1.91119661 0.54708002
73 74 75 76 77 78
2.26304937 -1.34983571 -0.73501658 7.15227775 0.48656636 3.59481896
79 80 81 82 83 84
-0.25849439 -5.38477906 -0.47493769 -1.08035692 -3.79739847 -0.38784142
85 86 87 88 89 90
-0.92175935 0.58201091 0.69004214 -0.84092669 0.64224954 8.86530206
91 92 93 94 95 96
-0.80305113 1.17554081 1.46459179 3.00816423 -2.66608550 -0.32009984
97 98 99 100 101 102
3.16632197 -0.96783727 -0.45133555 -2.64994722 -1.68487424 3.54250722
103 104 105 106 107 108
1.73379256 -3.09673738 4.47339083 5.54482232 -0.94817037 3.91450676
109 110 111 112 113 114
1.01888594 8.55420700 2.32610819 2.70658548 0.03597930 1.19356101
115 116 117 118 119 120
-1.28548592 -1.04114656 -0.22981514 -0.23147187 -4.52790043 4.13678725
121 122 123 124 125 126
0.31386297 1.34969482 -0.41803474 -4.00579189 -2.01304020 -0.84726577
127 128 129 130 131 132
-3.34438062 -1.35367626 -1.78045780 -0.60411899 -1.56288149 5.20179899
133 134 135 136 137 138
-1.69001418 0.33069720 -0.74114439 1.05788562 7.24935394 -0.24846675
139 140 141 142 143 144
0.19571035 -3.45258249 -2.63886501 -4.23367897 2.02811306 0.70682945
145 146 147 148 149 150
-0.71735033 -1.82264696 -0.33786677 -1.39729180 -1.61657649 5.33833650
151 152 153 154 155 156
-0.87137886 5.45354153 -3.03224939 -0.40708285 5.45320363 3.49330230
157 158 159 160 161 162
1.17554081 0.24315878 -1.78045780 -2.67219530 5.60744513 1.69000949
> postscript(file="/var/fisher/rcomp/tmp/6v35m1352143003.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 = 162
Frequency = 1
lag(myerror, k = 1) myerror
0 -2.35202835 NA
1 -0.09868999 -2.35202835
2 1.28989497 -0.09868999
3 -1.54517740 1.28989497
4 8.53781686 -1.54517740
5 -0.98424390 8.53781686
6 7.61955017 -0.98424390
7 -1.03826089 7.61955017
8 -2.74377895 -1.03826089
9 0.57819159 -2.74377895
10 -2.24749378 0.57819159
11 -6.01645481 -2.24749378
12 1.96681851 -6.01645481
13 0.28782632 1.96681851
14 -0.87572493 0.28782632
15 -0.22558284 -0.87572493
16 1.48719378 -0.22558284
17 1.00436776 1.48719378
18 -2.78515443 1.00436776
19 -1.24780935 -2.78515443
20 -6.36822898 -1.24780935
21 0.31377173 -6.36822898
22 -0.94604793 0.31377173
23 -0.11424487 -0.94604793
24 -0.10323474 -0.11424487
25 -2.17779616 -0.10323474
26 -0.49153396 -2.17779616
27 1.73084222 -0.49153396
28 2.34907654 1.73084222
29 -1.20564015 2.34907654
30 -3.63724443 -1.20564015
31 -0.47325979 -3.63724443
32 -3.19842018 -0.47325979
33 -0.96857276 -3.19842018
34 0.50970332 -0.96857276
35 -7.19855186 0.50970332
36 5.05468501 -7.19855186
37 -1.07251658 5.05468501
38 -2.55183736 -1.07251658
39 -2.87718350 -2.55183736
40 -3.44538593 -2.87718350
41 1.48418409 -3.44538593
42 -5.03734387 1.48418409
43 -0.63994911 -5.03734387
44 -2.54775716 -0.63994911
45 -0.66067778 -2.54775716
46 -4.87684158 -0.66067778
47 -1.67511407 -4.87684158
48 3.49211256 -1.67511407
49 -1.64496564 3.49211256
50 -2.38628545 -1.64496564
51 0.36383987 -2.38628545
52 3.87935577 0.36383987
53 -0.80391647 3.87935577
54 -3.85203950 -0.80391647
55 -1.00605819 -3.85203950
56 0.77771891 -1.00605819
57 -4.38203158 0.77771891
58 -2.23800791 -4.38203158
59 2.18430951 -2.23800791
60 4.36880367 2.18430951
61 0.36257336 4.36880367
62 0.33402935 0.36257336
63 -0.63315237 0.33402935
64 -1.25299478 -0.63315237
65 -0.48897673 -1.25299478
66 4.22162032 -0.48897673
67 0.14529627 4.22162032
68 -0.69462167 0.14529627
69 1.39561328 -0.69462167
70 -1.91119661 1.39561328
71 0.54708002 -1.91119661
72 2.26304937 0.54708002
73 -1.34983571 2.26304937
74 -0.73501658 -1.34983571
75 7.15227775 -0.73501658
76 0.48656636 7.15227775
77 3.59481896 0.48656636
78 -0.25849439 3.59481896
79 -5.38477906 -0.25849439
80 -0.47493769 -5.38477906
81 -1.08035692 -0.47493769
82 -3.79739847 -1.08035692
83 -0.38784142 -3.79739847
84 -0.92175935 -0.38784142
85 0.58201091 -0.92175935
86 0.69004214 0.58201091
87 -0.84092669 0.69004214
88 0.64224954 -0.84092669
89 8.86530206 0.64224954
90 -0.80305113 8.86530206
91 1.17554081 -0.80305113
92 1.46459179 1.17554081
93 3.00816423 1.46459179
94 -2.66608550 3.00816423
95 -0.32009984 -2.66608550
96 3.16632197 -0.32009984
97 -0.96783727 3.16632197
98 -0.45133555 -0.96783727
99 -2.64994722 -0.45133555
100 -1.68487424 -2.64994722
101 3.54250722 -1.68487424
102 1.73379256 3.54250722
103 -3.09673738 1.73379256
104 4.47339083 -3.09673738
105 5.54482232 4.47339083
106 -0.94817037 5.54482232
107 3.91450676 -0.94817037
108 1.01888594 3.91450676
109 8.55420700 1.01888594
110 2.32610819 8.55420700
111 2.70658548 2.32610819
112 0.03597930 2.70658548
113 1.19356101 0.03597930
114 -1.28548592 1.19356101
115 -1.04114656 -1.28548592
116 -0.22981514 -1.04114656
117 -0.23147187 -0.22981514
118 -4.52790043 -0.23147187
119 4.13678725 -4.52790043
120 0.31386297 4.13678725
121 1.34969482 0.31386297
122 -0.41803474 1.34969482
123 -4.00579189 -0.41803474
124 -2.01304020 -4.00579189
125 -0.84726577 -2.01304020
126 -3.34438062 -0.84726577
127 -1.35367626 -3.34438062
128 -1.78045780 -1.35367626
129 -0.60411899 -1.78045780
130 -1.56288149 -0.60411899
131 5.20179899 -1.56288149
132 -1.69001418 5.20179899
133 0.33069720 -1.69001418
134 -0.74114439 0.33069720
135 1.05788562 -0.74114439
136 7.24935394 1.05788562
137 -0.24846675 7.24935394
138 0.19571035 -0.24846675
139 -3.45258249 0.19571035
140 -2.63886501 -3.45258249
141 -4.23367897 -2.63886501
142 2.02811306 -4.23367897
143 0.70682945 2.02811306
144 -0.71735033 0.70682945
145 -1.82264696 -0.71735033
146 -0.33786677 -1.82264696
147 -1.39729180 -0.33786677
148 -1.61657649 -1.39729180
149 5.33833650 -1.61657649
150 -0.87137886 5.33833650
151 5.45354153 -0.87137886
152 -3.03224939 5.45354153
153 -0.40708285 -3.03224939
154 5.45320363 -0.40708285
155 3.49330230 5.45320363
156 1.17554081 3.49330230
157 0.24315878 1.17554081
158 -1.78045780 0.24315878
159 -2.67219530 -1.78045780
160 5.60744513 -2.67219530
161 1.69000949 5.60744513
162 NA 1.69000949
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -0.09868999 -2.35202835
[2,] 1.28989497 -0.09868999
[3,] -1.54517740 1.28989497
[4,] 8.53781686 -1.54517740
[5,] -0.98424390 8.53781686
[6,] 7.61955017 -0.98424390
[7,] -1.03826089 7.61955017
[8,] -2.74377895 -1.03826089
[9,] 0.57819159 -2.74377895
[10,] -2.24749378 0.57819159
[11,] -6.01645481 -2.24749378
[12,] 1.96681851 -6.01645481
[13,] 0.28782632 1.96681851
[14,] -0.87572493 0.28782632
[15,] -0.22558284 -0.87572493
[16,] 1.48719378 -0.22558284
[17,] 1.00436776 1.48719378
[18,] -2.78515443 1.00436776
[19,] -1.24780935 -2.78515443
[20,] -6.36822898 -1.24780935
[21,] 0.31377173 -6.36822898
[22,] -0.94604793 0.31377173
[23,] -0.11424487 -0.94604793
[24,] -0.10323474 -0.11424487
[25,] -2.17779616 -0.10323474
[26,] -0.49153396 -2.17779616
[27,] 1.73084222 -0.49153396
[28,] 2.34907654 1.73084222
[29,] -1.20564015 2.34907654
[30,] -3.63724443 -1.20564015
[31,] -0.47325979 -3.63724443
[32,] -3.19842018 -0.47325979
[33,] -0.96857276 -3.19842018
[34,] 0.50970332 -0.96857276
[35,] -7.19855186 0.50970332
[36,] 5.05468501 -7.19855186
[37,] -1.07251658 5.05468501
[38,] -2.55183736 -1.07251658
[39,] -2.87718350 -2.55183736
[40,] -3.44538593 -2.87718350
[41,] 1.48418409 -3.44538593
[42,] -5.03734387 1.48418409
[43,] -0.63994911 -5.03734387
[44,] -2.54775716 -0.63994911
[45,] -0.66067778 -2.54775716
[46,] -4.87684158 -0.66067778
[47,] -1.67511407 -4.87684158
[48,] 3.49211256 -1.67511407
[49,] -1.64496564 3.49211256
[50,] -2.38628545 -1.64496564
[51,] 0.36383987 -2.38628545
[52,] 3.87935577 0.36383987
[53,] -0.80391647 3.87935577
[54,] -3.85203950 -0.80391647
[55,] -1.00605819 -3.85203950
[56,] 0.77771891 -1.00605819
[57,] -4.38203158 0.77771891
[58,] -2.23800791 -4.38203158
[59,] 2.18430951 -2.23800791
[60,] 4.36880367 2.18430951
[61,] 0.36257336 4.36880367
[62,] 0.33402935 0.36257336
[63,] -0.63315237 0.33402935
[64,] -1.25299478 -0.63315237
[65,] -0.48897673 -1.25299478
[66,] 4.22162032 -0.48897673
[67,] 0.14529627 4.22162032
[68,] -0.69462167 0.14529627
[69,] 1.39561328 -0.69462167
[70,] -1.91119661 1.39561328
[71,] 0.54708002 -1.91119661
[72,] 2.26304937 0.54708002
[73,] -1.34983571 2.26304937
[74,] -0.73501658 -1.34983571
[75,] 7.15227775 -0.73501658
[76,] 0.48656636 7.15227775
[77,] 3.59481896 0.48656636
[78,] -0.25849439 3.59481896
[79,] -5.38477906 -0.25849439
[80,] -0.47493769 -5.38477906
[81,] -1.08035692 -0.47493769
[82,] -3.79739847 -1.08035692
[83,] -0.38784142 -3.79739847
[84,] -0.92175935 -0.38784142
[85,] 0.58201091 -0.92175935
[86,] 0.69004214 0.58201091
[87,] -0.84092669 0.69004214
[88,] 0.64224954 -0.84092669
[89,] 8.86530206 0.64224954
[90,] -0.80305113 8.86530206
[91,] 1.17554081 -0.80305113
[92,] 1.46459179 1.17554081
[93,] 3.00816423 1.46459179
[94,] -2.66608550 3.00816423
[95,] -0.32009984 -2.66608550
[96,] 3.16632197 -0.32009984
[97,] -0.96783727 3.16632197
[98,] -0.45133555 -0.96783727
[99,] -2.64994722 -0.45133555
[100,] -1.68487424 -2.64994722
[101,] 3.54250722 -1.68487424
[102,] 1.73379256 3.54250722
[103,] -3.09673738 1.73379256
[104,] 4.47339083 -3.09673738
[105,] 5.54482232 4.47339083
[106,] -0.94817037 5.54482232
[107,] 3.91450676 -0.94817037
[108,] 1.01888594 3.91450676
[109,] 8.55420700 1.01888594
[110,] 2.32610819 8.55420700
[111,] 2.70658548 2.32610819
[112,] 0.03597930 2.70658548
[113,] 1.19356101 0.03597930
[114,] -1.28548592 1.19356101
[115,] -1.04114656 -1.28548592
[116,] -0.22981514 -1.04114656
[117,] -0.23147187 -0.22981514
[118,] -4.52790043 -0.23147187
[119,] 4.13678725 -4.52790043
[120,] 0.31386297 4.13678725
[121,] 1.34969482 0.31386297
[122,] -0.41803474 1.34969482
[123,] -4.00579189 -0.41803474
[124,] -2.01304020 -4.00579189
[125,] -0.84726577 -2.01304020
[126,] -3.34438062 -0.84726577
[127,] -1.35367626 -3.34438062
[128,] -1.78045780 -1.35367626
[129,] -0.60411899 -1.78045780
[130,] -1.56288149 -0.60411899
[131,] 5.20179899 -1.56288149
[132,] -1.69001418 5.20179899
[133,] 0.33069720 -1.69001418
[134,] -0.74114439 0.33069720
[135,] 1.05788562 -0.74114439
[136,] 7.24935394 1.05788562
[137,] -0.24846675 7.24935394
[138,] 0.19571035 -0.24846675
[139,] -3.45258249 0.19571035
[140,] -2.63886501 -3.45258249
[141,] -4.23367897 -2.63886501
[142,] 2.02811306 -4.23367897
[143,] 0.70682945 2.02811306
[144,] -0.71735033 0.70682945
[145,] -1.82264696 -0.71735033
[146,] -0.33786677 -1.82264696
[147,] -1.39729180 -0.33786677
[148,] -1.61657649 -1.39729180
[149,] 5.33833650 -1.61657649
[150,] -0.87137886 5.33833650
[151,] 5.45354153 -0.87137886
[152,] -3.03224939 5.45354153
[153,] -0.40708285 -3.03224939
[154,] 5.45320363 -0.40708285
[155,] 3.49330230 5.45320363
[156,] 1.17554081 3.49330230
[157,] 0.24315878 1.17554081
[158,] -1.78045780 0.24315878
[159,] -2.67219530 -1.78045780
[160,] 5.60744513 -2.67219530
[161,] 1.69000949 5.60744513
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -0.09868999 -2.35202835
2 1.28989497 -0.09868999
3 -1.54517740 1.28989497
4 8.53781686 -1.54517740
5 -0.98424390 8.53781686
6 7.61955017 -0.98424390
7 -1.03826089 7.61955017
8 -2.74377895 -1.03826089
9 0.57819159 -2.74377895
10 -2.24749378 0.57819159
11 -6.01645481 -2.24749378
12 1.96681851 -6.01645481
13 0.28782632 1.96681851
14 -0.87572493 0.28782632
15 -0.22558284 -0.87572493
16 1.48719378 -0.22558284
17 1.00436776 1.48719378
18 -2.78515443 1.00436776
19 -1.24780935 -2.78515443
20 -6.36822898 -1.24780935
21 0.31377173 -6.36822898
22 -0.94604793 0.31377173
23 -0.11424487 -0.94604793
24 -0.10323474 -0.11424487
25 -2.17779616 -0.10323474
26 -0.49153396 -2.17779616
27 1.73084222 -0.49153396
28 2.34907654 1.73084222
29 -1.20564015 2.34907654
30 -3.63724443 -1.20564015
31 -0.47325979 -3.63724443
32 -3.19842018 -0.47325979
33 -0.96857276 -3.19842018
34 0.50970332 -0.96857276
35 -7.19855186 0.50970332
36 5.05468501 -7.19855186
37 -1.07251658 5.05468501
38 -2.55183736 -1.07251658
39 -2.87718350 -2.55183736
40 -3.44538593 -2.87718350
41 1.48418409 -3.44538593
42 -5.03734387 1.48418409
43 -0.63994911 -5.03734387
44 -2.54775716 -0.63994911
45 -0.66067778 -2.54775716
46 -4.87684158 -0.66067778
47 -1.67511407 -4.87684158
48 3.49211256 -1.67511407
49 -1.64496564 3.49211256
50 -2.38628545 -1.64496564
51 0.36383987 -2.38628545
52 3.87935577 0.36383987
53 -0.80391647 3.87935577
54 -3.85203950 -0.80391647
55 -1.00605819 -3.85203950
56 0.77771891 -1.00605819
57 -4.38203158 0.77771891
58 -2.23800791 -4.38203158
59 2.18430951 -2.23800791
60 4.36880367 2.18430951
61 0.36257336 4.36880367
62 0.33402935 0.36257336
63 -0.63315237 0.33402935
64 -1.25299478 -0.63315237
65 -0.48897673 -1.25299478
66 4.22162032 -0.48897673
67 0.14529627 4.22162032
68 -0.69462167 0.14529627
69 1.39561328 -0.69462167
70 -1.91119661 1.39561328
71 0.54708002 -1.91119661
72 2.26304937 0.54708002
73 -1.34983571 2.26304937
74 -0.73501658 -1.34983571
75 7.15227775 -0.73501658
76 0.48656636 7.15227775
77 3.59481896 0.48656636
78 -0.25849439 3.59481896
79 -5.38477906 -0.25849439
80 -0.47493769 -5.38477906
81 -1.08035692 -0.47493769
82 -3.79739847 -1.08035692
83 -0.38784142 -3.79739847
84 -0.92175935 -0.38784142
85 0.58201091 -0.92175935
86 0.69004214 0.58201091
87 -0.84092669 0.69004214
88 0.64224954 -0.84092669
89 8.86530206 0.64224954
90 -0.80305113 8.86530206
91 1.17554081 -0.80305113
92 1.46459179 1.17554081
93 3.00816423 1.46459179
94 -2.66608550 3.00816423
95 -0.32009984 -2.66608550
96 3.16632197 -0.32009984
97 -0.96783727 3.16632197
98 -0.45133555 -0.96783727
99 -2.64994722 -0.45133555
100 -1.68487424 -2.64994722
101 3.54250722 -1.68487424
102 1.73379256 3.54250722
103 -3.09673738 1.73379256
104 4.47339083 -3.09673738
105 5.54482232 4.47339083
106 -0.94817037 5.54482232
107 3.91450676 -0.94817037
108 1.01888594 3.91450676
109 8.55420700 1.01888594
110 2.32610819 8.55420700
111 2.70658548 2.32610819
112 0.03597930 2.70658548
113 1.19356101 0.03597930
114 -1.28548592 1.19356101
115 -1.04114656 -1.28548592
116 -0.22981514 -1.04114656
117 -0.23147187 -0.22981514
118 -4.52790043 -0.23147187
119 4.13678725 -4.52790043
120 0.31386297 4.13678725
121 1.34969482 0.31386297
122 -0.41803474 1.34969482
123 -4.00579189 -0.41803474
124 -2.01304020 -4.00579189
125 -0.84726577 -2.01304020
126 -3.34438062 -0.84726577
127 -1.35367626 -3.34438062
128 -1.78045780 -1.35367626
129 -0.60411899 -1.78045780
130 -1.56288149 -0.60411899
131 5.20179899 -1.56288149
132 -1.69001418 5.20179899
133 0.33069720 -1.69001418
134 -0.74114439 0.33069720
135 1.05788562 -0.74114439
136 7.24935394 1.05788562
137 -0.24846675 7.24935394
138 0.19571035 -0.24846675
139 -3.45258249 0.19571035
140 -2.63886501 -3.45258249
141 -4.23367897 -2.63886501
142 2.02811306 -4.23367897
143 0.70682945 2.02811306
144 -0.71735033 0.70682945
145 -1.82264696 -0.71735033
146 -0.33786677 -1.82264696
147 -1.39729180 -0.33786677
148 -1.61657649 -1.39729180
149 5.33833650 -1.61657649
150 -0.87137886 5.33833650
151 5.45354153 -0.87137886
152 -3.03224939 5.45354153
153 -0.40708285 -3.03224939
154 5.45320363 -0.40708285
155 3.49330230 5.45320363
156 1.17554081 3.49330230
157 0.24315878 1.17554081
158 -1.78045780 0.24315878
159 -2.67219530 -1.78045780
160 5.60744513 -2.67219530
161 1.69000949 5.60744513
> plot(z,main=paste('Residual Lag plot, lowess, and regression line'), ylab='values of Residuals', xlab='lagged values of Residuals')
> lines(lowess(z))
> abline(lm(z))
> grid()
> dev.off()
null device
1
> postscript(file="/var/fisher/rcomp/tmp/7pl9e1352143003.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> acf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Autocorrelation Function')
> grid()
> dev.off()
null device
1
> postscript(file="/var/fisher/rcomp/tmp/8gvot1352143003.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> pacf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Partial Autocorrelation Function')
> grid()
> dev.off()
null device
1
> postscript(file="/var/fisher/rcomp/tmp/9svyn1352143003.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/fisher/rcomp/tmp/10x0b41352143003.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
+ plot(kp3:nmkm3,gqarr[,2], main='Goldfeld-Quandt test',ylab='2-sided p-value',xlab='breakpoint')
+ grid()
+ dev.off()
+ }
null device
1
>
> #Note: the /var/fisher/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/fisher/rcomp/createtable")
>
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Estimated Regression Equation', 1, TRUE)
> a<-table.row.end(a)
> myeq <- colnames(x)[1]
> myeq <- paste(myeq, '[t] = ', sep='')
> for (i in 1:k){
+ if (mysum$coefficients[i,1] > 0) myeq <- paste(myeq, '+', '')
+ myeq <- paste(myeq, mysum$coefficients[i,1], sep=' ')
+ if (rownames(mysum$coefficients)[i] != '(Intercept)') {
+ myeq <- paste(myeq, rownames(mysum$coefficients)[i], sep='')
+ if (rownames(mysum$coefficients)[i] != 't') myeq <- paste(myeq, '[t]', sep='')
+ }
+ }
> myeq <- paste(myeq, ' + e[t]')
> a<-table.row.start(a)
> a<-table.element(a, myeq)
> a<-table.row.end(a)
> a<-table.end(a)
> table.save(a,file="/var/fisher/rcomp/tmp/113swt1352143003.tab")
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a,hyperlink('http://www.xycoon.com/ols1.htm','Multiple Linear Regression - Ordinary Least Squares',''), 6, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a,'Variable',header=TRUE)
> a<-table.element(a,'Parameter',header=TRUE)
> a<-table.element(a,'S.D.',header=TRUE)
> a<-table.element(a,'T-STAT
H0: parameter = 0',header=TRUE)
> a<-table.element(a,'2-tail p-value',header=TRUE)
> a<-table.element(a,'1-tail p-value',header=TRUE)
> a<-table.row.end(a)
> for (i in 1:k){
+ a<-table.row.start(a)
+ a<-table.element(a,rownames(mysum$coefficients)[i],header=TRUE)
+ a<-table.element(a,mysum$coefficients[i,1])
+ a<-table.element(a, round(mysum$coefficients[i,2],6))
+ a<-table.element(a, round(mysum$coefficients[i,3],4))
+ a<-table.element(a, round(mysum$coefficients[i,4],6))
+ a<-table.element(a, round(mysum$coefficients[i,4]/2,6))
+ a<-table.row.end(a)
+ }
> a<-table.end(a)
> table.save(a,file="/var/fisher/rcomp/tmp/12jv8w1352143003.tab")
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Regression Statistics', 2, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple R',1,TRUE)
> a<-table.element(a, sqrt(mysum$r.squared))
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'R-squared',1,TRUE)
> a<-table.element(a, mysum$r.squared)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Adjusted R-squared',1,TRUE)
> a<-table.element(a, mysum$adj.r.squared)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (value)',1,TRUE)
> a<-table.element(a, mysum$fstatistic[1])
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (DF numerator)',1,TRUE)
> a<-table.element(a, mysum$fstatistic[2])
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (DF denominator)',1,TRUE)
> a<-table.element(a, mysum$fstatistic[3])
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'p-value',1,TRUE)
> a<-table.element(a, 1-pf(mysum$fstatistic[1],mysum$fstatistic[2],mysum$fstatistic[3]))
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Residual Statistics', 2, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Residual Standard Deviation',1,TRUE)
> a<-table.element(a, mysum$sigma)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Sum Squared Residuals',1,TRUE)
> a<-table.element(a, sum(myerror*myerror))
> a<-table.row.end(a)
> a<-table.end(a)
> table.save(a,file="/var/fisher/rcomp/tmp/1321d71352143003.tab")
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Actuals, Interpolation, and Residuals', 4, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Time or Index', 1, TRUE)
> a<-table.element(a, 'Actuals', 1, TRUE)
> a<-table.element(a, 'Interpolation
Forecast', 1, TRUE)
> a<-table.element(a, 'Residuals
Prediction Error', 1, TRUE)
> a<-table.row.end(a)
> for (i in 1:n) {
+ a<-table.row.start(a)
+ a<-table.element(a,i, 1, TRUE)
+ a<-table.element(a,x[i])
+ a<-table.element(a,x[i]-mysum$resid[i])
+ a<-table.element(a,mysum$resid[i])
+ a<-table.row.end(a)
+ }
> a<-table.end(a)
> table.save(a,file="/var/fisher/rcomp/tmp/14oeny1352143003.tab")
> if (n > n25) {
+ a<-table.start()
+ a<-table.row.start(a)
+ a<-table.element(a,'Goldfeld-Quandt test for Heteroskedasticity',4,TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'p-values',header=TRUE)
+ a<-table.element(a,'Alternative Hypothesis',3,header=TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'breakpoint index',header=TRUE)
+ a<-table.element(a,'greater',header=TRUE)
+ a<-table.element(a,'2-sided',header=TRUE)
+ a<-table.element(a,'less',header=TRUE)
+ a<-table.row.end(a)
+ for (mypoint in kp3:nmkm3) {
+ a<-table.row.start(a)
+ a<-table.element(a,mypoint,header=TRUE)
+ a<-table.element(a,gqarr[mypoint-kp3+1,1])
+ a<-table.element(a,gqarr[mypoint-kp3+1,2])
+ a<-table.element(a,gqarr[mypoint-kp3+1,3])
+ a<-table.row.end(a)
+ }
+ a<-table.end(a)
+ table.save(a,file="/var/fisher/rcomp/tmp/15it711352143003.tab")
+ a<-table.start()
+ a<-table.row.start(a)
+ a<-table.element(a,'Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity',4,TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'Description',header=TRUE)
+ a<-table.element(a,'# significant tests',header=TRUE)
+ a<-table.element(a,'% significant tests',header=TRUE)
+ a<-table.element(a,'OK/NOK',header=TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'1% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant1)
+ a<-table.element(a,numsignificant1/numgqtests)
+ if (numsignificant1/numgqtests < 0.01) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'5% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant5)
+ a<-table.element(a,numsignificant5/numgqtests)
+ if (numsignificant5/numgqtests < 0.05) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'10% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant10)
+ a<-table.element(a,numsignificant10/numgqtests)
+ if (numsignificant10/numgqtests < 0.1) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.end(a)
+ table.save(a,file="/var/fisher/rcomp/tmp/166an01352143003.tab")
+ }
>
> try(system("convert tmp/13eon1352143003.ps tmp/13eon1352143003.png",intern=TRUE))
character(0)
> try(system("convert tmp/22zw61352143003.ps tmp/22zw61352143003.png",intern=TRUE))
character(0)
> try(system("convert tmp/3pyyc1352143003.ps tmp/3pyyc1352143003.png",intern=TRUE))
character(0)
> try(system("convert tmp/418av1352143003.ps tmp/418av1352143003.png",intern=TRUE))
character(0)
> try(system("convert tmp/5w2dp1352143003.ps tmp/5w2dp1352143003.png",intern=TRUE))
character(0)
> try(system("convert tmp/6v35m1352143003.ps tmp/6v35m1352143003.png",intern=TRUE))
character(0)
> try(system("convert tmp/7pl9e1352143003.ps tmp/7pl9e1352143003.png",intern=TRUE))
character(0)
> try(system("convert tmp/8gvot1352143003.ps tmp/8gvot1352143003.png",intern=TRUE))
character(0)
> try(system("convert tmp/9svyn1352143003.ps tmp/9svyn1352143003.png",intern=TRUE))
character(0)
> try(system("convert tmp/10x0b41352143003.ps tmp/10x0b41352143003.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
8.516 1.176 9.698