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 = 'Linear Trend'
> par2 = 'Do not include Seasonal Dummies'
> par1 = '1'
> #'GNU S' R Code compiled by R2WASP v. 1.0.44 ()
> #Author: Prof. Dr. P. Wessa
> #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/
> #Source of accompanying publication: Office for Research, Development, and Education
> #Technical description: Write here your technical program description (don't use hard returns!)
> library(lattice)
> library(lmtest)
Loading required package: zoo
Attaching package: 'zoo'
The following object(s) are masked from package:base :
as.Date.numeric
> n25 <- 25 #minimum number of obs. for Goldfeld-Quandt test
> par1 <- as.numeric(par1)
> x <- t(y)
> k <- length(x[1,])
> n <- length(x[,1])
> x1 <- cbind(x[,par1], x[,1:k!=par1])
> mycolnames <- c(colnames(x)[par1], colnames(x)[1:k!=par1])
> colnames(x1) <- mycolnames #colnames(x)[par1]
> x <- x1
> if (par3 == 'First Differences'){
+ x2 <- array(0, dim=c(n-1,k), dimnames=list(1:(n-1), paste('(1-B)',colnames(x),sep='')))
+ for (i in 1:n-1) {
+ for (j in 1:k) {
+ x2[i,j] <- x[i+1,j] - x[i,j]
+ }
+ }
+ x <- x2
+ }
> if (par2 == 'Include Monthly Dummies'){
+ x2 <- array(0, dim=c(n,11), dimnames=list(1:n, paste('M', seq(1:11), sep ='')))
+ for (i in 1:11){
+ x2[seq(i,n,12),i] <- 1
+ }
+ x <- cbind(x, x2)
+ }
> if (par2 == 'Include Quarterly Dummies'){
+ x2 <- array(0, dim=c(n,3), dimnames=list(1:n, paste('Q', seq(1:3), sep ='')))
+ for (i in 1:3){
+ x2[seq(i,n,4),i] <- 1
+ }
+ x <- cbind(x, x2)
+ }
> k <- length(x[1,])
> if (par3 == 'Linear Trend'){
+ x <- cbind(x, c(1:n))
+ colnames(x)[k+1] <- 't'
+ }
> x
Popularity FindingFriends KnowingPeople Liked Celebrity t
1 13 13 14 13 3 1
2 12 12 8 13 5 2
3 15 10 12 16 6 3
4 12 9 7 12 6 4
5 10 10 10 11 5 5
6 12 12 7 12 3 6
7 15 13 16 18 8 7
8 9 12 11 11 4 8
9 12 12 14 14 4 9
10 11 6 6 9 4 10
11 11 5 16 14 6 11
12 11 12 11 12 6 12
13 15 11 16 11 5 13
14 7 14 12 12 4 14
15 11 14 7 13 6 15
16 11 12 13 11 4 16
17 10 12 11 12 6 17
18 14 11 15 16 6 18
19 10 11 7 9 4 19
20 6 7 9 11 4 20
21 11 9 7 13 2 21
22 15 11 14 15 7 22
23 11 11 15 10 5 23
24 12 12 7 11 4 24
25 14 12 15 13 6 25
26 15 11 17 16 6 26
27 9 11 15 15 7 27
28 13 8 14 14 5 28
29 13 9 14 14 6 29
30 16 12 8 14 4 30
31 13 10 8 8 4 31
32 12 10 14 13 7 32
33 14 12 14 15 7 33
34 11 8 8 13 4 34
35 9 12 11 11 4 35
36 16 11 16 15 6 36
37 12 12 10 15 6 37
38 10 7 8 9 5 38
39 13 11 14 13 6 39
40 16 11 16 16 7 40
41 14 12 13 13 6 41
42 15 9 5 11 3 42
43 5 15 8 12 3 43
44 8 11 10 12 4 44
45 11 11 8 12 6 45
46 16 11 13 14 7 46
47 17 11 15 14 5 47
48 9 15 6 8 4 48
49 9 11 12 13 5 49
50 13 12 16 16 6 50
51 10 12 5 13 6 51
52 6 9 15 11 6 52
53 12 12 12 14 5 53
54 8 12 8 13 4 54
55 14 13 13 13 5 55
56 12 11 14 13 5 56
57 11 9 12 12 4 57
58 16 9 16 16 6 58
59 8 11 10 15 2 59
60 15 11 15 15 8 60
61 7 12 8 12 3 61
62 16 12 16 14 6 62
63 14 9 19 12 6 63
64 16 11 14 15 6 64
65 9 9 6 12 5 65
66 14 12 13 13 5 66
67 11 12 15 12 6 67
68 13 12 7 12 5 68
69 15 12 13 13 6 69
70 5 14 4 5 2 70
71 15 11 14 13 5 71
72 13 12 13 13 5 72
73 11 11 11 14 5 73
74 11 6 14 17 6 74
75 12 10 12 13 6 75
76 12 12 15 13 6 76
77 12 13 14 12 5 77
78 12 8 13 13 5 78
79 14 12 8 14 4 79
80 6 12 6 11 2 80
81 7 12 7 12 4 81
82 14 6 13 12 6 82
83 14 11 13 16 6 83
84 10 10 11 12 5 84
85 13 12 5 12 3 85
86 12 13 12 12 6 86
87 9 11 8 10 4 87
88 12 7 11 15 5 88
89 16 11 14 15 8 89
90 10 11 9 12 4 90
91 14 11 10 16 6 91
92 10 11 13 15 6 92
93 16 12 16 16 7 93
94 15 10 16 13 6 94
95 12 11 11 12 5 95
96 10 12 8 11 4 96
97 8 7 4 13 6 97
98 8 13 7 10 3 98
99 11 8 14 15 5 99
100 13 12 11 13 6 100
101 16 11 17 16 7 101
102 16 12 15 15 7 102
103 14 14 17 18 6 103
104 11 10 5 13 3 104
105 4 10 4 10 2 105
106 14 13 10 16 8 106
107 9 10 11 13 3 107
108 14 11 15 15 8 108
109 8 10 10 14 3 109
110 8 7 9 15 4 110
111 11 10 12 14 5 111
112 12 8 15 13 7 112
113 11 12 7 13 6 113
114 14 12 13 15 6 114
115 15 12 12 16 7 115
116 16 11 14 14 6 116
117 16 12 14 14 6 117
118 11 12 8 16 6 118
119 14 12 15 14 6 119
120 14 11 12 12 4 120
121 12 12 12 13 4 121
122 14 11 16 12 5 122
123 8 11 9 12 4 123
124 13 13 15 14 6 124
125 16 12 15 14 6 125
126 12 12 6 14 5 126
127 16 12 14 16 8 127
128 12 12 15 13 6 128
129 11 8 10 14 5 129
130 4 8 6 4 4 130
131 16 12 14 16 8 131
132 15 11 12 13 6 132
133 10 12 8 16 4 133
134 13 13 11 15 6 134
135 15 12 13 14 6 135
136 12 12 9 13 4 136
137 14 11 15 14 6 137
138 7 12 13 12 3 138
139 19 12 15 15 6 139
140 12 10 14 14 5 140
141 12 11 16 13 4 141
142 13 12 14 14 6 142
143 15 12 14 16 4 143
144 8 10 10 6 4 144
145 12 12 10 13 4 145
146 10 13 4 13 6 146
147 8 12 8 14 5 147
148 10 15 15 15 6 148
149 15 11 16 14 6 149
150 16 12 12 15 8 150
151 13 11 12 13 7 151
152 16 12 15 16 7 152
153 9 11 9 12 4 153
154 14 10 12 15 6 154
155 14 11 14 12 6 155
156 12 11 11 14 2 156
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) FindingFriends KnowingPeople Liked Celebrity
0.311900 0.096254 0.243370 0.351381 0.627592
t
-0.000729
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-6.4216 -1.2647 -0.0451 1.3080 6.8876
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.3119003 1.4303540 0.218 0.827680
FindingFriends 0.0962539 0.0966808 0.996 0.321055
KnowingPeople 0.2433703 0.0616159 3.950 0.000120 ***
Liked 0.3513806 0.0976571 3.598 0.000435 ***
Celebrity 0.6275918 0.1565552 4.009 9.59e-05 ***
t -0.0007291 0.0038239 -0.191 0.849050
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 2.112 on 150 degrees of freedom
Multiple R-squared: 0.4993, Adjusted R-squared: 0.4826
F-statistic: 29.92 on 5 and 150 DF, p-value: < 2.2e-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.02712890 0.054257795 0.972871103
[2,] 0.02373202 0.047464032 0.976267984
[3,] 0.05007465 0.100149297 0.949925352
[4,] 0.03368950 0.067379004 0.966310498
[5,] 0.43771699 0.875433987 0.562283006
[6,] 0.63165630 0.736687391 0.368343695
[7,] 0.56440647 0.871187063 0.435593531
[8,] 0.48985390 0.979707793 0.510146103
[9,] 0.40717496 0.814349923 0.592825039
[10,] 0.37522833 0.750456656 0.624771672
[11,] 0.32342430 0.646848596 0.676575702
[12,] 0.45075502 0.901510041 0.549244980
[13,] 0.45525023 0.910500468 0.544749766
[14,] 0.49806702 0.996134032 0.501932984
[15,] 0.43637159 0.872743172 0.563628414
[16,] 0.45456912 0.909138249 0.545430875
[17,] 0.43035591 0.860711830 0.569644085
[18,] 0.37613780 0.752275607 0.623862197
[19,] 0.60714157 0.785716852 0.392858426
[20,] 0.55821371 0.883572583 0.441786291
[21,] 0.50187753 0.996244948 0.498122474
[22,] 0.68061498 0.638770043 0.319385022
[23,] 0.78487482 0.430250352 0.215125176
[24,] 0.74753187 0.504936261 0.252468131
[25,] 0.69916224 0.601675527 0.300837764
[26,] 0.66353660 0.672926791 0.336463395
[27,] 0.66965711 0.660685782 0.330342891
[28,] 0.67703101 0.645937978 0.322968989
[29,] 0.64419627 0.711607459 0.355803729
[30,] 0.59444512 0.811109765 0.405554882
[31,] 0.54024752 0.919504961 0.459752481
[32,] 0.51092538 0.978149231 0.489074616
[33,] 0.47027673 0.940553450 0.529723275
[34,] 0.73593253 0.528134945 0.264067472
[35,] 0.94989693 0.100206147 0.050103073
[36,] 0.96186376 0.076272473 0.038136236
[37,] 0.95047942 0.099041160 0.049520580
[38,] 0.95612156 0.087756875 0.043878438
[39,] 0.97800504 0.043989917 0.021994958
[40,] 0.97097785 0.058044296 0.029022148
[41,] 0.97986997 0.040260058 0.020130029
[42,] 0.97688207 0.046235862 0.023117931
[43,] 0.97218875 0.055622505 0.027811252
[44,] 0.99731388 0.005372245 0.002686123
[45,] 0.99614619 0.007707614 0.003853807
[46,] 0.99690986 0.006180285 0.003090143
[47,] 0.99678917 0.006421650 0.003210825
[48,] 0.99547463 0.009050747 0.004525373
[49,] 0.99365576 0.012688474 0.006344237
[50,] 0.99296619 0.014067626 0.007033813
[51,] 0.99459144 0.010817112 0.005408556
[52,] 0.99292801 0.014143978 0.007071989
[53,] 0.99379391 0.012412176 0.006206088
[54,] 0.99447990 0.011040208 0.005520104
[55,] 0.99267493 0.014650142 0.007325071
[56,] 0.99319531 0.013609374 0.006804687
[57,] 0.99136243 0.017275150 0.008637575
[58,] 0.99060636 0.018787280 0.009393640
[59,] 0.99051511 0.018969771 0.009484886
[60,] 0.99201231 0.015975378 0.007987689
[61,] 0.99215928 0.015681448 0.007840724
[62,] 0.98947560 0.021048809 0.010524404
[63,] 0.99114658 0.017706837 0.008853418
[64,] 0.98836318 0.023273639 0.011636819
[65,] 0.98539438 0.029211240 0.014605620
[66,] 0.98942341 0.021153181 0.010576591
[67,] 0.98573332 0.028533370 0.014266685
[68,] 0.98327106 0.033457887 0.016728943
[69,] 0.97799249 0.044015021 0.022007510
[70,] 0.97099139 0.058017221 0.029008610
[71,] 0.98176525 0.036469502 0.018234751
[72,] 0.98088621 0.038227570 0.019113785
[73,] 0.98406489 0.031870213 0.015935106
[74,] 0.98500119 0.029997621 0.014998811
[75,] 0.97991939 0.040161212 0.020080606
[76,] 0.97530172 0.049396562 0.024698281
[77,] 0.99358723 0.012825531 0.006412765
[78,] 0.99113511 0.017729780 0.008864890
[79,] 0.98802045 0.023959102 0.011979551
[80,] 0.98435285 0.031294294 0.015647147
[81,] 0.98059439 0.038811214 0.019405607
[82,] 0.97457129 0.050857413 0.025428706
[83,] 0.97010271 0.059794583 0.029897291
[84,] 0.98175415 0.036491701 0.018245851
[85,] 0.97647392 0.047052154 0.023526077
[86,] 0.97368692 0.052626166 0.026313083
[87,] 0.96749354 0.065012915 0.032506458
[88,] 0.95998409 0.080031813 0.040015907
[89,] 0.95623192 0.087536152 0.043768076
[90,] 0.94465329 0.110693413 0.055346706
[91,] 0.93955143 0.120897138 0.060448569
[92,] 0.92718623 0.145627542 0.072813771
[93,] 0.90965443 0.180691137 0.090345568
[94,] 0.89747766 0.205044677 0.102522339
[95,] 0.89906165 0.201876691 0.100938345
[96,] 0.93484838 0.130303250 0.065151625
[97,] 0.93132464 0.137350728 0.068675364
[98,] 0.91254936 0.174901287 0.087450644
[99,] 0.89302465 0.213950697 0.106975348
[100,] 0.88438535 0.231229300 0.115614650
[101,] 0.88043417 0.239131651 0.119565826
[102,] 0.90222930 0.195541397 0.097770699
[103,] 0.89303345 0.213933096 0.106966548
[104,] 0.92797997 0.144040064 0.072020032
[105,] 0.90683113 0.186337731 0.093168865
[106,] 0.88370752 0.232584958 0.116292479
[107,] 0.85636259 0.287274813 0.143637406
[108,] 0.85198435 0.296031308 0.148015654
[109,] 0.85696807 0.286063856 0.143031928
[110,] 0.85091578 0.298168448 0.149084224
[111,] 0.81656806 0.366863875 0.183431937
[112,] 0.86343118 0.273137637 0.136568819
[113,] 0.83689598 0.326208043 0.163104022
[114,] 0.81521855 0.369562895 0.184781447
[115,] 0.80219768 0.395604636 0.197802318
[116,] 0.76151725 0.476965507 0.238482753
[117,] 0.76393298 0.472134045 0.236067022
[118,] 0.75477710 0.490445794 0.245222897
[119,] 0.70116681 0.597666385 0.298833193
[120,] 0.66431114 0.671377714 0.335688857
[121,] 0.67921767 0.641564654 0.320782327
[122,] 0.68097636 0.638047278 0.319023639
[123,] 0.62943368 0.741132631 0.370566315
[124,] 0.60131796 0.797364075 0.398682037
[125,] 0.58856236 0.822875273 0.411437637
[126,] 0.51398052 0.972038967 0.486019483
[127,] 0.47145629 0.942912587 0.528543706
[128,] 0.46145656 0.922913111 0.538543444
[129,] 0.38624746 0.772494921 0.613752539
[130,] 0.45828876 0.916577513 0.541711244
[131,] 0.81906325 0.361873493 0.180936746
[132,] 0.82590539 0.348189221 0.174094611
[133,] 0.78937858 0.421242839 0.210621419
[134,] 0.71974788 0.560504242 0.280252121
[135,] 0.65744065 0.685118700 0.342559350
[136,] 0.54245115 0.915097697 0.457548849
[137,] 0.62075486 0.758490279 0.379245139
[138,] 0.77298859 0.454022813 0.227011407
[139,] 0.63041316 0.739173681 0.369586840
> postscript(file="/var/www/html/rcomp/tmp/15ktw1291285607.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/www/html/rcomp/tmp/2gbah1291285607.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/www/html/rcomp/tmp/3gbah1291285607.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/www/html/rcomp/tmp/4gbah1291285607.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/www/html/rcomp/tmp/5r2rk1291285607.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 = 156
Frequency = 1
1 2 3 4 5 6
1.579620436 0.881641388 1.419663367 1.139020262 -0.707642946 2.734492197
7 8 9 10 11 12
-1.797608180 -1.513742019 -0.297265714 2.984852141 -2.363954568 -1.117390120
13 14 15 16 17 18
2.741713906 -4.296626408 -0.685610269 0.005349849 -2.113744852 -0.395765566
19 20 21 22 23 24
1.266773859 -3.536983332 2.310400895 0.574309725 -0.656244643 2.471403958
25 26 27 28 29 30
0.567225820 0.123326303 -5.665415287 0.474010052 -0.249106631 5.178266092
31 32 33 34 35 36
4.479786755 -1.619384570 -0.513924582 0.917578530 -1.494057573 1.725367755
37 38 39 40 41 42
-0.909935408 0.794679345 -0.082943252 0.749311494 1.065631238 6.887621013
43 44 45 46 47 48
-4.770664791 -2.499252549 -0.266966614 2.186557927 3.955730100 0.497651742
49 50 51 52 53 54
-2.961320317 -1.712060028 -0.980115986 -6.421566770 -0.406038635 -2.452855986
55 56 57 58 59 60
1.607175931 -0.442957502 0.215992381 1.582534091 -2.287274975 -0.268948358
61 62 63 64 65 66
-2.468780136 1.999449887 0.261591063 2.232521815 -0.945545349 1.711449417
67 68 69 70 71 72
-2.050773293 2.524509841 2.086044738 -0.593989035 2.567978302 0.715823739
73 74 75 76 77 78
-1.051833387 -2.981679437 -0.473702866 -1.395592447 -0.268774534 0.105213648
79 80 81 82 83 84
3.213989718 -1.989215082 -2.838420623 2.024426452 0.138363477 -1.244798628
85 86 87 88 89 90
4.278827991 -0.403064331 -0.278401413 -0.007262632 0.995564476 -0.222345804
91 92 93 94 95 96
0.874306746 -3.503694404 0.691697437 1.566668032 0.666967064 0.280525537
97 98 99 100 101 102
-2.221939756 -0.591927498 -1.825607779 0.595385960 0.550413482 1.293009835
103 104 105 106 107 108
-1.812059534 2.133807167 -2.940359752 -0.562448922 -1.324227353 -1.233953786
109 110 111 112 113 114
-2.430779602 -2.876891053 -1.171245734 -1.611922770 -0.421655223 0.416090878
115 116 117 118 119 120
0.681217736 2.621813238 2.526288394 -1.715522143 0.284376222 3.069414963
121 122 123 124 125 126
0.622509484 1.469800111 -2.198287036 -0.808232407 2.288750543 1.107403957
127 128 129 130 131 132
0.575633979 -1.357681660 -0.478874415 -2.363266042 0.578550194 2.471599291
133 134 135 136 137 138
-1.449402661 -0.178841387 1.782781639 1.363556128 0.393753083 -3.629494410
139 140 141 142 143 144
4.947576657 -0.636843740 -0.240136668 -0.455485266 2.097666195 -0.221809478
145 146 147 148 149 150
1.126747330 -0.763739511 -3.364026478 -4.334623551 1.159131446 1.430523408
151 152 153 154 155 156
-0.142140530 0.978081879 -1.176415428 0.881131095 1.353007600 1.891453579
> postscript(file="/var/www/html/rcomp/tmp/6r2rk1291285607.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 = 156
Frequency = 1
lag(myerror, k = 1) myerror
0 1.579620436 NA
1 0.881641388 1.579620436
2 1.419663367 0.881641388
3 1.139020262 1.419663367
4 -0.707642946 1.139020262
5 2.734492197 -0.707642946
6 -1.797608180 2.734492197
7 -1.513742019 -1.797608180
8 -0.297265714 -1.513742019
9 2.984852141 -0.297265714
10 -2.363954568 2.984852141
11 -1.117390120 -2.363954568
12 2.741713906 -1.117390120
13 -4.296626408 2.741713906
14 -0.685610269 -4.296626408
15 0.005349849 -0.685610269
16 -2.113744852 0.005349849
17 -0.395765566 -2.113744852
18 1.266773859 -0.395765566
19 -3.536983332 1.266773859
20 2.310400895 -3.536983332
21 0.574309725 2.310400895
22 -0.656244643 0.574309725
23 2.471403958 -0.656244643
24 0.567225820 2.471403958
25 0.123326303 0.567225820
26 -5.665415287 0.123326303
27 0.474010052 -5.665415287
28 -0.249106631 0.474010052
29 5.178266092 -0.249106631
30 4.479786755 5.178266092
31 -1.619384570 4.479786755
32 -0.513924582 -1.619384570
33 0.917578530 -0.513924582
34 -1.494057573 0.917578530
35 1.725367755 -1.494057573
36 -0.909935408 1.725367755
37 0.794679345 -0.909935408
38 -0.082943252 0.794679345
39 0.749311494 -0.082943252
40 1.065631238 0.749311494
41 6.887621013 1.065631238
42 -4.770664791 6.887621013
43 -2.499252549 -4.770664791
44 -0.266966614 -2.499252549
45 2.186557927 -0.266966614
46 3.955730100 2.186557927
47 0.497651742 3.955730100
48 -2.961320317 0.497651742
49 -1.712060028 -2.961320317
50 -0.980115986 -1.712060028
51 -6.421566770 -0.980115986
52 -0.406038635 -6.421566770
53 -2.452855986 -0.406038635
54 1.607175931 -2.452855986
55 -0.442957502 1.607175931
56 0.215992381 -0.442957502
57 1.582534091 0.215992381
58 -2.287274975 1.582534091
59 -0.268948358 -2.287274975
60 -2.468780136 -0.268948358
61 1.999449887 -2.468780136
62 0.261591063 1.999449887
63 2.232521815 0.261591063
64 -0.945545349 2.232521815
65 1.711449417 -0.945545349
66 -2.050773293 1.711449417
67 2.524509841 -2.050773293
68 2.086044738 2.524509841
69 -0.593989035 2.086044738
70 2.567978302 -0.593989035
71 0.715823739 2.567978302
72 -1.051833387 0.715823739
73 -2.981679437 -1.051833387
74 -0.473702866 -2.981679437
75 -1.395592447 -0.473702866
76 -0.268774534 -1.395592447
77 0.105213648 -0.268774534
78 3.213989718 0.105213648
79 -1.989215082 3.213989718
80 -2.838420623 -1.989215082
81 2.024426452 -2.838420623
82 0.138363477 2.024426452
83 -1.244798628 0.138363477
84 4.278827991 -1.244798628
85 -0.403064331 4.278827991
86 -0.278401413 -0.403064331
87 -0.007262632 -0.278401413
88 0.995564476 -0.007262632
89 -0.222345804 0.995564476
90 0.874306746 -0.222345804
91 -3.503694404 0.874306746
92 0.691697437 -3.503694404
93 1.566668032 0.691697437
94 0.666967064 1.566668032
95 0.280525537 0.666967064
96 -2.221939756 0.280525537
97 -0.591927498 -2.221939756
98 -1.825607779 -0.591927498
99 0.595385960 -1.825607779
100 0.550413482 0.595385960
101 1.293009835 0.550413482
102 -1.812059534 1.293009835
103 2.133807167 -1.812059534
104 -2.940359752 2.133807167
105 -0.562448922 -2.940359752
106 -1.324227353 -0.562448922
107 -1.233953786 -1.324227353
108 -2.430779602 -1.233953786
109 -2.876891053 -2.430779602
110 -1.171245734 -2.876891053
111 -1.611922770 -1.171245734
112 -0.421655223 -1.611922770
113 0.416090878 -0.421655223
114 0.681217736 0.416090878
115 2.621813238 0.681217736
116 2.526288394 2.621813238
117 -1.715522143 2.526288394
118 0.284376222 -1.715522143
119 3.069414963 0.284376222
120 0.622509484 3.069414963
121 1.469800111 0.622509484
122 -2.198287036 1.469800111
123 -0.808232407 -2.198287036
124 2.288750543 -0.808232407
125 1.107403957 2.288750543
126 0.575633979 1.107403957
127 -1.357681660 0.575633979
128 -0.478874415 -1.357681660
129 -2.363266042 -0.478874415
130 0.578550194 -2.363266042
131 2.471599291 0.578550194
132 -1.449402661 2.471599291
133 -0.178841387 -1.449402661
134 1.782781639 -0.178841387
135 1.363556128 1.782781639
136 0.393753083 1.363556128
137 -3.629494410 0.393753083
138 4.947576657 -3.629494410
139 -0.636843740 4.947576657
140 -0.240136668 -0.636843740
141 -0.455485266 -0.240136668
142 2.097666195 -0.455485266
143 -0.221809478 2.097666195
144 1.126747330 -0.221809478
145 -0.763739511 1.126747330
146 -3.364026478 -0.763739511
147 -4.334623551 -3.364026478
148 1.159131446 -4.334623551
149 1.430523408 1.159131446
150 -0.142140530 1.430523408
151 0.978081879 -0.142140530
152 -1.176415428 0.978081879
153 0.881131095 -1.176415428
154 1.353007600 0.881131095
155 1.891453579 1.353007600
156 NA 1.891453579
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 0.881641388 1.579620436
[2,] 1.419663367 0.881641388
[3,] 1.139020262 1.419663367
[4,] -0.707642946 1.139020262
[5,] 2.734492197 -0.707642946
[6,] -1.797608180 2.734492197
[7,] -1.513742019 -1.797608180
[8,] -0.297265714 -1.513742019
[9,] 2.984852141 -0.297265714
[10,] -2.363954568 2.984852141
[11,] -1.117390120 -2.363954568
[12,] 2.741713906 -1.117390120
[13,] -4.296626408 2.741713906
[14,] -0.685610269 -4.296626408
[15,] 0.005349849 -0.685610269
[16,] -2.113744852 0.005349849
[17,] -0.395765566 -2.113744852
[18,] 1.266773859 -0.395765566
[19,] -3.536983332 1.266773859
[20,] 2.310400895 -3.536983332
[21,] 0.574309725 2.310400895
[22,] -0.656244643 0.574309725
[23,] 2.471403958 -0.656244643
[24,] 0.567225820 2.471403958
[25,] 0.123326303 0.567225820
[26,] -5.665415287 0.123326303
[27,] 0.474010052 -5.665415287
[28,] -0.249106631 0.474010052
[29,] 5.178266092 -0.249106631
[30,] 4.479786755 5.178266092
[31,] -1.619384570 4.479786755
[32,] -0.513924582 -1.619384570
[33,] 0.917578530 -0.513924582
[34,] -1.494057573 0.917578530
[35,] 1.725367755 -1.494057573
[36,] -0.909935408 1.725367755
[37,] 0.794679345 -0.909935408
[38,] -0.082943252 0.794679345
[39,] 0.749311494 -0.082943252
[40,] 1.065631238 0.749311494
[41,] 6.887621013 1.065631238
[42,] -4.770664791 6.887621013
[43,] -2.499252549 -4.770664791
[44,] -0.266966614 -2.499252549
[45,] 2.186557927 -0.266966614
[46,] 3.955730100 2.186557927
[47,] 0.497651742 3.955730100
[48,] -2.961320317 0.497651742
[49,] -1.712060028 -2.961320317
[50,] -0.980115986 -1.712060028
[51,] -6.421566770 -0.980115986
[52,] -0.406038635 -6.421566770
[53,] -2.452855986 -0.406038635
[54,] 1.607175931 -2.452855986
[55,] -0.442957502 1.607175931
[56,] 0.215992381 -0.442957502
[57,] 1.582534091 0.215992381
[58,] -2.287274975 1.582534091
[59,] -0.268948358 -2.287274975
[60,] -2.468780136 -0.268948358
[61,] 1.999449887 -2.468780136
[62,] 0.261591063 1.999449887
[63,] 2.232521815 0.261591063
[64,] -0.945545349 2.232521815
[65,] 1.711449417 -0.945545349
[66,] -2.050773293 1.711449417
[67,] 2.524509841 -2.050773293
[68,] 2.086044738 2.524509841
[69,] -0.593989035 2.086044738
[70,] 2.567978302 -0.593989035
[71,] 0.715823739 2.567978302
[72,] -1.051833387 0.715823739
[73,] -2.981679437 -1.051833387
[74,] -0.473702866 -2.981679437
[75,] -1.395592447 -0.473702866
[76,] -0.268774534 -1.395592447
[77,] 0.105213648 -0.268774534
[78,] 3.213989718 0.105213648
[79,] -1.989215082 3.213989718
[80,] -2.838420623 -1.989215082
[81,] 2.024426452 -2.838420623
[82,] 0.138363477 2.024426452
[83,] -1.244798628 0.138363477
[84,] 4.278827991 -1.244798628
[85,] -0.403064331 4.278827991
[86,] -0.278401413 -0.403064331
[87,] -0.007262632 -0.278401413
[88,] 0.995564476 -0.007262632
[89,] -0.222345804 0.995564476
[90,] 0.874306746 -0.222345804
[91,] -3.503694404 0.874306746
[92,] 0.691697437 -3.503694404
[93,] 1.566668032 0.691697437
[94,] 0.666967064 1.566668032
[95,] 0.280525537 0.666967064
[96,] -2.221939756 0.280525537
[97,] -0.591927498 -2.221939756
[98,] -1.825607779 -0.591927498
[99,] 0.595385960 -1.825607779
[100,] 0.550413482 0.595385960
[101,] 1.293009835 0.550413482
[102,] -1.812059534 1.293009835
[103,] 2.133807167 -1.812059534
[104,] -2.940359752 2.133807167
[105,] -0.562448922 -2.940359752
[106,] -1.324227353 -0.562448922
[107,] -1.233953786 -1.324227353
[108,] -2.430779602 -1.233953786
[109,] -2.876891053 -2.430779602
[110,] -1.171245734 -2.876891053
[111,] -1.611922770 -1.171245734
[112,] -0.421655223 -1.611922770
[113,] 0.416090878 -0.421655223
[114,] 0.681217736 0.416090878
[115,] 2.621813238 0.681217736
[116,] 2.526288394 2.621813238
[117,] -1.715522143 2.526288394
[118,] 0.284376222 -1.715522143
[119,] 3.069414963 0.284376222
[120,] 0.622509484 3.069414963
[121,] 1.469800111 0.622509484
[122,] -2.198287036 1.469800111
[123,] -0.808232407 -2.198287036
[124,] 2.288750543 -0.808232407
[125,] 1.107403957 2.288750543
[126,] 0.575633979 1.107403957
[127,] -1.357681660 0.575633979
[128,] -0.478874415 -1.357681660
[129,] -2.363266042 -0.478874415
[130,] 0.578550194 -2.363266042
[131,] 2.471599291 0.578550194
[132,] -1.449402661 2.471599291
[133,] -0.178841387 -1.449402661
[134,] 1.782781639 -0.178841387
[135,] 1.363556128 1.782781639
[136,] 0.393753083 1.363556128
[137,] -3.629494410 0.393753083
[138,] 4.947576657 -3.629494410
[139,] -0.636843740 4.947576657
[140,] -0.240136668 -0.636843740
[141,] -0.455485266 -0.240136668
[142,] 2.097666195 -0.455485266
[143,] -0.221809478 2.097666195
[144,] 1.126747330 -0.221809478
[145,] -0.763739511 1.126747330
[146,] -3.364026478 -0.763739511
[147,] -4.334623551 -3.364026478
[148,] 1.159131446 -4.334623551
[149,] 1.430523408 1.159131446
[150,] -0.142140530 1.430523408
[151,] 0.978081879 -0.142140530
[152,] -1.176415428 0.978081879
[153,] 0.881131095 -1.176415428
[154,] 1.353007600 0.881131095
[155,] 1.891453579 1.353007600
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 0.881641388 1.579620436
2 1.419663367 0.881641388
3 1.139020262 1.419663367
4 -0.707642946 1.139020262
5 2.734492197 -0.707642946
6 -1.797608180 2.734492197
7 -1.513742019 -1.797608180
8 -0.297265714 -1.513742019
9 2.984852141 -0.297265714
10 -2.363954568 2.984852141
11 -1.117390120 -2.363954568
12 2.741713906 -1.117390120
13 -4.296626408 2.741713906
14 -0.685610269 -4.296626408
15 0.005349849 -0.685610269
16 -2.113744852 0.005349849
17 -0.395765566 -2.113744852
18 1.266773859 -0.395765566
19 -3.536983332 1.266773859
20 2.310400895 -3.536983332
21 0.574309725 2.310400895
22 -0.656244643 0.574309725
23 2.471403958 -0.656244643
24 0.567225820 2.471403958
25 0.123326303 0.567225820
26 -5.665415287 0.123326303
27 0.474010052 -5.665415287
28 -0.249106631 0.474010052
29 5.178266092 -0.249106631
30 4.479786755 5.178266092
31 -1.619384570 4.479786755
32 -0.513924582 -1.619384570
33 0.917578530 -0.513924582
34 -1.494057573 0.917578530
35 1.725367755 -1.494057573
36 -0.909935408 1.725367755
37 0.794679345 -0.909935408
38 -0.082943252 0.794679345
39 0.749311494 -0.082943252
40 1.065631238 0.749311494
41 6.887621013 1.065631238
42 -4.770664791 6.887621013
43 -2.499252549 -4.770664791
44 -0.266966614 -2.499252549
45 2.186557927 -0.266966614
46 3.955730100 2.186557927
47 0.497651742 3.955730100
48 -2.961320317 0.497651742
49 -1.712060028 -2.961320317
50 -0.980115986 -1.712060028
51 -6.421566770 -0.980115986
52 -0.406038635 -6.421566770
53 -2.452855986 -0.406038635
54 1.607175931 -2.452855986
55 -0.442957502 1.607175931
56 0.215992381 -0.442957502
57 1.582534091 0.215992381
58 -2.287274975 1.582534091
59 -0.268948358 -2.287274975
60 -2.468780136 -0.268948358
61 1.999449887 -2.468780136
62 0.261591063 1.999449887
63 2.232521815 0.261591063
64 -0.945545349 2.232521815
65 1.711449417 -0.945545349
66 -2.050773293 1.711449417
67 2.524509841 -2.050773293
68 2.086044738 2.524509841
69 -0.593989035 2.086044738
70 2.567978302 -0.593989035
71 0.715823739 2.567978302
72 -1.051833387 0.715823739
73 -2.981679437 -1.051833387
74 -0.473702866 -2.981679437
75 -1.395592447 -0.473702866
76 -0.268774534 -1.395592447
77 0.105213648 -0.268774534
78 3.213989718 0.105213648
79 -1.989215082 3.213989718
80 -2.838420623 -1.989215082
81 2.024426452 -2.838420623
82 0.138363477 2.024426452
83 -1.244798628 0.138363477
84 4.278827991 -1.244798628
85 -0.403064331 4.278827991
86 -0.278401413 -0.403064331
87 -0.007262632 -0.278401413
88 0.995564476 -0.007262632
89 -0.222345804 0.995564476
90 0.874306746 -0.222345804
91 -3.503694404 0.874306746
92 0.691697437 -3.503694404
93 1.566668032 0.691697437
94 0.666967064 1.566668032
95 0.280525537 0.666967064
96 -2.221939756 0.280525537
97 -0.591927498 -2.221939756
98 -1.825607779 -0.591927498
99 0.595385960 -1.825607779
100 0.550413482 0.595385960
101 1.293009835 0.550413482
102 -1.812059534 1.293009835
103 2.133807167 -1.812059534
104 -2.940359752 2.133807167
105 -0.562448922 -2.940359752
106 -1.324227353 -0.562448922
107 -1.233953786 -1.324227353
108 -2.430779602 -1.233953786
109 -2.876891053 -2.430779602
110 -1.171245734 -2.876891053
111 -1.611922770 -1.171245734
112 -0.421655223 -1.611922770
113 0.416090878 -0.421655223
114 0.681217736 0.416090878
115 2.621813238 0.681217736
116 2.526288394 2.621813238
117 -1.715522143 2.526288394
118 0.284376222 -1.715522143
119 3.069414963 0.284376222
120 0.622509484 3.069414963
121 1.469800111 0.622509484
122 -2.198287036 1.469800111
123 -0.808232407 -2.198287036
124 2.288750543 -0.808232407
125 1.107403957 2.288750543
126 0.575633979 1.107403957
127 -1.357681660 0.575633979
128 -0.478874415 -1.357681660
129 -2.363266042 -0.478874415
130 0.578550194 -2.363266042
131 2.471599291 0.578550194
132 -1.449402661 2.471599291
133 -0.178841387 -1.449402661
134 1.782781639 -0.178841387
135 1.363556128 1.782781639
136 0.393753083 1.363556128
137 -3.629494410 0.393753083
138 4.947576657 -3.629494410
139 -0.636843740 4.947576657
140 -0.240136668 -0.636843740
141 -0.455485266 -0.240136668
142 2.097666195 -0.455485266
143 -0.221809478 2.097666195
144 1.126747330 -0.221809478
145 -0.763739511 1.126747330
146 -3.364026478 -0.763739511
147 -4.334623551 -3.364026478
148 1.159131446 -4.334623551
149 1.430523408 1.159131446
150 -0.142140530 1.430523408
151 0.978081879 -0.142140530
152 -1.176415428 0.978081879
153 0.881131095 -1.176415428
154 1.353007600 0.881131095
155 1.891453579 1.353007600
> 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/7jb9n1291285607.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/www/html/rcomp/tmp/8jb9n1291285607.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/www/html/rcomp/tmp/9ul881291285607.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/www/html/rcomp/tmp/10ul881291285607.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/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/11xl6e1291285607.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/12j4nk1291285607.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/13q52e1291285607.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/14ie1g1291285607.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/15mf0m1291285607.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/16pxga1291285607.tab")
+ }
>
> try(system("convert tmp/15ktw1291285607.ps tmp/15ktw1291285607.png",intern=TRUE))
character(0)
> try(system("convert tmp/2gbah1291285607.ps tmp/2gbah1291285607.png",intern=TRUE))
character(0)
> try(system("convert tmp/3gbah1291285607.ps tmp/3gbah1291285607.png",intern=TRUE))
character(0)
> try(system("convert tmp/4gbah1291285607.ps tmp/4gbah1291285607.png",intern=TRUE))
character(0)
> try(system("convert tmp/5r2rk1291285607.ps tmp/5r2rk1291285607.png",intern=TRUE))
character(0)
> try(system("convert tmp/6r2rk1291285607.ps tmp/6r2rk1291285607.png",intern=TRUE))
character(0)
> try(system("convert tmp/7jb9n1291285607.ps tmp/7jb9n1291285607.png",intern=TRUE))
character(0)
> try(system("convert tmp/8jb9n1291285607.ps tmp/8jb9n1291285607.png",intern=TRUE))
character(0)
> try(system("convert tmp/9ul881291285607.ps tmp/9ul881291285607.png",intern=TRUE))
character(0)
> try(system("convert tmp/10ul881291285607.ps tmp/10ul881291285607.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
4.049 1.884 12.442