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(69
+ ,24
+ ,14
+ ,11
+ ,12
+ ,24
+ ,26
+ ,53
+ ,25
+ ,11
+ ,7
+ ,8
+ ,25
+ ,23
+ ,43
+ ,17
+ ,6
+ ,17
+ ,8
+ ,30
+ ,25
+ ,60
+ ,18
+ ,12
+ ,10
+ ,8
+ ,19
+ ,23
+ ,49
+ ,18
+ ,8
+ ,12
+ ,9
+ ,22
+ ,19
+ ,62
+ ,16
+ ,10
+ ,12
+ ,7
+ ,22
+ ,29
+ ,45
+ ,20
+ ,10
+ ,11
+ ,4
+ ,25
+ ,25
+ ,50
+ ,16
+ ,11
+ ,11
+ ,11
+ ,23
+ ,21
+ ,75
+ ,17
+ ,11
+ ,13
+ ,7
+ ,21
+ ,25
+ ,82
+ ,18
+ ,16
+ ,12
+ ,7
+ ,17
+ ,22
+ ,60
+ ,23
+ ,13
+ ,14
+ ,12
+ ,19
+ ,24
+ ,59
+ ,30
+ ,12
+ ,16
+ ,10
+ ,19
+ ,18
+ ,21
+ ,23
+ ,8
+ ,11
+ ,10
+ ,15
+ ,22
+ ,40
+ ,18
+ ,12
+ ,10
+ ,8
+ ,16
+ ,15
+ ,62
+ ,22
+ ,11
+ ,13
+ ,11
+ ,24
+ ,18
+ ,54
+ ,15
+ ,11
+ ,11
+ ,8
+ ,23
+ ,22
+ ,47
+ ,20
+ ,9
+ ,15
+ ,6
+ ,25
+ ,24
+ ,59
+ ,31
+ ,14
+ ,17
+ ,11
+ ,23
+ ,20
+ ,37
+ ,20
+ ,10
+ ,10
+ ,8
+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6
+ ,19
+ ,25
+ ,46
+ ,28
+ ,8
+ ,16
+ ,12
+ ,18
+ ,24
+ ,61
+ ,25
+ ,14
+ ,15
+ ,11
+ ,22
+ ,21
+ ,70
+ ,25
+ ,14
+ ,15
+ ,9
+ ,22
+ ,24
+ ,63
+ ,33
+ ,14
+ ,11
+ ,8
+ ,26
+ ,25
+ ,34
+ ,21
+ ,8
+ ,9
+ ,11
+ ,24
+ ,20
+ ,46
+ ,16
+ ,8
+ ,9
+ ,4
+ ,18
+ ,23
+ ,40
+ ,22
+ ,9
+ ,14
+ ,6
+ ,19
+ ,12
+ ,30
+ ,22
+ ,8
+ ,14
+ ,10
+ ,20
+ ,20
+ ,35
+ ,29
+ ,10
+ ,12
+ ,8
+ ,25
+ ,23
+ ,51
+ ,30
+ ,12
+ ,15
+ ,10
+ ,29
+ ,22
+ ,56
+ ,21
+ ,8
+ ,10
+ ,7
+ ,18
+ ,17
+ ,44
+ ,18
+ ,12
+ ,10
+ ,8
+ ,19
+ ,23
+ ,58
+ ,16
+ ,9
+ ,12
+ ,9
+ ,10
+ ,13)
+ ,dim=c(7
+ ,154)
+ ,dimnames=list(c('Anxiety'
+ ,'Concern'
+ ,'Doubts'
+ ,'Pexpectations'
+ ,'Pcriticism'
+ ,'Standards'
+ ,'Organization')
+ ,1:154))
> y <- array(NA,dim=c(7,154),dimnames=list(c('Anxiety','Concern','Doubts','Pexpectations','Pcriticism','Standards','Organization'),1:154))
> 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'
> #'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
Anxiety Concern Doubts Pexpectations Pcriticism Standards Organization
1 69 24 14 11 12 24 26
2 53 25 11 7 8 25 23
3 43 17 6 17 8 30 25
4 60 18 12 10 8 19 23
5 49 18 8 12 9 22 19
6 62 16 10 12 7 22 29
7 45 20 10 11 4 25 25
8 50 16 11 11 11 23 21
9 75 17 11 13 7 21 25
10 82 18 16 12 7 17 22
11 60 23 13 14 12 19 24
12 59 30 12 16 10 19 18
13 21 23 8 11 10 15 22
14 40 18 12 10 8 16 15
15 62 22 11 13 11 24 18
16 54 15 11 11 8 23 22
17 47 20 9 15 6 25 24
18 59 31 14 17 11 23 20
19 37 20 10 10 8 26 23
20 43 15 12 11 8 20 25
21 48 30 9 15 9 27 26
22 79 32 16 9 6 29 26
23 62 19 20 8 7 19 25
24 16 25 7 18 11 35 17
25 38 22 9 16 9 24 23
26 58 25 8 12 7 32 25
27 60 19 9 13 8 27 21
28 72 14 15 13 8 14 16
29 67 19 11 11 8 20 28
30 55 19 10 12 7 17 21
31 47 23 10 12 8 20 21
32 59 31 14 10 8 18 23
33 49 17 9 17 9 25 21
34 47 12 4 15 4 27 28
35 57 26 13 12 8 24 29
36 39 21 10 13 6 24 24
37 49 28 11 13 6 25 22
38 26 23 10 15 10 23 21
39 53 33 14 9 6 32 24
40 75 26 16 5 4 23 24
41 65 27 15 11 9 23 21
42 49 21 9 9 9 22 20
43 48 18 9 12 8 21 24
44 45 13 14 13 6 21 25
45 31 17 9 11 5 23 26
46 67 18 12 13 9 21 13
47 61 26 11 18 5 29 18
48 49 24 9 13 10 19 15
49 69 21 12 14 9 22 24
50 54 21 9 13 9 19 24
51 80 29 11 9 5 31 30
52 57 12 7 7 4 22 28
53 34 10 10 11 5 19 23
54 69 23 14 8 5 19 27
55 44 20 11 11 8 25 25
56 70 15 8 11 8 14 12
57 51 33 11 9 6 28 22
58 66 16 10 12 7 22 29
59 18 18 6 11 8 17 26
60 74 21 9 14 13 19 21
61 59 25 16 18 16 26 24
62 48 20 8 17 7 22 24
63 55 32 12 18 12 28 22
64 44 24 10 9 6 25 29
65 56 19 12 10 8 23 29
66 65 16 11 9 5 17 23
67 77 17 14 12 6 15 21
68 46 29 11 7 4 26 22
69 70 13 16 12 5 17 22
70 39 16 8 15 9 23 24
71 55 19 9 12 7 18 21
72 44 28 8 24 20 30 20
73 45 20 11 8 4 13 13
74 45 11 6 6 4 15 16
75 25 26 14 14 8 17 24
76 49 18 13 8 9 24 24
77 65 38 11 21 7 29 29
78 45 17 9 12 9 24 25
79 71 28 14 11 8 24 24
80 48 18 10 14 9 21 26
81 41 20 11 11 8 24 26
82 40 31 8 11 8 22 24
83 64 29 13 18 12 21 21
84 56 29 14 18 10 26 30
85 52 15 14 9 8 23 29
86 41 22 10 12 8 26 27
87 45 21 10 12 8 16 23
88 42 20 10 11 4 25 25
89 54 31 16 14 9 21 25
90 40 22 10 15 6 22 20
91 40 17 9 16 5 25 23
92 51 21 12 13 8 19 22
93 48 26 9 15 6 25 25
94 80 34 16 18 11 21 20
95 38 19 9 11 10 21 27
96 57 15 7 12 6 19 21
97 51 20 10 12 8 20 28
98 46 15 8 6 6 20 25
99 58 30 14 9 9 23 14
100 67 23 14 13 10 25 27
101 72 29 16 11 6 27 24
102 26 10 5 8 6 19 24
103 54 20 8 16 10 25 24
104 53 21 11 16 7 20 24
105 69 18 10 15 8 14 17
106 64 28 16 16 8 24 24
107 47 22 9 14 9 25 23
108 43 25 14 11 5 17 15
109 66 24 14 24 20 21 10
110 54 28 12 16 14 27 22
111 62 20 11 20 13 24 20
112 52 16 9 12 8 16 21
113 64 31 9 17 9 25 19
114 55 20 9 11 7 21 20
115 74 31 10 21 12 32 26
116 32 13 8 12 7 14 19
117 38 9 6 8 11 29 23
118 66 22 14 14 11 25 19
119 37 17 9 11 5 23 26
120 26 15 8 10 4 22 24
121 64 22 10 13 8 18 19
122 28 19 6 17 8 25 14
123 65 14 11 12 7 17 16
124 48 18 8 15 10 21 22
125 44 28 8 12 7 20 22
126 64 25 12 12 7 29 23
127 39 21 13 17 11 23 22
128 50 18 13 12 6 19 20
129 52 20 14 14 10 18 24
130 48 18 12 10 8 19 23
131 70 20 11 17 8 21 23
132 66 26 13 20 10 26 22
133 61 29 15 18 11 23 23
134 31 16 8 13 5 21 24
135 61 21 15 7 5 21 24
136 54 17 8 12 9 21 24
137 34 19 9 9 7 21 23
138 62 23 14 11 10 20 29
139 47 20 7 11 9 26 22
140 52 23 14 17 7 25 21
141 37 9 13 10 6 19 25
142 46 28 8 16 12 18 24
143 61 25 14 15 11 22 21
144 70 25 14 15 9 22 24
145 63 33 14 11 8 26 25
146 34 21 8 9 11 24 20
147 46 16 8 9 4 18 23
148 40 22 9 14 6 19 12
149 30 22 8 14 10 20 20
150 35 29 10 12 8 25 23
151 51 30 12 15 10 29 22
152 56 21 8 10 7 18 17
153 44 18 12 10 8 19 23
154 58 16 9 12 9 10 13
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Concern Doubts Pexpectations Pcriticism
20.38383 0.11318 2.57520 0.35652 -0.08463
Standards Organization
-0.07831 -0.02857
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-36.6767 -7.5943 -0.5128 7.9845 28.5058
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 20.38383 7.93724 2.568 0.0112 *
Concern 0.11318 0.20795 0.544 0.5871
Doubts 2.57520 0.37466 6.873 1.66e-10 ***
Pexpectations 0.35652 0.35185 1.013 0.3126
Pcriticism -0.08463 0.44396 -0.191 0.8491
Standards -0.07831 0.27639 -0.283 0.7773
Organization -0.02857 0.26790 -0.107 0.9152
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 11.41 on 147 degrees of freedom
Multiple R-squared: 0.3127, Adjusted R-squared: 0.2846
F-statistic: 11.15 on 6 and 147 DF, p-value: 3.13e-10
> 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.2542197 0.50843936 0.745780319
[2,] 0.4116048 0.82320959 0.588395203
[3,] 0.2721961 0.54439216 0.727803921
[4,] 0.3800054 0.76001084 0.619994579
[5,] 0.3871620 0.77432390 0.612838049
[6,] 0.3383559 0.67671187 0.661644065
[7,] 0.2617404 0.52348072 0.738259639
[8,] 0.2222477 0.44449543 0.777752286
[9,] 0.2182785 0.43655709 0.781721456
[10,] 0.2529518 0.50590360 0.747048198
[11,] 0.3976156 0.79523112 0.602384439
[12,] 0.3191050 0.63821007 0.680894966
[13,] 0.2632104 0.52642089 0.736789557
[14,] 0.5104877 0.97902454 0.489512271
[15,] 0.7629332 0.47413366 0.237066831
[16,] 0.7475233 0.50495346 0.252476731
[17,] 0.7637536 0.47249288 0.236246441
[18,] 0.7892150 0.42156997 0.210784984
[19,] 0.7780652 0.44386967 0.221934834
[20,] 0.7709134 0.45817329 0.229086644
[21,] 0.7296636 0.54067272 0.270336358
[22,] 0.6761304 0.64773915 0.323869577
[23,] 0.6191722 0.76165564 0.380827821
[24,] 0.5587149 0.88257027 0.441285135
[25,] 0.5213299 0.95734028 0.478670141
[26,] 0.4871928 0.97438569 0.512807156
[27,] 0.5167007 0.96659863 0.483299317
[28,] 0.4636168 0.92723355 0.536383223
[29,] 0.6288344 0.74233122 0.371165610
[30,] 0.5904658 0.81906841 0.409534204
[31,] 0.5678412 0.86431756 0.432158779
[32,] 0.5173251 0.96534978 0.482674891
[33,] 0.4801868 0.96037352 0.519813239
[34,] 0.4255450 0.85109005 0.574454976
[35,] 0.5424506 0.91509873 0.457549364
[36,] 0.6201460 0.75970792 0.379853958
[37,] 0.6551442 0.68971161 0.344855805
[38,] 0.6248901 0.75021985 0.375109923
[39,] 0.5839717 0.83205669 0.416028343
[40,] 0.5992452 0.80150964 0.400754818
[41,] 0.5657327 0.86853456 0.434267279
[42,] 0.7548885 0.49022307 0.245111537
[43,] 0.7800920 0.43981602 0.219908011
[44,] 0.8169464 0.36610726 0.183053631
[45,] 0.8026567 0.39468665 0.197343324
[46,] 0.7877665 0.42446709 0.212233547
[47,] 0.9017897 0.19642057 0.098210283
[48,] 0.8816482 0.23670354 0.118351769
[49,] 0.9041562 0.19168763 0.095843815
[50,] 0.9483308 0.10333834 0.051669172
[51,] 0.9852160 0.02956808 0.014784041
[52,] 0.9816255 0.03674894 0.018374469
[53,] 0.9755804 0.04883910 0.024419551
[54,] 0.9681097 0.06378053 0.031890266
[55,] 0.9614731 0.07705378 0.038526888
[56,] 0.9519844 0.09603117 0.048015584
[57,] 0.9566840 0.08663199 0.043315994
[58,] 0.9683778 0.06324447 0.031622235
[59,] 0.9621262 0.07574769 0.037873847
[60,] 0.9580339 0.08393210 0.041966052
[61,] 0.9493264 0.10134714 0.050673571
[62,] 0.9423587 0.11528269 0.057641346
[63,] 0.9412953 0.11740931 0.058704655
[64,] 0.9326476 0.13470481 0.067352406
[65,] 0.9273454 0.14530923 0.072654615
[66,] 0.9943709 0.01125820 0.005629099
[67,] 0.9931191 0.01376172 0.006880860
[68,] 0.9922265 0.01554697 0.007773485
[69,] 0.9893498 0.02130039 0.010650196
[70,] 0.9900537 0.01989268 0.009946341
[71,] 0.9864720 0.02705608 0.013528038
[72,] 0.9853795 0.02924109 0.014620544
[73,] 0.9819783 0.03604350 0.018021749
[74,] 0.9767157 0.04656868 0.023284338
[75,] 0.9718615 0.05627707 0.028138537
[76,] 0.9652413 0.06951741 0.034758707
[77,] 0.9601435 0.07971297 0.039856486
[78,] 0.9510922 0.09781567 0.048907833
[79,] 0.9419061 0.11618776 0.058093881
[80,] 0.9464687 0.10706255 0.053531277
[81,] 0.9450303 0.10993944 0.054969719
[82,] 0.9361002 0.12779956 0.063899782
[83,] 0.9211392 0.15772151 0.078860757
[84,] 0.9017111 0.19657771 0.098288857
[85,] 0.8987892 0.20242152 0.101210762
[86,] 0.8899032 0.22019356 0.110096781
[87,] 0.9135712 0.17285751 0.086428757
[88,] 0.8919910 0.21601797 0.108008985
[89,] 0.8770909 0.24581816 0.122909081
[90,] 0.8494184 0.30116318 0.150581589
[91,] 0.8335077 0.33298467 0.166492335
[92,] 0.8273938 0.34521246 0.172606231
[93,] 0.8067121 0.38657571 0.193287856
[94,] 0.7862226 0.42755486 0.213777430
[95,] 0.7460186 0.50796286 0.253981432
[96,] 0.8099019 0.38019614 0.190098070
[97,] 0.7726264 0.45474719 0.227373596
[98,] 0.7302349 0.53953012 0.269765062
[99,] 0.7698560 0.46028807 0.230144033
[100,] 0.7402678 0.51946447 0.259732234
[101,] 0.7101049 0.57979017 0.289895083
[102,] 0.6724168 0.65516634 0.327583169
[103,] 0.6403659 0.71926825 0.359634127
[104,] 0.6430137 0.71397252 0.356986261
[105,] 0.6311606 0.73767888 0.368839438
[106,] 0.7605527 0.47889459 0.239447294
[107,] 0.7581714 0.48365721 0.241828606
[108,] 0.7414480 0.51710404 0.258552019
[109,] 0.7149929 0.57001422 0.285007109
[110,] 0.6714504 0.65709920 0.328549599
[111,] 0.6886605 0.62267893 0.311339465
[112,] 0.7055490 0.58890202 0.294451010
[113,] 0.6997171 0.60056570 0.300282851
[114,] 0.7478483 0.50430337 0.252151687
[115,] 0.7070249 0.58595026 0.292975130
[116,] 0.6577439 0.68451212 0.342256061
[117,] 0.7022637 0.59547266 0.297736330
[118,] 0.7631375 0.47372491 0.236862457
[119,] 0.7136860 0.57262793 0.286313964
[120,] 0.6882633 0.62347345 0.311736725
[121,] 0.6270969 0.74580624 0.372903122
[122,] 0.7399601 0.52007978 0.260039892
[123,] 0.7582222 0.48355568 0.241777840
[124,] 0.6910181 0.61796374 0.308981870
[125,] 0.6403946 0.71921071 0.359605355
[126,] 0.5615642 0.87687170 0.438435849
[127,] 0.6426263 0.71474730 0.357373652
[128,] 0.6022969 0.79540628 0.397703138
[129,] 0.5115445 0.97691099 0.488455495
[130,] 0.7301116 0.53977685 0.269888426
[131,] 0.6338858 0.73222840 0.366114199
[132,] 0.5992974 0.80140526 0.400702629
[133,] 0.4739186 0.94783721 0.526081393
[134,] 0.3353234 0.67064681 0.664676593
[135,] 0.3527864 0.70557273 0.647213637
> postscript(file="/var/www/html/rcomp/tmp/1gyu21290422018.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/2gyu21290422018.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/3gyu21290422018.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/49pb51290422018.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/59pb51290422018.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 = 154
Frequency = 1
1 2 3 4 5 6
9.5630741 2.2556679 2.9206174 5.9332908 4.7263717 12.9187135
7 8 9 10 11 12
-4.3107124 -1.1116375 22.6812341 16.6496127 1.7331938 1.4624219
13 14 15 16 17 18
-23.8608847 -14.5301709 9.4888471 2.7762077 -1.0208937 -3.7026661
19 20 21 22 23 24
-11.5944713 -10.9482412 -0.6850529 14.1040243 -12.0959684 -27.4996099
25 26 27 28 29 30
-10.4567562 13.7193600 13.0455319 8.9993229 15.2599284 4.9590783
31 32 33 34 35 36
-3.1740736 -1.7667916 0.7738155 12.8621917 -0.6974497 -11.0745485
37 38 39 40 41 42
-4.4208398 -24.8394286 -6.6809417 11.5129204 2.1732858 2.9097536
43 44 45 46 47 48
1.1310468 -14.6762785 -15.4393936 11.8193379 6.1372780 0.8509890
49 50 51 52 53 54
13.5157997 6.3629857 28.5058342 17.5971882 -14.6212733 9.7903787
55 56 57 58 59 60
-7.5473789 25.5113386 -1.3257212 16.9187135 -21.0429511 26.2593047
61 62 63 64 65 66
-7.7581293 1.6909574 -2.4886319 -4.7668690 2.3047547 13.6808487
67 68 69 70 71 72
16.6433720 -5.4858462 5.0462543 -5.8956903 7.6125943 -4.0976564
73 74 75 76 77 78
-7.0988969 7.7511163 -36.6767173 -6.4240996 8.1930137 -1.4076307
79 80 81 82 83 84
10.7146810 -2.0154345 -10.5971278 -5.3302800 3.6989492 -6.3968660
85 86 87 88 89 90
-6.0364004 -8.4196182 -5.2038355 -7.3107124 -12.9665762 -11.1716613
91 92 93 94 95 96
-8.1510685 -4.5043844 -0.6714199 11.2942347 -8.3706507 15.2094059
97 98 99 100 101 102
1.3654271 3.9659071 -2.0779697 6.9008240 6.5167689 -8.5624994
103 104 105 106 107 108
8.5363224 -0.9479370 17.7381277 -3.2183309 -0.6653992 -18.0049575
109 110 111 112 113 114
1.9133834 -2.2319074 7.4459578 4.8801460 14.1321393 8.0623107
115 116 117 118 119 120
21.1329052 -12.5034981 2.1532241 5.5135982 -9.4393936 -17.5013841
121 122 123 124 125 126
13.3688289 -13.0115309 12.8069606 2.7488220 -1.6456477 9.1264799
127 128 129 130 131 132
-19.9385153 -7.6099171 -8.7500443 -6.0667092 15.9431062 5.5763185
133 134 135 136 137 138
-4.3223310 -13.6778106 -0.1310052 9.9040646 -12.0257693 2.2794275
139 140 141 142 143 144
5.8306822 -9.9505539 -18.7354122 -0.7480622 -0.3602807 8.5561465
145 146 147 148 149 150
2.3339645 -9.1891487 2.4001349 -8.7033994 -15.4828278 -15.4044652
151 152 153 154
-5.2836574 11.5602157 -10.0667092 10.2663763
> postscript(file="/var/www/html/rcomp/tmp/69pb51290422018.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 = 154
Frequency = 1
lag(myerror, k = 1) myerror
0 9.5630741 NA
1 2.2556679 9.5630741
2 2.9206174 2.2556679
3 5.9332908 2.9206174
4 4.7263717 5.9332908
5 12.9187135 4.7263717
6 -4.3107124 12.9187135
7 -1.1116375 -4.3107124
8 22.6812341 -1.1116375
9 16.6496127 22.6812341
10 1.7331938 16.6496127
11 1.4624219 1.7331938
12 -23.8608847 1.4624219
13 -14.5301709 -23.8608847
14 9.4888471 -14.5301709
15 2.7762077 9.4888471
16 -1.0208937 2.7762077
17 -3.7026661 -1.0208937
18 -11.5944713 -3.7026661
19 -10.9482412 -11.5944713
20 -0.6850529 -10.9482412
21 14.1040243 -0.6850529
22 -12.0959684 14.1040243
23 -27.4996099 -12.0959684
24 -10.4567562 -27.4996099
25 13.7193600 -10.4567562
26 13.0455319 13.7193600
27 8.9993229 13.0455319
28 15.2599284 8.9993229
29 4.9590783 15.2599284
30 -3.1740736 4.9590783
31 -1.7667916 -3.1740736
32 0.7738155 -1.7667916
33 12.8621917 0.7738155
34 -0.6974497 12.8621917
35 -11.0745485 -0.6974497
36 -4.4208398 -11.0745485
37 -24.8394286 -4.4208398
38 -6.6809417 -24.8394286
39 11.5129204 -6.6809417
40 2.1732858 11.5129204
41 2.9097536 2.1732858
42 1.1310468 2.9097536
43 -14.6762785 1.1310468
44 -15.4393936 -14.6762785
45 11.8193379 -15.4393936
46 6.1372780 11.8193379
47 0.8509890 6.1372780
48 13.5157997 0.8509890
49 6.3629857 13.5157997
50 28.5058342 6.3629857
51 17.5971882 28.5058342
52 -14.6212733 17.5971882
53 9.7903787 -14.6212733
54 -7.5473789 9.7903787
55 25.5113386 -7.5473789
56 -1.3257212 25.5113386
57 16.9187135 -1.3257212
58 -21.0429511 16.9187135
59 26.2593047 -21.0429511
60 -7.7581293 26.2593047
61 1.6909574 -7.7581293
62 -2.4886319 1.6909574
63 -4.7668690 -2.4886319
64 2.3047547 -4.7668690
65 13.6808487 2.3047547
66 16.6433720 13.6808487
67 -5.4858462 16.6433720
68 5.0462543 -5.4858462
69 -5.8956903 5.0462543
70 7.6125943 -5.8956903
71 -4.0976564 7.6125943
72 -7.0988969 -4.0976564
73 7.7511163 -7.0988969
74 -36.6767173 7.7511163
75 -6.4240996 -36.6767173
76 8.1930137 -6.4240996
77 -1.4076307 8.1930137
78 10.7146810 -1.4076307
79 -2.0154345 10.7146810
80 -10.5971278 -2.0154345
81 -5.3302800 -10.5971278
82 3.6989492 -5.3302800
83 -6.3968660 3.6989492
84 -6.0364004 -6.3968660
85 -8.4196182 -6.0364004
86 -5.2038355 -8.4196182
87 -7.3107124 -5.2038355
88 -12.9665762 -7.3107124
89 -11.1716613 -12.9665762
90 -8.1510685 -11.1716613
91 -4.5043844 -8.1510685
92 -0.6714199 -4.5043844
93 11.2942347 -0.6714199
94 -8.3706507 11.2942347
95 15.2094059 -8.3706507
96 1.3654271 15.2094059
97 3.9659071 1.3654271
98 -2.0779697 3.9659071
99 6.9008240 -2.0779697
100 6.5167689 6.9008240
101 -8.5624994 6.5167689
102 8.5363224 -8.5624994
103 -0.9479370 8.5363224
104 17.7381277 -0.9479370
105 -3.2183309 17.7381277
106 -0.6653992 -3.2183309
107 -18.0049575 -0.6653992
108 1.9133834 -18.0049575
109 -2.2319074 1.9133834
110 7.4459578 -2.2319074
111 4.8801460 7.4459578
112 14.1321393 4.8801460
113 8.0623107 14.1321393
114 21.1329052 8.0623107
115 -12.5034981 21.1329052
116 2.1532241 -12.5034981
117 5.5135982 2.1532241
118 -9.4393936 5.5135982
119 -17.5013841 -9.4393936
120 13.3688289 -17.5013841
121 -13.0115309 13.3688289
122 12.8069606 -13.0115309
123 2.7488220 12.8069606
124 -1.6456477 2.7488220
125 9.1264799 -1.6456477
126 -19.9385153 9.1264799
127 -7.6099171 -19.9385153
128 -8.7500443 -7.6099171
129 -6.0667092 -8.7500443
130 15.9431062 -6.0667092
131 5.5763185 15.9431062
132 -4.3223310 5.5763185
133 -13.6778106 -4.3223310
134 -0.1310052 -13.6778106
135 9.9040646 -0.1310052
136 -12.0257693 9.9040646
137 2.2794275 -12.0257693
138 5.8306822 2.2794275
139 -9.9505539 5.8306822
140 -18.7354122 -9.9505539
141 -0.7480622 -18.7354122
142 -0.3602807 -0.7480622
143 8.5561465 -0.3602807
144 2.3339645 8.5561465
145 -9.1891487 2.3339645
146 2.4001349 -9.1891487
147 -8.7033994 2.4001349
148 -15.4828278 -8.7033994
149 -15.4044652 -15.4828278
150 -5.2836574 -15.4044652
151 11.5602157 -5.2836574
152 -10.0667092 11.5602157
153 10.2663763 -10.0667092
154 NA 10.2663763
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 2.2556679 9.5630741
[2,] 2.9206174 2.2556679
[3,] 5.9332908 2.9206174
[4,] 4.7263717 5.9332908
[5,] 12.9187135 4.7263717
[6,] -4.3107124 12.9187135
[7,] -1.1116375 -4.3107124
[8,] 22.6812341 -1.1116375
[9,] 16.6496127 22.6812341
[10,] 1.7331938 16.6496127
[11,] 1.4624219 1.7331938
[12,] -23.8608847 1.4624219
[13,] -14.5301709 -23.8608847
[14,] 9.4888471 -14.5301709
[15,] 2.7762077 9.4888471
[16,] -1.0208937 2.7762077
[17,] -3.7026661 -1.0208937
[18,] -11.5944713 -3.7026661
[19,] -10.9482412 -11.5944713
[20,] -0.6850529 -10.9482412
[21,] 14.1040243 -0.6850529
[22,] -12.0959684 14.1040243
[23,] -27.4996099 -12.0959684
[24,] -10.4567562 -27.4996099
[25,] 13.7193600 -10.4567562
[26,] 13.0455319 13.7193600
[27,] 8.9993229 13.0455319
[28,] 15.2599284 8.9993229
[29,] 4.9590783 15.2599284
[30,] -3.1740736 4.9590783
[31,] -1.7667916 -3.1740736
[32,] 0.7738155 -1.7667916
[33,] 12.8621917 0.7738155
[34,] -0.6974497 12.8621917
[35,] -11.0745485 -0.6974497
[36,] -4.4208398 -11.0745485
[37,] -24.8394286 -4.4208398
[38,] -6.6809417 -24.8394286
[39,] 11.5129204 -6.6809417
[40,] 2.1732858 11.5129204
[41,] 2.9097536 2.1732858
[42,] 1.1310468 2.9097536
[43,] -14.6762785 1.1310468
[44,] -15.4393936 -14.6762785
[45,] 11.8193379 -15.4393936
[46,] 6.1372780 11.8193379
[47,] 0.8509890 6.1372780
[48,] 13.5157997 0.8509890
[49,] 6.3629857 13.5157997
[50,] 28.5058342 6.3629857
[51,] 17.5971882 28.5058342
[52,] -14.6212733 17.5971882
[53,] 9.7903787 -14.6212733
[54,] -7.5473789 9.7903787
[55,] 25.5113386 -7.5473789
[56,] -1.3257212 25.5113386
[57,] 16.9187135 -1.3257212
[58,] -21.0429511 16.9187135
[59,] 26.2593047 -21.0429511
[60,] -7.7581293 26.2593047
[61,] 1.6909574 -7.7581293
[62,] -2.4886319 1.6909574
[63,] -4.7668690 -2.4886319
[64,] 2.3047547 -4.7668690
[65,] 13.6808487 2.3047547
[66,] 16.6433720 13.6808487
[67,] -5.4858462 16.6433720
[68,] 5.0462543 -5.4858462
[69,] -5.8956903 5.0462543
[70,] 7.6125943 -5.8956903
[71,] -4.0976564 7.6125943
[72,] -7.0988969 -4.0976564
[73,] 7.7511163 -7.0988969
[74,] -36.6767173 7.7511163
[75,] -6.4240996 -36.6767173
[76,] 8.1930137 -6.4240996
[77,] -1.4076307 8.1930137
[78,] 10.7146810 -1.4076307
[79,] -2.0154345 10.7146810
[80,] -10.5971278 -2.0154345
[81,] -5.3302800 -10.5971278
[82,] 3.6989492 -5.3302800
[83,] -6.3968660 3.6989492
[84,] -6.0364004 -6.3968660
[85,] -8.4196182 -6.0364004
[86,] -5.2038355 -8.4196182
[87,] -7.3107124 -5.2038355
[88,] -12.9665762 -7.3107124
[89,] -11.1716613 -12.9665762
[90,] -8.1510685 -11.1716613
[91,] -4.5043844 -8.1510685
[92,] -0.6714199 -4.5043844
[93,] 11.2942347 -0.6714199
[94,] -8.3706507 11.2942347
[95,] 15.2094059 -8.3706507
[96,] 1.3654271 15.2094059
[97,] 3.9659071 1.3654271
[98,] -2.0779697 3.9659071
[99,] 6.9008240 -2.0779697
[100,] 6.5167689 6.9008240
[101,] -8.5624994 6.5167689
[102,] 8.5363224 -8.5624994
[103,] -0.9479370 8.5363224
[104,] 17.7381277 -0.9479370
[105,] -3.2183309 17.7381277
[106,] -0.6653992 -3.2183309
[107,] -18.0049575 -0.6653992
[108,] 1.9133834 -18.0049575
[109,] -2.2319074 1.9133834
[110,] 7.4459578 -2.2319074
[111,] 4.8801460 7.4459578
[112,] 14.1321393 4.8801460
[113,] 8.0623107 14.1321393
[114,] 21.1329052 8.0623107
[115,] -12.5034981 21.1329052
[116,] 2.1532241 -12.5034981
[117,] 5.5135982 2.1532241
[118,] -9.4393936 5.5135982
[119,] -17.5013841 -9.4393936
[120,] 13.3688289 -17.5013841
[121,] -13.0115309 13.3688289
[122,] 12.8069606 -13.0115309
[123,] 2.7488220 12.8069606
[124,] -1.6456477 2.7488220
[125,] 9.1264799 -1.6456477
[126,] -19.9385153 9.1264799
[127,] -7.6099171 -19.9385153
[128,] -8.7500443 -7.6099171
[129,] -6.0667092 -8.7500443
[130,] 15.9431062 -6.0667092
[131,] 5.5763185 15.9431062
[132,] -4.3223310 5.5763185
[133,] -13.6778106 -4.3223310
[134,] -0.1310052 -13.6778106
[135,] 9.9040646 -0.1310052
[136,] -12.0257693 9.9040646
[137,] 2.2794275 -12.0257693
[138,] 5.8306822 2.2794275
[139,] -9.9505539 5.8306822
[140,] -18.7354122 -9.9505539
[141,] -0.7480622 -18.7354122
[142,] -0.3602807 -0.7480622
[143,] 8.5561465 -0.3602807
[144,] 2.3339645 8.5561465
[145,] -9.1891487 2.3339645
[146,] 2.4001349 -9.1891487
[147,] -8.7033994 2.4001349
[148,] -15.4828278 -8.7033994
[149,] -15.4044652 -15.4828278
[150,] -5.2836574 -15.4044652
[151,] 11.5602157 -5.2836574
[152,] -10.0667092 11.5602157
[153,] 10.2663763 -10.0667092
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 2.2556679 9.5630741
2 2.9206174 2.2556679
3 5.9332908 2.9206174
4 4.7263717 5.9332908
5 12.9187135 4.7263717
6 -4.3107124 12.9187135
7 -1.1116375 -4.3107124
8 22.6812341 -1.1116375
9 16.6496127 22.6812341
10 1.7331938 16.6496127
11 1.4624219 1.7331938
12 -23.8608847 1.4624219
13 -14.5301709 -23.8608847
14 9.4888471 -14.5301709
15 2.7762077 9.4888471
16 -1.0208937 2.7762077
17 -3.7026661 -1.0208937
18 -11.5944713 -3.7026661
19 -10.9482412 -11.5944713
20 -0.6850529 -10.9482412
21 14.1040243 -0.6850529
22 -12.0959684 14.1040243
23 -27.4996099 -12.0959684
24 -10.4567562 -27.4996099
25 13.7193600 -10.4567562
26 13.0455319 13.7193600
27 8.9993229 13.0455319
28 15.2599284 8.9993229
29 4.9590783 15.2599284
30 -3.1740736 4.9590783
31 -1.7667916 -3.1740736
32 0.7738155 -1.7667916
33 12.8621917 0.7738155
34 -0.6974497 12.8621917
35 -11.0745485 -0.6974497
36 -4.4208398 -11.0745485
37 -24.8394286 -4.4208398
38 -6.6809417 -24.8394286
39 11.5129204 -6.6809417
40 2.1732858 11.5129204
41 2.9097536 2.1732858
42 1.1310468 2.9097536
43 -14.6762785 1.1310468
44 -15.4393936 -14.6762785
45 11.8193379 -15.4393936
46 6.1372780 11.8193379
47 0.8509890 6.1372780
48 13.5157997 0.8509890
49 6.3629857 13.5157997
50 28.5058342 6.3629857
51 17.5971882 28.5058342
52 -14.6212733 17.5971882
53 9.7903787 -14.6212733
54 -7.5473789 9.7903787
55 25.5113386 -7.5473789
56 -1.3257212 25.5113386
57 16.9187135 -1.3257212
58 -21.0429511 16.9187135
59 26.2593047 -21.0429511
60 -7.7581293 26.2593047
61 1.6909574 -7.7581293
62 -2.4886319 1.6909574
63 -4.7668690 -2.4886319
64 2.3047547 -4.7668690
65 13.6808487 2.3047547
66 16.6433720 13.6808487
67 -5.4858462 16.6433720
68 5.0462543 -5.4858462
69 -5.8956903 5.0462543
70 7.6125943 -5.8956903
71 -4.0976564 7.6125943
72 -7.0988969 -4.0976564
73 7.7511163 -7.0988969
74 -36.6767173 7.7511163
75 -6.4240996 -36.6767173
76 8.1930137 -6.4240996
77 -1.4076307 8.1930137
78 10.7146810 -1.4076307
79 -2.0154345 10.7146810
80 -10.5971278 -2.0154345
81 -5.3302800 -10.5971278
82 3.6989492 -5.3302800
83 -6.3968660 3.6989492
84 -6.0364004 -6.3968660
85 -8.4196182 -6.0364004
86 -5.2038355 -8.4196182
87 -7.3107124 -5.2038355
88 -12.9665762 -7.3107124
89 -11.1716613 -12.9665762
90 -8.1510685 -11.1716613
91 -4.5043844 -8.1510685
92 -0.6714199 -4.5043844
93 11.2942347 -0.6714199
94 -8.3706507 11.2942347
95 15.2094059 -8.3706507
96 1.3654271 15.2094059
97 3.9659071 1.3654271
98 -2.0779697 3.9659071
99 6.9008240 -2.0779697
100 6.5167689 6.9008240
101 -8.5624994 6.5167689
102 8.5363224 -8.5624994
103 -0.9479370 8.5363224
104 17.7381277 -0.9479370
105 -3.2183309 17.7381277
106 -0.6653992 -3.2183309
107 -18.0049575 -0.6653992
108 1.9133834 -18.0049575
109 -2.2319074 1.9133834
110 7.4459578 -2.2319074
111 4.8801460 7.4459578
112 14.1321393 4.8801460
113 8.0623107 14.1321393
114 21.1329052 8.0623107
115 -12.5034981 21.1329052
116 2.1532241 -12.5034981
117 5.5135982 2.1532241
118 -9.4393936 5.5135982
119 -17.5013841 -9.4393936
120 13.3688289 -17.5013841
121 -13.0115309 13.3688289
122 12.8069606 -13.0115309
123 2.7488220 12.8069606
124 -1.6456477 2.7488220
125 9.1264799 -1.6456477
126 -19.9385153 9.1264799
127 -7.6099171 -19.9385153
128 -8.7500443 -7.6099171
129 -6.0667092 -8.7500443
130 15.9431062 -6.0667092
131 5.5763185 15.9431062
132 -4.3223310 5.5763185
133 -13.6778106 -4.3223310
134 -0.1310052 -13.6778106
135 9.9040646 -0.1310052
136 -12.0257693 9.9040646
137 2.2794275 -12.0257693
138 5.8306822 2.2794275
139 -9.9505539 5.8306822
140 -18.7354122 -9.9505539
141 -0.7480622 -18.7354122
142 -0.3602807 -0.7480622
143 8.5561465 -0.3602807
144 2.3339645 8.5561465
145 -9.1891487 2.3339645
146 2.4001349 -9.1891487
147 -8.7033994 2.4001349
148 -15.4828278 -8.7033994
149 -15.4044652 -15.4828278
150 -5.2836574 -15.4044652
151 11.5602157 -5.2836574
152 -10.0667092 11.5602157
153 10.2663763 -10.0667092
> 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/72ht81290422018.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/8u8sb1290422018.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/9u8sb1290422018.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/10u8sb1290422018.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/11ri8k1290422018.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/12c0o71290422018.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/13qsmg1290422018.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/14ts341290422018.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/15ft1a1290422018.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/160t0g1290422018.tab")
+ }
>
> try(system("convert tmp/1gyu21290422018.ps tmp/1gyu21290422018.png",intern=TRUE))
character(0)
> try(system("convert tmp/2gyu21290422018.ps tmp/2gyu21290422018.png",intern=TRUE))
character(0)
> try(system("convert tmp/3gyu21290422018.ps tmp/3gyu21290422018.png",intern=TRUE))
character(0)
> try(system("convert tmp/49pb51290422018.ps tmp/49pb51290422018.png",intern=TRUE))
character(0)
> try(system("convert tmp/59pb51290422018.ps tmp/59pb51290422018.png",intern=TRUE))
character(0)
> try(system("convert tmp/69pb51290422018.ps tmp/69pb51290422018.png",intern=TRUE))
character(0)
> try(system("convert tmp/72ht81290422018.ps tmp/72ht81290422018.png",intern=TRUE))
character(0)
> try(system("convert tmp/8u8sb1290422018.ps tmp/8u8sb1290422018.png",intern=TRUE))
character(0)
> try(system("convert tmp/9u8sb1290422018.ps tmp/9u8sb1290422018.png",intern=TRUE))
character(0)
> try(system("convert tmp/10u8sb1290422018.ps tmp/10u8sb1290422018.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
4.160 1.793 9.703