R version 2.11.1 (2010-05-31)
Copyright (C) 2010 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(11
+ ,24
+ ,7
+ ,25
+ ,17
+ ,30
+ ,10
+ ,19
+ ,12
+ ,22
+ ,12
+ ,22
+ ,11
+ ,25
+ ,11
+ ,23
+ ,12
+ ,17
+ ,13
+ ,21
+ ,14
+ ,19
+ ,16
+ ,19
+ ,11
+ ,15
+ ,10
+ ,16
+ ,11
+ ,23
+ ,15
+ ,27
+ ,9
+ ,22
+ ,11
+ ,14
+ ,17
+ ,22
+ ,17
+ ,23
+ ,11
+ ,23
+ ,18
+ ,21
+ ,14
+ ,19
+ ,10
+ ,18
+ ,11
+ ,20
+ ,15
+ ,23
+ ,15
+ ,25
+ ,13
+ ,19
+ ,16
+ ,24
+ ,13
+ ,22
+ ,9
+ ,25
+ ,18
+ ,26
+ ,18
+ ,29
+ ,12
+ ,32
+ ,17
+ ,25
+ ,9
+ ,29
+ ,9
+ ,28
+ ,12
+ ,17
+ ,18
+ ,28
+ ,12
+ ,29
+ ,18
+ ,26
+ ,14
+ ,25
+ ,15
+ ,14
+ ,16
+ ,25
+ ,10
+ ,26
+ ,11
+ ,20
+ ,14
+ ,18
+ ,9
+ ,32
+ ,12
+ ,25
+ ,17
+ ,25
+ ,5
+ ,23
+ ,12
+ ,21
+ ,12
+ ,20
+ ,6
+ ,15
+ ,24
+ ,30
+ ,12
+ ,24
+ ,12
+ ,26
+ ,14
+ ,24
+ ,7
+ ,22
+ ,13
+ ,14
+ ,12
+ ,24
+ ,13
+ ,24
+ ,14
+ ,24
+ ,8
+ ,24
+ ,11
+ ,19
+ ,9
+ ,31
+ ,11
+ ,22
+ ,13
+ ,27
+ ,10
+ ,19
+ ,11
+ ,25
+ ,12
+ ,20
+ ,9
+ ,21
+ ,15
+ ,27
+ ,18
+ ,23
+ ,15
+ ,25
+ ,12
+ ,20
+ ,13
+ ,21
+ ,14
+ ,22
+ ,10
+ ,23
+ ,13
+ ,25
+ ,13
+ ,25
+ ,11
+ ,17
+ ,13
+ ,19
+ ,16
+ ,25
+ ,8
+ ,19
+ ,16
+ ,20
+ ,11
+ ,26
+ ,9
+ ,23
+ ,16
+ ,27
+ ,12
+ ,17
+ ,14
+ ,17
+ ,8
+ ,19
+ ,9
+ ,17
+ ,15
+ ,22
+ ,11
+ ,21
+ ,21
+ ,32
+ ,14
+ ,21
+ ,18
+ ,21
+ ,12
+ ,18
+ ,13
+ ,18
+ ,15
+ ,23
+ ,12
+ ,19
+ ,19
+ ,20
+ ,15
+ ,21
+ ,11
+ ,20
+ ,11
+ ,17
+ ,10
+ ,18
+ ,13
+ ,19
+ ,15
+ ,22
+ ,12
+ ,15
+ ,12
+ ,14
+ ,16
+ ,18
+ ,9
+ ,24
+ ,18
+ ,35
+ ,8
+ ,29
+ ,13
+ ,21
+ ,17
+ ,25
+ ,9
+ ,20
+ ,15
+ ,22
+ ,8
+ ,13
+ ,7
+ ,26
+ ,12
+ ,17
+ ,14
+ ,25
+ ,6
+ ,20
+ ,8
+ ,19
+ ,17
+ ,21
+ ,10
+ ,22
+ ,11
+ ,24
+ ,14
+ ,21
+ ,11
+ ,26
+ ,13
+ ,24
+ ,12
+ ,16
+ ,11
+ ,23
+ ,9
+ ,18
+ ,12
+ ,16
+ ,20
+ ,26
+ ,12
+ ,19
+ ,13
+ ,21
+ ,12
+ ,21
+ ,12
+ ,22
+ ,9
+ ,23
+ ,15
+ ,29
+ ,24
+ ,21
+ ,7
+ ,21
+ ,17
+ ,23
+ ,11
+ ,27
+ ,17
+ ,25
+ ,11
+ ,21
+ ,12
+ ,10
+ ,14
+ ,20
+ ,11
+ ,26
+ ,16
+ ,24
+ ,21
+ ,29
+ ,14
+ ,19
+ ,20
+ ,24
+ ,13
+ ,19
+ ,11
+ ,24
+ ,15
+ ,22
+ ,19
+ ,17)
+ ,dim=c(2
+ ,159)
+ ,dimnames=list(c('ParentalExpectations'
+ ,'PersonalStandards
')
+ ,1:159))
> y <- array(NA,dim=c(2,159),dimnames=list(c('ParentalExpectations','PersonalStandards
'),1:159))
> for (i in 1:dim(x)[1])
+ {
+ for (j in 1:dim(x)[2])
+ {
+ y[i,j] <- as.numeric(x[i,j])
+ }
+ }
> par3 = '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
> 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
ParentalExpectations PersonalStandards\r t
1 11 24 1
2 7 25 2
3 17 30 3
4 10 19 4
5 12 22 5
6 12 22 6
7 11 25 7
8 11 23 8
9 12 17 9
10 13 21 10
11 14 19 11
12 16 19 12
13 11 15 13
14 10 16 14
15 11 23 15
16 15 27 16
17 9 22 17
18 11 14 18
19 17 22 19
20 17 23 20
21 11 23 21
22 18 21 22
23 14 19 23
24 10 18 24
25 11 20 25
26 15 23 26
27 15 25 27
28 13 19 28
29 16 24 29
30 13 22 30
31 9 25 31
32 18 26 32
33 18 29 33
34 12 32 34
35 17 25 35
36 9 29 36
37 9 28 37
38 12 17 38
39 18 28 39
40 12 29 40
41 18 26 41
42 14 25 42
43 15 14 43
44 16 25 44
45 10 26 45
46 11 20 46
47 14 18 47
48 9 32 48
49 12 25 49
50 17 25 50
51 5 23 51
52 12 21 52
53 12 20 53
54 6 15 54
55 24 30 55
56 12 24 56
57 12 26 57
58 14 24 58
59 7 22 59
60 13 14 60
61 12 24 61
62 13 24 62
63 14 24 63
64 8 24 64
65 11 19 65
66 9 31 66
67 11 22 67
68 13 27 68
69 10 19 69
70 11 25 70
71 12 20 71
72 9 21 72
73 15 27 73
74 18 23 74
75 15 25 75
76 12 20 76
77 13 21 77
78 14 22 78
79 10 23 79
80 13 25 80
81 13 25 81
82 11 17 82
83 13 19 83
84 16 25 84
85 8 19 85
86 16 20 86
87 11 26 87
88 9 23 88
89 16 27 89
90 12 17 90
91 14 17 91
92 8 19 92
93 9 17 93
94 15 22 94
95 11 21 95
96 21 32 96
97 14 21 97
98 18 21 98
99 12 18 99
100 13 18 100
101 15 23 101
102 12 19 102
103 19 20 103
104 15 21 104
105 11 20 105
106 11 17 106
107 10 18 107
108 13 19 108
109 15 22 109
110 12 15 110
111 12 14 111
112 16 18 112
113 9 24 113
114 18 35 114
115 8 29 115
116 13 21 116
117 17 25 117
118 9 20 118
119 15 22 119
120 8 13 120
121 7 26 121
122 12 17 122
123 14 25 123
124 6 20 124
125 8 19 125
126 17 21 126
127 10 22 127
128 11 24 128
129 14 21 129
130 11 26 130
131 13 24 131
132 12 16 132
133 11 23 133
134 9 18 134
135 12 16 135
136 20 26 136
137 12 19 137
138 13 21 138
139 12 21 139
140 12 22 140
141 9 23 141
142 15 29 142
143 24 21 143
144 7 21 144
145 17 23 145
146 11 27 146
147 17 25 147
148 11 21 148
149 12 10 149
150 14 20 150
151 11 26 151
152 16 24 152
153 21 29 153
154 14 19 154
155 20 24 155
156 13 19 156
157 11 24 157
158 15 22 158
159 19 17 159
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) `PersonalStandards\r` t
7.649318 0.207693 0.007584
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-7.81306 -2.12606 -0.05749 2.06825 10.90459
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 7.649318 1.548061 4.941 1.98e-06 ***
`PersonalStandards\r` 0.207693 0.063447 3.274 0.00131 **
t 0.007584 0.005811 1.305 0.19376
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 3.345 on 156 degrees of freedom
Multiple R-squared: 0.06952, Adjusted R-squared: 0.05759
F-statistic: 5.828 on 2 and 156 DF, p-value: 0.003623
> 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.44002284 0.88004569 0.5599772
[2,] 0.43996455 0.87992911 0.5600354
[3,] 0.31527167 0.63054333 0.6847283
[4,] 0.25232088 0.50464175 0.7476791
[5,] 0.16202873 0.32405746 0.8379713
[6,] 0.11236911 0.22473821 0.8876309
[7,] 0.09610562 0.19221124 0.9038944
[8,] 0.06916511 0.13833022 0.9308349
[9,] 0.07130986 0.14261973 0.9286901
[10,] 0.10028573 0.20057147 0.8997143
[11,] 0.06525953 0.13051906 0.9347405
[12,] 0.10483802 0.20967605 0.8951620
[13,] 0.07084501 0.14169001 0.9291550
[14,] 0.08595901 0.17191801 0.9140410
[15,] 0.07714622 0.15429244 0.9228538
[16,] 0.09089306 0.18178611 0.9091069
[17,] 0.11246498 0.22492996 0.8875350
[18,] 0.08281043 0.16562085 0.9171896
[19,] 0.09810787 0.19621574 0.9018921
[20,] 0.09489089 0.18978177 0.9051091
[21,] 0.07054191 0.14108383 0.9294581
[22,] 0.05144631 0.10289261 0.9485537
[23,] 0.03729916 0.07459832 0.9627008
[24,] 0.02752566 0.05505132 0.9724743
[25,] 0.02153054 0.04306108 0.9784695
[26,] 0.05756277 0.11512553 0.9424372
[27,] 0.05995896 0.11991792 0.9400410
[28,] 0.05205208 0.10410416 0.9479479
[29,] 0.07207278 0.14414557 0.9279272
[30,] 0.06499146 0.12998293 0.9350085
[31,] 0.13766833 0.27533666 0.8623317
[32,] 0.20165570 0.40331140 0.7983443
[33,] 0.16906765 0.33813529 0.8309324
[34,] 0.18245847 0.36491695 0.8175415
[35,] 0.16786761 0.33573522 0.8321324
[36,] 0.18580313 0.37160625 0.8141969
[37,] 0.15394349 0.30788698 0.8460565
[38,] 0.14480220 0.28960439 0.8551978
[39,] 0.12745224 0.25490447 0.8725478
[40,] 0.15409457 0.30818913 0.8459054
[41,] 0.14407756 0.28815511 0.8559224
[42,] 0.12371670 0.24743341 0.8762833
[43,] 0.18355921 0.36711842 0.8164408
[44,] 0.15940925 0.31881850 0.8405908
[45,] 0.16463546 0.32927093 0.8353645
[46,] 0.37893130 0.75786260 0.6210687
[47,] 0.33659393 0.67318785 0.6634061
[48,] 0.29587907 0.59175814 0.7041209
[49,] 0.37464336 0.74928673 0.6253566
[50,] 0.73678892 0.52642217 0.2632111
[51,] 0.70089150 0.59821701 0.2991085
[52,] 0.66553041 0.66893917 0.3344696
[53,] 0.62734076 0.74531849 0.3726592
[54,] 0.69456404 0.61087192 0.3054360
[55,] 0.67285369 0.65429261 0.3271463
[56,] 0.63175587 0.73648826 0.3682441
[57,] 0.58731649 0.82536702 0.4126835
[58,] 0.54832398 0.90335205 0.4516760
[59,] 0.59088694 0.81822612 0.4091131
[60,] 0.54657058 0.90685883 0.4534294
[61,] 0.60124560 0.79750880 0.3987544
[62,] 0.56102693 0.87794615 0.4389731
[63,] 0.51572578 0.96854844 0.4842742
[64,] 0.47889203 0.95778407 0.5211080
[65,] 0.44628076 0.89256151 0.5537192
[66,] 0.40156642 0.80313284 0.5984336
[67,] 0.39152765 0.78305531 0.6084723
[68,] 0.36249335 0.72498670 0.6375067
[69,] 0.44133649 0.88267298 0.5586635
[70,] 0.41416765 0.82833530 0.5858323
[71,] 0.37000999 0.74001998 0.6299900
[72,] 0.33053297 0.66106595 0.6694670
[73,] 0.29995074 0.59990148 0.7000493
[74,] 0.28283406 0.56566813 0.7171659
[75,] 0.24557540 0.49115080 0.7544246
[76,] 0.21115343 0.42230685 0.7888466
[77,] 0.17972126 0.35944251 0.8202787
[78,] 0.15499106 0.30998211 0.8450089
[79,] 0.14944552 0.29889105 0.8505545
[80,] 0.15605018 0.31210035 0.8439498
[81,] 0.16799416 0.33598832 0.8320058
[82,] 0.15267009 0.30534019 0.8473299
[83,] 0.15799674 0.31599348 0.8420033
[84,] 0.14563899 0.29127798 0.8543610
[85,] 0.12153942 0.24307883 0.8784606
[86,] 0.11201352 0.22402704 0.8879865
[87,] 0.11885115 0.23770231 0.8811488
[88,] 0.10846038 0.21692076 0.8915396
[89,] 0.09860709 0.19721418 0.9013929
[90,] 0.08295372 0.16590743 0.9170463
[91,] 0.13625668 0.27251336 0.8637433
[92,] 0.11803973 0.23607947 0.8819603
[93,] 0.16660917 0.33321835 0.8333908
[94,] 0.13934820 0.27869641 0.8606518
[95,] 0.11890229 0.23780457 0.8810977
[96,] 0.10837319 0.21674638 0.8916268
[97,] 0.08830781 0.17661561 0.9116922
[98,] 0.17413248 0.34826496 0.8258675
[99,] 0.17220231 0.34440463 0.8277977
[100,] 0.14613076 0.29226153 0.8538692
[101,] 0.12174959 0.24349919 0.8782504
[102,] 0.10288273 0.20576546 0.8971173
[103,] 0.08791436 0.17582872 0.9120856
[104,] 0.08592691 0.17185383 0.9140731
[105,] 0.07325610 0.14651219 0.9267439
[106,] 0.06417897 0.12835793 0.9358210
[107,] 0.09446968 0.18893936 0.9055303
[108,] 0.09184410 0.18368819 0.9081559
[109,] 0.09801138 0.19602275 0.9019886
[110,] 0.12632701 0.25265402 0.8736730
[111,] 0.10991082 0.21982164 0.8900892
[112,] 0.14536175 0.29072350 0.8546383
[113,] 0.12874494 0.25748989 0.8712551
[114,] 0.14086471 0.28172942 0.8591353
[115,] 0.12075703 0.24151407 0.8792430
[116,] 0.15912845 0.31825690 0.8408716
[117,] 0.13757552 0.27515105 0.8624245
[118,] 0.12030098 0.24060195 0.8796990
[119,] 0.15658561 0.31317123 0.8434144
[120,] 0.15288442 0.30576884 0.8471156
[121,] 0.20667820 0.41335640 0.7933218
[122,] 0.17798705 0.35597409 0.8220130
[123,] 0.14801495 0.29602991 0.8519850
[124,] 0.12947927 0.25895854 0.8705207
[125,] 0.10880703 0.21761406 0.8911930
[126,] 0.08375281 0.16750563 0.9162472
[127,] 0.06490379 0.12980757 0.9350962
[128,] 0.05072809 0.10145618 0.9492719
[129,] 0.04455272 0.08910544 0.9554473
[130,] 0.03184258 0.06368516 0.9681574
[131,] 0.06892563 0.13785126 0.9310744
[132,] 0.04978239 0.09956478 0.9502176
[133,] 0.03556167 0.07112335 0.9644383
[134,] 0.02425875 0.04851749 0.9757413
[135,] 0.01621749 0.03243499 0.9837825
[136,] 0.01930659 0.03861317 0.9806934
[137,] 0.01237354 0.02474708 0.9876265
[138,] 0.26886069 0.53772138 0.7311393
[139,] 0.36277240 0.72554480 0.6372276
[140,] 0.39160189 0.78320378 0.6083981
[141,] 0.37187803 0.74375607 0.6281220
[142,] 0.35757943 0.71515886 0.6424206
[143,] 0.29896173 0.59792346 0.7010383
[144,] 0.21870196 0.43740393 0.7812980
[145,] 0.14996635 0.29993271 0.8500336
[146,] 0.20743689 0.41487377 0.7925631
[147,] 0.13170578 0.26341156 0.8682942
[148,] 0.14713834 0.29427668 0.8528617
> postscript(file="/var/www/rcomp/tmp/1pari1289556022.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/rcomp/tmp/2pari1289556022.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/rcomp/tmp/3i18l1289556022.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/rcomp/tmp/4i18l1289556022.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/rcomp/tmp/5i18l1289556022.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 = 159
Frequency = 1
1 2 3 4 5 6
-1.641544565 -5.856822129 3.097126484 -1.625829611 -0.256494086 -0.264078194
7 8 9 10 11 12
-1.894742670 -1.486939867 0.751636760 0.913278828 2.321081632 4.313497523
13 14 15 16 17 18
0.136687238 -1.078590326 -1.540028624 1.621613444 -3.347503385 0.306460153
19 20 21 22 23 24
4.637328398 4.422050834 -1.585533274 5.822269529 2.230072333 -1.569818320
25 26 27 28 29 30
-0.992789340 2.376546185 1.953575165 1.192151791 3.146100404 0.553903208
31 32 33 34 35 36
-4.076761268 4.707961168 4.077296693 -2.553367783 3.892902299 -4.945455632
37 38 39 40 41 42
-4.745346284 0.531697621 4.239485499 -1.975792065 4.639704194 0.839813542
43 44 45 46 47 48
4.116857447 2.824645325 -3.390632239 -1.152055613 2.255747191 -5.659545298
49 50 51 52 53 54
-1.213275216 3.779140676 -7.813056521 -0.405253718 -0.205144370 -5.174261200
55 56 57 58 59 60
9.702752856 -1.058670518 -1.481641538 0.926161265 -5.666035931 1.987927606
61 62 63 64 65 66
-1.096591059 -0.104175168 0.888240724 -5.119343384 -1.088460214 -5.588365791
67 68 69 70 71 72
-1.726708797 -0.772760184 -2.118796647 -2.372541489 -0.341658319 -3.556935883
73 74 75 76 77 78
1.189319274 5.012508989 1.589537969 -0.379578860 0.405143576 1.189866012
79 80 81 82 83 84
-3.025411552 -0.448382572 -0.455966680 -0.802003142 0.775025838 2.521280995
85 86 87 88 89 90
-4.240142378 3.544580058 -2.709164785 -4.093668526 2.067973543 0.137323992
91 92 93 94 95 96
2.129739884 -4.293231136 -2.885428333 2.068520280 -1.731370372 5.976417506
97 98 99 100 101 102
1.253461411 5.245877303 -0.138626438 0.853789454 1.807738067 -0.369072219
103 104 105 106 107 108
6.415650217 2.200372653 -1.599517999 -0.984021740 -2.199299304 0.585423132
109 110 111 112 113 114
1.954758656 0.401028738 0.601138086 3.762780155 -4.490964688 2.216823190
115 116 117 118 119 120
-6.544600183 0.109363354 3.271005423 -3.698111406 1.878917574 -3.259425433
121 122 123 124 125 126
-6.967024466 -0.105367472 0.225500774 -6.743616056 -4.543506708 4.033522272
127 128 129 130 131 132
-3.181755292 -2.604726312 1.010769947 -3.035281440 -0.627478637 0.026484901
133 134 135 136 137 138
-2.434953397 -3.404070227 0.003732577 5.919213911 -0.634516007 -0.057487027
139 140 141 142 143 144
-1.065071135 -1.280348699 -4.495626263 0.250628894 10.904592432 -6.102991676
145 146 147 148 149 150
3.474037304 -3.364320627 3.043482176 -2.133328109 1.143715796 1.059197130
151 152 153 154 155 156
-3.194547713 2.213255090 6.167203703 1.236554153 6.190502766 0.221385936
157 158 159
-2.824665451 1.583137352 6.614020523
> postscript(file="/var/www/rcomp/tmp/6ssqo1289556022.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 = 159
Frequency = 1
lag(myerror, k = 1) myerror
0 -1.641544565 NA
1 -5.856822129 -1.641544565
2 3.097126484 -5.856822129
3 -1.625829611 3.097126484
4 -0.256494086 -1.625829611
5 -0.264078194 -0.256494086
6 -1.894742670 -0.264078194
7 -1.486939867 -1.894742670
8 0.751636760 -1.486939867
9 0.913278828 0.751636760
10 2.321081632 0.913278828
11 4.313497523 2.321081632
12 0.136687238 4.313497523
13 -1.078590326 0.136687238
14 -1.540028624 -1.078590326
15 1.621613444 -1.540028624
16 -3.347503385 1.621613444
17 0.306460153 -3.347503385
18 4.637328398 0.306460153
19 4.422050834 4.637328398
20 -1.585533274 4.422050834
21 5.822269529 -1.585533274
22 2.230072333 5.822269529
23 -1.569818320 2.230072333
24 -0.992789340 -1.569818320
25 2.376546185 -0.992789340
26 1.953575165 2.376546185
27 1.192151791 1.953575165
28 3.146100404 1.192151791
29 0.553903208 3.146100404
30 -4.076761268 0.553903208
31 4.707961168 -4.076761268
32 4.077296693 4.707961168
33 -2.553367783 4.077296693
34 3.892902299 -2.553367783
35 -4.945455632 3.892902299
36 -4.745346284 -4.945455632
37 0.531697621 -4.745346284
38 4.239485499 0.531697621
39 -1.975792065 4.239485499
40 4.639704194 -1.975792065
41 0.839813542 4.639704194
42 4.116857447 0.839813542
43 2.824645325 4.116857447
44 -3.390632239 2.824645325
45 -1.152055613 -3.390632239
46 2.255747191 -1.152055613
47 -5.659545298 2.255747191
48 -1.213275216 -5.659545298
49 3.779140676 -1.213275216
50 -7.813056521 3.779140676
51 -0.405253718 -7.813056521
52 -0.205144370 -0.405253718
53 -5.174261200 -0.205144370
54 9.702752856 -5.174261200
55 -1.058670518 9.702752856
56 -1.481641538 -1.058670518
57 0.926161265 -1.481641538
58 -5.666035931 0.926161265
59 1.987927606 -5.666035931
60 -1.096591059 1.987927606
61 -0.104175168 -1.096591059
62 0.888240724 -0.104175168
63 -5.119343384 0.888240724
64 -1.088460214 -5.119343384
65 -5.588365791 -1.088460214
66 -1.726708797 -5.588365791
67 -0.772760184 -1.726708797
68 -2.118796647 -0.772760184
69 -2.372541489 -2.118796647
70 -0.341658319 -2.372541489
71 -3.556935883 -0.341658319
72 1.189319274 -3.556935883
73 5.012508989 1.189319274
74 1.589537969 5.012508989
75 -0.379578860 1.589537969
76 0.405143576 -0.379578860
77 1.189866012 0.405143576
78 -3.025411552 1.189866012
79 -0.448382572 -3.025411552
80 -0.455966680 -0.448382572
81 -0.802003142 -0.455966680
82 0.775025838 -0.802003142
83 2.521280995 0.775025838
84 -4.240142378 2.521280995
85 3.544580058 -4.240142378
86 -2.709164785 3.544580058
87 -4.093668526 -2.709164785
88 2.067973543 -4.093668526
89 0.137323992 2.067973543
90 2.129739884 0.137323992
91 -4.293231136 2.129739884
92 -2.885428333 -4.293231136
93 2.068520280 -2.885428333
94 -1.731370372 2.068520280
95 5.976417506 -1.731370372
96 1.253461411 5.976417506
97 5.245877303 1.253461411
98 -0.138626438 5.245877303
99 0.853789454 -0.138626438
100 1.807738067 0.853789454
101 -0.369072219 1.807738067
102 6.415650217 -0.369072219
103 2.200372653 6.415650217
104 -1.599517999 2.200372653
105 -0.984021740 -1.599517999
106 -2.199299304 -0.984021740
107 0.585423132 -2.199299304
108 1.954758656 0.585423132
109 0.401028738 1.954758656
110 0.601138086 0.401028738
111 3.762780155 0.601138086
112 -4.490964688 3.762780155
113 2.216823190 -4.490964688
114 -6.544600183 2.216823190
115 0.109363354 -6.544600183
116 3.271005423 0.109363354
117 -3.698111406 3.271005423
118 1.878917574 -3.698111406
119 -3.259425433 1.878917574
120 -6.967024466 -3.259425433
121 -0.105367472 -6.967024466
122 0.225500774 -0.105367472
123 -6.743616056 0.225500774
124 -4.543506708 -6.743616056
125 4.033522272 -4.543506708
126 -3.181755292 4.033522272
127 -2.604726312 -3.181755292
128 1.010769947 -2.604726312
129 -3.035281440 1.010769947
130 -0.627478637 -3.035281440
131 0.026484901 -0.627478637
132 -2.434953397 0.026484901
133 -3.404070227 -2.434953397
134 0.003732577 -3.404070227
135 5.919213911 0.003732577
136 -0.634516007 5.919213911
137 -0.057487027 -0.634516007
138 -1.065071135 -0.057487027
139 -1.280348699 -1.065071135
140 -4.495626263 -1.280348699
141 0.250628894 -4.495626263
142 10.904592432 0.250628894
143 -6.102991676 10.904592432
144 3.474037304 -6.102991676
145 -3.364320627 3.474037304
146 3.043482176 -3.364320627
147 -2.133328109 3.043482176
148 1.143715796 -2.133328109
149 1.059197130 1.143715796
150 -3.194547713 1.059197130
151 2.213255090 -3.194547713
152 6.167203703 2.213255090
153 1.236554153 6.167203703
154 6.190502766 1.236554153
155 0.221385936 6.190502766
156 -2.824665451 0.221385936
157 1.583137352 -2.824665451
158 6.614020523 1.583137352
159 NA 6.614020523
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -5.856822129 -1.641544565
[2,] 3.097126484 -5.856822129
[3,] -1.625829611 3.097126484
[4,] -0.256494086 -1.625829611
[5,] -0.264078194 -0.256494086
[6,] -1.894742670 -0.264078194
[7,] -1.486939867 -1.894742670
[8,] 0.751636760 -1.486939867
[9,] 0.913278828 0.751636760
[10,] 2.321081632 0.913278828
[11,] 4.313497523 2.321081632
[12,] 0.136687238 4.313497523
[13,] -1.078590326 0.136687238
[14,] -1.540028624 -1.078590326
[15,] 1.621613444 -1.540028624
[16,] -3.347503385 1.621613444
[17,] 0.306460153 -3.347503385
[18,] 4.637328398 0.306460153
[19,] 4.422050834 4.637328398
[20,] -1.585533274 4.422050834
[21,] 5.822269529 -1.585533274
[22,] 2.230072333 5.822269529
[23,] -1.569818320 2.230072333
[24,] -0.992789340 -1.569818320
[25,] 2.376546185 -0.992789340
[26,] 1.953575165 2.376546185
[27,] 1.192151791 1.953575165
[28,] 3.146100404 1.192151791
[29,] 0.553903208 3.146100404
[30,] -4.076761268 0.553903208
[31,] 4.707961168 -4.076761268
[32,] 4.077296693 4.707961168
[33,] -2.553367783 4.077296693
[34,] 3.892902299 -2.553367783
[35,] -4.945455632 3.892902299
[36,] -4.745346284 -4.945455632
[37,] 0.531697621 -4.745346284
[38,] 4.239485499 0.531697621
[39,] -1.975792065 4.239485499
[40,] 4.639704194 -1.975792065
[41,] 0.839813542 4.639704194
[42,] 4.116857447 0.839813542
[43,] 2.824645325 4.116857447
[44,] -3.390632239 2.824645325
[45,] -1.152055613 -3.390632239
[46,] 2.255747191 -1.152055613
[47,] -5.659545298 2.255747191
[48,] -1.213275216 -5.659545298
[49,] 3.779140676 -1.213275216
[50,] -7.813056521 3.779140676
[51,] -0.405253718 -7.813056521
[52,] -0.205144370 -0.405253718
[53,] -5.174261200 -0.205144370
[54,] 9.702752856 -5.174261200
[55,] -1.058670518 9.702752856
[56,] -1.481641538 -1.058670518
[57,] 0.926161265 -1.481641538
[58,] -5.666035931 0.926161265
[59,] 1.987927606 -5.666035931
[60,] -1.096591059 1.987927606
[61,] -0.104175168 -1.096591059
[62,] 0.888240724 -0.104175168
[63,] -5.119343384 0.888240724
[64,] -1.088460214 -5.119343384
[65,] -5.588365791 -1.088460214
[66,] -1.726708797 -5.588365791
[67,] -0.772760184 -1.726708797
[68,] -2.118796647 -0.772760184
[69,] -2.372541489 -2.118796647
[70,] -0.341658319 -2.372541489
[71,] -3.556935883 -0.341658319
[72,] 1.189319274 -3.556935883
[73,] 5.012508989 1.189319274
[74,] 1.589537969 5.012508989
[75,] -0.379578860 1.589537969
[76,] 0.405143576 -0.379578860
[77,] 1.189866012 0.405143576
[78,] -3.025411552 1.189866012
[79,] -0.448382572 -3.025411552
[80,] -0.455966680 -0.448382572
[81,] -0.802003142 -0.455966680
[82,] 0.775025838 -0.802003142
[83,] 2.521280995 0.775025838
[84,] -4.240142378 2.521280995
[85,] 3.544580058 -4.240142378
[86,] -2.709164785 3.544580058
[87,] -4.093668526 -2.709164785
[88,] 2.067973543 -4.093668526
[89,] 0.137323992 2.067973543
[90,] 2.129739884 0.137323992
[91,] -4.293231136 2.129739884
[92,] -2.885428333 -4.293231136
[93,] 2.068520280 -2.885428333
[94,] -1.731370372 2.068520280
[95,] 5.976417506 -1.731370372
[96,] 1.253461411 5.976417506
[97,] 5.245877303 1.253461411
[98,] -0.138626438 5.245877303
[99,] 0.853789454 -0.138626438
[100,] 1.807738067 0.853789454
[101,] -0.369072219 1.807738067
[102,] 6.415650217 -0.369072219
[103,] 2.200372653 6.415650217
[104,] -1.599517999 2.200372653
[105,] -0.984021740 -1.599517999
[106,] -2.199299304 -0.984021740
[107,] 0.585423132 -2.199299304
[108,] 1.954758656 0.585423132
[109,] 0.401028738 1.954758656
[110,] 0.601138086 0.401028738
[111,] 3.762780155 0.601138086
[112,] -4.490964688 3.762780155
[113,] 2.216823190 -4.490964688
[114,] -6.544600183 2.216823190
[115,] 0.109363354 -6.544600183
[116,] 3.271005423 0.109363354
[117,] -3.698111406 3.271005423
[118,] 1.878917574 -3.698111406
[119,] -3.259425433 1.878917574
[120,] -6.967024466 -3.259425433
[121,] -0.105367472 -6.967024466
[122,] 0.225500774 -0.105367472
[123,] -6.743616056 0.225500774
[124,] -4.543506708 -6.743616056
[125,] 4.033522272 -4.543506708
[126,] -3.181755292 4.033522272
[127,] -2.604726312 -3.181755292
[128,] 1.010769947 -2.604726312
[129,] -3.035281440 1.010769947
[130,] -0.627478637 -3.035281440
[131,] 0.026484901 -0.627478637
[132,] -2.434953397 0.026484901
[133,] -3.404070227 -2.434953397
[134,] 0.003732577 -3.404070227
[135,] 5.919213911 0.003732577
[136,] -0.634516007 5.919213911
[137,] -0.057487027 -0.634516007
[138,] -1.065071135 -0.057487027
[139,] -1.280348699 -1.065071135
[140,] -4.495626263 -1.280348699
[141,] 0.250628894 -4.495626263
[142,] 10.904592432 0.250628894
[143,] -6.102991676 10.904592432
[144,] 3.474037304 -6.102991676
[145,] -3.364320627 3.474037304
[146,] 3.043482176 -3.364320627
[147,] -2.133328109 3.043482176
[148,] 1.143715796 -2.133328109
[149,] 1.059197130 1.143715796
[150,] -3.194547713 1.059197130
[151,] 2.213255090 -3.194547713
[152,] 6.167203703 2.213255090
[153,] 1.236554153 6.167203703
[154,] 6.190502766 1.236554153
[155,] 0.221385936 6.190502766
[156,] -2.824665451 0.221385936
[157,] 1.583137352 -2.824665451
[158,] 6.614020523 1.583137352
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -5.856822129 -1.641544565
2 3.097126484 -5.856822129
3 -1.625829611 3.097126484
4 -0.256494086 -1.625829611
5 -0.264078194 -0.256494086
6 -1.894742670 -0.264078194
7 -1.486939867 -1.894742670
8 0.751636760 -1.486939867
9 0.913278828 0.751636760
10 2.321081632 0.913278828
11 4.313497523 2.321081632
12 0.136687238 4.313497523
13 -1.078590326 0.136687238
14 -1.540028624 -1.078590326
15 1.621613444 -1.540028624
16 -3.347503385 1.621613444
17 0.306460153 -3.347503385
18 4.637328398 0.306460153
19 4.422050834 4.637328398
20 -1.585533274 4.422050834
21 5.822269529 -1.585533274
22 2.230072333 5.822269529
23 -1.569818320 2.230072333
24 -0.992789340 -1.569818320
25 2.376546185 -0.992789340
26 1.953575165 2.376546185
27 1.192151791 1.953575165
28 3.146100404 1.192151791
29 0.553903208 3.146100404
30 -4.076761268 0.553903208
31 4.707961168 -4.076761268
32 4.077296693 4.707961168
33 -2.553367783 4.077296693
34 3.892902299 -2.553367783
35 -4.945455632 3.892902299
36 -4.745346284 -4.945455632
37 0.531697621 -4.745346284
38 4.239485499 0.531697621
39 -1.975792065 4.239485499
40 4.639704194 -1.975792065
41 0.839813542 4.639704194
42 4.116857447 0.839813542
43 2.824645325 4.116857447
44 -3.390632239 2.824645325
45 -1.152055613 -3.390632239
46 2.255747191 -1.152055613
47 -5.659545298 2.255747191
48 -1.213275216 -5.659545298
49 3.779140676 -1.213275216
50 -7.813056521 3.779140676
51 -0.405253718 -7.813056521
52 -0.205144370 -0.405253718
53 -5.174261200 -0.205144370
54 9.702752856 -5.174261200
55 -1.058670518 9.702752856
56 -1.481641538 -1.058670518
57 0.926161265 -1.481641538
58 -5.666035931 0.926161265
59 1.987927606 -5.666035931
60 -1.096591059 1.987927606
61 -0.104175168 -1.096591059
62 0.888240724 -0.104175168
63 -5.119343384 0.888240724
64 -1.088460214 -5.119343384
65 -5.588365791 -1.088460214
66 -1.726708797 -5.588365791
67 -0.772760184 -1.726708797
68 -2.118796647 -0.772760184
69 -2.372541489 -2.118796647
70 -0.341658319 -2.372541489
71 -3.556935883 -0.341658319
72 1.189319274 -3.556935883
73 5.012508989 1.189319274
74 1.589537969 5.012508989
75 -0.379578860 1.589537969
76 0.405143576 -0.379578860
77 1.189866012 0.405143576
78 -3.025411552 1.189866012
79 -0.448382572 -3.025411552
80 -0.455966680 -0.448382572
81 -0.802003142 -0.455966680
82 0.775025838 -0.802003142
83 2.521280995 0.775025838
84 -4.240142378 2.521280995
85 3.544580058 -4.240142378
86 -2.709164785 3.544580058
87 -4.093668526 -2.709164785
88 2.067973543 -4.093668526
89 0.137323992 2.067973543
90 2.129739884 0.137323992
91 -4.293231136 2.129739884
92 -2.885428333 -4.293231136
93 2.068520280 -2.885428333
94 -1.731370372 2.068520280
95 5.976417506 -1.731370372
96 1.253461411 5.976417506
97 5.245877303 1.253461411
98 -0.138626438 5.245877303
99 0.853789454 -0.138626438
100 1.807738067 0.853789454
101 -0.369072219 1.807738067
102 6.415650217 -0.369072219
103 2.200372653 6.415650217
104 -1.599517999 2.200372653
105 -0.984021740 -1.599517999
106 -2.199299304 -0.984021740
107 0.585423132 -2.199299304
108 1.954758656 0.585423132
109 0.401028738 1.954758656
110 0.601138086 0.401028738
111 3.762780155 0.601138086
112 -4.490964688 3.762780155
113 2.216823190 -4.490964688
114 -6.544600183 2.216823190
115 0.109363354 -6.544600183
116 3.271005423 0.109363354
117 -3.698111406 3.271005423
118 1.878917574 -3.698111406
119 -3.259425433 1.878917574
120 -6.967024466 -3.259425433
121 -0.105367472 -6.967024466
122 0.225500774 -0.105367472
123 -6.743616056 0.225500774
124 -4.543506708 -6.743616056
125 4.033522272 -4.543506708
126 -3.181755292 4.033522272
127 -2.604726312 -3.181755292
128 1.010769947 -2.604726312
129 -3.035281440 1.010769947
130 -0.627478637 -3.035281440
131 0.026484901 -0.627478637
132 -2.434953397 0.026484901
133 -3.404070227 -2.434953397
134 0.003732577 -3.404070227
135 5.919213911 0.003732577
136 -0.634516007 5.919213911
137 -0.057487027 -0.634516007
138 -1.065071135 -0.057487027
139 -1.280348699 -1.065071135
140 -4.495626263 -1.280348699
141 0.250628894 -4.495626263
142 10.904592432 0.250628894
143 -6.102991676 10.904592432
144 3.474037304 -6.102991676
145 -3.364320627 3.474037304
146 3.043482176 -3.364320627
147 -2.133328109 3.043482176
148 1.143715796 -2.133328109
149 1.059197130 1.143715796
150 -3.194547713 1.059197130
151 2.213255090 -3.194547713
152 6.167203703 2.213255090
153 1.236554153 6.167203703
154 6.190502766 1.236554153
155 0.221385936 6.190502766
156 -2.824665451 0.221385936
157 1.583137352 -2.824665451
158 6.614020523 1.583137352
> 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/rcomp/tmp/73k791289556022.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/rcomp/tmp/83k791289556022.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/rcomp/tmp/9wtou1289556022.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/rcomp/tmp/10wtou1289556022.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/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/www/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/rcomp/tmp/11ztni1289556022.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/rcomp/tmp/12lul61289556022.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/rcomp/tmp/13av0h1289556022.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/rcomp/tmp/14kmzk1289556022.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/rcomp/tmp/156nyq1289556022.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/rcomp/tmp/162xeh1289556022.tab")
+ }
>
> try(system("convert tmp/1pari1289556022.ps tmp/1pari1289556022.png",intern=TRUE))
character(0)
> try(system("convert tmp/2pari1289556022.ps tmp/2pari1289556022.png",intern=TRUE))
character(0)
> try(system("convert tmp/3i18l1289556022.ps tmp/3i18l1289556022.png",intern=TRUE))
character(0)
> try(system("convert tmp/4i18l1289556022.ps tmp/4i18l1289556022.png",intern=TRUE))
character(0)
> try(system("convert tmp/5i18l1289556022.ps tmp/5i18l1289556022.png",intern=TRUE))
character(0)
> try(system("convert tmp/6ssqo1289556022.ps tmp/6ssqo1289556022.png",intern=TRUE))
character(0)
> try(system("convert tmp/73k791289556022.ps tmp/73k791289556022.png",intern=TRUE))
character(0)
> try(system("convert tmp/83k791289556022.ps tmp/83k791289556022.png",intern=TRUE))
character(0)
> try(system("convert tmp/9wtou1289556022.ps tmp/9wtou1289556022.png",intern=TRUE))
character(0)
> try(system("convert tmp/10wtou1289556022.ps tmp/10wtou1289556022.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
5.280 1.060 6.363