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(32
+ ,33
+ ,16
+ ,11
+ ,18
+ ,7
+ ,66
+ ,31
+ ,31
+ ,16
+ ,12
+ ,11
+ ,14
+ ,68
+ ,39
+ ,38
+ ,19
+ ,13
+ ,14
+ ,12
+ ,54
+ ,37
+ ,39
+ ,16
+ ,11
+ ,12
+ ,14
+ ,56
+ ,39
+ ,32
+ ,17
+ ,9
+ ,17
+ ,11
+ ,86
+ ,41
+ ,32
+ ,17
+ ,13
+ ,9
+ ,9
+ ,80
+ ,36
+ ,35
+ ,16
+ ,10
+ ,16
+ ,11
+ ,76
+ ,33
+ ,37
+ ,15
+ ,14
+ ,14
+ ,15
+ ,69
+ ,33
+ ,33
+ ,16
+ ,12
+ ,15
+ ,14
+ ,78
+ ,34
+ ,33
+ ,14
+ ,10
+ ,11
+ ,13
+ ,67
+ ,31
+ ,28
+ ,15
+ ,12
+ ,16
+ ,9
+ ,80
+ ,27
+ ,32
+ ,12
+ ,8
+ ,13
+ ,15
+ ,54
+ ,37
+ ,31
+ ,14
+ ,10
+ ,17
+ ,10
+ ,71
+ ,34
+ ,37
+ ,16
+ ,12
+ ,15
+ ,11
+ ,84
+ ,34
+ ,30
+ ,14
+ ,12
+ ,14
+ ,13
+ ,74
+ ,32
+ ,33
+ ,7
+ ,7
+ ,16
+ ,8
+ ,71
+ ,29
+ ,31
+ ,10
+ ,6
+ ,9
+ ,20
+ ,63
+ ,36
+ ,33
+ ,14
+ ,12
+ ,15
+ ,12
+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,9
+ ,84
+ ,32
+ ,35
+ ,12
+ ,8
+ ,12
+ ,18
+ ,84
+ ,34
+ ,36
+ ,13
+ ,8
+ ,13
+ ,16
+ ,69)
+ ,dim=c(7
+ ,142)
+ ,dimnames=list(c('Connected'
+ ,'Separate'
+ ,'Learning'
+ ,'Software'
+ ,'Happiness'
+ ,'Depression'
+ ,'Belonging')
+ ,1:142))
> y <- array(NA,dim=c(7,142),dimnames=list(c('Connected','Separate','Learning','Software','Happiness','Depression','Belonging'),1:142))
> 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 = '3'
> par3 <- 'No Linear Trend'
> par2 <- 'Do not include Seasonal Dummies'
> par1 <- '3'
> #'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 Connected Separate Software Happiness Depression Belonging
1 16 32 33 11 18 7 66
2 16 31 31 12 11 14 68
3 19 39 38 13 14 12 54
4 16 37 39 11 12 14 56
5 17 39 32 9 17 11 86
6 17 41 32 13 9 9 80
7 16 36 35 10 16 11 76
8 15 33 37 14 14 15 69
9 16 33 33 12 15 14 78
10 14 34 33 10 11 13 67
11 15 31 28 12 16 9 80
12 12 27 32 8 13 15 54
13 14 37 31 10 17 10 71
14 16 34 37 12 15 11 84
15 14 34 30 12 14 13 74
16 7 32 33 7 16 8 71
17 10 29 31 6 9 20 63
18 14 36 33 12 15 12 71
19 16 29 31 10 17 10 76
20 16 35 33 10 13 10 69
21 16 37 32 10 15 9 74
22 14 34 33 12 16 14 75
23 20 38 32 15 16 8 54
24 14 35 33 10 12 14 52
25 14 38 28 10 12 11 69
26 11 37 35 12 11 13 68
27 14 38 39 13 15 9 65
28 15 33 34 11 15 11 75
29 16 36 38 11 17 15 74
30 14 38 32 12 13 11 75
31 16 32 38 14 16 10 72
32 14 32 30 10 14 14 67
33 12 32 33 12 11 18 63
34 16 34 38 13 12 14 62
35 9 32 32 5 12 11 63
36 14 37 32 6 15 12 76
37 16 39 34 12 16 13 74
38 16 29 34 12 15 9 67
39 15 37 36 11 12 10 73
40 16 35 34 10 12 15 70
41 12 30 28 7 8 20 53
42 16 38 34 12 13 12 77
43 16 34 35 14 11 12 77
44 14 31 35 11 14 14 52
45 16 34 31 12 15 13 54
46 17 35 37 13 10 11 80
47 18 36 35 14 11 17 66
48 18 30 27 11 12 12 73
49 12 39 40 12 15 13 63
50 16 35 37 12 15 14 69
51 10 38 36 8 14 13 67
52 14 31 38 11 16 15 54
53 18 34 39 14 15 13 81
54 18 38 41 14 15 10 69
55 16 34 27 12 13 11 84
56 17 39 30 9 12 19 80
57 16 37 37 13 17 13 70
58 16 34 31 11 13 17 69
59 13 28 31 12 15 13 77
60 16 37 27 12 13 9 54
61 16 33 36 12 15 11 79
62 20 37 38 12 16 10 30
63 16 35 37 12 15 9 71
64 15 37 33 12 16 12 73
65 15 32 34 11 15 12 72
66 16 33 31 10 14 13 77
67 14 38 39 9 15 13 75
68 16 33 34 12 14 12 69
69 16 29 32 12 13 15 54
70 15 33 33 12 7 22 70
71 12 31 36 9 17 13 73
72 17 36 32 15 13 15 54
73 16 35 41 12 15 13 77
74 15 32 28 12 14 15 82
75 13 29 30 12 13 10 80
76 16 39 36 10 16 11 80
77 16 37 35 13 12 16 69
78 16 35 31 9 14 11 78
79 16 37 34 12 17 11 81
80 14 32 36 10 15 10 76
81 16 38 36 14 17 10 76
82 16 37 35 11 12 16 73
83 20 36 37 15 16 12 85
84 15 32 28 11 11 11 66
85 16 33 39 11 15 16 79
86 13 40 32 12 9 19 68
87 17 38 35 12 16 11 76
88 16 41 39 12 15 16 71
89 16 36 35 11 10 15 54
90 12 43 42 7 10 24 46
91 16 30 34 12 15 14 82
92 16 31 33 14 11 15 74
93 17 32 41 11 13 11 88
94 13 32 33 11 14 15 38
95 12 37 34 10 18 12 76
96 18 37 32 13 16 10 86
97 14 33 40 13 14 14 54
98 14 34 40 8 14 13 70
99 13 33 35 11 14 9 69
100 16 38 36 12 14 15 90
101 13 33 37 11 12 15 54
102 16 31 27 13 14 14 76
103 13 38 39 12 15 11 89
104 16 37 38 14 15 8 76
105 15 33 31 13 15 11 73
106 16 31 33 15 13 11 79
107 15 39 32 10 17 8 90
108 17 44 39 11 17 10 74
109 15 33 36 9 19 11 81
110 12 35 33 11 15 13 72
111 16 32 33 10 13 11 71
112 10 28 32 11 9 20 66
113 16 40 37 8 15 10 77
114 12 27 30 11 15 15 65
115 14 37 38 12 15 12 74
116 15 32 29 12 16 14 82
117 13 28 22 9 11 23 54
118 15 34 35 11 14 14 63
119 11 30 35 10 11 16 54
120 12 35 34 8 15 11 64
121 8 31 35 9 13 12 69
122 16 32 34 8 15 10 54
123 15 30 34 9 16 14 84
124 17 30 35 15 14 12 86
125 16 31 23 11 15 12 77
126 10 40 31 8 16 11 89
127 18 32 27 13 16 12 76
128 13 36 36 12 11 13 60
129 16 32 31 12 12 11 75
130 13 35 32 9 9 19 73
131 10 38 39 7 16 12 85
132 15 42 37 13 13 17 79
133 16 34 38 9 16 9 71
134 16 35 39 6 12 12 72
135 14 35 34 8 9 19 69
136 10 33 31 8 13 18 78
137 17 36 32 15 13 15 54
138 13 32 37 6 14 14 69
139 15 33 36 9 19 11 81
140 16 34 32 11 13 9 84
141 12 32 35 8 12 18 84
142 13 34 36 8 13 16 69
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Connected Separate Software Happiness Depression
5.760262 0.107710 -0.028163 0.580006 0.068685 -0.088577
Belonging
0.001572
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-5.8396 -1.1478 0.2223 1.1245 4.2138
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 5.760262 2.757791 2.089 0.0386 *
Connected 0.107710 0.049482 2.177 0.0312 *
Separate -0.028163 0.046263 -0.609 0.5437
Software 0.580006 0.073399 7.902 8.6e-13 ***
Happiness 0.068685 0.084553 0.812 0.4180
Depression -0.088577 0.061553 -1.439 0.1525
Belonging 0.001572 0.015387 0.102 0.9188
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 1.814 on 135 degrees of freedom
Multiple R-squared: 0.3907, Adjusted R-squared: 0.3636
F-statistic: 14.43 on 6 and 135 DF, p-value: 1.143e-12
> 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.097203268 0.19440654 0.9027967
[2,] 0.076726994 0.15345399 0.9232730
[3,] 0.049803533 0.09960707 0.9501965
[4,] 0.243852921 0.48770584 0.7561471
[5,] 0.154774175 0.30954835 0.8452258
[6,] 0.129555010 0.25911002 0.8704450
[7,] 0.751928442 0.49614312 0.2480716
[8,] 0.671746884 0.65650623 0.3282531
[9,] 0.722867575 0.55426485 0.2771324
[10,] 0.804619234 0.39076153 0.1953808
[11,] 0.798515300 0.40296940 0.2014847
[12,] 0.756025968 0.48794806 0.2439740
[13,] 0.752185976 0.49562805 0.2478140
[14,] 0.706780035 0.58643993 0.2932200
[15,] 0.645867649 0.70826470 0.3541324
[16,] 0.590879254 0.81824149 0.4091207
[17,] 0.864165447 0.27166911 0.1358346
[18,] 0.894827236 0.21034553 0.1051728
[19,] 0.863556518 0.27288696 0.1364435
[20,] 0.831170212 0.33765958 0.1688298
[21,] 0.829155699 0.34168860 0.1708443
[22,] 0.787195494 0.42560901 0.2128045
[23,] 0.738703460 0.52259308 0.2612965
[24,] 0.768839054 0.46232189 0.2311609
[25,] 0.728111120 0.54377776 0.2718889
[26,] 0.710316075 0.57936785 0.2896839
[27,] 0.698530881 0.60293824 0.3014691
[28,] 0.652468911 0.69506218 0.3475311
[29,] 0.625683561 0.74863288 0.3743164
[30,] 0.573580536 0.85283893 0.4264195
[31,] 0.596845396 0.80630921 0.4031546
[32,] 0.562069774 0.87586045 0.4379302
[33,] 0.506824419 0.98635116 0.4931756
[34,] 0.453594055 0.90718811 0.5464059
[35,] 0.400434455 0.80086891 0.5995655
[36,] 0.349162737 0.69832547 0.6508373
[37,] 0.338596689 0.67719338 0.6614033
[38,] 0.327678489 0.65535698 0.6723215
[39,] 0.469211099 0.93842220 0.5307889
[40,] 0.609240248 0.78151950 0.3907598
[41,] 0.565764314 0.86847137 0.4342357
[42,] 0.647295085 0.70540983 0.3527049
[43,] 0.598431528 0.80313694 0.4015685
[44,] 0.583838051 0.83232390 0.4161619
[45,] 0.555708829 0.88858234 0.4442912
[46,] 0.507710572 0.98457886 0.4922894
[47,] 0.597974849 0.80405030 0.4020252
[48,] 0.551535985 0.89692803 0.4484640
[49,] 0.526444390 0.94711122 0.4735556
[50,] 0.547696544 0.90460691 0.4523035
[51,] 0.497965123 0.99593025 0.5020349
[52,] 0.453081371 0.90616274 0.5469186
[53,] 0.669752127 0.66049575 0.3302479
[54,] 0.625729085 0.74854183 0.3742709
[55,] 0.593714718 0.81257056 0.4062853
[56,] 0.546091961 0.90781608 0.4539080
[57,] 0.544875790 0.91024842 0.4551242
[58,] 0.496828927 0.99365785 0.5031711
[59,] 0.453723746 0.90744749 0.5462763
[60,] 0.431190058 0.86238012 0.5688099
[61,] 0.394671336 0.78934267 0.6053287
[62,] 0.371539631 0.74307926 0.6284604
[63,] 0.343769174 0.68753835 0.6562308
[64,] 0.307912577 0.61582515 0.6920874
[65,] 0.269003170 0.53800634 0.7309968
[66,] 0.281568312 0.56313662 0.7184317
[67,] 0.254475808 0.50895162 0.7455242
[68,] 0.220200037 0.44040007 0.7798000
[69,] 0.229655062 0.45931012 0.7703449
[70,] 0.193857026 0.38771405 0.8061430
[71,] 0.163073881 0.32614776 0.8369261
[72,] 0.148057880 0.29611576 0.8519421
[73,] 0.136417052 0.27283410 0.8635829
[74,] 0.171027360 0.34205472 0.8289726
[75,] 0.141635789 0.28327158 0.8583642
[76,] 0.139896208 0.27979242 0.8601038
[77,] 0.153784143 0.30756829 0.8462159
[78,] 0.136009327 0.27201865 0.8639907
[79,] 0.118106580 0.23621316 0.8818934
[80,] 0.114803763 0.22960753 0.8851962
[81,] 0.104125210 0.20825042 0.8958748
[82,] 0.090621922 0.18124384 0.9093781
[83,] 0.073308350 0.14661670 0.9266916
[84,] 0.093434282 0.18686856 0.9065657
[85,] 0.079995531 0.15999106 0.9200045
[86,] 0.106266558 0.21253312 0.8937334
[87,] 0.098924954 0.19784991 0.9010750
[88,] 0.085077291 0.17015458 0.9149227
[89,] 0.073935921 0.14787184 0.9260641
[90,] 0.076663846 0.15332769 0.9233362
[91,] 0.070793456 0.14158691 0.9292065
[92,] 0.058295314 0.11659063 0.9417047
[93,] 0.045577612 0.09115522 0.9544224
[94,] 0.053179158 0.10635832 0.9468208
[95,] 0.042510044 0.08502009 0.9574900
[96,] 0.034330247 0.06866049 0.9656698
[97,] 0.025882645 0.05176529 0.9741174
[98,] 0.018993334 0.03798667 0.9810067
[99,] 0.015442880 0.03088576 0.9845571
[100,] 0.011860658 0.02372132 0.9881393
[101,] 0.017105312 0.03421062 0.9828947
[102,] 0.015146275 0.03029255 0.9848537
[103,] 0.023557306 0.04711461 0.9764427
[104,] 0.027395120 0.05479024 0.9726049
[105,] 0.035640259 0.07128052 0.9643597
[106,] 0.028370385 0.05674077 0.9716296
[107,] 0.019423294 0.03884659 0.9805767
[108,] 0.013083901 0.02616780 0.9869161
[109,] 0.008530006 0.01706001 0.9914700
[110,] 0.015965607 0.03193121 0.9840344
[111,] 0.013606638 0.02721328 0.9863934
[112,] 0.476454271 0.95290854 0.5235457
[113,] 0.425120828 0.85024166 0.5748792
[114,] 0.365955990 0.73191198 0.6340440
[115,] 0.310529904 0.62105981 0.6894701
[116,] 0.256831468 0.51366294 0.7431685
[117,] 0.261580423 0.52316085 0.7384196
[118,] 0.289369136 0.57873827 0.7106309
[119,] 0.770310123 0.45937975 0.2296899
[120,] 0.710531000 0.57893800 0.2894690
[121,] 0.588654005 0.82269199 0.4113460
[122,] 0.834059600 0.33188080 0.1659404
[123,] 0.837210430 0.32557914 0.1627896
> postscript(file="/var/fisher/rcomp/tmp/1eiq91351786599.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/2nykr1351786599.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/3mka51351786599.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/4p49t1351786599.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/59hxa1351786599.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 = 142
Frequency = 1
1 2 3 4 5 6
0.622337393 1.191400240 2.585660637 1.300633559 2.391774010 0.238086126
7 8 9 10 11 12
1.303789880 -1.134098621 0.741851395 -0.002394959 -0.698258758 -0.056362141
13 14 15 16 17 18
-1.065975408 0.471634129 -1.463953175 -5.839552906 -0.436457339 -1.747427850
19 20 21 22 23 24
1.787841438 1.483652364 1.006264860 -1.429827185 1.872701997 -0.066634759
25 26 27 28 29 30
-0.823031764 -4.430779964 -2.630171559 0.089005666 1.097040571 -1.948505212
31 32 33 34 35 36
-0.583194301 0.011056906 -2.497816161 0.426156206 -2.154661513 1.588874475
37 38 39 40 41 42
-0.027216247 0.775259032 -0.164884933 2.021812432 0.875740143 0.193254702
43 44 45 46 47 48
-0.370386204 -0.296844845 0.526962302 1.133629114 1.874368881 3.512764572
49 50 51 52 53 54
-3.772261125 0.653232477 -3.394785042 -0.264290688 1.549818530 0.928438958
55 56 57 58 59 60
0.327369311 3.396915381 -0.369710030 1.575066836 -1.862932845 -0.125757778
61 62 63 64 65 66
0.559039398 4.104286635 0.207204885 -0.926965594 0.290007451 1.827215687
67 68 69 70 71 72
0.028440179 0.675692294 1.408195931 1.012516957 -1.436308992 -0.085787772
73 74 75 76 77 78
0.664734618 -0.140282059 -2.131882444 1.002537442 0.184688250 2.013077013
79 80 81 82 83 84
-0.068638222 -0.257100925 -1.360750013 1.338412381 2.534518308 0.316619588
85 86 87 88 89 90
1.666419247 -2.169568794 0.928359415 0.237312168 1.524779076 0.097745003
91 92 93 94 95 96
1.086855965 0.166861360 2.510794275 -1.350298695 -2.880875387 1.267277879
97 98 99 100 101 102
-1.534601990 1.143991054 -1.981868933 0.426193448 -1.233134779 0.280112525
103 104 105 106 107 108
-2.910736246 -1.236498133 -1.152352323 -0.912679831 -0.460249409 0.820644031
109 110 111 112 113 114
1.021174617 -2.972707665 1.892213987 -3.205328595 2.067826091 -2.007365445
115 116 117 118 119 120
-1.719035864 -0.338064602 0.820272091 0.362736489 -2.229065976 -1.369105981
121 122 123 124 125 126
-5.272023535 2.881164066 1.755044916 0.260245843 1.080060418 -4.100124079
127 128 129 130 131 132
1.857880299 -2.282332403 0.738272976 0.101136742 -2.984528050 -1.293358583
133 134 135 136 137 138
2.014410400 4.213778321 1.743756600 -2.502776179 -0.085787772 1.525079946
139 140 141 142
1.021174617 0.871038458 -0.223159509 0.367324231
> postscript(file="/var/fisher/rcomp/tmp/6wzdy1351786599.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 = 142
Frequency = 1
lag(myerror, k = 1) myerror
0 0.622337393 NA
1 1.191400240 0.622337393
2 2.585660637 1.191400240
3 1.300633559 2.585660637
4 2.391774010 1.300633559
5 0.238086126 2.391774010
6 1.303789880 0.238086126
7 -1.134098621 1.303789880
8 0.741851395 -1.134098621
9 -0.002394959 0.741851395
10 -0.698258758 -0.002394959
11 -0.056362141 -0.698258758
12 -1.065975408 -0.056362141
13 0.471634129 -1.065975408
14 -1.463953175 0.471634129
15 -5.839552906 -1.463953175
16 -0.436457339 -5.839552906
17 -1.747427850 -0.436457339
18 1.787841438 -1.747427850
19 1.483652364 1.787841438
20 1.006264860 1.483652364
21 -1.429827185 1.006264860
22 1.872701997 -1.429827185
23 -0.066634759 1.872701997
24 -0.823031764 -0.066634759
25 -4.430779964 -0.823031764
26 -2.630171559 -4.430779964
27 0.089005666 -2.630171559
28 1.097040571 0.089005666
29 -1.948505212 1.097040571
30 -0.583194301 -1.948505212
31 0.011056906 -0.583194301
32 -2.497816161 0.011056906
33 0.426156206 -2.497816161
34 -2.154661513 0.426156206
35 1.588874475 -2.154661513
36 -0.027216247 1.588874475
37 0.775259032 -0.027216247
38 -0.164884933 0.775259032
39 2.021812432 -0.164884933
40 0.875740143 2.021812432
41 0.193254702 0.875740143
42 -0.370386204 0.193254702
43 -0.296844845 -0.370386204
44 0.526962302 -0.296844845
45 1.133629114 0.526962302
46 1.874368881 1.133629114
47 3.512764572 1.874368881
48 -3.772261125 3.512764572
49 0.653232477 -3.772261125
50 -3.394785042 0.653232477
51 -0.264290688 -3.394785042
52 1.549818530 -0.264290688
53 0.928438958 1.549818530
54 0.327369311 0.928438958
55 3.396915381 0.327369311
56 -0.369710030 3.396915381
57 1.575066836 -0.369710030
58 -1.862932845 1.575066836
59 -0.125757778 -1.862932845
60 0.559039398 -0.125757778
61 4.104286635 0.559039398
62 0.207204885 4.104286635
63 -0.926965594 0.207204885
64 0.290007451 -0.926965594
65 1.827215687 0.290007451
66 0.028440179 1.827215687
67 0.675692294 0.028440179
68 1.408195931 0.675692294
69 1.012516957 1.408195931
70 -1.436308992 1.012516957
71 -0.085787772 -1.436308992
72 0.664734618 -0.085787772
73 -0.140282059 0.664734618
74 -2.131882444 -0.140282059
75 1.002537442 -2.131882444
76 0.184688250 1.002537442
77 2.013077013 0.184688250
78 -0.068638222 2.013077013
79 -0.257100925 -0.068638222
80 -1.360750013 -0.257100925
81 1.338412381 -1.360750013
82 2.534518308 1.338412381
83 0.316619588 2.534518308
84 1.666419247 0.316619588
85 -2.169568794 1.666419247
86 0.928359415 -2.169568794
87 0.237312168 0.928359415
88 1.524779076 0.237312168
89 0.097745003 1.524779076
90 1.086855965 0.097745003
91 0.166861360 1.086855965
92 2.510794275 0.166861360
93 -1.350298695 2.510794275
94 -2.880875387 -1.350298695
95 1.267277879 -2.880875387
96 -1.534601990 1.267277879
97 1.143991054 -1.534601990
98 -1.981868933 1.143991054
99 0.426193448 -1.981868933
100 -1.233134779 0.426193448
101 0.280112525 -1.233134779
102 -2.910736246 0.280112525
103 -1.236498133 -2.910736246
104 -1.152352323 -1.236498133
105 -0.912679831 -1.152352323
106 -0.460249409 -0.912679831
107 0.820644031 -0.460249409
108 1.021174617 0.820644031
109 -2.972707665 1.021174617
110 1.892213987 -2.972707665
111 -3.205328595 1.892213987
112 2.067826091 -3.205328595
113 -2.007365445 2.067826091
114 -1.719035864 -2.007365445
115 -0.338064602 -1.719035864
116 0.820272091 -0.338064602
117 0.362736489 0.820272091
118 -2.229065976 0.362736489
119 -1.369105981 -2.229065976
120 -5.272023535 -1.369105981
121 2.881164066 -5.272023535
122 1.755044916 2.881164066
123 0.260245843 1.755044916
124 1.080060418 0.260245843
125 -4.100124079 1.080060418
126 1.857880299 -4.100124079
127 -2.282332403 1.857880299
128 0.738272976 -2.282332403
129 0.101136742 0.738272976
130 -2.984528050 0.101136742
131 -1.293358583 -2.984528050
132 2.014410400 -1.293358583
133 4.213778321 2.014410400
134 1.743756600 4.213778321
135 -2.502776179 1.743756600
136 -0.085787772 -2.502776179
137 1.525079946 -0.085787772
138 1.021174617 1.525079946
139 0.871038458 1.021174617
140 -0.223159509 0.871038458
141 0.367324231 -0.223159509
142 NA 0.367324231
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 1.191400240 0.622337393
[2,] 2.585660637 1.191400240
[3,] 1.300633559 2.585660637
[4,] 2.391774010 1.300633559
[5,] 0.238086126 2.391774010
[6,] 1.303789880 0.238086126
[7,] -1.134098621 1.303789880
[8,] 0.741851395 -1.134098621
[9,] -0.002394959 0.741851395
[10,] -0.698258758 -0.002394959
[11,] -0.056362141 -0.698258758
[12,] -1.065975408 -0.056362141
[13,] 0.471634129 -1.065975408
[14,] -1.463953175 0.471634129
[15,] -5.839552906 -1.463953175
[16,] -0.436457339 -5.839552906
[17,] -1.747427850 -0.436457339
[18,] 1.787841438 -1.747427850
[19,] 1.483652364 1.787841438
[20,] 1.006264860 1.483652364
[21,] -1.429827185 1.006264860
[22,] 1.872701997 -1.429827185
[23,] -0.066634759 1.872701997
[24,] -0.823031764 -0.066634759
[25,] -4.430779964 -0.823031764
[26,] -2.630171559 -4.430779964
[27,] 0.089005666 -2.630171559
[28,] 1.097040571 0.089005666
[29,] -1.948505212 1.097040571
[30,] -0.583194301 -1.948505212
[31,] 0.011056906 -0.583194301
[32,] -2.497816161 0.011056906
[33,] 0.426156206 -2.497816161
[34,] -2.154661513 0.426156206
[35,] 1.588874475 -2.154661513
[36,] -0.027216247 1.588874475
[37,] 0.775259032 -0.027216247
[38,] -0.164884933 0.775259032
[39,] 2.021812432 -0.164884933
[40,] 0.875740143 2.021812432
[41,] 0.193254702 0.875740143
[42,] -0.370386204 0.193254702
[43,] -0.296844845 -0.370386204
[44,] 0.526962302 -0.296844845
[45,] 1.133629114 0.526962302
[46,] 1.874368881 1.133629114
[47,] 3.512764572 1.874368881
[48,] -3.772261125 3.512764572
[49,] 0.653232477 -3.772261125
[50,] -3.394785042 0.653232477
[51,] -0.264290688 -3.394785042
[52,] 1.549818530 -0.264290688
[53,] 0.928438958 1.549818530
[54,] 0.327369311 0.928438958
[55,] 3.396915381 0.327369311
[56,] -0.369710030 3.396915381
[57,] 1.575066836 -0.369710030
[58,] -1.862932845 1.575066836
[59,] -0.125757778 -1.862932845
[60,] 0.559039398 -0.125757778
[61,] 4.104286635 0.559039398
[62,] 0.207204885 4.104286635
[63,] -0.926965594 0.207204885
[64,] 0.290007451 -0.926965594
[65,] 1.827215687 0.290007451
[66,] 0.028440179 1.827215687
[67,] 0.675692294 0.028440179
[68,] 1.408195931 0.675692294
[69,] 1.012516957 1.408195931
[70,] -1.436308992 1.012516957
[71,] -0.085787772 -1.436308992
[72,] 0.664734618 -0.085787772
[73,] -0.140282059 0.664734618
[74,] -2.131882444 -0.140282059
[75,] 1.002537442 -2.131882444
[76,] 0.184688250 1.002537442
[77,] 2.013077013 0.184688250
[78,] -0.068638222 2.013077013
[79,] -0.257100925 -0.068638222
[80,] -1.360750013 -0.257100925
[81,] 1.338412381 -1.360750013
[82,] 2.534518308 1.338412381
[83,] 0.316619588 2.534518308
[84,] 1.666419247 0.316619588
[85,] -2.169568794 1.666419247
[86,] 0.928359415 -2.169568794
[87,] 0.237312168 0.928359415
[88,] 1.524779076 0.237312168
[89,] 0.097745003 1.524779076
[90,] 1.086855965 0.097745003
[91,] 0.166861360 1.086855965
[92,] 2.510794275 0.166861360
[93,] -1.350298695 2.510794275
[94,] -2.880875387 -1.350298695
[95,] 1.267277879 -2.880875387
[96,] -1.534601990 1.267277879
[97,] 1.143991054 -1.534601990
[98,] -1.981868933 1.143991054
[99,] 0.426193448 -1.981868933
[100,] -1.233134779 0.426193448
[101,] 0.280112525 -1.233134779
[102,] -2.910736246 0.280112525
[103,] -1.236498133 -2.910736246
[104,] -1.152352323 -1.236498133
[105,] -0.912679831 -1.152352323
[106,] -0.460249409 -0.912679831
[107,] 0.820644031 -0.460249409
[108,] 1.021174617 0.820644031
[109,] -2.972707665 1.021174617
[110,] 1.892213987 -2.972707665
[111,] -3.205328595 1.892213987
[112,] 2.067826091 -3.205328595
[113,] -2.007365445 2.067826091
[114,] -1.719035864 -2.007365445
[115,] -0.338064602 -1.719035864
[116,] 0.820272091 -0.338064602
[117,] 0.362736489 0.820272091
[118,] -2.229065976 0.362736489
[119,] -1.369105981 -2.229065976
[120,] -5.272023535 -1.369105981
[121,] 2.881164066 -5.272023535
[122,] 1.755044916 2.881164066
[123,] 0.260245843 1.755044916
[124,] 1.080060418 0.260245843
[125,] -4.100124079 1.080060418
[126,] 1.857880299 -4.100124079
[127,] -2.282332403 1.857880299
[128,] 0.738272976 -2.282332403
[129,] 0.101136742 0.738272976
[130,] -2.984528050 0.101136742
[131,] -1.293358583 -2.984528050
[132,] 2.014410400 -1.293358583
[133,] 4.213778321 2.014410400
[134,] 1.743756600 4.213778321
[135,] -2.502776179 1.743756600
[136,] -0.085787772 -2.502776179
[137,] 1.525079946 -0.085787772
[138,] 1.021174617 1.525079946
[139,] 0.871038458 1.021174617
[140,] -0.223159509 0.871038458
[141,] 0.367324231 -0.223159509
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 1.191400240 0.622337393
2 2.585660637 1.191400240
3 1.300633559 2.585660637
4 2.391774010 1.300633559
5 0.238086126 2.391774010
6 1.303789880 0.238086126
7 -1.134098621 1.303789880
8 0.741851395 -1.134098621
9 -0.002394959 0.741851395
10 -0.698258758 -0.002394959
11 -0.056362141 -0.698258758
12 -1.065975408 -0.056362141
13 0.471634129 -1.065975408
14 -1.463953175 0.471634129
15 -5.839552906 -1.463953175
16 -0.436457339 -5.839552906
17 -1.747427850 -0.436457339
18 1.787841438 -1.747427850
19 1.483652364 1.787841438
20 1.006264860 1.483652364
21 -1.429827185 1.006264860
22 1.872701997 -1.429827185
23 -0.066634759 1.872701997
24 -0.823031764 -0.066634759
25 -4.430779964 -0.823031764
26 -2.630171559 -4.430779964
27 0.089005666 -2.630171559
28 1.097040571 0.089005666
29 -1.948505212 1.097040571
30 -0.583194301 -1.948505212
31 0.011056906 -0.583194301
32 -2.497816161 0.011056906
33 0.426156206 -2.497816161
34 -2.154661513 0.426156206
35 1.588874475 -2.154661513
36 -0.027216247 1.588874475
37 0.775259032 -0.027216247
38 -0.164884933 0.775259032
39 2.021812432 -0.164884933
40 0.875740143 2.021812432
41 0.193254702 0.875740143
42 -0.370386204 0.193254702
43 -0.296844845 -0.370386204
44 0.526962302 -0.296844845
45 1.133629114 0.526962302
46 1.874368881 1.133629114
47 3.512764572 1.874368881
48 -3.772261125 3.512764572
49 0.653232477 -3.772261125
50 -3.394785042 0.653232477
51 -0.264290688 -3.394785042
52 1.549818530 -0.264290688
53 0.928438958 1.549818530
54 0.327369311 0.928438958
55 3.396915381 0.327369311
56 -0.369710030 3.396915381
57 1.575066836 -0.369710030
58 -1.862932845 1.575066836
59 -0.125757778 -1.862932845
60 0.559039398 -0.125757778
61 4.104286635 0.559039398
62 0.207204885 4.104286635
63 -0.926965594 0.207204885
64 0.290007451 -0.926965594
65 1.827215687 0.290007451
66 0.028440179 1.827215687
67 0.675692294 0.028440179
68 1.408195931 0.675692294
69 1.012516957 1.408195931
70 -1.436308992 1.012516957
71 -0.085787772 -1.436308992
72 0.664734618 -0.085787772
73 -0.140282059 0.664734618
74 -2.131882444 -0.140282059
75 1.002537442 -2.131882444
76 0.184688250 1.002537442
77 2.013077013 0.184688250
78 -0.068638222 2.013077013
79 -0.257100925 -0.068638222
80 -1.360750013 -0.257100925
81 1.338412381 -1.360750013
82 2.534518308 1.338412381
83 0.316619588 2.534518308
84 1.666419247 0.316619588
85 -2.169568794 1.666419247
86 0.928359415 -2.169568794
87 0.237312168 0.928359415
88 1.524779076 0.237312168
89 0.097745003 1.524779076
90 1.086855965 0.097745003
91 0.166861360 1.086855965
92 2.510794275 0.166861360
93 -1.350298695 2.510794275
94 -2.880875387 -1.350298695
95 1.267277879 -2.880875387
96 -1.534601990 1.267277879
97 1.143991054 -1.534601990
98 -1.981868933 1.143991054
99 0.426193448 -1.981868933
100 -1.233134779 0.426193448
101 0.280112525 -1.233134779
102 -2.910736246 0.280112525
103 -1.236498133 -2.910736246
104 -1.152352323 -1.236498133
105 -0.912679831 -1.152352323
106 -0.460249409 -0.912679831
107 0.820644031 -0.460249409
108 1.021174617 0.820644031
109 -2.972707665 1.021174617
110 1.892213987 -2.972707665
111 -3.205328595 1.892213987
112 2.067826091 -3.205328595
113 -2.007365445 2.067826091
114 -1.719035864 -2.007365445
115 -0.338064602 -1.719035864
116 0.820272091 -0.338064602
117 0.362736489 0.820272091
118 -2.229065976 0.362736489
119 -1.369105981 -2.229065976
120 -5.272023535 -1.369105981
121 2.881164066 -5.272023535
122 1.755044916 2.881164066
123 0.260245843 1.755044916
124 1.080060418 0.260245843
125 -4.100124079 1.080060418
126 1.857880299 -4.100124079
127 -2.282332403 1.857880299
128 0.738272976 -2.282332403
129 0.101136742 0.738272976
130 -2.984528050 0.101136742
131 -1.293358583 -2.984528050
132 2.014410400 -1.293358583
133 4.213778321 2.014410400
134 1.743756600 4.213778321
135 -2.502776179 1.743756600
136 -0.085787772 -2.502776179
137 1.525079946 -0.085787772
138 1.021174617 1.525079946
139 0.871038458 1.021174617
140 -0.223159509 0.871038458
141 0.367324231 -0.223159509
> 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/7bmrj1351786599.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/8z27d1351786599.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/9lssp1351786599.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/10mt521351786599.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/11cf9z1351786599.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/12f93i1351786599.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/1340gr1351786599.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/14v8pr1351786599.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/15xjgw1351786599.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/16cljc1351786599.tab")
+ }
>
> try(system("convert tmp/1eiq91351786599.ps tmp/1eiq91351786599.png",intern=TRUE))
character(0)
> try(system("convert tmp/2nykr1351786599.ps tmp/2nykr1351786599.png",intern=TRUE))
character(0)
> try(system("convert tmp/3mka51351786599.ps tmp/3mka51351786599.png",intern=TRUE))
character(0)
> try(system("convert tmp/4p49t1351786599.ps tmp/4p49t1351786599.png",intern=TRUE))
character(0)
> try(system("convert tmp/59hxa1351786599.ps tmp/59hxa1351786599.png",intern=TRUE))
character(0)
> try(system("convert tmp/6wzdy1351786599.ps tmp/6wzdy1351786599.png",intern=TRUE))
character(0)
> try(system("convert tmp/7bmrj1351786599.ps tmp/7bmrj1351786599.png",intern=TRUE))
character(0)
> try(system("convert tmp/8z27d1351786599.ps tmp/8z27d1351786599.png",intern=TRUE))
character(0)
> try(system("convert tmp/9lssp1351786599.ps tmp/9lssp1351786599.png",intern=TRUE))
character(0)
> try(system("convert tmp/10mt521351786599.ps tmp/10mt521351786599.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
7.592 1.126 8.716