R version 2.15.1 (2012-06-22) -- "Roasted Marshmallows"
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
+ ,41
+ ,12
+ ,12
+ ,13
+ ,2
+ ,39
+ ,11
+ ,11
+ ,16
+ ,3
+ ,30
+ ,15
+ ,14
+ ,19
+ ,4
+ ,31
+ ,6
+ ,12
+ ,15
+ ,5
+ ,34
+ ,13
+ ,21
+ ,14
+ ,6
+ ,35
+ ,10
+ ,12
+ ,13
+ ,7
+ ,39
+ ,12
+ ,22
+ ,19
+ ,8
+ ,34
+ ,14
+ ,11
+ ,15
+ ,9
+ ,36
+ ,12
+ ,10
+ ,14
+ ,10
+ ,37
+ ,6
+ ,13
+ ,15
+ ,11
+ ,38
+ ,10
+ ,10
+ ,16
+ ,12
+ ,36
+ ,12
+ ,8
+ ,16
+ ,13
+ ,38
+ ,12
+ ,15
+ ,16
+ ,14
+ ,39
+ ,11
+ ,14
+ ,16
+ ,15
+ ,33
+ ,15
+ ,10
+ ,17
+ ,16
+ ,32
+ ,12
+ ,14
+ ,15
+ ,17
+ ,36
+ ,10
+ ,14
+ ,15
+ ,18
+ ,38
+ ,12
+ ,11
+ ,20
+ ,19
+ ,39
+ ,11
+ ,10
+ ,18
+ ,20
+ ,32
+ ,12
+ ,13
+ ,16
+ ,21
+ ,32
+ ,11
+ ,7
+ ,16
+ ,22
+ ,31
+ ,12
+ ,14
+ ,16
+ ,23
+ ,39
+ ,13
+ ,12
+ ,19
+ ,24
+ ,37
+ ,11
+ ,14
+ ,16
+ ,25
+ ,39
+ ,9
+ ,11
+ ,17
+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
+ ,16
+ ,13)
+ ,dim=c(5
+ ,162)
+ ,dimnames=list(c('t'
+ ,'Connected'
+ ,'Software'
+ ,'Depression'
+ ,'Learning')
+ ,1:162))
> y <- array(NA,dim=c(5,162),dimnames=list(c('t','Connected','Software','Depression','Learning'),1:162))
> 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 = '5'
> par3 <- 'No Linear Trend'
> par2 <- 'Do not include Seasonal Dummies'
> par1 <- '5'
> #'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
Learning t Connected Software Depression
1 13 1 41 12 12
2 16 2 39 11 11
3 19 3 30 15 14
4 15 4 31 6 12
5 14 5 34 13 21
6 13 6 35 10 12
7 19 7 39 12 22
8 15 8 34 14 11
9 14 9 36 12 10
10 15 10 37 6 13
11 16 11 38 10 10
12 16 12 36 12 8
13 16 13 38 12 15
14 16 14 39 11 14
15 17 15 33 15 10
16 15 16 32 12 14
17 15 17 36 10 14
18 20 18 38 12 11
19 18 19 39 11 10
20 16 20 32 12 13
21 16 21 32 11 7
22 16 22 31 12 14
23 19 23 39 13 12
24 16 24 37 11 14
25 17 25 39 9 11
26 17 26 41 13 9
27 16 27 36 10 11
28 15 28 33 14 15
29 16 29 33 12 14
30 14 30 34 10 13
31 15 31 31 12 9
32 12 32 27 8 15
33 14 33 37 10 10
34 16 34 34 12 11
35 14 35 34 12 13
36 7 36 32 7 8
37 10 37 29 6 20
38 14 38 36 12 12
39 16 39 29 10 10
40 16 40 35 10 10
41 16 41 37 10 9
42 14 42 34 12 14
43 20 43 38 15 8
44 14 44 35 10 14
45 14 45 38 10 11
46 11 46 37 12 13
47 14 47 38 13 9
48 15 48 33 11 11
49 16 49 36 11 15
50 14 50 38 12 11
51 16 51 32 14 10
52 14 52 32 10 14
53 12 53 32 12 18
54 16 54 34 13 14
55 9 55 32 5 11
56 14 56 37 6 12
57 16 57 39 12 13
58 16 58 29 12 9
59 15 59 37 11 10
60 16 60 35 10 15
61 12 61 30 7 20
62 16 62 38 12 12
63 16 63 34 14 12
64 14 64 31 11 14
65 16 65 34 12 13
66 17 66 35 13 11
67 18 67 36 14 17
68 18 68 30 11 12
69 12 69 39 12 13
70 16 70 35 12 14
71 10 71 38 8 13
72 14 72 31 11 15
73 18 73 34 14 13
74 18 74 38 14 10
75 16 75 34 12 11
76 17 76 39 9 19
77 16 77 37 13 13
78 16 78 34 11 17
79 13 79 28 12 13
80 16 80 37 12 9
81 16 81 33 12 11
82 20 82 37 12 10
83 16 83 35 12 9
84 15 84 37 12 12
85 15 85 32 11 12
86 16 86 33 10 13
87 14 87 38 9 13
88 16 88 33 12 12
89 16 89 29 12 15
90 15 90 33 12 22
91 12 91 31 9 13
92 17 92 36 15 15
93 16 93 35 12 13
94 15 94 32 12 15
95 13 95 29 12 10
96 16 96 39 10 11
97 16 97 37 13 16
98 16 98 35 9 11
99 16 99 37 12 11
100 14 100 32 10 10
101 16 101 38 14 10
102 16 102 37 11 16
103 20 103 36 15 12
104 15 104 32 11 11
105 16 105 33 11 16
106 13 106 40 12 19
107 17 107 38 12 11
108 16 108 41 12 16
109 16 109 36 11 15
110 12 110 43 7 24
111 16 111 30 12 14
112 16 112 31 14 15
113 17 113 32 11 11
114 13 114 32 11 15
115 12 115 37 10 12
116 18 116 37 13 10
117 14 117 33 13 14
118 14 118 34 8 13
119 13 119 33 11 9
120 16 120 38 12 15
121 13 121 33 11 15
122 16 122 31 13 14
123 13 123 38 12 11
124 16 124 37 14 8
125 15 125 33 13 11
126 16 126 31 15 11
127 15 127 39 10 8
128 17 128 44 11 10
129 15 129 33 9 11
130 12 130 35 11 13
131 16 131 32 10 11
132 10 132 28 11 20
133 16 133 40 8 10
134 12 134 27 11 15
135 14 135 37 12 12
136 15 136 32 12 14
137 13 137 28 9 23
138 15 138 34 11 14
139 11 139 30 10 16
140 12 140 35 8 11
141 8 141 31 9 12
142 16 142 32 8 10
143 15 143 30 9 14
144 17 144 30 15 12
145 16 145 31 11 12
146 10 146 40 8 11
147 18 147 32 13 12
148 13 148 36 12 13
149 16 149 32 12 11
150 13 150 35 9 19
151 10 151 38 7 12
152 15 152 42 13 17
153 16 153 34 9 9
154 16 154 35 6 12
155 14 155 35 8 19
156 10 156 33 8 18
157 17 157 36 15 15
158 13 158 32 6 14
159 15 159 33 9 11
160 16 160 34 11 9
161 12 161 32 8 18
162 13 162 34 8 16
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) t Connected Software Depression
7.023400 -0.004043 0.104339 0.532416 -0.096130
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-6.1746 -1.0769 0.1839 1.1209 4.0199
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 7.023400 1.893738 3.709 0.000288 ***
t -0.004043 0.003147 -1.285 0.200765
Connected 0.104339 0.043364 2.406 0.017285 *
Software 0.532416 0.068683 7.752 1.06e-12 ***
Depression -0.096130 0.046568 -2.064 0.040634 *
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 1.832 on 157 degrees of freedom
Multiple R-squared: 0.3567, Adjusted R-squared: 0.3404
F-statistic: 21.77 on 4 and 157 DF, p-value: 2.633e-14
> 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.96970984 0.06058031 0.03029016
[2,] 0.93885842 0.12228315 0.06114158
[3,] 0.90997740 0.18004519 0.09002260
[4,] 0.88515463 0.22969074 0.11484537
[5,] 0.83250470 0.33499060 0.16749530
[6,] 0.76048150 0.47903700 0.23951850
[7,] 0.67702854 0.64594292 0.32297146
[8,] 0.58828132 0.82343737 0.41171868
[9,] 0.56875911 0.86248179 0.43124089
[10,] 0.49404009 0.98808018 0.50595991
[11,] 0.73921876 0.52156248 0.26078124
[12,] 0.71086973 0.57826055 0.28913027
[13,] 0.66280010 0.67439980 0.33719990
[14,] 0.59367920 0.81264159 0.40632080
[15,] 0.53938907 0.92122186 0.46061093
[16,] 0.51023922 0.97952155 0.48976078
[17,] 0.47611345 0.95222691 0.52388655
[18,] 0.42751403 0.85502805 0.57248597
[19,] 0.37611635 0.75223270 0.62388365
[20,] 0.33135402 0.66270804 0.66864598
[21,] 0.37916265 0.75832530 0.62083735
[22,] 0.32947633 0.65895266 0.67052367
[23,] 0.34548279 0.69096557 0.65451721
[24,] 0.30424943 0.60849887 0.69575057
[25,] 0.30859832 0.61719663 0.69140168
[26,] 0.30931634 0.61863268 0.69068366
[27,] 0.25892881 0.51785762 0.74107119
[28,] 0.25734120 0.51468240 0.74265880
[29,] 0.77518733 0.44962534 0.22481267
[30,] 0.75301265 0.49397470 0.24698735
[31,] 0.73659361 0.52681279 0.26340639
[32,] 0.77760873 0.44478254 0.22239127
[33,] 0.76205660 0.47588680 0.23794340
[34,] 0.73212565 0.53574870 0.26787435
[35,] 0.70642084 0.58715832 0.29357916
[36,] 0.72433984 0.55132031 0.27566016
[37,] 0.68137098 0.63725805 0.31862902
[38,] 0.64816203 0.70367595 0.35183797
[39,] 0.84249052 0.31501895 0.15750948
[40,] 0.85794938 0.28410124 0.14205062
[41,] 0.83324251 0.33351499 0.16675749
[42,] 0.82086531 0.35826937 0.17913469
[43,] 0.81404668 0.37190663 0.18595332
[44,] 0.78446122 0.43107757 0.21553878
[45,] 0.75056597 0.49886806 0.24943403
[46,] 0.77139206 0.45721587 0.22860794
[47,] 0.74304177 0.51391645 0.25695823
[48,] 0.76952156 0.46095688 0.23047844
[49,] 0.76645392 0.46709216 0.23354608
[50,] 0.73221118 0.53557763 0.26778882
[51,] 0.72257372 0.55485256 0.27742628
[52,] 0.68627830 0.62744340 0.31372170
[53,] 0.69489510 0.61020979 0.30510490
[54,] 0.65617695 0.68764610 0.34382305
[55,] 0.61476517 0.77046966 0.38523483
[56,] 0.57403465 0.85193070 0.42596535
[57,] 0.53330570 0.93338861 0.46669430
[58,] 0.49913422 0.99826844 0.50086578
[59,] 0.46936967 0.93873933 0.53063033
[60,] 0.46498387 0.92996775 0.53501613
[61,] 0.59340814 0.81318372 0.40659186
[62,] 0.73605808 0.52788384 0.26394192
[63,] 0.70260517 0.59478966 0.29739483
[64,] 0.81284540 0.37430920 0.18715460
[65,] 0.78402510 0.43194979 0.21597490
[66,] 0.77625027 0.44749947 0.22374973
[67,] 0.75107131 0.49785738 0.24892869
[68,] 0.71745695 0.56508611 0.28254305
[69,] 0.78574337 0.42851326 0.21425663
[70,] 0.75167823 0.49664355 0.24832177
[71,] 0.73649307 0.52701386 0.26350693
[72,] 0.73715588 0.52568823 0.26284412
[73,] 0.70159378 0.59681243 0.29840622
[74,] 0.66541163 0.66917675 0.33458837
[75,] 0.79806107 0.40387785 0.20193893
[76,] 0.76485565 0.47028871 0.23514435
[77,] 0.73694844 0.52610312 0.26305156
[78,] 0.69899632 0.60200737 0.30100368
[79,] 0.69058233 0.61883534 0.30941767
[80,] 0.65020866 0.69958268 0.34979134
[81,] 0.61006547 0.77986905 0.38993453
[82,] 0.58556198 0.82887604 0.41443802
[83,] 0.55124164 0.89751673 0.44875836
[84,] 0.53918272 0.92163456 0.46081728
[85,] 0.49525109 0.99050219 0.50474891
[86,] 0.45216199 0.90432398 0.54783801
[87,] 0.40666020 0.81332041 0.59333980
[88,] 0.43219567 0.86439134 0.56780433
[89,] 0.39614350 0.79228700 0.60385650
[90,] 0.35422769 0.70845537 0.64577231
[91,] 0.35090095 0.70180190 0.64909905
[92,] 0.30838816 0.61677632 0.69161184
[93,] 0.27282119 0.54564239 0.72717881
[94,] 0.24838024 0.49676049 0.75161976
[95,] 0.22862014 0.45724027 0.77137986
[96,] 0.28561969 0.57123938 0.71438031
[97,] 0.24660132 0.49320265 0.75339868
[98,] 0.24356809 0.48713618 0.75643191
[99,] 0.25697919 0.51395838 0.74302081
[100,] 0.23622565 0.47245130 0.76377435
[101,] 0.21198770 0.42397541 0.78801230
[102,] 0.20516798 0.41033595 0.79483202
[103,] 0.19726270 0.39452540 0.80273730
[104,] 0.18792274 0.37584549 0.81207726
[105,] 0.16568473 0.33136947 0.83431527
[106,] 0.19669610 0.39339219 0.80330390
[107,] 0.17220893 0.34441785 0.82779107
[108,] 0.18014196 0.36028391 0.81985804
[109,] 0.19360865 0.38721730 0.80639135
[110,] 0.17130377 0.34260755 0.82869623
[111,] 0.15946540 0.31893081 0.84053460
[112,] 0.15515091 0.31030183 0.84484909
[113,] 0.15753383 0.31506767 0.84246617
[114,] 0.13348799 0.26697598 0.86651201
[115,] 0.12425828 0.24851657 0.87574172
[116,] 0.13015288 0.26030577 0.86984712
[117,] 0.10714888 0.21429775 0.89285112
[118,] 0.08534976 0.17069952 0.91465024
[119,] 0.06666328 0.13332657 0.93333672
[120,] 0.05053794 0.10107587 0.94946206
[121,] 0.05369625 0.10739250 0.94630375
[122,] 0.05036291 0.10072583 0.94963709
[123,] 0.05052643 0.10105286 0.94947357
[124,] 0.05488872 0.10977745 0.94511128
[125,] 0.06759917 0.13519834 0.93240083
[126,] 0.13498125 0.26996251 0.86501875
[127,] 0.13710194 0.27420388 0.86289806
[128,] 0.10980325 0.21960650 0.89019675
[129,] 0.08556016 0.17112033 0.91443984
[130,] 0.08026934 0.16053867 0.91973066
[131,] 0.07772501 0.15545002 0.92227499
[132,] 0.07345005 0.14690011 0.92654995
[133,] 0.05346338 0.10692677 0.94653662
[134,] 0.47925188 0.95850376 0.52074812
[135,] 0.49395296 0.98790592 0.50604704
[136,] 0.44429968 0.88859935 0.55570032
[137,] 0.38912889 0.77825778 0.61087111
[138,] 0.32013571 0.64027141 0.67986429
[139,] 0.38716607 0.77433214 0.61283393
[140,] 0.38760031 0.77520061 0.61239969
[141,] 0.41434424 0.82868848 0.58565576
[142,] 0.32784571 0.65569143 0.67215429
[143,] 0.24087880 0.48175761 0.75912120
[144,] 0.70275521 0.59448957 0.29724479
[145,] 0.85114047 0.29771905 0.14885953
[146,] 0.74379330 0.51241340 0.25620670
[147,] 0.60128763 0.79742475 0.39871237
> postscript(file="/var/fisher/rcomp/tmp/1g2y21351952341.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/2ibkj1351952341.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/38pry1351952341.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/4s8on1351952341.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/5iyfd1351952341.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 = 162
Frequency = 1
1 2 3 4 5 6
-3.532686631 0.116320732 2.218140948 2.717329168 -1.453386445 -1.821603801
7 8 9 10 11 12
3.661551421 -1.934971855 -2.170904429 2.211685714 0.693336369 -0.351034142
13 14 15 16 17 18
0.117241074 0.453231507 -0.430874968 -0.340724814 0.310794625 3.752938242
19 20 21 22 23 24
2.088928675 0.579318846 0.538998425 0.787874601 2.232530295 0.702343524
25 26 27 28 29 30
2.274151018 -0.252407337 1.062838791 -1.365244886 0.607500493 -0.524093105
31 32 33 34 35 36
-0.656384571 -0.528541586 -1.113369713 0.234988651 -1.568708011 -6.174556636
37 38 39 40 41 42
-1.171520739 -1.861385710 1.745602537 1.123612085 0.822847573 -1.444274200
43 44 45 46 47 48
1.968385597 -0.475694425 -1.073057846 -4.837247469 -2.854478873 -0.071648714
49 50 51 52 53 54
1.003897628 -2.117672752 -0.648557391 -0.130330244 -2.806598912 0.071830708
55 56 57 58 59 60
-2.744510077 1.301552444 -0.001447952 0.661465355 -0.540657115 1.685130044
61 62 63 64 65 66
0.288766070 0.026978091 -0.616454535 -0.509886360 0.552594182 0.727622711
67 68 69 70 71 72
1.671690968 3.418366310 -3.952927074 0.564602204 -3.710837408 -0.381409142
73 74 75 76 77 78
1.520109495 0.818407098 0.400768314 3.249404474 -0.244317839 1.522094299
79 80 81 82 83 84
-1.764764269 -0.084291515 0.529367729 4.019925264 0.136516657 -0.779727991
85 86 87 88 89 90
0.278426267 1.806676632 -0.178558875 0.653801541 1.363590751 0.623188013
91 92 93 94 95 96
-1.432012414 0.048100227 0.561470586 0.070790854 -2.092798641 1.028816906
97 98 99 100 101 102
0.124940188 1.986675593 0.184793139 -0.320766600 -1.072420928 1.209989158
103 104 105 106 107 108
2.804187800 0.259121023 1.639475283 -2.330880217 1.112801414 0.284477722
109 110 111 112 113 114
1.246502013 -0.484993845 1.252076750 0.183079207 2.295511681 -1.315925049
115 116 117 118 119 120
-2.589550453 1.624985114 -1.569095710 0.896558600 -1.976826789 0.549885562
121 122 123 124 125 126
-1.391960180 0.659799275 -2.822504083 -1.067343536 -0.825138357 -0.677248936
127 128 129 130 131 132
-0.134227393 1.007965094 1.320699146 -2.756507407 1.900708966 -3.345137997
133 134 135 136 137 138
2.042785939 -1.713362038 -1.573514263 0.144483958 1.028300871 0.476308787
139 140 141 142 143 144
-2.377616000 -1.311085367 -5.325972058 2.913888409 1.978713663 0.596001323
145 146 147 148 149 150
1.625369629 -3.808519811 2.464285527 -2.320481037 0.908658343 -0.034027544
151 152 153 154 155 156
-2.951078891 -1.078237375 2.121141992 3.906484227 1.518605457 -2.364803149
157 158 159 160 161 162
0.310921646 1.427934714 1.442001339 1.084613898 -0.240247141 0.362858381
> postscript(file="/var/fisher/rcomp/tmp/64win1351952341.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 = 162
Frequency = 1
lag(myerror, k = 1) myerror
0 -3.532686631 NA
1 0.116320732 -3.532686631
2 2.218140948 0.116320732
3 2.717329168 2.218140948
4 -1.453386445 2.717329168
5 -1.821603801 -1.453386445
6 3.661551421 -1.821603801
7 -1.934971855 3.661551421
8 -2.170904429 -1.934971855
9 2.211685714 -2.170904429
10 0.693336369 2.211685714
11 -0.351034142 0.693336369
12 0.117241074 -0.351034142
13 0.453231507 0.117241074
14 -0.430874968 0.453231507
15 -0.340724814 -0.430874968
16 0.310794625 -0.340724814
17 3.752938242 0.310794625
18 2.088928675 3.752938242
19 0.579318846 2.088928675
20 0.538998425 0.579318846
21 0.787874601 0.538998425
22 2.232530295 0.787874601
23 0.702343524 2.232530295
24 2.274151018 0.702343524
25 -0.252407337 2.274151018
26 1.062838791 -0.252407337
27 -1.365244886 1.062838791
28 0.607500493 -1.365244886
29 -0.524093105 0.607500493
30 -0.656384571 -0.524093105
31 -0.528541586 -0.656384571
32 -1.113369713 -0.528541586
33 0.234988651 -1.113369713
34 -1.568708011 0.234988651
35 -6.174556636 -1.568708011
36 -1.171520739 -6.174556636
37 -1.861385710 -1.171520739
38 1.745602537 -1.861385710
39 1.123612085 1.745602537
40 0.822847573 1.123612085
41 -1.444274200 0.822847573
42 1.968385597 -1.444274200
43 -0.475694425 1.968385597
44 -1.073057846 -0.475694425
45 -4.837247469 -1.073057846
46 -2.854478873 -4.837247469
47 -0.071648714 -2.854478873
48 1.003897628 -0.071648714
49 -2.117672752 1.003897628
50 -0.648557391 -2.117672752
51 -0.130330244 -0.648557391
52 -2.806598912 -0.130330244
53 0.071830708 -2.806598912
54 -2.744510077 0.071830708
55 1.301552444 -2.744510077
56 -0.001447952 1.301552444
57 0.661465355 -0.001447952
58 -0.540657115 0.661465355
59 1.685130044 -0.540657115
60 0.288766070 1.685130044
61 0.026978091 0.288766070
62 -0.616454535 0.026978091
63 -0.509886360 -0.616454535
64 0.552594182 -0.509886360
65 0.727622711 0.552594182
66 1.671690968 0.727622711
67 3.418366310 1.671690968
68 -3.952927074 3.418366310
69 0.564602204 -3.952927074
70 -3.710837408 0.564602204
71 -0.381409142 -3.710837408
72 1.520109495 -0.381409142
73 0.818407098 1.520109495
74 0.400768314 0.818407098
75 3.249404474 0.400768314
76 -0.244317839 3.249404474
77 1.522094299 -0.244317839
78 -1.764764269 1.522094299
79 -0.084291515 -1.764764269
80 0.529367729 -0.084291515
81 4.019925264 0.529367729
82 0.136516657 4.019925264
83 -0.779727991 0.136516657
84 0.278426267 -0.779727991
85 1.806676632 0.278426267
86 -0.178558875 1.806676632
87 0.653801541 -0.178558875
88 1.363590751 0.653801541
89 0.623188013 1.363590751
90 -1.432012414 0.623188013
91 0.048100227 -1.432012414
92 0.561470586 0.048100227
93 0.070790854 0.561470586
94 -2.092798641 0.070790854
95 1.028816906 -2.092798641
96 0.124940188 1.028816906
97 1.986675593 0.124940188
98 0.184793139 1.986675593
99 -0.320766600 0.184793139
100 -1.072420928 -0.320766600
101 1.209989158 -1.072420928
102 2.804187800 1.209989158
103 0.259121023 2.804187800
104 1.639475283 0.259121023
105 -2.330880217 1.639475283
106 1.112801414 -2.330880217
107 0.284477722 1.112801414
108 1.246502013 0.284477722
109 -0.484993845 1.246502013
110 1.252076750 -0.484993845
111 0.183079207 1.252076750
112 2.295511681 0.183079207
113 -1.315925049 2.295511681
114 -2.589550453 -1.315925049
115 1.624985114 -2.589550453
116 -1.569095710 1.624985114
117 0.896558600 -1.569095710
118 -1.976826789 0.896558600
119 0.549885562 -1.976826789
120 -1.391960180 0.549885562
121 0.659799275 -1.391960180
122 -2.822504083 0.659799275
123 -1.067343536 -2.822504083
124 -0.825138357 -1.067343536
125 -0.677248936 -0.825138357
126 -0.134227393 -0.677248936
127 1.007965094 -0.134227393
128 1.320699146 1.007965094
129 -2.756507407 1.320699146
130 1.900708966 -2.756507407
131 -3.345137997 1.900708966
132 2.042785939 -3.345137997
133 -1.713362038 2.042785939
134 -1.573514263 -1.713362038
135 0.144483958 -1.573514263
136 1.028300871 0.144483958
137 0.476308787 1.028300871
138 -2.377616000 0.476308787
139 -1.311085367 -2.377616000
140 -5.325972058 -1.311085367
141 2.913888409 -5.325972058
142 1.978713663 2.913888409
143 0.596001323 1.978713663
144 1.625369629 0.596001323
145 -3.808519811 1.625369629
146 2.464285527 -3.808519811
147 -2.320481037 2.464285527
148 0.908658343 -2.320481037
149 -0.034027544 0.908658343
150 -2.951078891 -0.034027544
151 -1.078237375 -2.951078891
152 2.121141992 -1.078237375
153 3.906484227 2.121141992
154 1.518605457 3.906484227
155 -2.364803149 1.518605457
156 0.310921646 -2.364803149
157 1.427934714 0.310921646
158 1.442001339 1.427934714
159 1.084613898 1.442001339
160 -0.240247141 1.084613898
161 0.362858381 -0.240247141
162 NA 0.362858381
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 0.116320732 -3.532686631
[2,] 2.218140948 0.116320732
[3,] 2.717329168 2.218140948
[4,] -1.453386445 2.717329168
[5,] -1.821603801 -1.453386445
[6,] 3.661551421 -1.821603801
[7,] -1.934971855 3.661551421
[8,] -2.170904429 -1.934971855
[9,] 2.211685714 -2.170904429
[10,] 0.693336369 2.211685714
[11,] -0.351034142 0.693336369
[12,] 0.117241074 -0.351034142
[13,] 0.453231507 0.117241074
[14,] -0.430874968 0.453231507
[15,] -0.340724814 -0.430874968
[16,] 0.310794625 -0.340724814
[17,] 3.752938242 0.310794625
[18,] 2.088928675 3.752938242
[19,] 0.579318846 2.088928675
[20,] 0.538998425 0.579318846
[21,] 0.787874601 0.538998425
[22,] 2.232530295 0.787874601
[23,] 0.702343524 2.232530295
[24,] 2.274151018 0.702343524
[25,] -0.252407337 2.274151018
[26,] 1.062838791 -0.252407337
[27,] -1.365244886 1.062838791
[28,] 0.607500493 -1.365244886
[29,] -0.524093105 0.607500493
[30,] -0.656384571 -0.524093105
[31,] -0.528541586 -0.656384571
[32,] -1.113369713 -0.528541586
[33,] 0.234988651 -1.113369713
[34,] -1.568708011 0.234988651
[35,] -6.174556636 -1.568708011
[36,] -1.171520739 -6.174556636
[37,] -1.861385710 -1.171520739
[38,] 1.745602537 -1.861385710
[39,] 1.123612085 1.745602537
[40,] 0.822847573 1.123612085
[41,] -1.444274200 0.822847573
[42,] 1.968385597 -1.444274200
[43,] -0.475694425 1.968385597
[44,] -1.073057846 -0.475694425
[45,] -4.837247469 -1.073057846
[46,] -2.854478873 -4.837247469
[47,] -0.071648714 -2.854478873
[48,] 1.003897628 -0.071648714
[49,] -2.117672752 1.003897628
[50,] -0.648557391 -2.117672752
[51,] -0.130330244 -0.648557391
[52,] -2.806598912 -0.130330244
[53,] 0.071830708 -2.806598912
[54,] -2.744510077 0.071830708
[55,] 1.301552444 -2.744510077
[56,] -0.001447952 1.301552444
[57,] 0.661465355 -0.001447952
[58,] -0.540657115 0.661465355
[59,] 1.685130044 -0.540657115
[60,] 0.288766070 1.685130044
[61,] 0.026978091 0.288766070
[62,] -0.616454535 0.026978091
[63,] -0.509886360 -0.616454535
[64,] 0.552594182 -0.509886360
[65,] 0.727622711 0.552594182
[66,] 1.671690968 0.727622711
[67,] 3.418366310 1.671690968
[68,] -3.952927074 3.418366310
[69,] 0.564602204 -3.952927074
[70,] -3.710837408 0.564602204
[71,] -0.381409142 -3.710837408
[72,] 1.520109495 -0.381409142
[73,] 0.818407098 1.520109495
[74,] 0.400768314 0.818407098
[75,] 3.249404474 0.400768314
[76,] -0.244317839 3.249404474
[77,] 1.522094299 -0.244317839
[78,] -1.764764269 1.522094299
[79,] -0.084291515 -1.764764269
[80,] 0.529367729 -0.084291515
[81,] 4.019925264 0.529367729
[82,] 0.136516657 4.019925264
[83,] -0.779727991 0.136516657
[84,] 0.278426267 -0.779727991
[85,] 1.806676632 0.278426267
[86,] -0.178558875 1.806676632
[87,] 0.653801541 -0.178558875
[88,] 1.363590751 0.653801541
[89,] 0.623188013 1.363590751
[90,] -1.432012414 0.623188013
[91,] 0.048100227 -1.432012414
[92,] 0.561470586 0.048100227
[93,] 0.070790854 0.561470586
[94,] -2.092798641 0.070790854
[95,] 1.028816906 -2.092798641
[96,] 0.124940188 1.028816906
[97,] 1.986675593 0.124940188
[98,] 0.184793139 1.986675593
[99,] -0.320766600 0.184793139
[100,] -1.072420928 -0.320766600
[101,] 1.209989158 -1.072420928
[102,] 2.804187800 1.209989158
[103,] 0.259121023 2.804187800
[104,] 1.639475283 0.259121023
[105,] -2.330880217 1.639475283
[106,] 1.112801414 -2.330880217
[107,] 0.284477722 1.112801414
[108,] 1.246502013 0.284477722
[109,] -0.484993845 1.246502013
[110,] 1.252076750 -0.484993845
[111,] 0.183079207 1.252076750
[112,] 2.295511681 0.183079207
[113,] -1.315925049 2.295511681
[114,] -2.589550453 -1.315925049
[115,] 1.624985114 -2.589550453
[116,] -1.569095710 1.624985114
[117,] 0.896558600 -1.569095710
[118,] -1.976826789 0.896558600
[119,] 0.549885562 -1.976826789
[120,] -1.391960180 0.549885562
[121,] 0.659799275 -1.391960180
[122,] -2.822504083 0.659799275
[123,] -1.067343536 -2.822504083
[124,] -0.825138357 -1.067343536
[125,] -0.677248936 -0.825138357
[126,] -0.134227393 -0.677248936
[127,] 1.007965094 -0.134227393
[128,] 1.320699146 1.007965094
[129,] -2.756507407 1.320699146
[130,] 1.900708966 -2.756507407
[131,] -3.345137997 1.900708966
[132,] 2.042785939 -3.345137997
[133,] -1.713362038 2.042785939
[134,] -1.573514263 -1.713362038
[135,] 0.144483958 -1.573514263
[136,] 1.028300871 0.144483958
[137,] 0.476308787 1.028300871
[138,] -2.377616000 0.476308787
[139,] -1.311085367 -2.377616000
[140,] -5.325972058 -1.311085367
[141,] 2.913888409 -5.325972058
[142,] 1.978713663 2.913888409
[143,] 0.596001323 1.978713663
[144,] 1.625369629 0.596001323
[145,] -3.808519811 1.625369629
[146,] 2.464285527 -3.808519811
[147,] -2.320481037 2.464285527
[148,] 0.908658343 -2.320481037
[149,] -0.034027544 0.908658343
[150,] -2.951078891 -0.034027544
[151,] -1.078237375 -2.951078891
[152,] 2.121141992 -1.078237375
[153,] 3.906484227 2.121141992
[154,] 1.518605457 3.906484227
[155,] -2.364803149 1.518605457
[156,] 0.310921646 -2.364803149
[157,] 1.427934714 0.310921646
[158,] 1.442001339 1.427934714
[159,] 1.084613898 1.442001339
[160,] -0.240247141 1.084613898
[161,] 0.362858381 -0.240247141
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 0.116320732 -3.532686631
2 2.218140948 0.116320732
3 2.717329168 2.218140948
4 -1.453386445 2.717329168
5 -1.821603801 -1.453386445
6 3.661551421 -1.821603801
7 -1.934971855 3.661551421
8 -2.170904429 -1.934971855
9 2.211685714 -2.170904429
10 0.693336369 2.211685714
11 -0.351034142 0.693336369
12 0.117241074 -0.351034142
13 0.453231507 0.117241074
14 -0.430874968 0.453231507
15 -0.340724814 -0.430874968
16 0.310794625 -0.340724814
17 3.752938242 0.310794625
18 2.088928675 3.752938242
19 0.579318846 2.088928675
20 0.538998425 0.579318846
21 0.787874601 0.538998425
22 2.232530295 0.787874601
23 0.702343524 2.232530295
24 2.274151018 0.702343524
25 -0.252407337 2.274151018
26 1.062838791 -0.252407337
27 -1.365244886 1.062838791
28 0.607500493 -1.365244886
29 -0.524093105 0.607500493
30 -0.656384571 -0.524093105
31 -0.528541586 -0.656384571
32 -1.113369713 -0.528541586
33 0.234988651 -1.113369713
34 -1.568708011 0.234988651
35 -6.174556636 -1.568708011
36 -1.171520739 -6.174556636
37 -1.861385710 -1.171520739
38 1.745602537 -1.861385710
39 1.123612085 1.745602537
40 0.822847573 1.123612085
41 -1.444274200 0.822847573
42 1.968385597 -1.444274200
43 -0.475694425 1.968385597
44 -1.073057846 -0.475694425
45 -4.837247469 -1.073057846
46 -2.854478873 -4.837247469
47 -0.071648714 -2.854478873
48 1.003897628 -0.071648714
49 -2.117672752 1.003897628
50 -0.648557391 -2.117672752
51 -0.130330244 -0.648557391
52 -2.806598912 -0.130330244
53 0.071830708 -2.806598912
54 -2.744510077 0.071830708
55 1.301552444 -2.744510077
56 -0.001447952 1.301552444
57 0.661465355 -0.001447952
58 -0.540657115 0.661465355
59 1.685130044 -0.540657115
60 0.288766070 1.685130044
61 0.026978091 0.288766070
62 -0.616454535 0.026978091
63 -0.509886360 -0.616454535
64 0.552594182 -0.509886360
65 0.727622711 0.552594182
66 1.671690968 0.727622711
67 3.418366310 1.671690968
68 -3.952927074 3.418366310
69 0.564602204 -3.952927074
70 -3.710837408 0.564602204
71 -0.381409142 -3.710837408
72 1.520109495 -0.381409142
73 0.818407098 1.520109495
74 0.400768314 0.818407098
75 3.249404474 0.400768314
76 -0.244317839 3.249404474
77 1.522094299 -0.244317839
78 -1.764764269 1.522094299
79 -0.084291515 -1.764764269
80 0.529367729 -0.084291515
81 4.019925264 0.529367729
82 0.136516657 4.019925264
83 -0.779727991 0.136516657
84 0.278426267 -0.779727991
85 1.806676632 0.278426267
86 -0.178558875 1.806676632
87 0.653801541 -0.178558875
88 1.363590751 0.653801541
89 0.623188013 1.363590751
90 -1.432012414 0.623188013
91 0.048100227 -1.432012414
92 0.561470586 0.048100227
93 0.070790854 0.561470586
94 -2.092798641 0.070790854
95 1.028816906 -2.092798641
96 0.124940188 1.028816906
97 1.986675593 0.124940188
98 0.184793139 1.986675593
99 -0.320766600 0.184793139
100 -1.072420928 -0.320766600
101 1.209989158 -1.072420928
102 2.804187800 1.209989158
103 0.259121023 2.804187800
104 1.639475283 0.259121023
105 -2.330880217 1.639475283
106 1.112801414 -2.330880217
107 0.284477722 1.112801414
108 1.246502013 0.284477722
109 -0.484993845 1.246502013
110 1.252076750 -0.484993845
111 0.183079207 1.252076750
112 2.295511681 0.183079207
113 -1.315925049 2.295511681
114 -2.589550453 -1.315925049
115 1.624985114 -2.589550453
116 -1.569095710 1.624985114
117 0.896558600 -1.569095710
118 -1.976826789 0.896558600
119 0.549885562 -1.976826789
120 -1.391960180 0.549885562
121 0.659799275 -1.391960180
122 -2.822504083 0.659799275
123 -1.067343536 -2.822504083
124 -0.825138357 -1.067343536
125 -0.677248936 -0.825138357
126 -0.134227393 -0.677248936
127 1.007965094 -0.134227393
128 1.320699146 1.007965094
129 -2.756507407 1.320699146
130 1.900708966 -2.756507407
131 -3.345137997 1.900708966
132 2.042785939 -3.345137997
133 -1.713362038 2.042785939
134 -1.573514263 -1.713362038
135 0.144483958 -1.573514263
136 1.028300871 0.144483958
137 0.476308787 1.028300871
138 -2.377616000 0.476308787
139 -1.311085367 -2.377616000
140 -5.325972058 -1.311085367
141 2.913888409 -5.325972058
142 1.978713663 2.913888409
143 0.596001323 1.978713663
144 1.625369629 0.596001323
145 -3.808519811 1.625369629
146 2.464285527 -3.808519811
147 -2.320481037 2.464285527
148 0.908658343 -2.320481037
149 -0.034027544 0.908658343
150 -2.951078891 -0.034027544
151 -1.078237375 -2.951078891
152 2.121141992 -1.078237375
153 3.906484227 2.121141992
154 1.518605457 3.906484227
155 -2.364803149 1.518605457
156 0.310921646 -2.364803149
157 1.427934714 0.310921646
158 1.442001339 1.427934714
159 1.084613898 1.442001339
160 -0.240247141 1.084613898
161 0.362858381 -0.240247141
> 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/7t9aa1351952341.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/8b7ha1351952341.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/9coh71351952341.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/10g0621351952341.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/112d0d1351952341.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/12pa6h1351952341.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/13mt6s1351952341.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/14so941351952341.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/15xf9q1351952341.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/1663z91351952342.tab")
+ }
>
> try(system("convert tmp/1g2y21351952341.ps tmp/1g2y21351952341.png",intern=TRUE))
character(0)
> try(system("convert tmp/2ibkj1351952341.ps tmp/2ibkj1351952341.png",intern=TRUE))
character(0)
> try(system("convert tmp/38pry1351952341.ps tmp/38pry1351952341.png",intern=TRUE))
character(0)
> try(system("convert tmp/4s8on1351952341.ps tmp/4s8on1351952341.png",intern=TRUE))
character(0)
> try(system("convert tmp/5iyfd1351952341.ps tmp/5iyfd1351952341.png",intern=TRUE))
character(0)
> try(system("convert tmp/64win1351952341.ps tmp/64win1351952341.png",intern=TRUE))
character(0)
> try(system("convert tmp/7t9aa1351952341.ps tmp/7t9aa1351952341.png",intern=TRUE))
character(0)
> try(system("convert tmp/8b7ha1351952341.ps tmp/8b7ha1351952341.png",intern=TRUE))
character(0)
> try(system("convert tmp/9coh71351952341.ps tmp/9coh71351952341.png",intern=TRUE))
character(0)
> try(system("convert tmp/10g0621351952341.ps tmp/10g0621351952341.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
7.810 1.157 8.978