R version 2.15.2 (2012-10-26) -- "Trick or Treat"
Copyright (C) 2012 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: i686-pc-linux-gnu (32-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> x <- array(list(1
+ ,87.28
+ ,255
+ ,2
+ ,87.28
+ ,280.2
+ ,3
+ ,87.09
+ ,299.9
+ ,4
+ ,86.92
+ ,339.2
+ ,5
+ ,87.59
+ ,374.2
+ ,6
+ ,90.72
+ ,393.5
+ ,7
+ ,90.69
+ ,389.2
+ ,8
+ ,90.3
+ ,381.7
+ ,9
+ ,89.55
+ ,375.2
+ ,10
+ ,88.94
+ ,369
+ ,11
+ ,88.41
+ ,357.4
+ ,12
+ ,87.82
+ ,352.1
+ ,1
+ ,87.07
+ ,346.5
+ ,2
+ ,86.82
+ ,342.9
+ ,3
+ ,86.4
+ ,340.3
+ ,4
+ ,86.02
+ ,328.3
+ ,5
+ ,85.66
+ ,322.9
+ ,6
+ ,85.32
+ ,314.3
+ ,7
+ ,85
+ ,308.9
+ ,8
+ ,84.67
+ ,294
+ ,9
+ ,83.94
+ ,285.6
+ ,10
+ ,82.83
+ ,281.2
+ ,11
+ ,81.95
+ ,280.3
+ ,12
+ ,81.19
+ ,278.8
+ ,1
+ ,80.48
+ ,274.5
+ ,2
+ ,78.86
+ ,270.4
+ ,3
+ ,69.47
+ ,263.4
+ ,4
+ ,68.77
+ ,259.9
+ ,5
+ ,70.06
+ ,258
+ ,6
+ ,73.95
+ ,262.7
+ ,7
+ ,75.8
+ ,284.7
+ ,8
+ ,77.79
+ ,311.3
+ ,9
+ ,81.57
+ ,322.1
+ ,10
+ ,83.07
+ ,327
+ ,11
+ ,84.34
+ ,331.3
+ ,12
+ ,85.1
+ ,333.3
+ ,1
+ ,85.25
+ ,321.4
+ ,2
+ ,84.26
+ ,327
+ ,3
+ ,83.63
+ ,320
+ ,4
+ ,86.44
+ ,314.7
+ ,5
+ ,85.3
+ ,316.7
+ ,6
+ ,84.1
+ ,314.4
+ ,7
+ ,83.36
+ ,321.3
+ ,8
+ ,82.48
+ ,318.2
+ ,9
+ ,81.58
+ ,307.2
+ ,10
+ ,80.47
+ ,301.3
+ ,11
+ ,79.34
+ ,287.5
+ ,12
+ ,82.13
+ ,277.7
+ ,1
+ ,81.69
+ ,274.4
+ ,2
+ ,80.7
+ ,258.8
+ ,3
+ ,79.88
+ ,253.3
+ ,4
+ ,79.16
+ ,251
+ ,5
+ ,78.38
+ ,248.4
+ ,6
+ ,77.42
+ ,249.5
+ ,7
+ ,76.47
+ ,246.1
+ ,8
+ ,75.46
+ ,244.5
+ ,9
+ ,74.48
+ ,243.6
+ ,10
+ ,78.27
+ ,244
+ ,11
+ ,80.7
+ ,240.8
+ ,12
+ ,79.91
+ ,249.8
+ ,1
+ ,78.75
+ ,248
+ ,2
+ ,77.78
+ ,259.4
+ ,3
+ ,81.14
+ ,260.5
+ ,4
+ ,81.08
+ ,260.8
+ ,5
+ ,80.03
+ ,261.3
+ ,6
+ ,78.91
+ ,259.5
+ ,7
+ ,78.01
+ ,256.6
+ ,8
+ ,76.9
+ ,257.9
+ ,9
+ ,75.97
+ ,256.5
+ ,10
+ ,81.93
+ ,254.2
+ ,11
+ ,80.27
+ ,253.3
+ ,12
+ ,78.67
+ ,253.8
+ ,1
+ ,77.42
+ ,255.5
+ ,2
+ ,76.16
+ ,257.1
+ ,3
+ ,74.7
+ ,257.3
+ ,4
+ ,76.39
+ ,253.2
+ ,5
+ ,76.04
+ ,252.8
+ ,6
+ ,74.65
+ ,252
+ ,7
+ ,73.29
+ ,250.7
+ ,8
+ ,71.79
+ ,252.2
+ ,9
+ ,74.39
+ ,250
+ ,10
+ ,74.91
+ ,251
+ ,11
+ ,74.54
+ ,253.4
+ ,12
+ ,73.08
+ ,251.2
+ ,1
+ ,72.75
+ ,255.6
+ ,2
+ ,71.32
+ ,261.1
+ ,3
+ ,70.38
+ ,258.9
+ ,4
+ ,70.35
+ ,259.9
+ ,5
+ ,70.01
+ ,261.2
+ ,6
+ ,69.36
+ ,264.7
+ ,7
+ ,67.77
+ ,267.1
+ ,8
+ ,69.26
+ ,266.4
+ ,9
+ ,69.8
+ ,267.7
+ ,10
+ ,68.38
+ ,268.6
+ ,11
+ ,67.62
+ ,267.5
+ ,12
+ ,68.39
+ ,268.5
+ ,1
+ ,66.95
+ ,268.5
+ ,2
+ ,65.21
+ ,270.5
+ ,3
+ ,66.64
+ ,270.9
+ ,4
+ ,63.45
+ ,270.1
+ ,5
+ ,60.66
+ ,269.3
+ ,6
+ ,62.34
+ ,269.8
+ ,7
+ ,60.32
+ ,270.1
+ ,8
+ ,58.64
+ ,264.9
+ ,9
+ ,60.46
+ ,263.7
+ ,10
+ ,58.59
+ ,264.8
+ ,11
+ ,61.87
+ ,263.7
+ ,12
+ ,61.85
+ ,255.9
+ ,1
+ ,67.44
+ ,276.2
+ ,2
+ ,77.06
+ ,360.1
+ ,3
+ ,91.74
+ ,380.5
+ ,4
+ ,93.15
+ ,373.7
+ ,5
+ ,94.15
+ ,369.8
+ ,6
+ ,93.11
+ ,366.6
+ ,7
+ ,91.51
+ ,359.3
+ ,8
+ ,89.96
+ ,345.8
+ ,9
+ ,88.16
+ ,326.2
+ ,10
+ ,86.98
+ ,324.5
+ ,11
+ ,88.03
+ ,328.1
+ ,12
+ ,86.24
+ ,327.5
+ ,1
+ ,84.65
+ ,324.4
+ ,2
+ ,83.23
+ ,316.5
+ ,3
+ ,81.7
+ ,310.9
+ ,4
+ ,80.25
+ ,301.5
+ ,5
+ ,78.8
+ ,291.7
+ ,6
+ ,77.51
+ ,290.4
+ ,7
+ ,76.2
+ ,287.4
+ ,8
+ ,75.04
+ ,277.7
+ ,9
+ ,74
+ ,281.6
+ ,10
+ ,75.49
+ ,288
+ ,11
+ ,77.14
+ ,276
+ ,12
+ ,76.15
+ ,272.9
+ ,1
+ ,76.27
+ ,283
+ ,2
+ ,78.19
+ ,283.3
+ ,3
+ ,76.49
+ ,276.8
+ ,4
+ ,77.31
+ ,284.5
+ ,5
+ ,76.65
+ ,282.7
+ ,6
+ ,74.99
+ ,281.2
+ ,7
+ ,73.51
+ ,287.4
+ ,8
+ ,72.07
+ ,283.1
+ ,9
+ ,70.59
+ ,284
+ ,10
+ ,71.96
+ ,285.5
+ ,11
+ ,76.29
+ ,289.2)
+ ,dim=c(3
+ ,143)
+ ,dimnames=list(c('month'
+ ,'col'
+ ,'usa')
+ ,1:143))
> y <- array(NA,dim=c(3,143),dimnames=list(c('month','col','usa'),1:143))
> for (i in 1:dim(x)[1])
+ {
+ for (j in 1:dim(x)[2])
+ {
+ y[i,j] <- as.numeric(x[i,j])
+ }
+ }
> par3 = 'No Linear Trend'
> par2 = 'Do not include Seasonal Dummies'
> par1 = '1'
> par3 <- 'No Linear Trend'
> par2 <- 'Do not include Seasonal Dummies'
> par1 <- '1'
> #'GNU S' R Code compiled by R2WASP v. 1.0.44 ()
> #Author: Prof. Dr. P. Wessa
> #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/
> #Source of accompanying publication: Office for Research, Development, and Education
> #Technical description: Write here your technical program description (don't use hard returns!)
> library(lattice)
> library(lmtest)
Loading required package: zoo
Attaching package: 'zoo'
The following object(s) are masked from 'package:base':
as.Date, as.Date.numeric
> n25 <- 25 #minimum number of obs. for Goldfeld-Quandt test
> par1 <- as.numeric(par1)
> x <- t(y)
> k <- length(x[1,])
> n <- length(x[,1])
> x1 <- cbind(x[,par1], x[,1:k!=par1])
> mycolnames <- c(colnames(x)[par1], colnames(x)[1:k!=par1])
> colnames(x1) <- mycolnames #colnames(x)[par1]
> x <- x1
> if (par3 == 'First Differences'){
+ x2 <- array(0, dim=c(n-1,k), dimnames=list(1:(n-1), paste('(1-B)',colnames(x),sep='')))
+ for (i in 1:n-1) {
+ for (j in 1:k) {
+ x2[i,j] <- x[i+1,j] - x[i,j]
+ }
+ }
+ x <- x2
+ }
> if (par2 == 'Include Monthly Dummies'){
+ x2 <- array(0, dim=c(n,11), dimnames=list(1:n, paste('M', seq(1:11), sep ='')))
+ for (i in 1:11){
+ x2[seq(i,n,12),i] <- 1
+ }
+ x <- cbind(x, x2)
+ }
> if (par2 == 'Include Quarterly Dummies'){
+ x2 <- array(0, dim=c(n,3), dimnames=list(1:n, paste('Q', seq(1:3), sep ='')))
+ for (i in 1:3){
+ x2[seq(i,n,4),i] <- 1
+ }
+ x <- cbind(x, x2)
+ }
> k <- length(x[1,])
> if (par3 == 'Linear Trend'){
+ x <- cbind(x, c(1:n))
+ colnames(x)[k+1] <- 't'
+ }
> x
month col usa
1 1 87.28 255.0
2 2 87.28 280.2
3 3 87.09 299.9
4 4 86.92 339.2
5 5 87.59 374.2
6 6 90.72 393.5
7 7 90.69 389.2
8 8 90.30 381.7
9 9 89.55 375.2
10 10 88.94 369.0
11 11 88.41 357.4
12 12 87.82 352.1
13 1 87.07 346.5
14 2 86.82 342.9
15 3 86.40 340.3
16 4 86.02 328.3
17 5 85.66 322.9
18 6 85.32 314.3
19 7 85.00 308.9
20 8 84.67 294.0
21 9 83.94 285.6
22 10 82.83 281.2
23 11 81.95 280.3
24 12 81.19 278.8
25 1 80.48 274.5
26 2 78.86 270.4
27 3 69.47 263.4
28 4 68.77 259.9
29 5 70.06 258.0
30 6 73.95 262.7
31 7 75.80 284.7
32 8 77.79 311.3
33 9 81.57 322.1
34 10 83.07 327.0
35 11 84.34 331.3
36 12 85.10 333.3
37 1 85.25 321.4
38 2 84.26 327.0
39 3 83.63 320.0
40 4 86.44 314.7
41 5 85.30 316.7
42 6 84.10 314.4
43 7 83.36 321.3
44 8 82.48 318.2
45 9 81.58 307.2
46 10 80.47 301.3
47 11 79.34 287.5
48 12 82.13 277.7
49 1 81.69 274.4
50 2 80.70 258.8
51 3 79.88 253.3
52 4 79.16 251.0
53 5 78.38 248.4
54 6 77.42 249.5
55 7 76.47 246.1
56 8 75.46 244.5
57 9 74.48 243.6
58 10 78.27 244.0
59 11 80.70 240.8
60 12 79.91 249.8
61 1 78.75 248.0
62 2 77.78 259.4
63 3 81.14 260.5
64 4 81.08 260.8
65 5 80.03 261.3
66 6 78.91 259.5
67 7 78.01 256.6
68 8 76.90 257.9
69 9 75.97 256.5
70 10 81.93 254.2
71 11 80.27 253.3
72 12 78.67 253.8
73 1 77.42 255.5
74 2 76.16 257.1
75 3 74.70 257.3
76 4 76.39 253.2
77 5 76.04 252.8
78 6 74.65 252.0
79 7 73.29 250.7
80 8 71.79 252.2
81 9 74.39 250.0
82 10 74.91 251.0
83 11 74.54 253.4
84 12 73.08 251.2
85 1 72.75 255.6
86 2 71.32 261.1
87 3 70.38 258.9
88 4 70.35 259.9
89 5 70.01 261.2
90 6 69.36 264.7
91 7 67.77 267.1
92 8 69.26 266.4
93 9 69.80 267.7
94 10 68.38 268.6
95 11 67.62 267.5
96 12 68.39 268.5
97 1 66.95 268.5
98 2 65.21 270.5
99 3 66.64 270.9
100 4 63.45 270.1
101 5 60.66 269.3
102 6 62.34 269.8
103 7 60.32 270.1
104 8 58.64 264.9
105 9 60.46 263.7
106 10 58.59 264.8
107 11 61.87 263.7
108 12 61.85 255.9
109 1 67.44 276.2
110 2 77.06 360.1
111 3 91.74 380.5
112 4 93.15 373.7
113 5 94.15 369.8
114 6 93.11 366.6
115 7 91.51 359.3
116 8 89.96 345.8
117 9 88.16 326.2
118 10 86.98 324.5
119 11 88.03 328.1
120 12 86.24 327.5
121 1 84.65 324.4
122 2 83.23 316.5
123 3 81.70 310.9
124 4 80.25 301.5
125 5 78.80 291.7
126 6 77.51 290.4
127 7 76.20 287.4
128 8 75.04 277.7
129 9 74.00 281.6
130 10 75.49 288.0
131 11 77.14 276.0
132 12 76.15 272.9
133 1 76.27 283.0
134 2 78.19 283.3
135 3 76.49 276.8
136 4 77.31 284.5
137 5 76.65 282.7
138 6 74.99 281.2
139 7 73.51 287.4
140 8 72.07 283.1
141 9 70.59 284.0
142 10 71.96 285.5
143 11 76.29 289.2
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) col usa
8.339390 -0.039120 0.004089
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-5.8307 -3.0603 -0.1961 2.7759 5.7651
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 8.339390 2.904272 2.871 0.00472 **
col -0.039120 0.051300 -0.763 0.44700
usa 0.004089 0.010640 0.384 0.70131
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 3.462 on 140 degrees of freedom
Multiple R-squared: 0.004437, Adjusted R-squared: -0.009785
F-statistic: 0.312 on 2 and 140 DF, p-value: 0.7325
> 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.0004621183 0.0009242367 0.99953788
[2,] 0.0006569192 0.0013138384 0.99934308
[3,] 0.0022869383 0.0045738766 0.99771306
[4,] 0.0101997116 0.0203994232 0.98980029
[5,] 0.0393389112 0.0786778223 0.96066109
[6,] 0.1322100746 0.2644201491 0.86778993
[7,] 0.2903256329 0.5806512659 0.70967437
[8,] 0.4405074289 0.8810148578 0.55949257
[9,] 0.4275762397 0.8551524794 0.57242376
[10,] 0.3558636915 0.7117273831 0.64413631
[11,] 0.2821166613 0.5642333225 0.71788334
[12,] 0.2332885867 0.4665771734 0.76671141
[13,] 0.2155225856 0.4310451713 0.78447741
[14,] 0.2210183162 0.4420366324 0.77898168
[15,] 0.2634388392 0.5268776784 0.73656116
[16,] 0.3216073872 0.6432147744 0.67839261
[17,] 0.3642596393 0.7285192785 0.63574036
[18,] 0.3821608180 0.7643216359 0.61783918
[19,] 0.3876235120 0.7752470241 0.61237649
[20,] 0.6197504712 0.7604990575 0.38024953
[21,] 0.6916379482 0.6167241036 0.30836205
[22,] 0.6942263570 0.6115472860 0.30577364
[23,] 0.6462973933 0.7074052134 0.35370261
[24,] 0.5906291072 0.8187417856 0.40937089
[25,] 0.5355817865 0.9288364270 0.46441821
[26,] 0.4847656621 0.9695313241 0.51523434
[27,] 0.4416678107 0.8833356214 0.55833219
[28,] 0.4184695330 0.8369390659 0.58153047
[29,] 0.4232338106 0.8464676212 0.57676619
[30,] 0.4636544204 0.9273088407 0.53634558
[31,] 0.5479594273 0.9040811453 0.45204057
[32,] 0.6192038221 0.7615923558 0.38079618
[33,] 0.6487239434 0.7025521132 0.35127606
[34,] 0.6408719787 0.7182560426 0.35912802
[35,] 0.6044225747 0.7911548506 0.39557743
[36,] 0.5557692355 0.8884615291 0.44423076
[37,] 0.5020321239 0.9959357522 0.49796788
[38,] 0.4509583428 0.9019166856 0.54904166
[39,] 0.4115982739 0.8231965478 0.58840173
[40,] 0.3953623039 0.7907246077 0.60463770
[41,] 0.4071016519 0.8142033037 0.59289835
[42,] 0.4588865833 0.9177731665 0.54111342
[43,] 0.5691675619 0.8616648762 0.43083244
[44,] 0.6161052955 0.7677894090 0.38389470
[45,] 0.6217152947 0.7565694105 0.37828471
[46,] 0.6026991166 0.7946017667 0.39730088
[47,] 0.5681180500 0.8637639000 0.43188195
[48,] 0.5252459695 0.9495080611 0.47475403
[49,] 0.4801134838 0.9602269677 0.51988652
[50,] 0.4404299852 0.8808599703 0.55957001
[51,] 0.4112838858 0.8225677717 0.58871611
[52,] 0.3969476734 0.7938953468 0.60305233
[53,] 0.4171985620 0.8343971240 0.58280144
[54,] 0.4759465446 0.9518930892 0.52405346
[55,] 0.5630198630 0.8739602740 0.43698014
[56,] 0.6236072554 0.7527854891 0.37639274
[57,] 0.6503934533 0.6992130934 0.34960655
[58,] 0.6454921046 0.7090157908 0.35450790
[59,] 0.6213917899 0.7572164203 0.37860821
[60,] 0.5839175539 0.8321648921 0.41608245
[61,] 0.5389235698 0.9221528604 0.46107643
[62,] 0.4935007908 0.9870015816 0.50649921
[63,] 0.4543533685 0.9087067369 0.54564663
[64,] 0.4288769512 0.8577539024 0.57112305
[65,] 0.4357993858 0.8715987715 0.56420061
[66,] 0.4712178050 0.9424356100 0.52878220
[67,] 0.5460841543 0.9078316914 0.45391585
[68,] 0.6148076447 0.7703847106 0.38519236
[69,] 0.6497150692 0.7005698617 0.35028493
[70,] 0.6566574739 0.6866850521 0.34334253
[71,] 0.6429014109 0.7141971781 0.35709859
[72,] 0.6135475003 0.7729049994 0.38645250
[73,] 0.5730521369 0.8538957261 0.42694786
[74,] 0.5276572697 0.9446854606 0.47234273
[75,] 0.4845500875 0.9691001750 0.51544991
[76,] 0.4525749313 0.9051498625 0.54742507
[77,] 0.4397920645 0.8795841289 0.56020794
[78,] 0.4562598695 0.9125197390 0.54374013
[79,] 0.5121636048 0.9756727903 0.48783640
[80,] 0.6018682079 0.7962635842 0.39813179
[81,] 0.6512738659 0.6974522683 0.34872613
[82,] 0.6686139671 0.6627720657 0.33138603
[83,] 0.6608529707 0.6782940586 0.33914703
[84,] 0.6334749456 0.7330501088 0.36652505
[85,] 0.5912897340 0.8174205319 0.40871027
[86,] 0.5428539277 0.9142921447 0.45714607
[87,] 0.4974546840 0.9949093680 0.50254532
[88,] 0.4632280681 0.9264561362 0.53677193
[89,] 0.4496946994 0.8993893989 0.55030530
[90,] 0.4640338691 0.9280677383 0.53596613
[91,] 0.5170651078 0.9658697843 0.48293489
[92,] 0.6191440662 0.7617118676 0.38085593
[93,] 0.6696615948 0.6606768104 0.33033841
[94,] 0.6867134455 0.6265731090 0.31328655
[95,] 0.6762519431 0.6474961138 0.32374806
[96,] 0.6466829885 0.7066340230 0.35331701
[97,] 0.6039465999 0.7921068002 0.39605340
[98,] 0.5534198313 0.8931603374 0.44658017
[99,] 0.5023497989 0.9953004023 0.49765020
[100,] 0.4587922490 0.9175844979 0.54120775
[101,] 0.4375936016 0.8751872033 0.56240640
[102,] 0.4610354540 0.9220709080 0.53896455
[103,] 0.5627701529 0.8744596942 0.43722985
[104,] 0.6239849089 0.7520301821 0.37601509
[105,] 0.6105031364 0.7789937273 0.38949686
[106,] 0.5933800779 0.8132398442 0.40661992
[107,] 0.5629826799 0.8740346402 0.43701732
[108,] 0.5171889724 0.9656220551 0.48281103
[109,] 0.4630600466 0.9261200933 0.53693995
[110,] 0.4042075914 0.8084151827 0.59579241
[111,] 0.3492799580 0.6985599160 0.65072004
[112,] 0.3225226137 0.6450452275 0.67747739
[113,] 0.3387374194 0.6774748388 0.66126258
[114,] 0.4895305415 0.9790610830 0.51046946
[115,] 0.8999944721 0.2000110558 0.10000553
[116,] 0.8749023177 0.2501953646 0.12509768
[117,] 0.8404400670 0.3191198659 0.15955993
[118,] 0.7963033482 0.4073933036 0.20369665
[119,] 0.7422234582 0.5155530836 0.25777654
[120,] 0.6764420960 0.6471158080 0.32355790
[121,] 0.6051847897 0.7896304206 0.39481521
[122,] 0.5293545503 0.9412908995 0.47064545
[123,] 0.4451630146 0.8903260291 0.55483699
[124,] 0.3687622562 0.7375245125 0.63123774
[125,] 0.3946888104 0.7893776208 0.60531119
[126,] 0.4784138030 0.9568276061 0.52158620
[127,] 0.9361224673 0.1277550655 0.06387753
[128,] 0.9743773633 0.0512452733 0.02562264
[129,] 0.9743557917 0.0512884166 0.02564421
[130,] 0.9459877409 0.1080245181 0.05401226
[131,] 0.9304987246 0.1390025508 0.06950128
[132,] 0.8593283717 0.2813432566 0.14067163
> postscript(file="/var/fisher/rcomp/tmp/1gyn41352153329.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> plot(x[,1], type='l', main='Actuals and Interpolation', ylab='value of Actuals and Interpolation (dots)', xlab='time or index')
> points(x[,1]-mysum$resid)
> grid()
> dev.off()
null device
1
> postscript(file="/var/fisher/rcomp/tmp/2mi2l1352153329.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> plot(mysum$resid, type='b', pch=19, main='Residuals', ylab='value of Residuals', xlab='time or index')
> grid()
> dev.off()
null device
1
> postscript(file="/var/fisher/rcomp/tmp/3ityt1352153329.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> hist(mysum$resid, main='Residual Histogram', xlab='values of Residuals')
> grid()
> dev.off()
null device
1
> postscript(file="/var/fisher/rcomp/tmp/46id91352153329.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> densityplot(~mysum$resid,col='black',main='Residual Density Plot', xlab='values of Residuals')
> dev.off()
null device
1
> postscript(file="/var/fisher/rcomp/tmp/5qpn11352153329.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> qqnorm(mysum$resid, main='Residual Normal Q-Q Plot')
> qqline(mysum$resid)
> grid()
> dev.off()
null device
1
> (myerror <- as.ts(mysum$resid))
Time Series:
Start = 1
End = 143
Frequency = 1
1 2 3 4 5 6
-4.96782113 -4.07087594 -3.15887142 -2.32623824 -1.44315959 -0.39964120
7 8 9 10 11 12
0.61676996 1.63218427 2.62942594 3.63091756 4.65762194 5.65621542
13 14 15 16 17 18
-5.35022343 -4.34528129 -3.35107901 -2.31687085 -1.30887084 -0.28700211
19 20 21 22 23 24
0.72256270 1.77058633 2.77638041 3.75095101 4.72020603 5.69660912
25 26 27 28 29 30
-5.31358126 -4.36018865 -3.69889819 -2.71196896 -1.65373428 -0.52077840
31 32 33 34 35 36
0.46162493 1.43069346 2.53440034 3.57304175 4.60513928 5.62669145
37 38 39 40 41 42
-5.31877579 -4.38040556 -3.37642476 -2.24482361 -1.29759925 -0.33513734
43 44 45 46 47 48
0.60769654 1.58594841 2.59572474 3.57642956 4.58865885 5.73788025
49 50 51 52 53 54
-5.26583723 -4.24077010 -3.25035630 -2.26911683 -1.28899771 -0.33105124
55 56 57 58 59 60
0.64568907 1.61272113 2.57806416 3.72469280 4.83284048 5.76513047
61 62 63 64 65 66
-5.27288756 -4.35745390 -3.23050945 -2.23408349 -1.27720412 -0.31365736
67 68 69 70 71 72
0.66299421 1.61425480 2.58359856 3.82615897 4.76490047 5.70026388
73 74 75 76 77 78
-5.35558810 -4.41142234 -3.46935530 -2.38647581 -1.39853198 -0.44963707
79 80 81 82 83 84
0.50247619 1.43766212 2.54837071 3.56462359 4.54033448 5.49221627
85 86 87 88 89 90
-5.53868700 -4.61712058 -3.64489644 -2.65015951 -1.66877660 -0.70851770
91 92 93 94 95 96
0.21946691 1.28061820 2.29642662 3.23719583 4.21196313 5.23799598
97 98 99 100 101 102
-5.81833668 -4.89458426 -3.84027859 -2.96179950 -2.06767245 -1.00399575
103 104 105 106 107 108
-0.08424479 0.87129905 1.94740464 2.86975200 4.00256371 5.03367923
109 110 111 112 113 114
-5.83065690 -4.79743054 -3.30657570 -2.22360820 -1.16853933 -0.19613771
115 116 117 118 119 120
0.77112363 1.76569572 2.77543364 3.73622426 4.76257805 5.69500711
121 122 123 124 125 126
-5.35451616 -4.37775955 -3.41471194 -2.43299471 -1.44964170 -0.49479005
127 128 129 130 131 132
0.46623131 1.46052014 2.40388649 3.43600249 4.54962405 5.52357272
133 134 135 136 137 138
-5.51303660 -4.43915323 -3.47907547 -2.47848612 -1.49694420 -0.55574902
139 140 141 142 143
0.36099877 1.32225086 2.26067288 3.30813293 4.46239104
> postscript(file="/var/fisher/rcomp/tmp/6ee6v1352153329.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> dum <- cbind(lag(myerror,k=1),myerror)
> dum
Time Series:
Start = 0
End = 143
Frequency = 1
lag(myerror, k = 1) myerror
0 -4.96782113 NA
1 -4.07087594 -4.96782113
2 -3.15887142 -4.07087594
3 -2.32623824 -3.15887142
4 -1.44315959 -2.32623824
5 -0.39964120 -1.44315959
6 0.61676996 -0.39964120
7 1.63218427 0.61676996
8 2.62942594 1.63218427
9 3.63091756 2.62942594
10 4.65762194 3.63091756
11 5.65621542 4.65762194
12 -5.35022343 5.65621542
13 -4.34528129 -5.35022343
14 -3.35107901 -4.34528129
15 -2.31687085 -3.35107901
16 -1.30887084 -2.31687085
17 -0.28700211 -1.30887084
18 0.72256270 -0.28700211
19 1.77058633 0.72256270
20 2.77638041 1.77058633
21 3.75095101 2.77638041
22 4.72020603 3.75095101
23 5.69660912 4.72020603
24 -5.31358126 5.69660912
25 -4.36018865 -5.31358126
26 -3.69889819 -4.36018865
27 -2.71196896 -3.69889819
28 -1.65373428 -2.71196896
29 -0.52077840 -1.65373428
30 0.46162493 -0.52077840
31 1.43069346 0.46162493
32 2.53440034 1.43069346
33 3.57304175 2.53440034
34 4.60513928 3.57304175
35 5.62669145 4.60513928
36 -5.31877579 5.62669145
37 -4.38040556 -5.31877579
38 -3.37642476 -4.38040556
39 -2.24482361 -3.37642476
40 -1.29759925 -2.24482361
41 -0.33513734 -1.29759925
42 0.60769654 -0.33513734
43 1.58594841 0.60769654
44 2.59572474 1.58594841
45 3.57642956 2.59572474
46 4.58865885 3.57642956
47 5.73788025 4.58865885
48 -5.26583723 5.73788025
49 -4.24077010 -5.26583723
50 -3.25035630 -4.24077010
51 -2.26911683 -3.25035630
52 -1.28899771 -2.26911683
53 -0.33105124 -1.28899771
54 0.64568907 -0.33105124
55 1.61272113 0.64568907
56 2.57806416 1.61272113
57 3.72469280 2.57806416
58 4.83284048 3.72469280
59 5.76513047 4.83284048
60 -5.27288756 5.76513047
61 -4.35745390 -5.27288756
62 -3.23050945 -4.35745390
63 -2.23408349 -3.23050945
64 -1.27720412 -2.23408349
65 -0.31365736 -1.27720412
66 0.66299421 -0.31365736
67 1.61425480 0.66299421
68 2.58359856 1.61425480
69 3.82615897 2.58359856
70 4.76490047 3.82615897
71 5.70026388 4.76490047
72 -5.35558810 5.70026388
73 -4.41142234 -5.35558810
74 -3.46935530 -4.41142234
75 -2.38647581 -3.46935530
76 -1.39853198 -2.38647581
77 -0.44963707 -1.39853198
78 0.50247619 -0.44963707
79 1.43766212 0.50247619
80 2.54837071 1.43766212
81 3.56462359 2.54837071
82 4.54033448 3.56462359
83 5.49221627 4.54033448
84 -5.53868700 5.49221627
85 -4.61712058 -5.53868700
86 -3.64489644 -4.61712058
87 -2.65015951 -3.64489644
88 -1.66877660 -2.65015951
89 -0.70851770 -1.66877660
90 0.21946691 -0.70851770
91 1.28061820 0.21946691
92 2.29642662 1.28061820
93 3.23719583 2.29642662
94 4.21196313 3.23719583
95 5.23799598 4.21196313
96 -5.81833668 5.23799598
97 -4.89458426 -5.81833668
98 -3.84027859 -4.89458426
99 -2.96179950 -3.84027859
100 -2.06767245 -2.96179950
101 -1.00399575 -2.06767245
102 -0.08424479 -1.00399575
103 0.87129905 -0.08424479
104 1.94740464 0.87129905
105 2.86975200 1.94740464
106 4.00256371 2.86975200
107 5.03367923 4.00256371
108 -5.83065690 5.03367923
109 -4.79743054 -5.83065690
110 -3.30657570 -4.79743054
111 -2.22360820 -3.30657570
112 -1.16853933 -2.22360820
113 -0.19613771 -1.16853933
114 0.77112363 -0.19613771
115 1.76569572 0.77112363
116 2.77543364 1.76569572
117 3.73622426 2.77543364
118 4.76257805 3.73622426
119 5.69500711 4.76257805
120 -5.35451616 5.69500711
121 -4.37775955 -5.35451616
122 -3.41471194 -4.37775955
123 -2.43299471 -3.41471194
124 -1.44964170 -2.43299471
125 -0.49479005 -1.44964170
126 0.46623131 -0.49479005
127 1.46052014 0.46623131
128 2.40388649 1.46052014
129 3.43600249 2.40388649
130 4.54962405 3.43600249
131 5.52357272 4.54962405
132 -5.51303660 5.52357272
133 -4.43915323 -5.51303660
134 -3.47907547 -4.43915323
135 -2.47848612 -3.47907547
136 -1.49694420 -2.47848612
137 -0.55574902 -1.49694420
138 0.36099877 -0.55574902
139 1.32225086 0.36099877
140 2.26067288 1.32225086
141 3.30813293 2.26067288
142 4.46239104 3.30813293
143 NA 4.46239104
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -4.07087594 -4.96782113
[2,] -3.15887142 -4.07087594
[3,] -2.32623824 -3.15887142
[4,] -1.44315959 -2.32623824
[5,] -0.39964120 -1.44315959
[6,] 0.61676996 -0.39964120
[7,] 1.63218427 0.61676996
[8,] 2.62942594 1.63218427
[9,] 3.63091756 2.62942594
[10,] 4.65762194 3.63091756
[11,] 5.65621542 4.65762194
[12,] -5.35022343 5.65621542
[13,] -4.34528129 -5.35022343
[14,] -3.35107901 -4.34528129
[15,] -2.31687085 -3.35107901
[16,] -1.30887084 -2.31687085
[17,] -0.28700211 -1.30887084
[18,] 0.72256270 -0.28700211
[19,] 1.77058633 0.72256270
[20,] 2.77638041 1.77058633
[21,] 3.75095101 2.77638041
[22,] 4.72020603 3.75095101
[23,] 5.69660912 4.72020603
[24,] -5.31358126 5.69660912
[25,] -4.36018865 -5.31358126
[26,] -3.69889819 -4.36018865
[27,] -2.71196896 -3.69889819
[28,] -1.65373428 -2.71196896
[29,] -0.52077840 -1.65373428
[30,] 0.46162493 -0.52077840
[31,] 1.43069346 0.46162493
[32,] 2.53440034 1.43069346
[33,] 3.57304175 2.53440034
[34,] 4.60513928 3.57304175
[35,] 5.62669145 4.60513928
[36,] -5.31877579 5.62669145
[37,] -4.38040556 -5.31877579
[38,] -3.37642476 -4.38040556
[39,] -2.24482361 -3.37642476
[40,] -1.29759925 -2.24482361
[41,] -0.33513734 -1.29759925
[42,] 0.60769654 -0.33513734
[43,] 1.58594841 0.60769654
[44,] 2.59572474 1.58594841
[45,] 3.57642956 2.59572474
[46,] 4.58865885 3.57642956
[47,] 5.73788025 4.58865885
[48,] -5.26583723 5.73788025
[49,] -4.24077010 -5.26583723
[50,] -3.25035630 -4.24077010
[51,] -2.26911683 -3.25035630
[52,] -1.28899771 -2.26911683
[53,] -0.33105124 -1.28899771
[54,] 0.64568907 -0.33105124
[55,] 1.61272113 0.64568907
[56,] 2.57806416 1.61272113
[57,] 3.72469280 2.57806416
[58,] 4.83284048 3.72469280
[59,] 5.76513047 4.83284048
[60,] -5.27288756 5.76513047
[61,] -4.35745390 -5.27288756
[62,] -3.23050945 -4.35745390
[63,] -2.23408349 -3.23050945
[64,] -1.27720412 -2.23408349
[65,] -0.31365736 -1.27720412
[66,] 0.66299421 -0.31365736
[67,] 1.61425480 0.66299421
[68,] 2.58359856 1.61425480
[69,] 3.82615897 2.58359856
[70,] 4.76490047 3.82615897
[71,] 5.70026388 4.76490047
[72,] -5.35558810 5.70026388
[73,] -4.41142234 -5.35558810
[74,] -3.46935530 -4.41142234
[75,] -2.38647581 -3.46935530
[76,] -1.39853198 -2.38647581
[77,] -0.44963707 -1.39853198
[78,] 0.50247619 -0.44963707
[79,] 1.43766212 0.50247619
[80,] 2.54837071 1.43766212
[81,] 3.56462359 2.54837071
[82,] 4.54033448 3.56462359
[83,] 5.49221627 4.54033448
[84,] -5.53868700 5.49221627
[85,] -4.61712058 -5.53868700
[86,] -3.64489644 -4.61712058
[87,] -2.65015951 -3.64489644
[88,] -1.66877660 -2.65015951
[89,] -0.70851770 -1.66877660
[90,] 0.21946691 -0.70851770
[91,] 1.28061820 0.21946691
[92,] 2.29642662 1.28061820
[93,] 3.23719583 2.29642662
[94,] 4.21196313 3.23719583
[95,] 5.23799598 4.21196313
[96,] -5.81833668 5.23799598
[97,] -4.89458426 -5.81833668
[98,] -3.84027859 -4.89458426
[99,] -2.96179950 -3.84027859
[100,] -2.06767245 -2.96179950
[101,] -1.00399575 -2.06767245
[102,] -0.08424479 -1.00399575
[103,] 0.87129905 -0.08424479
[104,] 1.94740464 0.87129905
[105,] 2.86975200 1.94740464
[106,] 4.00256371 2.86975200
[107,] 5.03367923 4.00256371
[108,] -5.83065690 5.03367923
[109,] -4.79743054 -5.83065690
[110,] -3.30657570 -4.79743054
[111,] -2.22360820 -3.30657570
[112,] -1.16853933 -2.22360820
[113,] -0.19613771 -1.16853933
[114,] 0.77112363 -0.19613771
[115,] 1.76569572 0.77112363
[116,] 2.77543364 1.76569572
[117,] 3.73622426 2.77543364
[118,] 4.76257805 3.73622426
[119,] 5.69500711 4.76257805
[120,] -5.35451616 5.69500711
[121,] -4.37775955 -5.35451616
[122,] -3.41471194 -4.37775955
[123,] -2.43299471 -3.41471194
[124,] -1.44964170 -2.43299471
[125,] -0.49479005 -1.44964170
[126,] 0.46623131 -0.49479005
[127,] 1.46052014 0.46623131
[128,] 2.40388649 1.46052014
[129,] 3.43600249 2.40388649
[130,] 4.54962405 3.43600249
[131,] 5.52357272 4.54962405
[132,] -5.51303660 5.52357272
[133,] -4.43915323 -5.51303660
[134,] -3.47907547 -4.43915323
[135,] -2.47848612 -3.47907547
[136,] -1.49694420 -2.47848612
[137,] -0.55574902 -1.49694420
[138,] 0.36099877 -0.55574902
[139,] 1.32225086 0.36099877
[140,] 2.26067288 1.32225086
[141,] 3.30813293 2.26067288
[142,] 4.46239104 3.30813293
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -4.07087594 -4.96782113
2 -3.15887142 -4.07087594
3 -2.32623824 -3.15887142
4 -1.44315959 -2.32623824
5 -0.39964120 -1.44315959
6 0.61676996 -0.39964120
7 1.63218427 0.61676996
8 2.62942594 1.63218427
9 3.63091756 2.62942594
10 4.65762194 3.63091756
11 5.65621542 4.65762194
12 -5.35022343 5.65621542
13 -4.34528129 -5.35022343
14 -3.35107901 -4.34528129
15 -2.31687085 -3.35107901
16 -1.30887084 -2.31687085
17 -0.28700211 -1.30887084
18 0.72256270 -0.28700211
19 1.77058633 0.72256270
20 2.77638041 1.77058633
21 3.75095101 2.77638041
22 4.72020603 3.75095101
23 5.69660912 4.72020603
24 -5.31358126 5.69660912
25 -4.36018865 -5.31358126
26 -3.69889819 -4.36018865
27 -2.71196896 -3.69889819
28 -1.65373428 -2.71196896
29 -0.52077840 -1.65373428
30 0.46162493 -0.52077840
31 1.43069346 0.46162493
32 2.53440034 1.43069346
33 3.57304175 2.53440034
34 4.60513928 3.57304175
35 5.62669145 4.60513928
36 -5.31877579 5.62669145
37 -4.38040556 -5.31877579
38 -3.37642476 -4.38040556
39 -2.24482361 -3.37642476
40 -1.29759925 -2.24482361
41 -0.33513734 -1.29759925
42 0.60769654 -0.33513734
43 1.58594841 0.60769654
44 2.59572474 1.58594841
45 3.57642956 2.59572474
46 4.58865885 3.57642956
47 5.73788025 4.58865885
48 -5.26583723 5.73788025
49 -4.24077010 -5.26583723
50 -3.25035630 -4.24077010
51 -2.26911683 -3.25035630
52 -1.28899771 -2.26911683
53 -0.33105124 -1.28899771
54 0.64568907 -0.33105124
55 1.61272113 0.64568907
56 2.57806416 1.61272113
57 3.72469280 2.57806416
58 4.83284048 3.72469280
59 5.76513047 4.83284048
60 -5.27288756 5.76513047
61 -4.35745390 -5.27288756
62 -3.23050945 -4.35745390
63 -2.23408349 -3.23050945
64 -1.27720412 -2.23408349
65 -0.31365736 -1.27720412
66 0.66299421 -0.31365736
67 1.61425480 0.66299421
68 2.58359856 1.61425480
69 3.82615897 2.58359856
70 4.76490047 3.82615897
71 5.70026388 4.76490047
72 -5.35558810 5.70026388
73 -4.41142234 -5.35558810
74 -3.46935530 -4.41142234
75 -2.38647581 -3.46935530
76 -1.39853198 -2.38647581
77 -0.44963707 -1.39853198
78 0.50247619 -0.44963707
79 1.43766212 0.50247619
80 2.54837071 1.43766212
81 3.56462359 2.54837071
82 4.54033448 3.56462359
83 5.49221627 4.54033448
84 -5.53868700 5.49221627
85 -4.61712058 -5.53868700
86 -3.64489644 -4.61712058
87 -2.65015951 -3.64489644
88 -1.66877660 -2.65015951
89 -0.70851770 -1.66877660
90 0.21946691 -0.70851770
91 1.28061820 0.21946691
92 2.29642662 1.28061820
93 3.23719583 2.29642662
94 4.21196313 3.23719583
95 5.23799598 4.21196313
96 -5.81833668 5.23799598
97 -4.89458426 -5.81833668
98 -3.84027859 -4.89458426
99 -2.96179950 -3.84027859
100 -2.06767245 -2.96179950
101 -1.00399575 -2.06767245
102 -0.08424479 -1.00399575
103 0.87129905 -0.08424479
104 1.94740464 0.87129905
105 2.86975200 1.94740464
106 4.00256371 2.86975200
107 5.03367923 4.00256371
108 -5.83065690 5.03367923
109 -4.79743054 -5.83065690
110 -3.30657570 -4.79743054
111 -2.22360820 -3.30657570
112 -1.16853933 -2.22360820
113 -0.19613771 -1.16853933
114 0.77112363 -0.19613771
115 1.76569572 0.77112363
116 2.77543364 1.76569572
117 3.73622426 2.77543364
118 4.76257805 3.73622426
119 5.69500711 4.76257805
120 -5.35451616 5.69500711
121 -4.37775955 -5.35451616
122 -3.41471194 -4.37775955
123 -2.43299471 -3.41471194
124 -1.44964170 -2.43299471
125 -0.49479005 -1.44964170
126 0.46623131 -0.49479005
127 1.46052014 0.46623131
128 2.40388649 1.46052014
129 3.43600249 2.40388649
130 4.54962405 3.43600249
131 5.52357272 4.54962405
132 -5.51303660 5.52357272
133 -4.43915323 -5.51303660
134 -3.47907547 -4.43915323
135 -2.47848612 -3.47907547
136 -1.49694420 -2.47848612
137 -0.55574902 -1.49694420
138 0.36099877 -0.55574902
139 1.32225086 0.36099877
140 2.26067288 1.32225086
141 3.30813293 2.26067288
142 4.46239104 3.30813293
> plot(z,main=paste('Residual Lag plot, lowess, and regression line'), ylab='values of Residuals', xlab='lagged values of Residuals')
> lines(lowess(z))
> abline(lm(z))
> grid()
> dev.off()
null device
1
> postscript(file="/var/fisher/rcomp/tmp/7u8t71352153329.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> acf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Autocorrelation Function')
> grid()
> dev.off()
null device
1
> postscript(file="/var/fisher/rcomp/tmp/8mlvc1352153329.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> pacf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Partial Autocorrelation Function')
> grid()
> dev.off()
null device
1
> postscript(file="/var/fisher/rcomp/tmp/9c4rf1352153329.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> opar <- par(mfrow = c(2,2), oma = c(0, 0, 1.1, 0))
> plot(mylm, las = 1, sub='Residual Diagnostics')
> par(opar)
> dev.off()
null device
1
> if (n > n25) {
+ postscript(file="/var/fisher/rcomp/tmp/10u4c11352153329.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
+ plot(kp3:nmkm3,gqarr[,2], main='Goldfeld-Quandt test',ylab='2-sided p-value',xlab='breakpoint')
+ grid()
+ dev.off()
+ }
null device
1
>
> #Note: the /var/fisher/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/fisher/rcomp/createtable")
>
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Estimated Regression Equation', 1, TRUE)
> a<-table.row.end(a)
> myeq <- colnames(x)[1]
> myeq <- paste(myeq, '[t] = ', sep='')
> for (i in 1:k){
+ if (mysum$coefficients[i,1] > 0) myeq <- paste(myeq, '+', '')
+ myeq <- paste(myeq, mysum$coefficients[i,1], sep=' ')
+ if (rownames(mysum$coefficients)[i] != '(Intercept)') {
+ myeq <- paste(myeq, rownames(mysum$coefficients)[i], sep='')
+ if (rownames(mysum$coefficients)[i] != 't') myeq <- paste(myeq, '[t]', sep='')
+ }
+ }
> myeq <- paste(myeq, ' + e[t]')
> a<-table.row.start(a)
> a<-table.element(a, myeq)
> a<-table.row.end(a)
> a<-table.end(a)
> table.save(a,file="/var/fisher/rcomp/tmp/11ba1o1352153329.tab")
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a,hyperlink('http://www.xycoon.com/ols1.htm','Multiple Linear Regression - Ordinary Least Squares',''), 6, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a,'Variable',header=TRUE)
> a<-table.element(a,'Parameter',header=TRUE)
> a<-table.element(a,'S.D.',header=TRUE)
> a<-table.element(a,'T-STAT
H0: parameter = 0',header=TRUE)
> a<-table.element(a,'2-tail p-value',header=TRUE)
> a<-table.element(a,'1-tail p-value',header=TRUE)
> a<-table.row.end(a)
> for (i in 1:k){
+ a<-table.row.start(a)
+ a<-table.element(a,rownames(mysum$coefficients)[i],header=TRUE)
+ a<-table.element(a,mysum$coefficients[i,1])
+ a<-table.element(a, round(mysum$coefficients[i,2],6))
+ a<-table.element(a, round(mysum$coefficients[i,3],4))
+ a<-table.element(a, round(mysum$coefficients[i,4],6))
+ a<-table.element(a, round(mysum$coefficients[i,4]/2,6))
+ a<-table.row.end(a)
+ }
> a<-table.end(a)
> table.save(a,file="/var/fisher/rcomp/tmp/12s9e31352153329.tab")
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Regression Statistics', 2, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple R',1,TRUE)
> a<-table.element(a, sqrt(mysum$r.squared))
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'R-squared',1,TRUE)
> a<-table.element(a, mysum$r.squared)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Adjusted R-squared',1,TRUE)
> a<-table.element(a, mysum$adj.r.squared)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (value)',1,TRUE)
> a<-table.element(a, mysum$fstatistic[1])
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (DF numerator)',1,TRUE)
> a<-table.element(a, mysum$fstatistic[2])
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (DF denominator)',1,TRUE)
> a<-table.element(a, mysum$fstatistic[3])
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'p-value',1,TRUE)
> a<-table.element(a, 1-pf(mysum$fstatistic[1],mysum$fstatistic[2],mysum$fstatistic[3]))
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Residual Statistics', 2, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Residual Standard Deviation',1,TRUE)
> a<-table.element(a, mysum$sigma)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Sum Squared Residuals',1,TRUE)
> a<-table.element(a, sum(myerror*myerror))
> a<-table.row.end(a)
> a<-table.end(a)
> table.save(a,file="/var/fisher/rcomp/tmp/13sejt1352153329.tab")
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Actuals, Interpolation, and Residuals', 4, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Time or Index', 1, TRUE)
> a<-table.element(a, 'Actuals', 1, TRUE)
> a<-table.element(a, 'Interpolation
Forecast', 1, TRUE)
> a<-table.element(a, 'Residuals
Prediction Error', 1, TRUE)
> a<-table.row.end(a)
> for (i in 1:n) {
+ a<-table.row.start(a)
+ a<-table.element(a,i, 1, TRUE)
+ a<-table.element(a,x[i])
+ a<-table.element(a,x[i]-mysum$resid[i])
+ a<-table.element(a,mysum$resid[i])
+ a<-table.row.end(a)
+ }
> a<-table.end(a)
> table.save(a,file="/var/fisher/rcomp/tmp/14u5bt1352153329.tab")
> if (n > n25) {
+ a<-table.start()
+ a<-table.row.start(a)
+ a<-table.element(a,'Goldfeld-Quandt test for Heteroskedasticity',4,TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'p-values',header=TRUE)
+ a<-table.element(a,'Alternative Hypothesis',3,header=TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'breakpoint index',header=TRUE)
+ a<-table.element(a,'greater',header=TRUE)
+ a<-table.element(a,'2-sided',header=TRUE)
+ a<-table.element(a,'less',header=TRUE)
+ a<-table.row.end(a)
+ for (mypoint in kp3:nmkm3) {
+ a<-table.row.start(a)
+ a<-table.element(a,mypoint,header=TRUE)
+ a<-table.element(a,gqarr[mypoint-kp3+1,1])
+ a<-table.element(a,gqarr[mypoint-kp3+1,2])
+ a<-table.element(a,gqarr[mypoint-kp3+1,3])
+ a<-table.row.end(a)
+ }
+ a<-table.end(a)
+ table.save(a,file="/var/fisher/rcomp/tmp/15exij1352153330.tab")
+ a<-table.start()
+ a<-table.row.start(a)
+ a<-table.element(a,'Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity',4,TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'Description',header=TRUE)
+ a<-table.element(a,'# significant tests',header=TRUE)
+ a<-table.element(a,'% significant tests',header=TRUE)
+ a<-table.element(a,'OK/NOK',header=TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'1% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant1)
+ a<-table.element(a,numsignificant1/numgqtests)
+ if (numsignificant1/numgqtests < 0.01) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'5% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant5)
+ a<-table.element(a,numsignificant5/numgqtests)
+ if (numsignificant5/numgqtests < 0.05) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'10% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant10)
+ a<-table.element(a,numsignificant10/numgqtests)
+ if (numsignificant10/numgqtests < 0.1) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.end(a)
+ table.save(a,file="/var/fisher/rcomp/tmp/16y9k31352153330.tab")
+ }
>
> try(system("convert tmp/1gyn41352153329.ps tmp/1gyn41352153329.png",intern=TRUE))
character(0)
> try(system("convert tmp/2mi2l1352153329.ps tmp/2mi2l1352153329.png",intern=TRUE))
character(0)
> try(system("convert tmp/3ityt1352153329.ps tmp/3ityt1352153329.png",intern=TRUE))
character(0)
> try(system("convert tmp/46id91352153329.ps tmp/46id91352153329.png",intern=TRUE))
character(0)
> try(system("convert tmp/5qpn11352153329.ps tmp/5qpn11352153329.png",intern=TRUE))
character(0)
> try(system("convert tmp/6ee6v1352153329.ps tmp/6ee6v1352153329.png",intern=TRUE))
character(0)
> try(system("convert tmp/7u8t71352153329.ps tmp/7u8t71352153329.png",intern=TRUE))
character(0)
> try(system("convert tmp/8mlvc1352153329.ps tmp/8mlvc1352153329.png",intern=TRUE))
character(0)
> try(system("convert tmp/9c4rf1352153329.ps tmp/9c4rf1352153329.png",intern=TRUE))
character(0)
> try(system("convert tmp/10u4c11352153329.ps tmp/10u4c11352153329.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
7.352 1.162 8.510