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(13
+ ,13
+ ,14
+ ,13
+ ,3
+ ,12
+ ,12
+ ,8
+ ,13
+ ,5
+ ,15
+ ,10
+ ,12
+ ,16
+ ,6
+ ,12
+ ,9
+ ,7
+ ,12
+ ,6
+ ,10
+ ,10
+ ,10
+ ,11
+ ,5
+ ,12
+ ,12
+ ,7
+ ,12
+ ,3
+ ,15
+ ,13
+ ,16
+ ,18
+ ,8
+ ,9
+ ,12
+ ,11
+ ,11
+ ,4
+ ,12
+ ,12
+ ,14
+ ,14
+ ,4
+ ,11
+ ,6
+ ,6
+ ,9
+ ,4
+ ,11
+ ,5
+ ,16
+ ,14
+ ,6
+ ,11
+ ,12
+ ,11
+ ,12
+ ,6
+ ,15
+ ,11
+ ,16
+ ,11
+ ,5
+ ,7
+ ,14
+ ,12
+ ,12
+ ,4
+ ,11
+ ,14
+ ,7
+ ,13
+ ,6
+ ,11
+ ,12
+ ,13
+ ,11
+ ,4
+ ,10
+ ,12
+ ,11
+ ,12
+ ,6
+ ,14
+ ,11
+ ,15
+ ,16
+ ,6
+ ,10
+ ,11
+ ,7
+ ,9
+ ,4
+ ,6
+ ,7
+ ,9
+ ,11
+ ,4
+ ,11
+ ,9
+ ,7
+ ,13
+ ,2
+ ,15
+ ,11
+ ,14
+ ,15
+ ,7
+ ,11
+ ,11
+ ,15
+ ,10
+ ,5
+ ,12
+ ,12
+ ,7
+ ,11
+ ,4
+ ,14
+ ,12
+ ,15
+ ,13
+ ,6
+ ,15
+ ,11
+ ,17
+ ,16
+ ,6
+ ,9
+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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
Liked Popularity FindingFriends KnowingPeople Celebrity
1 13 13 13 14 3
2 13 12 12 8 5
3 16 15 10 12 6
4 12 12 9 7 6
5 11 10 10 10 5
6 12 12 12 7 3
7 18 15 13 16 8
8 11 9 12 11 4
9 14 12 12 14 4
10 9 11 6 6 4
11 14 11 5 16 6
12 12 11 12 11 6
13 11 15 11 16 5
14 12 7 14 12 4
15 13 11 14 7 6
16 11 11 12 13 4
17 12 10 12 11 6
18 16 14 11 15 6
19 9 10 11 7 4
20 11 6 7 9 4
21 13 11 9 7 2
22 15 15 11 14 7
23 10 11 11 15 5
24 11 12 12 7 4
25 13 14 12 15 6
26 16 15 11 17 6
27 15 9 11 15 7
28 14 13 8 14 5
29 14 13 9 14 6
30 14 16 12 8 4
31 8 13 10 8 4
32 13 12 10 14 7
33 15 14 12 14 7
34 13 11 8 8 4
35 11 9 12 11 4
36 15 16 11 16 6
37 15 12 12 10 6
38 9 10 7 8 5
39 13 13 11 14 6
40 16 16 11 16 7
41 13 14 12 13 6
42 11 15 9 5 3
43 12 5 15 8 3
44 12 8 11 10 4
45 12 11 11 8 6
46 14 16 11 13 7
47 14 17 11 15 5
48 8 9 15 6 4
49 13 9 11 12 5
50 16 13 12 16 6
51 13 10 12 5 6
52 11 6 9 15 6
53 14 12 12 12 5
54 13 8 12 8 4
55 13 14 13 13 5
56 13 12 11 14 5
57 12 11 9 12 4
58 16 16 9 16 6
59 15 8 11 10 2
60 15 15 11 15 8
61 12 7 12 8 3
62 14 16 12 16 6
63 12 14 9 19 6
64 15 16 11 14 6
65 12 9 9 6 5
66 13 14 12 13 5
67 12 11 12 15 6
68 12 13 12 7 5
69 13 15 12 13 6
70 5 5 14 4 2
71 13 15 11 14 5
72 13 13 12 13 5
73 14 11 11 11 5
74 17 11 6 14 6
75 13 12 10 12 6
76 13 12 12 15 6
77 12 12 13 14 5
78 13 12 8 13 5
79 14 14 12 8 4
80 11 6 12 6 2
81 12 7 12 7 4
82 12 14 6 13 6
83 16 14 11 13 6
84 12 10 10 11 5
85 12 13 12 5 3
86 12 12 13 12 6
87 10 9 11 8 4
88 15 12 7 11 5
89 15 16 11 14 8
90 12 10 11 9 4
91 16 14 11 10 6
92 15 10 11 13 6
93 16 16 12 16 7
94 13 15 10 16 6
95 12 12 11 11 5
96 11 10 12 8 4
97 13 8 7 4 6
98 10 8 13 7 3
99 15 11 8 14 5
100 13 13 12 11 6
101 16 16 11 17 7
102 15 16 12 15 7
103 18 14 14 17 6
104 13 11 10 5 3
105 10 4 10 4 2
106 16 14 13 10 8
107 13 9 10 11 3
108 15 14 11 15 8
109 14 8 10 10 3
110 15 8 7 9 4
111 14 11 10 12 5
112 13 12 8 15 7
113 13 11 12 7 6
114 15 14 12 13 6
115 16 15 12 12 7
116 14 16 11 14 6
117 14 16 12 14 6
118 16 11 12 8 6
119 14 14 12 15 6
120 12 14 11 12 4
121 13 12 12 12 4
122 12 14 11 16 5
123 12 8 11 9 4
124 14 13 13 15 6
125 14 16 12 15 6
126 14 12 12 6 5
127 16 16 12 14 8
128 13 12 12 15 6
129 14 11 8 10 5
130 4 4 8 6 4
131 16 16 12 14 8
132 13 15 11 12 6
133 16 10 12 8 4
134 15 13 13 11 6
135 14 15 12 13 6
136 13 12 12 9 4
137 14 14 11 15 6
138 12 7 12 13 3
139 15 19 12 15 6
140 14 12 10 14 5
141 13 12 11 16 4
142 14 13 12 14 6
143 16 15 12 14 4
144 6 8 10 10 4
145 13 12 12 10 4
146 13 10 13 4 6
147 14 8 12 8 5
148 15 10 15 15 6
149 14 15 11 16 6
150 15 16 12 12 8
151 13 13 11 12 7
152 16 16 12 15 7
153 12 9 11 9 4
154 15 14 10 12 6
155 12 14 11 14 6
156 14 12 11 11 2
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Popularity FindingFriends KnowingPeople Celebrity
6.44338 0.22845 0.06004 0.11010 0.39349
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-6.0721 -0.9827 0.1269 1.1201 4.1806
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 6.44338 1.02725 6.272 3.56e-09 ***
Popularity 0.22845 0.06317 3.616 0.000407 ***
FindingFriends 0.06004 0.07774 0.772 0.441168
KnowingPeople 0.11010 0.05142 2.141 0.033851 *
Celebrity 0.39349 0.12892 3.052 0.002685 **
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 1.704 on 151 degrees of freedom
Multiple R-squared: 0.4025, Adjusted R-squared: 0.3867
F-statistic: 25.43 on 4 and 151 DF, p-value: 4.057e-16
> 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.04822720 0.09645441 0.9517728
[2,] 0.03201832 0.06403664 0.9679817
[3,] 0.01225177 0.02450354 0.9877482
[4,] 0.01968019 0.03936039 0.9803198
[5,] 0.01790076 0.03580153 0.9820992
[6,] 0.58701195 0.82597611 0.4129881
[7,] 0.49411716 0.98823431 0.5058828
[8,] 0.39803239 0.79606478 0.6019676
[9,] 0.36377966 0.72755932 0.6362203
[10,] 0.31344482 0.62688964 0.6865552
[11,] 0.28328614 0.56657229 0.7167139
[12,] 0.28232288 0.56464575 0.7176771
[13,] 0.30204481 0.60408962 0.6979552
[14,] 0.50075641 0.99848718 0.4992436
[15,] 0.42709511 0.85419023 0.5729049
[16,] 0.58499817 0.83000365 0.4150018
[17,] 0.53379174 0.93241651 0.4662083
[18,] 0.50972402 0.98055196 0.4902760
[19,] 0.46972836 0.93945671 0.5302716
[20,] 0.46041078 0.92082156 0.5395892
[21,] 0.40587738 0.81175476 0.5941226
[22,] 0.34404406 0.68808812 0.6559559
[23,] 0.30315698 0.60631395 0.6968430
[24,] 0.58121660 0.83756680 0.4187834
[25,] 0.54850627 0.90298745 0.4514937
[26,] 0.48916543 0.97833087 0.5108346
[27,] 0.49376410 0.98752821 0.5062359
[28,] 0.44175854 0.88351708 0.5582415
[29,] 0.38521755 0.77043509 0.6147825
[30,] 0.39299340 0.78598680 0.6070066
[31,] 0.46020088 0.92040176 0.5397991
[32,] 0.42338105 0.84676209 0.5766190
[33,] 0.37307521 0.74615042 0.6269248
[34,] 0.34703624 0.69407248 0.6529638
[35,] 0.31362589 0.62725177 0.6863741
[36,] 0.33619320 0.67238641 0.6638068
[37,] 0.29850628 0.59701257 0.7014937
[38,] 0.26010416 0.52020832 0.7398958
[39,] 0.23101355 0.46202710 0.7689865
[40,] 0.19734999 0.39469998 0.8026500
[41,] 0.31579810 0.63159619 0.6842019
[42,] 0.28045978 0.56091957 0.7195402
[43,] 0.28055674 0.56111348 0.7194433
[44,] 0.26253856 0.52507711 0.7374614
[45,] 0.24589572 0.49179145 0.7541043
[46,] 0.21995753 0.43991506 0.7800425
[47,] 0.23407709 0.46815419 0.7659229
[48,] 0.20544661 0.41089322 0.7945534
[49,] 0.17250367 0.34500734 0.8274963
[50,] 0.14436318 0.28872637 0.8556368
[51,] 0.13165558 0.26331115 0.8683444
[52,] 0.34152116 0.68304233 0.6584788
[53,] 0.29869812 0.59739624 0.7013019
[54,] 0.28089857 0.56179713 0.7191014
[55,] 0.25477822 0.50955644 0.7452218
[56,] 0.31749804 0.63499608 0.6825020
[57,] 0.27937265 0.55874529 0.7206274
[58,] 0.24861657 0.49723314 0.7513834
[59,] 0.21873409 0.43746818 0.7812659
[60,] 0.21641397 0.43282795 0.7835860
[61,] 0.19165180 0.38330360 0.8083482
[62,] 0.17918841 0.35837681 0.8208116
[63,] 0.43262522 0.86525043 0.5673748
[64,] 0.40461976 0.80923952 0.5953802
[65,] 0.36429696 0.72859393 0.6357030
[66,] 0.34706798 0.69413596 0.6529320
[67,] 0.54332364 0.91335272 0.4566764
[68,] 0.49912660 0.99825320 0.5008734
[69,] 0.46376807 0.92753614 0.5362319
[70,] 0.45274030 0.90548060 0.5472597
[71,] 0.40658096 0.81316191 0.5934190
[72,] 0.39064168 0.78128336 0.6093583
[73,] 0.36509814 0.73019629 0.6349019
[74,] 0.33542586 0.67085172 0.6645741
[75,] 0.33673620 0.67347241 0.6632638
[76,] 0.34917498 0.69834996 0.6508250
[77,] 0.31047505 0.62095010 0.6895249
[78,] 0.28362762 0.56725523 0.7163724
[79,] 0.28147906 0.56295812 0.7185209
[80,] 0.28698804 0.57397607 0.7130120
[81,] 0.31862633 0.63725267 0.6813737
[82,] 0.27930798 0.55861597 0.7206920
[83,] 0.24349025 0.48698050 0.7565098
[84,] 0.26757746 0.53515491 0.7324225
[85,] 0.27818319 0.55636637 0.7218168
[86,] 0.24623002 0.49246003 0.7537700
[87,] 0.23723087 0.47446174 0.7627691
[88,] 0.21828985 0.43657971 0.7817101
[89,] 0.20558345 0.41116690 0.7944166
[90,] 0.20069926 0.40139852 0.7993007
[91,] 0.20527188 0.41054376 0.7947281
[92,] 0.25178006 0.50356012 0.7482199
[93,] 0.22745601 0.45491203 0.7725440
[94,] 0.20357797 0.40715593 0.7964220
[95,] 0.17108205 0.34216410 0.8289179
[96,] 0.25860429 0.51720858 0.7413957
[97,] 0.24252703 0.48505405 0.7574730
[98,] 0.21022658 0.42045316 0.7897734
[99,] 0.19140410 0.38280819 0.8085959
[100,] 0.17857990 0.35715981 0.8214201
[101,] 0.15197231 0.30394462 0.8480277
[102,] 0.20159073 0.40318146 0.7984093
[103,] 0.53381626 0.93236748 0.4661837
[104,] 0.54886304 0.90227391 0.4511370
[105,] 0.58444604 0.83110792 0.4155540
[106,] 0.53975491 0.92049018 0.4602451
[107,] 0.49575790 0.99151579 0.5042421
[108,] 0.46839802 0.93679603 0.5316020
[109,] 0.41828619 0.83657239 0.5817138
[110,] 0.38921078 0.77842157 0.6107892
[111,] 0.48242472 0.96484945 0.5175753
[112,] 0.42784918 0.85569836 0.5721508
[113,] 0.43068525 0.86137050 0.5693147
[114,] 0.38357219 0.76714437 0.6164278
[115,] 0.38899310 0.77798619 0.6110069
[116,] 0.34555618 0.69111235 0.6544438
[117,] 0.29864999 0.59729998 0.7013500
[118,] 0.28309324 0.56618649 0.7169068
[119,] 0.24264416 0.48528832 0.7573558
[120,] 0.20393777 0.40787554 0.7960622
[121,] 0.16704724 0.33409448 0.8329528
[122,] 0.42876001 0.85752003 0.5712400
[123,] 0.60434446 0.79131108 0.3956555
[124,] 0.55851804 0.88296393 0.4414820
[125,] 0.51589105 0.96821791 0.4841090
[126,] 0.70563809 0.58872381 0.2943619
[127,] 0.64438898 0.71122204 0.3556110
[128,] 0.58860822 0.82278357 0.4113918
[129,] 0.52328489 0.95343022 0.4767151
[130,] 0.44613139 0.89226278 0.5538686
[131,] 0.37108569 0.74217137 0.6289143
[132,] 0.42107911 0.84215822 0.5789209
[133,] 0.49322003 0.98644006 0.5067800
[134,] 0.41053002 0.82106004 0.5894700
[135,] 0.32046924 0.64093848 0.6795308
[136,] 0.24710088 0.49420176 0.7528991
[137,] 0.80953348 0.38093305 0.1904665
[138,] 0.74820559 0.50358882 0.2517944
[139,] 0.72026221 0.55947559 0.2797378
[140,] 0.66205254 0.67589492 0.3379475
[141,] 0.62869099 0.74261803 0.3713090
> postscript(file="/var/www/html/rcomp/tmp/1xvjy1290542145.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/27mi11290542145.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/37mi11290542145.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/47mi11290542145.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/57mi11290542145.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 = 156
Frequency = 1
1 2 3 4 5 6
0.08440345 0.24651784 1.84734395 -0.85676206 -1.39671963 0.14360898
7 8 9 10 11 12
2.43983261 -1.00495542 0.97939369 -2.55111256 0.62090604 -1.24883804
13 14 15 16 17 18
-3.25961117 0.22176199 0.07150002 -1.68205601 -1.02039078 1.68544508
19 20 21 22 23 24
-2.73295351 0.20077761 1.94566140 0.17360680 -3.23571909 -1.24988507
25 26 27 28 29 30
-1.37459196 1.23679175 1.43418733 0.59760053 0.14406944 0.72622285
31 32 33 34 35 36
-4.46836129 -1.08101438 0.34201702 1.10860730 -1.00495542 0.11844752
37 38 39 40 41 42
1.63281773 -2.99640245 -0.97600463 0.72495347 -1.15438589 -1.14141563
43 44 45 46 47 48
1.45252566 0.39363191 -0.85849191 -0.94473743 -0.60640266 -3.63455136
49 50 51 52 53 54
0.55148453 1.74375227 0.64022742 -1.36690276 0.80610571 1.55380094
55 56 57 58 59 60
-0.82092888 -0.35406332 -0.39184187 1.23852159 4.18062001 -0.32999028
61 62 63 64 65 66
1.17574225 -0.94158952 -2.63489298 0.33865359 0.33217680 -0.76089184
67 68 69 70 71 72
-1.68925018 -0.87182638 -1.38283315 -4.65353112 -1.03940510 -0.53244458
73 74 75 76 77 78
1.20469304 3.78107507 -0.46731427 -0.91769744 -1.47413739 -0.06384918
79 80 81 82 83 84
1.18311737 1.01788963 0.89235123 -1.79416368 1.90565114 -0.50682266
85 86 87 88 89 90
0.13536778 -1.64742537 -1.61460929 2.21639393 -0.44833451 0.04684042
91 92 93 94 95 96
2.23596024 1.81944019 0.66491644 -1.59306818 -1.02375422 -0.90309358
97 98 99 100 101 102
1.50741015 -1.00263901 2.05449505 -0.70573257 0.61485044 -0.22498053
103 104 105 106 107 108
3.28512790 1.71233638 0.81506429 1.32889807 1.50861270 -0.10154302
109 110 111 112 113 114
2.84716299 3.74388309 1.15462704 -1.07104334 0.19157409 0.84561411
115 116 117 118 119 120
1.33377583 -0.66134641 -0.72138345 3.08147106 -0.37459196 -1.19725772
121 122 123 124 125 126
0.19959976 -2.03116391 0.50373494 -0.20618174 -0.83148648 1.46672391
127 128 129 130 131 132
0.49162845 -0.91769744 1.49490718 -6.07205581 0.49162845 -1.21269308
133 134 135 136 137 138
4.09690642 1.23423040 -0.38283315 0.52990886 -0.31455492 0.62522708
139 140 141 142 143 144
-0.51682826 0.70597372 -0.18077534 -0.03604167 2.29405191 -5.54633106
145 146 147 148 149 150
0.41980583 0.69029341 2.16030689 1.35908598 -0.65310522 -0.28816548
151 152 153 154 155 156
-1.14929261 0.77501947 0.27528768 1.07579121 -2.20445189 2.15672793
> postscript(file="/var/www/html/rcomp/tmp/60ehm1290542145.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 = 156
Frequency = 1
lag(myerror, k = 1) myerror
0 0.08440345 NA
1 0.24651784 0.08440345
2 1.84734395 0.24651784
3 -0.85676206 1.84734395
4 -1.39671963 -0.85676206
5 0.14360898 -1.39671963
6 2.43983261 0.14360898
7 -1.00495542 2.43983261
8 0.97939369 -1.00495542
9 -2.55111256 0.97939369
10 0.62090604 -2.55111256
11 -1.24883804 0.62090604
12 -3.25961117 -1.24883804
13 0.22176199 -3.25961117
14 0.07150002 0.22176199
15 -1.68205601 0.07150002
16 -1.02039078 -1.68205601
17 1.68544508 -1.02039078
18 -2.73295351 1.68544508
19 0.20077761 -2.73295351
20 1.94566140 0.20077761
21 0.17360680 1.94566140
22 -3.23571909 0.17360680
23 -1.24988507 -3.23571909
24 -1.37459196 -1.24988507
25 1.23679175 -1.37459196
26 1.43418733 1.23679175
27 0.59760053 1.43418733
28 0.14406944 0.59760053
29 0.72622285 0.14406944
30 -4.46836129 0.72622285
31 -1.08101438 -4.46836129
32 0.34201702 -1.08101438
33 1.10860730 0.34201702
34 -1.00495542 1.10860730
35 0.11844752 -1.00495542
36 1.63281773 0.11844752
37 -2.99640245 1.63281773
38 -0.97600463 -2.99640245
39 0.72495347 -0.97600463
40 -1.15438589 0.72495347
41 -1.14141563 -1.15438589
42 1.45252566 -1.14141563
43 0.39363191 1.45252566
44 -0.85849191 0.39363191
45 -0.94473743 -0.85849191
46 -0.60640266 -0.94473743
47 -3.63455136 -0.60640266
48 0.55148453 -3.63455136
49 1.74375227 0.55148453
50 0.64022742 1.74375227
51 -1.36690276 0.64022742
52 0.80610571 -1.36690276
53 1.55380094 0.80610571
54 -0.82092888 1.55380094
55 -0.35406332 -0.82092888
56 -0.39184187 -0.35406332
57 1.23852159 -0.39184187
58 4.18062001 1.23852159
59 -0.32999028 4.18062001
60 1.17574225 -0.32999028
61 -0.94158952 1.17574225
62 -2.63489298 -0.94158952
63 0.33865359 -2.63489298
64 0.33217680 0.33865359
65 -0.76089184 0.33217680
66 -1.68925018 -0.76089184
67 -0.87182638 -1.68925018
68 -1.38283315 -0.87182638
69 -4.65353112 -1.38283315
70 -1.03940510 -4.65353112
71 -0.53244458 -1.03940510
72 1.20469304 -0.53244458
73 3.78107507 1.20469304
74 -0.46731427 3.78107507
75 -0.91769744 -0.46731427
76 -1.47413739 -0.91769744
77 -0.06384918 -1.47413739
78 1.18311737 -0.06384918
79 1.01788963 1.18311737
80 0.89235123 1.01788963
81 -1.79416368 0.89235123
82 1.90565114 -1.79416368
83 -0.50682266 1.90565114
84 0.13536778 -0.50682266
85 -1.64742537 0.13536778
86 -1.61460929 -1.64742537
87 2.21639393 -1.61460929
88 -0.44833451 2.21639393
89 0.04684042 -0.44833451
90 2.23596024 0.04684042
91 1.81944019 2.23596024
92 0.66491644 1.81944019
93 -1.59306818 0.66491644
94 -1.02375422 -1.59306818
95 -0.90309358 -1.02375422
96 1.50741015 -0.90309358
97 -1.00263901 1.50741015
98 2.05449505 -1.00263901
99 -0.70573257 2.05449505
100 0.61485044 -0.70573257
101 -0.22498053 0.61485044
102 3.28512790 -0.22498053
103 1.71233638 3.28512790
104 0.81506429 1.71233638
105 1.32889807 0.81506429
106 1.50861270 1.32889807
107 -0.10154302 1.50861270
108 2.84716299 -0.10154302
109 3.74388309 2.84716299
110 1.15462704 3.74388309
111 -1.07104334 1.15462704
112 0.19157409 -1.07104334
113 0.84561411 0.19157409
114 1.33377583 0.84561411
115 -0.66134641 1.33377583
116 -0.72138345 -0.66134641
117 3.08147106 -0.72138345
118 -0.37459196 3.08147106
119 -1.19725772 -0.37459196
120 0.19959976 -1.19725772
121 -2.03116391 0.19959976
122 0.50373494 -2.03116391
123 -0.20618174 0.50373494
124 -0.83148648 -0.20618174
125 1.46672391 -0.83148648
126 0.49162845 1.46672391
127 -0.91769744 0.49162845
128 1.49490718 -0.91769744
129 -6.07205581 1.49490718
130 0.49162845 -6.07205581
131 -1.21269308 0.49162845
132 4.09690642 -1.21269308
133 1.23423040 4.09690642
134 -0.38283315 1.23423040
135 0.52990886 -0.38283315
136 -0.31455492 0.52990886
137 0.62522708 -0.31455492
138 -0.51682826 0.62522708
139 0.70597372 -0.51682826
140 -0.18077534 0.70597372
141 -0.03604167 -0.18077534
142 2.29405191 -0.03604167
143 -5.54633106 2.29405191
144 0.41980583 -5.54633106
145 0.69029341 0.41980583
146 2.16030689 0.69029341
147 1.35908598 2.16030689
148 -0.65310522 1.35908598
149 -0.28816548 -0.65310522
150 -1.14929261 -0.28816548
151 0.77501947 -1.14929261
152 0.27528768 0.77501947
153 1.07579121 0.27528768
154 -2.20445189 1.07579121
155 2.15672793 -2.20445189
156 NA 2.15672793
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 0.24651784 0.08440345
[2,] 1.84734395 0.24651784
[3,] -0.85676206 1.84734395
[4,] -1.39671963 -0.85676206
[5,] 0.14360898 -1.39671963
[6,] 2.43983261 0.14360898
[7,] -1.00495542 2.43983261
[8,] 0.97939369 -1.00495542
[9,] -2.55111256 0.97939369
[10,] 0.62090604 -2.55111256
[11,] -1.24883804 0.62090604
[12,] -3.25961117 -1.24883804
[13,] 0.22176199 -3.25961117
[14,] 0.07150002 0.22176199
[15,] -1.68205601 0.07150002
[16,] -1.02039078 -1.68205601
[17,] 1.68544508 -1.02039078
[18,] -2.73295351 1.68544508
[19,] 0.20077761 -2.73295351
[20,] 1.94566140 0.20077761
[21,] 0.17360680 1.94566140
[22,] -3.23571909 0.17360680
[23,] -1.24988507 -3.23571909
[24,] -1.37459196 -1.24988507
[25,] 1.23679175 -1.37459196
[26,] 1.43418733 1.23679175
[27,] 0.59760053 1.43418733
[28,] 0.14406944 0.59760053
[29,] 0.72622285 0.14406944
[30,] -4.46836129 0.72622285
[31,] -1.08101438 -4.46836129
[32,] 0.34201702 -1.08101438
[33,] 1.10860730 0.34201702
[34,] -1.00495542 1.10860730
[35,] 0.11844752 -1.00495542
[36,] 1.63281773 0.11844752
[37,] -2.99640245 1.63281773
[38,] -0.97600463 -2.99640245
[39,] 0.72495347 -0.97600463
[40,] -1.15438589 0.72495347
[41,] -1.14141563 -1.15438589
[42,] 1.45252566 -1.14141563
[43,] 0.39363191 1.45252566
[44,] -0.85849191 0.39363191
[45,] -0.94473743 -0.85849191
[46,] -0.60640266 -0.94473743
[47,] -3.63455136 -0.60640266
[48,] 0.55148453 -3.63455136
[49,] 1.74375227 0.55148453
[50,] 0.64022742 1.74375227
[51,] -1.36690276 0.64022742
[52,] 0.80610571 -1.36690276
[53,] 1.55380094 0.80610571
[54,] -0.82092888 1.55380094
[55,] -0.35406332 -0.82092888
[56,] -0.39184187 -0.35406332
[57,] 1.23852159 -0.39184187
[58,] 4.18062001 1.23852159
[59,] -0.32999028 4.18062001
[60,] 1.17574225 -0.32999028
[61,] -0.94158952 1.17574225
[62,] -2.63489298 -0.94158952
[63,] 0.33865359 -2.63489298
[64,] 0.33217680 0.33865359
[65,] -0.76089184 0.33217680
[66,] -1.68925018 -0.76089184
[67,] -0.87182638 -1.68925018
[68,] -1.38283315 -0.87182638
[69,] -4.65353112 -1.38283315
[70,] -1.03940510 -4.65353112
[71,] -0.53244458 -1.03940510
[72,] 1.20469304 -0.53244458
[73,] 3.78107507 1.20469304
[74,] -0.46731427 3.78107507
[75,] -0.91769744 -0.46731427
[76,] -1.47413739 -0.91769744
[77,] -0.06384918 -1.47413739
[78,] 1.18311737 -0.06384918
[79,] 1.01788963 1.18311737
[80,] 0.89235123 1.01788963
[81,] -1.79416368 0.89235123
[82,] 1.90565114 -1.79416368
[83,] -0.50682266 1.90565114
[84,] 0.13536778 -0.50682266
[85,] -1.64742537 0.13536778
[86,] -1.61460929 -1.64742537
[87,] 2.21639393 -1.61460929
[88,] -0.44833451 2.21639393
[89,] 0.04684042 -0.44833451
[90,] 2.23596024 0.04684042
[91,] 1.81944019 2.23596024
[92,] 0.66491644 1.81944019
[93,] -1.59306818 0.66491644
[94,] -1.02375422 -1.59306818
[95,] -0.90309358 -1.02375422
[96,] 1.50741015 -0.90309358
[97,] -1.00263901 1.50741015
[98,] 2.05449505 -1.00263901
[99,] -0.70573257 2.05449505
[100,] 0.61485044 -0.70573257
[101,] -0.22498053 0.61485044
[102,] 3.28512790 -0.22498053
[103,] 1.71233638 3.28512790
[104,] 0.81506429 1.71233638
[105,] 1.32889807 0.81506429
[106,] 1.50861270 1.32889807
[107,] -0.10154302 1.50861270
[108,] 2.84716299 -0.10154302
[109,] 3.74388309 2.84716299
[110,] 1.15462704 3.74388309
[111,] -1.07104334 1.15462704
[112,] 0.19157409 -1.07104334
[113,] 0.84561411 0.19157409
[114,] 1.33377583 0.84561411
[115,] -0.66134641 1.33377583
[116,] -0.72138345 -0.66134641
[117,] 3.08147106 -0.72138345
[118,] -0.37459196 3.08147106
[119,] -1.19725772 -0.37459196
[120,] 0.19959976 -1.19725772
[121,] -2.03116391 0.19959976
[122,] 0.50373494 -2.03116391
[123,] -0.20618174 0.50373494
[124,] -0.83148648 -0.20618174
[125,] 1.46672391 -0.83148648
[126,] 0.49162845 1.46672391
[127,] -0.91769744 0.49162845
[128,] 1.49490718 -0.91769744
[129,] -6.07205581 1.49490718
[130,] 0.49162845 -6.07205581
[131,] -1.21269308 0.49162845
[132,] 4.09690642 -1.21269308
[133,] 1.23423040 4.09690642
[134,] -0.38283315 1.23423040
[135,] 0.52990886 -0.38283315
[136,] -0.31455492 0.52990886
[137,] 0.62522708 -0.31455492
[138,] -0.51682826 0.62522708
[139,] 0.70597372 -0.51682826
[140,] -0.18077534 0.70597372
[141,] -0.03604167 -0.18077534
[142,] 2.29405191 -0.03604167
[143,] -5.54633106 2.29405191
[144,] 0.41980583 -5.54633106
[145,] 0.69029341 0.41980583
[146,] 2.16030689 0.69029341
[147,] 1.35908598 2.16030689
[148,] -0.65310522 1.35908598
[149,] -0.28816548 -0.65310522
[150,] -1.14929261 -0.28816548
[151,] 0.77501947 -1.14929261
[152,] 0.27528768 0.77501947
[153,] 1.07579121 0.27528768
[154,] -2.20445189 1.07579121
[155,] 2.15672793 -2.20445189
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 0.24651784 0.08440345
2 1.84734395 0.24651784
3 -0.85676206 1.84734395
4 -1.39671963 -0.85676206
5 0.14360898 -1.39671963
6 2.43983261 0.14360898
7 -1.00495542 2.43983261
8 0.97939369 -1.00495542
9 -2.55111256 0.97939369
10 0.62090604 -2.55111256
11 -1.24883804 0.62090604
12 -3.25961117 -1.24883804
13 0.22176199 -3.25961117
14 0.07150002 0.22176199
15 -1.68205601 0.07150002
16 -1.02039078 -1.68205601
17 1.68544508 -1.02039078
18 -2.73295351 1.68544508
19 0.20077761 -2.73295351
20 1.94566140 0.20077761
21 0.17360680 1.94566140
22 -3.23571909 0.17360680
23 -1.24988507 -3.23571909
24 -1.37459196 -1.24988507
25 1.23679175 -1.37459196
26 1.43418733 1.23679175
27 0.59760053 1.43418733
28 0.14406944 0.59760053
29 0.72622285 0.14406944
30 -4.46836129 0.72622285
31 -1.08101438 -4.46836129
32 0.34201702 -1.08101438
33 1.10860730 0.34201702
34 -1.00495542 1.10860730
35 0.11844752 -1.00495542
36 1.63281773 0.11844752
37 -2.99640245 1.63281773
38 -0.97600463 -2.99640245
39 0.72495347 -0.97600463
40 -1.15438589 0.72495347
41 -1.14141563 -1.15438589
42 1.45252566 -1.14141563
43 0.39363191 1.45252566
44 -0.85849191 0.39363191
45 -0.94473743 -0.85849191
46 -0.60640266 -0.94473743
47 -3.63455136 -0.60640266
48 0.55148453 -3.63455136
49 1.74375227 0.55148453
50 0.64022742 1.74375227
51 -1.36690276 0.64022742
52 0.80610571 -1.36690276
53 1.55380094 0.80610571
54 -0.82092888 1.55380094
55 -0.35406332 -0.82092888
56 -0.39184187 -0.35406332
57 1.23852159 -0.39184187
58 4.18062001 1.23852159
59 -0.32999028 4.18062001
60 1.17574225 -0.32999028
61 -0.94158952 1.17574225
62 -2.63489298 -0.94158952
63 0.33865359 -2.63489298
64 0.33217680 0.33865359
65 -0.76089184 0.33217680
66 -1.68925018 -0.76089184
67 -0.87182638 -1.68925018
68 -1.38283315 -0.87182638
69 -4.65353112 -1.38283315
70 -1.03940510 -4.65353112
71 -0.53244458 -1.03940510
72 1.20469304 -0.53244458
73 3.78107507 1.20469304
74 -0.46731427 3.78107507
75 -0.91769744 -0.46731427
76 -1.47413739 -0.91769744
77 -0.06384918 -1.47413739
78 1.18311737 -0.06384918
79 1.01788963 1.18311737
80 0.89235123 1.01788963
81 -1.79416368 0.89235123
82 1.90565114 -1.79416368
83 -0.50682266 1.90565114
84 0.13536778 -0.50682266
85 -1.64742537 0.13536778
86 -1.61460929 -1.64742537
87 2.21639393 -1.61460929
88 -0.44833451 2.21639393
89 0.04684042 -0.44833451
90 2.23596024 0.04684042
91 1.81944019 2.23596024
92 0.66491644 1.81944019
93 -1.59306818 0.66491644
94 -1.02375422 -1.59306818
95 -0.90309358 -1.02375422
96 1.50741015 -0.90309358
97 -1.00263901 1.50741015
98 2.05449505 -1.00263901
99 -0.70573257 2.05449505
100 0.61485044 -0.70573257
101 -0.22498053 0.61485044
102 3.28512790 -0.22498053
103 1.71233638 3.28512790
104 0.81506429 1.71233638
105 1.32889807 0.81506429
106 1.50861270 1.32889807
107 -0.10154302 1.50861270
108 2.84716299 -0.10154302
109 3.74388309 2.84716299
110 1.15462704 3.74388309
111 -1.07104334 1.15462704
112 0.19157409 -1.07104334
113 0.84561411 0.19157409
114 1.33377583 0.84561411
115 -0.66134641 1.33377583
116 -0.72138345 -0.66134641
117 3.08147106 -0.72138345
118 -0.37459196 3.08147106
119 -1.19725772 -0.37459196
120 0.19959976 -1.19725772
121 -2.03116391 0.19959976
122 0.50373494 -2.03116391
123 -0.20618174 0.50373494
124 -0.83148648 -0.20618174
125 1.46672391 -0.83148648
126 0.49162845 1.46672391
127 -0.91769744 0.49162845
128 1.49490718 -0.91769744
129 -6.07205581 1.49490718
130 0.49162845 -6.07205581
131 -1.21269308 0.49162845
132 4.09690642 -1.21269308
133 1.23423040 4.09690642
134 -0.38283315 1.23423040
135 0.52990886 -0.38283315
136 -0.31455492 0.52990886
137 0.62522708 -0.31455492
138 -0.51682826 0.62522708
139 0.70597372 -0.51682826
140 -0.18077534 0.70597372
141 -0.03604167 -0.18077534
142 2.29405191 -0.03604167
143 -5.54633106 2.29405191
144 0.41980583 -5.54633106
145 0.69029341 0.41980583
146 2.16030689 0.69029341
147 1.35908598 2.16030689
148 -0.65310522 1.35908598
149 -0.28816548 -0.65310522
150 -1.14929261 -0.28816548
151 0.77501947 -1.14929261
152 0.27528768 0.77501947
153 1.07579121 0.27528768
154 -2.20445189 1.07579121
155 2.15672793 -2.20445189
> 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/7bny71290542145.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/8bny71290542145.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/9leys1290542145.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/10leys1290542145.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/117xwg1290542145.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/12afv41290542145.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/13zysy1290542145.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/14kzql1290542145.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/156h791290542145.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/16rinx1290542145.tab")
+ }
>
> try(system("convert tmp/1xvjy1290542145.ps tmp/1xvjy1290542145.png",intern=TRUE))
character(0)
> try(system("convert tmp/27mi11290542145.ps tmp/27mi11290542145.png",intern=TRUE))
character(0)
> try(system("convert tmp/37mi11290542145.ps tmp/37mi11290542145.png",intern=TRUE))
character(0)
> try(system("convert tmp/47mi11290542145.ps tmp/47mi11290542145.png",intern=TRUE))
character(0)
> try(system("convert tmp/57mi11290542145.ps tmp/57mi11290542145.png",intern=TRUE))
character(0)
> try(system("convert tmp/60ehm1290542145.ps tmp/60ehm1290542145.png",intern=TRUE))
character(0)
> try(system("convert tmp/7bny71290542145.ps tmp/7bny71290542145.png",intern=TRUE))
character(0)
> try(system("convert tmp/8bny71290542145.ps tmp/8bny71290542145.png",intern=TRUE))
character(0)
> try(system("convert tmp/9leys1290542145.ps tmp/9leys1290542145.png",intern=TRUE))
character(0)
> try(system("convert tmp/10leys1290542145.ps tmp/10leys1290542145.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
4.051 1.783 9.754