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(5.3
+ ,6.0
+ ,5.5
+ ,12
+ ,5.6
+ ,4.0
+ ,3.5
+ ,11
+ ,3.8
+ ,4.0
+ ,8.5
+ ,14
+ ,4.0
+ ,4.0
+ ,5.0
+ ,12
+ ,4.0
+ ,4.5
+ ,6.0
+ ,21
+ ,3.6
+ ,3.5
+ ,6.0
+ ,12
+ ,4.4
+ ,2.0
+ ,5.5
+ ,22
+ ,3.6
+ ,5.5
+ ,5.5
+ ,11
+ ,4.0
+ ,3.5
+ ,6.0
+ ,10
+ ,3.8
+ ,3.5
+ ,6.5
+ ,13
+ ,5.1
+ ,6.0
+ ,7.0
+ ,10
+ ,6.7
+ ,5.0
+ ,8.0
+ ,8
+ ,5.1
+ ,5.0
+ ,5.5
+ ,15
+ ,4.0
+ ,4.0
+ ,5.0
+ ,14
+ ,3.3
+ ,4.0
+ ,5.5
+ ,10
+ ,2.7
+ ,2.0
+ ,7.5
+ ,14
+ ,4.7
+ ,4.5
+ ,4.5
+ ,14
+ ,3.3
+ ,4.0
+ ,5.5
+ ,11
+ ,4.4
+ ,3.5
+ ,8.5
+ ,10
+ ,6.9
+ ,5.5
+ ,8.5
+ ,13
+ ,6.0
+ ,4.5
+ ,5.5
+ ,7
+ ,7.6
+ ,5.5
+ ,9.0
+ ,14
+ ,4.7
+ ,6.5
+ ,7.0
+ ,12
+ ,6.9
+ ,4.0
+ ,5.0
+ ,14
+ ,4.2
+ ,4.0
+ ,5.5
+ ,11
+ ,3.6
+ ,4.5
+ ,7.5
+ ,9
+ ,4.4
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ism','Expectat','Depression'),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 = 'No Linear Trend'
> par2 = 'Do not include Seasonal Dummies'
> par1 = '4'
> #'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
Depression Concerns Criticism Expectat
1 12 5.3 6.0 5.5
2 11 5.6 4.0 3.5
3 14 3.8 4.0 8.5
4 12 4.0 4.0 5.0
5 21 4.0 4.5 6.0
6 12 3.6 3.5 6.0
7 22 4.4 2.0 5.5
8 11 3.6 5.5 5.5
9 10 4.0 3.5 6.0
10 13 3.8 3.5 6.5
11 10 5.1 6.0 7.0
12 8 6.7 5.0 8.0
13 15 5.1 5.0 5.5
14 14 4.0 4.0 5.0
15 10 3.3 4.0 5.5
16 14 2.7 2.0 7.5
17 14 4.7 4.5 4.5
18 11 3.3 4.0 5.5
19 10 4.4 3.5 8.5
20 13 6.9 5.5 8.5
21 7 6.0 4.5 5.5
22 14 7.6 5.5 9.0
23 12 4.7 6.5 7.0
24 14 6.9 4.0 5.0
25 11 4.2 4.0 5.5
26 9 3.6 4.5 7.5
27 11 4.4 3.0 7.5
28 15 4.7 4.5 6.5
29 14 4.9 4.5 8.0
30 13 3.8 3.0 6.5
31 9 5.3 3.0 4.5
32 15 5.6 8.0 9.0
33 10 5.8 2.5 9.0
34 11 5.6 3.5 6.0
35 13 3.8 4.5 8.5
36 8 7.1 3.0 4.5
37 20 7.3 3.0 4.5
38 12 2.9 2.5 6.0
39 10 7.1 6.0 9.0
40 10 5.6 3.5 6.0
41 9 6.4 5.0 9.0
42 14 4.9 4.5 7.0
43 8 4.0 4.0 7.5
44 14 3.8 2.5 8.0
45 11 4.4 4.0 5.0
46 13 3.3 4.0 5.5
47 9 4.4 5.0 7.0
48 11 7.3 3.0 4.5
49 15 6.4 4.0 6.0
50 11 5.1 3.5 8.5
51 10 5.8 2.0 2.5
52 14 4.0 4.0 6.0
53 18 4.4 4.0 6.0
54 14 2.4 2.0 3.0
55 11 6.2 10.0 12.0
56 12 5.8 4.0 6.0
57 13 4.9 4.0 6.0
58 9 3.8 3.0 7.0
59 10 2.7 2.0 3.5
60 15 3.1 4.0 6.5
61 20 3.8 4.5 6.0
62 12 4.7 3.0 6.5
63 12 4.2 3.5 7.0
64 14 4.0 4.5 4.0
65 13 2.2 2.5 5.5
66 11 6.4 2.5 4.5
67 17 6.9 4.0 5.5
68 12 4.2 4.0 6.5
69 13 2.0 3.0 5.0
70 14 4.4 4.0 5.5
71 13 6.2 3.5 6.0
72 15 4.2 3.5 4.5
73 13 6.7 4.5 7.5
74 10 6.4 5.5 9.0
75 11 5.8 3.0 7.5
76 19 5.1 4.0 6.0
77 13 2.9 3.0 6.5
78 17 4.7 4.5 7.0
79 13 4.2 4.0 5.0
80 9 6.2 3.0 6.5
81 11 5.1 5.0 6.5
82 10 4.0 4.0 5.5
83 9 4.7 4.0 6.5
84 12 4.4 5.0 8.0
85 12 5.1 2.5 4.0
86 13 4.7 3.5 8.0
87 13 4.7 2.5 5.5
88 12 3.3 4.0 4.5
89 15 6.2 7.0 8.0
90 22 4.2 3.5 6.0
91 13 5.8 4.0 7.0
92 15 2.2 3.0 4.0
93 13 3.6 2.5 4.5
94 15 4.9 3.0 7.5
95 10 4.2 5.0 5.5
96 11 6.9 6.0 10.5
97 16 6.9 4.5 7.0
98 11 6.4 6.0 9.0
99 11 4.2 3.5 6.0
100 10 4.9 4.0 6.5
101 10 5.1 5.0 7.5
102 16 3.3 3.0 6.0
103 12 4.4 5.0 9.5
104 11 4.0 5.0 7.5
105 16 5.1 5.0 5.5
106 19 5.6 2.5 5.5
107 11 4.7 3.5 5.0
108 16 5.3 5.0 6.5
109 15 5.6 5.5 7.5
110 24 3.8 3.0 6.0
111 14 2.9 3.5 6.0
112 15 6.2 6.0 8.0
113 11 4.7 5.5 4.5
114 15 5.6 5.5 9.0
115 12 2.0 5.5 4.0
116 10 3.6 2.5 6.5
117 14 4.2 4.0 8.5
118 13 3.8 3.0 4.5
119 9 5.6 4.5 7.5
120 15 4.4 2.0 4.0
121 15 6.4 2.0 3.5
122 14 3.1 3.5 6.0
123 11 4.9 5.5 7.0
124 8 3.3 3.0 3.0
125 11 4.2 3.5 4.0
126 11 4.4 4.0 8.5
127 8 3.3 2.0 5.0
128 10 4.4 4.0 5.5
129 11 4.0 4.5 7.0
130 13 7.3 4.0 5.5
131 11 4.9 5.5 6.5
132 20 3.6 4.0 6.0
133 10 3.8 2.5 5.5
134 15 3.6 2.0 4.5
135 12 4.7 4.0 6.0
136 14 5.8 5.0 10.0
137 23 4.0 3.0 6.0
138 14 4.0 4.5 6.5
139 16 3.8 4.5 6.0
140 11 4.9 6.5 6.0
141 12 6.7 4.5 4.5
142 10 6.7 5.0 7.5
143 14 5.3 10.0 12.0
144 12 4.7 2.5 3.5
145 12 4.7 5.5 8.5
146 11 6.4 3.0 5.5
147 12 6.9 4.5 8.5
148 13 4.4 3.5 5.5
149 11 3.6 4.5 6.0
150 19 4.9 5.0 7.0
151 12 4.4 4.5 5.5
152 17 6.2 4.0 8.0
153 9 8.4 3.5 10.5
154 12 4.9 3.0 7.0
155 19 4.4 6.5 10.0
156 18 3.8 3.0 6.5
157 15 6.2 4.0 5.5
158 14 4.9 5.0 7.5
159 11 6.9 8.0 9.5
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Concerns Criticism Expectat
14.164941 -0.229536 -0.035846 -0.003658
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-5.6063 -2.0388 -0.6683 1.4581 10.8368
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 14.164941 1.194343 11.860 <2e-16 ***
Concerns -0.229536 0.212105 -1.082 0.281
Criticism -0.035846 0.233418 -0.154 0.878
Expectat -0.003658 0.184625 -0.020 0.984
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 3.16 on 155 degrees of freedom
Multiple R-squared: 0.009883, Adjusted R-squared: -0.00928
F-statistic: 0.5157 on 3 and 155 DF, p-value: 0.672
> 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.97967882 0.04064236 0.02032118
[2,] 0.95622576 0.08754849 0.04377424
[3,] 0.97340850 0.05318299 0.02659150
[4,] 0.95717263 0.08565474 0.04282737
[5,] 0.93524585 0.12950830 0.06475415
[6,] 0.92930347 0.14139306 0.07069653
[7,] 0.92208450 0.15583099 0.07791550
[8,] 0.88417213 0.23165573 0.11582787
[9,] 0.89990220 0.20019561 0.10009780
[10,] 0.87297692 0.25404616 0.12702308
[11,] 0.82925584 0.34148831 0.17074416
[12,] 0.80389752 0.39220497 0.19610248
[13,] 0.78349728 0.43300543 0.21650272
[14,] 0.75552317 0.48895366 0.24447683
[15,] 0.84577126 0.30845748 0.15422874
[16,] 0.83836504 0.32326991 0.16163496
[17,] 0.80210866 0.39578268 0.19789134
[18,] 0.75625627 0.48748745 0.24374373
[19,] 0.72172512 0.55654976 0.27827488
[20,] 0.72176653 0.55646694 0.27823347
[21,] 0.69441556 0.61116888 0.30558444
[22,] 0.67455855 0.65088291 0.32544145
[23,] 0.63398198 0.73203603 0.36601802
[24,] 0.57563673 0.84872654 0.42436327
[25,] 0.62856445 0.74287111 0.37143555
[26,] 0.64011947 0.71976107 0.35988053
[27,] 0.62215258 0.75569483 0.37784742
[28,] 0.57625225 0.84749550 0.42374775
[29,] 0.51958637 0.96082726 0.48041363
[30,] 0.53510772 0.92978457 0.46489228
[31,] 0.78906791 0.42186417 0.21093209
[32,] 0.75183469 0.49633062 0.24816531
[33,] 0.72451542 0.55096915 0.27548458
[34,] 0.70714220 0.58571560 0.29285780
[35,] 0.70039848 0.59920304 0.29960152
[36,] 0.66462142 0.67075716 0.33537858
[37,] 0.71191603 0.57616795 0.28808397
[38,] 0.67561876 0.64876248 0.32438124
[39,] 0.64236081 0.71527837 0.35763919
[40,] 0.59396701 0.81206597 0.40603299
[41,] 0.60274436 0.79451128 0.39725564
[42,] 0.56224115 0.87551770 0.43775885
[43,] 0.54868853 0.90262293 0.45131147
[44,] 0.50977096 0.98045808 0.49022904
[45,] 0.49895224 0.99790447 0.50104776
[46,] 0.45887957 0.91775914 0.54112043
[47,] 0.54867585 0.90264831 0.45132415
[48,] 0.50090735 0.99818530 0.49909265
[49,] 0.45847560 0.91695119 0.54152440
[50,] 0.41173126 0.82346253 0.58826874
[51,] 0.36620159 0.73240317 0.63379841
[52,] 0.38981741 0.77963482 0.61018259
[53,] 0.39376423 0.78752846 0.60623577
[54,] 0.36901054 0.73802108 0.63098946
[55,] 0.55720032 0.88559936 0.44279968
[56,] 0.51365362 0.97269277 0.48634638
[57,] 0.47103064 0.94206128 0.52896936
[58,] 0.42826375 0.85652750 0.57173625
[59,] 0.38446121 0.76892243 0.61553879
[60,] 0.34910343 0.69820686 0.65089657
[61,] 0.40595308 0.81190615 0.59404692
[62,] 0.36564737 0.73129473 0.63435263
[63,] 0.32501538 0.65003076 0.67498462
[64,] 0.28901103 0.57802206 0.71098897
[65,] 0.25184068 0.50368135 0.74815932
[66,] 0.22953744 0.45907489 0.77046256
[67,] 0.19800969 0.39601939 0.80199031
[68,] 0.18311143 0.36622286 0.81688857
[69,] 0.16208942 0.32417884 0.83791058
[70,] 0.25908658 0.51817316 0.74091342
[71,] 0.22553181 0.45106362 0.77446819
[72,] 0.25184644 0.50369288 0.74815356
[73,] 0.21638069 0.43276138 0.78361931
[74,] 0.22548426 0.45096852 0.77451574
[75,] 0.20202170 0.40404340 0.79797830
[76,] 0.20091302 0.40182604 0.79908698
[77,] 0.21941656 0.43883312 0.78058344
[78,] 0.19104899 0.38209798 0.80895101
[79,] 0.16356857 0.32713714 0.83643143
[80,] 0.13940767 0.27881534 0.86059233
[81,] 0.11613326 0.23226653 0.88386674
[82,] 0.09845743 0.19691486 0.90154257
[83,] 0.09309166 0.18618332 0.90690834
[84,] 0.29566225 0.59132451 0.70433775
[85,] 0.25771392 0.51542784 0.74228608
[86,] 0.22731721 0.45463443 0.77268279
[87,] 0.19429267 0.38858535 0.80570733
[88,] 0.17585312 0.35170625 0.82414688
[89,] 0.17177446 0.34354892 0.82822554
[90,] 0.15066914 0.30133828 0.84933086
[91,] 0.15798902 0.31597803 0.84201098
[92,] 0.13728807 0.27457614 0.86271193
[93,] 0.12457990 0.24915980 0.87542010
[94,] 0.12224883 0.24449767 0.87775117
[95,] 0.11911933 0.23823865 0.88088067
[96,] 0.10961062 0.21922124 0.89038938
[97,] 0.09505561 0.19011123 0.90494439
[98,] 0.08694646 0.17389292 0.91305354
[99,] 0.08768505 0.17537010 0.91231495
[100,] 0.14879786 0.29759573 0.85120214
[101,] 0.13150153 0.26300306 0.86849847
[102,] 0.13168515 0.26337029 0.86831485
[103,] 0.11888800 0.23777599 0.88111200
[104,] 0.51396476 0.97207048 0.48603524
[105,] 0.46431518 0.92863036 0.53568482
[106,] 0.44363349 0.88726697 0.55636651
[107,] 0.40424344 0.80848687 0.59575656
[108,] 0.37486472 0.74972944 0.62513528
[109,] 0.33606377 0.67212755 0.66393623
[110,] 0.35287841 0.70575683 0.64712159
[111,] 0.30790052 0.61580104 0.69209948
[112,] 0.26308332 0.52616664 0.73691668
[113,] 0.28290950 0.56581900 0.71709050
[114,] 0.25564214 0.51128429 0.74435786
[115,] 0.26372356 0.52744713 0.73627644
[116,] 0.22172871 0.44345742 0.77827129
[117,] 0.19669567 0.39339133 0.80330433
[118,] 0.25713131 0.51426262 0.74286869
[119,] 0.23018315 0.46036630 0.76981685
[120,] 0.22860583 0.45721167 0.77139417
[121,] 0.39624002 0.79248005 0.60375998
[122,] 0.41837869 0.83675738 0.58162131
[123,] 0.44668200 0.89336400 0.55331800
[124,] 0.42868361 0.85736722 0.57131639
[125,] 0.40096759 0.80193518 0.59903241
[126,] 0.49936369 0.99872739 0.50063631
[127,] 0.62355268 0.75289464 0.37644732
[128,] 0.56701907 0.86596186 0.43298093
[129,] 0.53223151 0.93553698 0.46776849
[130,] 0.46763596 0.93527193 0.53236404
[131,] 0.82402506 0.35194988 0.17597494
[132,] 0.77513806 0.44972388 0.22486194
[133,] 0.72806703 0.54386595 0.27193297
[134,] 0.68961039 0.62077922 0.31038961
[135,] 0.63263063 0.73473874 0.36736937
[136,] 0.57872193 0.84255613 0.42127807
[137,] 0.50938765 0.98122469 0.49061235
[138,] 0.42608041 0.85216082 0.57391959
[139,] 0.42166605 0.84333210 0.57833395
[140,] 0.33312313 0.66624625 0.66687687
[141,] 0.24925264 0.49850529 0.75074736
[142,] 0.18509003 0.37018007 0.81490997
[143,] 0.32484905 0.64969809 0.67515095
[144,] 0.37441534 0.74883068 0.62558466
[145,] 0.41121203 0.82242407 0.58878797
[146,] 0.48945320 0.97890639 0.51054680
> postscript(file="/var/www/html/rcomp/tmp/1ygiz1290462421.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/2wboq1290462421.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/3wboq1290462421.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/4wboq1290462421.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/5wboq1290462421.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
-0.71320632 -1.72335402 0.88177087 -1.08512431 7.93645669 -1.19120396
7 8 9 10 11 12
8.93682605 -2.12134007 -3.09938971 -0.14346793 -2.75362674 -4.41855834
13 14 15 16 17 18
2.20504017 0.91487569 -3.24397035 0.55393109 1.09164492 -2.24397035
19 20 21 22 23 24
-2.99843096 0.64710088 -5.60630097 1.80960472 -0.82751779 1.58052899
25 26 27 28 29 30
-2.03738829 -4.14987086 -2.02001195 2.09896052 1.15035435 -0.16139113
31 32 33 34 35 36
-3.82440330 2.44014946 -2.71109858 -1.73213271 -0.10030594 -4.41123918
37 38 39 40 41 42
7.63466795 -1.38772529 -2.28723989 -2.73213271 -3.48376122 1.14669655
43 44 45 46 47 48
-5.07597981 0.82617238 -1.99331006 -0.24397035 -3.95014807 -1.36533205
49 50 51 52 53 54
2.46941898 -1.83775602 -2.75279748 0.91853349 5.01034774 0.46861031
55 56 57 58 59 60
-1.33946298 -0.66830239 0.12511555 -4.15956223 -3.46070011 1.71378033
61 62 63 64 65 66
6.89054956 -0.95480907 -1.04982478 0.92914108 -0.55022912 -1.58983731
67 68 69 70 71 72
4.58235789 -1.03373049 -0.58004195 1.00851884 0.40558866 1.94103072
73 74 75 76 77 78
0.56168957 -2.46583803 -1.69866208 6.17102267 -0.36797319 4.10078942
79 80 81 82 83 84
-0.03921719 -3.61050563 -1.79130203 -3.08329541 -3.91896268 -0.94649027
85 86 87 88 89 90
-0.89006252 0.06860083 0.02360993 -1.24762815 2.53836664 8.94651742
91 92 93 94 95 96
0.33535541 1.46220737 -0.23253705 2.09475586 -3.00154189 -1.32766032
97 98 99 100 101 102
3.60576779 -1.44791483 -2.05348258 -2.87305555 -2.78764423 2.72201216
103 104 105 106 107 108
-0.94100357 -2.04013342 3.20504017 6.23019199 -1.94237257 3.25460509
109 110 111 112 113 114
2.34504677 10.83677997 0.64812111 2.50252025 -1.87250869 2.35053348
115 116 117 118 119 120
-1.49408377 -3.22522145 0.97358511 -0.16870673 -3.69079962 1.93133935
121 122 123 124 125 126
2.38858170 0.69402823 -1.81745706 -5.28896124 -2.06079818 -1.98050776
127 128 129 130 131 132
-5.31749203 -2.99148116 -2.05988551 0.67417214 -1.81928596 6.82671924
133 134 135 136 137 138
-3.18297213 1.74953975 -0.92079158 1.38217520 9.88268710 0.93828559
139 140 141 142 143 144
2.89054956 -1.78526847 -0.44928383 -2.42038724 1.45395496 -0.98370567
145 146 147 148 149 150
-0.85787748 -1.56825631 -0.38874551 -0.00940436 -2.15535756 6.16461974
151 152 153 154 155 156
-0.97355797 4.43082746 -3.07297287 -0.90707304 6.11459492 4.83860887
157 158 159
2.42168296 1.16644864 -1.25962533
> postscript(file="/var/www/html/rcomp/tmp/6khyn1290462421.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 -0.71320632 NA
1 -1.72335402 -0.71320632
2 0.88177087 -1.72335402
3 -1.08512431 0.88177087
4 7.93645669 -1.08512431
5 -1.19120396 7.93645669
6 8.93682605 -1.19120396
7 -2.12134007 8.93682605
8 -3.09938971 -2.12134007
9 -0.14346793 -3.09938971
10 -2.75362674 -0.14346793
11 -4.41855834 -2.75362674
12 2.20504017 -4.41855834
13 0.91487569 2.20504017
14 -3.24397035 0.91487569
15 0.55393109 -3.24397035
16 1.09164492 0.55393109
17 -2.24397035 1.09164492
18 -2.99843096 -2.24397035
19 0.64710088 -2.99843096
20 -5.60630097 0.64710088
21 1.80960472 -5.60630097
22 -0.82751779 1.80960472
23 1.58052899 -0.82751779
24 -2.03738829 1.58052899
25 -4.14987086 -2.03738829
26 -2.02001195 -4.14987086
27 2.09896052 -2.02001195
28 1.15035435 2.09896052
29 -0.16139113 1.15035435
30 -3.82440330 -0.16139113
31 2.44014946 -3.82440330
32 -2.71109858 2.44014946
33 -1.73213271 -2.71109858
34 -0.10030594 -1.73213271
35 -4.41123918 -0.10030594
36 7.63466795 -4.41123918
37 -1.38772529 7.63466795
38 -2.28723989 -1.38772529
39 -2.73213271 -2.28723989
40 -3.48376122 -2.73213271
41 1.14669655 -3.48376122
42 -5.07597981 1.14669655
43 0.82617238 -5.07597981
44 -1.99331006 0.82617238
45 -0.24397035 -1.99331006
46 -3.95014807 -0.24397035
47 -1.36533205 -3.95014807
48 2.46941898 -1.36533205
49 -1.83775602 2.46941898
50 -2.75279748 -1.83775602
51 0.91853349 -2.75279748
52 5.01034774 0.91853349
53 0.46861031 5.01034774
54 -1.33946298 0.46861031
55 -0.66830239 -1.33946298
56 0.12511555 -0.66830239
57 -4.15956223 0.12511555
58 -3.46070011 -4.15956223
59 1.71378033 -3.46070011
60 6.89054956 1.71378033
61 -0.95480907 6.89054956
62 -1.04982478 -0.95480907
63 0.92914108 -1.04982478
64 -0.55022912 0.92914108
65 -1.58983731 -0.55022912
66 4.58235789 -1.58983731
67 -1.03373049 4.58235789
68 -0.58004195 -1.03373049
69 1.00851884 -0.58004195
70 0.40558866 1.00851884
71 1.94103072 0.40558866
72 0.56168957 1.94103072
73 -2.46583803 0.56168957
74 -1.69866208 -2.46583803
75 6.17102267 -1.69866208
76 -0.36797319 6.17102267
77 4.10078942 -0.36797319
78 -0.03921719 4.10078942
79 -3.61050563 -0.03921719
80 -1.79130203 -3.61050563
81 -3.08329541 -1.79130203
82 -3.91896268 -3.08329541
83 -0.94649027 -3.91896268
84 -0.89006252 -0.94649027
85 0.06860083 -0.89006252
86 0.02360993 0.06860083
87 -1.24762815 0.02360993
88 2.53836664 -1.24762815
89 8.94651742 2.53836664
90 0.33535541 8.94651742
91 1.46220737 0.33535541
92 -0.23253705 1.46220737
93 2.09475586 -0.23253705
94 -3.00154189 2.09475586
95 -1.32766032 -3.00154189
96 3.60576779 -1.32766032
97 -1.44791483 3.60576779
98 -2.05348258 -1.44791483
99 -2.87305555 -2.05348258
100 -2.78764423 -2.87305555
101 2.72201216 -2.78764423
102 -0.94100357 2.72201216
103 -2.04013342 -0.94100357
104 3.20504017 -2.04013342
105 6.23019199 3.20504017
106 -1.94237257 6.23019199
107 3.25460509 -1.94237257
108 2.34504677 3.25460509
109 10.83677997 2.34504677
110 0.64812111 10.83677997
111 2.50252025 0.64812111
112 -1.87250869 2.50252025
113 2.35053348 -1.87250869
114 -1.49408377 2.35053348
115 -3.22522145 -1.49408377
116 0.97358511 -3.22522145
117 -0.16870673 0.97358511
118 -3.69079962 -0.16870673
119 1.93133935 -3.69079962
120 2.38858170 1.93133935
121 0.69402823 2.38858170
122 -1.81745706 0.69402823
123 -5.28896124 -1.81745706
124 -2.06079818 -5.28896124
125 -1.98050776 -2.06079818
126 -5.31749203 -1.98050776
127 -2.99148116 -5.31749203
128 -2.05988551 -2.99148116
129 0.67417214 -2.05988551
130 -1.81928596 0.67417214
131 6.82671924 -1.81928596
132 -3.18297213 6.82671924
133 1.74953975 -3.18297213
134 -0.92079158 1.74953975
135 1.38217520 -0.92079158
136 9.88268710 1.38217520
137 0.93828559 9.88268710
138 2.89054956 0.93828559
139 -1.78526847 2.89054956
140 -0.44928383 -1.78526847
141 -2.42038724 -0.44928383
142 1.45395496 -2.42038724
143 -0.98370567 1.45395496
144 -0.85787748 -0.98370567
145 -1.56825631 -0.85787748
146 -0.38874551 -1.56825631
147 -0.00940436 -0.38874551
148 -2.15535756 -0.00940436
149 6.16461974 -2.15535756
150 -0.97355797 6.16461974
151 4.43082746 -0.97355797
152 -3.07297287 4.43082746
153 -0.90707304 -3.07297287
154 6.11459492 -0.90707304
155 4.83860887 6.11459492
156 2.42168296 4.83860887
157 1.16644864 2.42168296
158 -1.25962533 1.16644864
159 NA -1.25962533
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -1.72335402 -0.71320632
[2,] 0.88177087 -1.72335402
[3,] -1.08512431 0.88177087
[4,] 7.93645669 -1.08512431
[5,] -1.19120396 7.93645669
[6,] 8.93682605 -1.19120396
[7,] -2.12134007 8.93682605
[8,] -3.09938971 -2.12134007
[9,] -0.14346793 -3.09938971
[10,] -2.75362674 -0.14346793
[11,] -4.41855834 -2.75362674
[12,] 2.20504017 -4.41855834
[13,] 0.91487569 2.20504017
[14,] -3.24397035 0.91487569
[15,] 0.55393109 -3.24397035
[16,] 1.09164492 0.55393109
[17,] -2.24397035 1.09164492
[18,] -2.99843096 -2.24397035
[19,] 0.64710088 -2.99843096
[20,] -5.60630097 0.64710088
[21,] 1.80960472 -5.60630097
[22,] -0.82751779 1.80960472
[23,] 1.58052899 -0.82751779
[24,] -2.03738829 1.58052899
[25,] -4.14987086 -2.03738829
[26,] -2.02001195 -4.14987086
[27,] 2.09896052 -2.02001195
[28,] 1.15035435 2.09896052
[29,] -0.16139113 1.15035435
[30,] -3.82440330 -0.16139113
[31,] 2.44014946 -3.82440330
[32,] -2.71109858 2.44014946
[33,] -1.73213271 -2.71109858
[34,] -0.10030594 -1.73213271
[35,] -4.41123918 -0.10030594
[36,] 7.63466795 -4.41123918
[37,] -1.38772529 7.63466795
[38,] -2.28723989 -1.38772529
[39,] -2.73213271 -2.28723989
[40,] -3.48376122 -2.73213271
[41,] 1.14669655 -3.48376122
[42,] -5.07597981 1.14669655
[43,] 0.82617238 -5.07597981
[44,] -1.99331006 0.82617238
[45,] -0.24397035 -1.99331006
[46,] -3.95014807 -0.24397035
[47,] -1.36533205 -3.95014807
[48,] 2.46941898 -1.36533205
[49,] -1.83775602 2.46941898
[50,] -2.75279748 -1.83775602
[51,] 0.91853349 -2.75279748
[52,] 5.01034774 0.91853349
[53,] 0.46861031 5.01034774
[54,] -1.33946298 0.46861031
[55,] -0.66830239 -1.33946298
[56,] 0.12511555 -0.66830239
[57,] -4.15956223 0.12511555
[58,] -3.46070011 -4.15956223
[59,] 1.71378033 -3.46070011
[60,] 6.89054956 1.71378033
[61,] -0.95480907 6.89054956
[62,] -1.04982478 -0.95480907
[63,] 0.92914108 -1.04982478
[64,] -0.55022912 0.92914108
[65,] -1.58983731 -0.55022912
[66,] 4.58235789 -1.58983731
[67,] -1.03373049 4.58235789
[68,] -0.58004195 -1.03373049
[69,] 1.00851884 -0.58004195
[70,] 0.40558866 1.00851884
[71,] 1.94103072 0.40558866
[72,] 0.56168957 1.94103072
[73,] -2.46583803 0.56168957
[74,] -1.69866208 -2.46583803
[75,] 6.17102267 -1.69866208
[76,] -0.36797319 6.17102267
[77,] 4.10078942 -0.36797319
[78,] -0.03921719 4.10078942
[79,] -3.61050563 -0.03921719
[80,] -1.79130203 -3.61050563
[81,] -3.08329541 -1.79130203
[82,] -3.91896268 -3.08329541
[83,] -0.94649027 -3.91896268
[84,] -0.89006252 -0.94649027
[85,] 0.06860083 -0.89006252
[86,] 0.02360993 0.06860083
[87,] -1.24762815 0.02360993
[88,] 2.53836664 -1.24762815
[89,] 8.94651742 2.53836664
[90,] 0.33535541 8.94651742
[91,] 1.46220737 0.33535541
[92,] -0.23253705 1.46220737
[93,] 2.09475586 -0.23253705
[94,] -3.00154189 2.09475586
[95,] -1.32766032 -3.00154189
[96,] 3.60576779 -1.32766032
[97,] -1.44791483 3.60576779
[98,] -2.05348258 -1.44791483
[99,] -2.87305555 -2.05348258
[100,] -2.78764423 -2.87305555
[101,] 2.72201216 -2.78764423
[102,] -0.94100357 2.72201216
[103,] -2.04013342 -0.94100357
[104,] 3.20504017 -2.04013342
[105,] 6.23019199 3.20504017
[106,] -1.94237257 6.23019199
[107,] 3.25460509 -1.94237257
[108,] 2.34504677 3.25460509
[109,] 10.83677997 2.34504677
[110,] 0.64812111 10.83677997
[111,] 2.50252025 0.64812111
[112,] -1.87250869 2.50252025
[113,] 2.35053348 -1.87250869
[114,] -1.49408377 2.35053348
[115,] -3.22522145 -1.49408377
[116,] 0.97358511 -3.22522145
[117,] -0.16870673 0.97358511
[118,] -3.69079962 -0.16870673
[119,] 1.93133935 -3.69079962
[120,] 2.38858170 1.93133935
[121,] 0.69402823 2.38858170
[122,] -1.81745706 0.69402823
[123,] -5.28896124 -1.81745706
[124,] -2.06079818 -5.28896124
[125,] -1.98050776 -2.06079818
[126,] -5.31749203 -1.98050776
[127,] -2.99148116 -5.31749203
[128,] -2.05988551 -2.99148116
[129,] 0.67417214 -2.05988551
[130,] -1.81928596 0.67417214
[131,] 6.82671924 -1.81928596
[132,] -3.18297213 6.82671924
[133,] 1.74953975 -3.18297213
[134,] -0.92079158 1.74953975
[135,] 1.38217520 -0.92079158
[136,] 9.88268710 1.38217520
[137,] 0.93828559 9.88268710
[138,] 2.89054956 0.93828559
[139,] -1.78526847 2.89054956
[140,] -0.44928383 -1.78526847
[141,] -2.42038724 -0.44928383
[142,] 1.45395496 -2.42038724
[143,] -0.98370567 1.45395496
[144,] -0.85787748 -0.98370567
[145,] -1.56825631 -0.85787748
[146,] -0.38874551 -1.56825631
[147,] -0.00940436 -0.38874551
[148,] -2.15535756 -0.00940436
[149,] 6.16461974 -2.15535756
[150,] -0.97355797 6.16461974
[151,] 4.43082746 -0.97355797
[152,] -3.07297287 4.43082746
[153,] -0.90707304 -3.07297287
[154,] 6.11459492 -0.90707304
[155,] 4.83860887 6.11459492
[156,] 2.42168296 4.83860887
[157,] 1.16644864 2.42168296
[158,] -1.25962533 1.16644864
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -1.72335402 -0.71320632
2 0.88177087 -1.72335402
3 -1.08512431 0.88177087
4 7.93645669 -1.08512431
5 -1.19120396 7.93645669
6 8.93682605 -1.19120396
7 -2.12134007 8.93682605
8 -3.09938971 -2.12134007
9 -0.14346793 -3.09938971
10 -2.75362674 -0.14346793
11 -4.41855834 -2.75362674
12 2.20504017 -4.41855834
13 0.91487569 2.20504017
14 -3.24397035 0.91487569
15 0.55393109 -3.24397035
16 1.09164492 0.55393109
17 -2.24397035 1.09164492
18 -2.99843096 -2.24397035
19 0.64710088 -2.99843096
20 -5.60630097 0.64710088
21 1.80960472 -5.60630097
22 -0.82751779 1.80960472
23 1.58052899 -0.82751779
24 -2.03738829 1.58052899
25 -4.14987086 -2.03738829
26 -2.02001195 -4.14987086
27 2.09896052 -2.02001195
28 1.15035435 2.09896052
29 -0.16139113 1.15035435
30 -3.82440330 -0.16139113
31 2.44014946 -3.82440330
32 -2.71109858 2.44014946
33 -1.73213271 -2.71109858
34 -0.10030594 -1.73213271
35 -4.41123918 -0.10030594
36 7.63466795 -4.41123918
37 -1.38772529 7.63466795
38 -2.28723989 -1.38772529
39 -2.73213271 -2.28723989
40 -3.48376122 -2.73213271
41 1.14669655 -3.48376122
42 -5.07597981 1.14669655
43 0.82617238 -5.07597981
44 -1.99331006 0.82617238
45 -0.24397035 -1.99331006
46 -3.95014807 -0.24397035
47 -1.36533205 -3.95014807
48 2.46941898 -1.36533205
49 -1.83775602 2.46941898
50 -2.75279748 -1.83775602
51 0.91853349 -2.75279748
52 5.01034774 0.91853349
53 0.46861031 5.01034774
54 -1.33946298 0.46861031
55 -0.66830239 -1.33946298
56 0.12511555 -0.66830239
57 -4.15956223 0.12511555
58 -3.46070011 -4.15956223
59 1.71378033 -3.46070011
60 6.89054956 1.71378033
61 -0.95480907 6.89054956
62 -1.04982478 -0.95480907
63 0.92914108 -1.04982478
64 -0.55022912 0.92914108
65 -1.58983731 -0.55022912
66 4.58235789 -1.58983731
67 -1.03373049 4.58235789
68 -0.58004195 -1.03373049
69 1.00851884 -0.58004195
70 0.40558866 1.00851884
71 1.94103072 0.40558866
72 0.56168957 1.94103072
73 -2.46583803 0.56168957
74 -1.69866208 -2.46583803
75 6.17102267 -1.69866208
76 -0.36797319 6.17102267
77 4.10078942 -0.36797319
78 -0.03921719 4.10078942
79 -3.61050563 -0.03921719
80 -1.79130203 -3.61050563
81 -3.08329541 -1.79130203
82 -3.91896268 -3.08329541
83 -0.94649027 -3.91896268
84 -0.89006252 -0.94649027
85 0.06860083 -0.89006252
86 0.02360993 0.06860083
87 -1.24762815 0.02360993
88 2.53836664 -1.24762815
89 8.94651742 2.53836664
90 0.33535541 8.94651742
91 1.46220737 0.33535541
92 -0.23253705 1.46220737
93 2.09475586 -0.23253705
94 -3.00154189 2.09475586
95 -1.32766032 -3.00154189
96 3.60576779 -1.32766032
97 -1.44791483 3.60576779
98 -2.05348258 -1.44791483
99 -2.87305555 -2.05348258
100 -2.78764423 -2.87305555
101 2.72201216 -2.78764423
102 -0.94100357 2.72201216
103 -2.04013342 -0.94100357
104 3.20504017 -2.04013342
105 6.23019199 3.20504017
106 -1.94237257 6.23019199
107 3.25460509 -1.94237257
108 2.34504677 3.25460509
109 10.83677997 2.34504677
110 0.64812111 10.83677997
111 2.50252025 0.64812111
112 -1.87250869 2.50252025
113 2.35053348 -1.87250869
114 -1.49408377 2.35053348
115 -3.22522145 -1.49408377
116 0.97358511 -3.22522145
117 -0.16870673 0.97358511
118 -3.69079962 -0.16870673
119 1.93133935 -3.69079962
120 2.38858170 1.93133935
121 0.69402823 2.38858170
122 -1.81745706 0.69402823
123 -5.28896124 -1.81745706
124 -2.06079818 -5.28896124
125 -1.98050776 -2.06079818
126 -5.31749203 -1.98050776
127 -2.99148116 -5.31749203
128 -2.05988551 -2.99148116
129 0.67417214 -2.05988551
130 -1.81928596 0.67417214
131 6.82671924 -1.81928596
132 -3.18297213 6.82671924
133 1.74953975 -3.18297213
134 -0.92079158 1.74953975
135 1.38217520 -0.92079158
136 9.88268710 1.38217520
137 0.93828559 9.88268710
138 2.89054956 0.93828559
139 -1.78526847 2.89054956
140 -0.44928383 -1.78526847
141 -2.42038724 -0.44928383
142 1.45395496 -2.42038724
143 -0.98370567 1.45395496
144 -0.85787748 -0.98370567
145 -1.56825631 -0.85787748
146 -0.38874551 -1.56825631
147 -0.00940436 -0.38874551
148 -2.15535756 -0.00940436
149 6.16461974 -2.15535756
150 -0.97355797 6.16461974
151 4.43082746 -0.97355797
152 -3.07297287 4.43082746
153 -0.90707304 -3.07297287
154 6.11459492 -0.90707304
155 4.83860887 6.11459492
156 2.42168296 4.83860887
157 1.16644864 2.42168296
158 -1.25962533 1.16644864
> 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/7c8gp1290462421.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/8c8gp1290462421.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/9c8gp1290462421.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/10nhfs1290462421.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/118iwg1290462421.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/12u0u41290462421.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/13j19g1290462421.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/14mkq41290462421.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/15pkoa1290462421.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/16t34x1290462421.tab")
+ }
>
> try(system("convert tmp/1ygiz1290462421.ps tmp/1ygiz1290462421.png",intern=TRUE))
character(0)
> try(system("convert tmp/2wboq1290462421.ps tmp/2wboq1290462421.png",intern=TRUE))
character(0)
> try(system("convert tmp/3wboq1290462421.ps tmp/3wboq1290462421.png",intern=TRUE))
character(0)
> try(system("convert tmp/4wboq1290462421.ps tmp/4wboq1290462421.png",intern=TRUE))
character(0)
> try(system("convert tmp/5wboq1290462421.ps tmp/5wboq1290462421.png",intern=TRUE))
character(0)
> try(system("convert tmp/6khyn1290462421.ps tmp/6khyn1290462421.png",intern=TRUE))
character(0)
> try(system("convert tmp/7c8gp1290462421.ps tmp/7c8gp1290462421.png",intern=TRUE))
character(0)
> try(system("convert tmp/8c8gp1290462421.ps tmp/8c8gp1290462421.png",intern=TRUE))
character(0)
> try(system("convert tmp/9c8gp1290462421.ps tmp/9c8gp1290462421.png",intern=TRUE))
character(0)
> try(system("convert tmp/10nhfs1290462421.ps tmp/10nhfs1290462421.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
3.978 1.736 8.885