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
+ ,14
+ ,12
+ ,53
+ ,13
+ ,2
+ ,39
+ ,11
+ ,18
+ ,11
+ ,86
+ ,16
+ ,3
+ ,30
+ ,15
+ ,11
+ ,14
+ ,66
+ ,19
+ ,4
+ ,31
+ ,6
+ ,12
+ ,12
+ ,67
+ ,15
+ ,5
+ ,34
+ ,13
+ ,16
+ ,21
+ ,76
+ ,14
+ ,6
+ ,35
+ ,10
+ ,18
+ ,12
+ ,78
+ ,13
+ ,7
+ ,39
+ ,12
+ ,14
+ ,22
+ ,53
+ ,19
+ ,8
+ ,34
+ ,14
+ ,14
+ ,11
+ ,80
+ ,15
+ ,9
+ ,36
+ ,12
+ ,15
+ ,10
+ ,74
+ ,14
+ ,10
+ ,37
+ ,6
+ ,15
+ ,13
+ ,76
+ ,15
+ ,11
+ ,38
+ ,10
+ ,17
+ ,10
+ ,79
+ ,16
+ ,12
+ ,36
+ ,12
+ ,19
+ ,8
+ ,54
+ ,16
+ ,13
+ ,38
+ ,12
+ ,10
+ ,15
+ ,67
+ ,16
+ ,14
+ ,39
+ ,11
+ ,16
+ ,14
+ ,54
+ ,16
+ ,15
+ ,33
+ ,15
+ ,18
+ ,10
+ ,87
+ ,17
+ ,16
+ ,32
+ ,12
+ ,14
+ ,14
+ ,58
+ ,15
+ ,17
+ ,36
+ ,10
+ ,14
+ ,14
+ ,75
+ ,15
+ ,18
+ ,38
+ ,12
+ ,17
+ ,11
+ ,88
+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Learning')
+ ,1:162))
> y <- array(NA,dim=c(7,162),dimnames=list(c('t','Connected','Software','Happiness','Depression','Belonging','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 = '7'
> par3 <- 'No Linear Trend'
> par2 <- 'Do not include Seasonal Dummies'
> par1 <- '7'
> #'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 Happiness Depression Belonging
1 13 1 41 12 14 12 53
2 16 2 39 11 18 11 86
3 19 3 30 15 11 14 66
4 15 4 31 6 12 12 67
5 14 5 34 13 16 21 76
6 13 6 35 10 18 12 78
7 19 7 39 12 14 22 53
8 15 8 34 14 14 11 80
9 14 9 36 12 15 10 74
10 15 10 37 6 15 13 76
11 16 11 38 10 17 10 79
12 16 12 36 12 19 8 54
13 16 13 38 12 10 15 67
14 16 14 39 11 16 14 54
15 17 15 33 15 18 10 87
16 15 16 32 12 14 14 58
17 15 17 36 10 14 14 75
18 20 18 38 12 17 11 88
19 18 19 39 11 14 10 64
20 16 20 32 12 16 13 57
21 16 21 32 11 18 7 66
22 16 22 31 12 11 14 68
23 19 23 39 13 14 12 54
24 16 24 37 11 12 14 56
25 17 25 39 9 17 11 86
26 17 26 41 13 9 9 80
27 16 27 36 10 16 11 76
28 15 28 33 14 14 15 69
29 16 29 33 12 15 14 78
30 14 30 34 10 11 13 67
31 15 31 31 12 16 9 80
32 12 32 27 8 13 15 54
33 14 33 37 10 17 10 71
34 16 34 34 12 15 11 84
35 14 35 34 12 14 13 74
36 7 36 32 7 16 8 71
37 10 37 29 6 9 20 63
38 14 38 36 12 15 12 71
39 16 39 29 10 17 10 76
40 16 40 35 10 13 10 69
41 16 41 37 10 15 9 74
42 14 42 34 12 16 14 75
43 20 43 38 15 16 8 54
44 14 44 35 10 12 14 52
45 14 45 38 10 12 11 69
46 11 46 37 12 11 13 68
47 14 47 38 13 15 9 65
48 15 48 33 11 15 11 75
49 16 49 36 11 17 15 74
50 14 50 38 12 13 11 75
51 16 51 32 14 16 10 72
52 14 52 32 10 14 14 67
53 12 53 32 12 11 18 63
54 16 54 34 13 12 14 62
55 9 55 32 5 12 11 63
56 14 56 37 6 15 12 76
57 16 57 39 12 16 13 74
58 16 58 29 12 15 9 67
59 15 59 37 11 12 10 73
60 16 60 35 10 12 15 70
61 12 61 30 7 8 20 53
62 16 62 38 12 13 12 77
63 16 63 34 14 11 12 77
64 14 64 31 11 14 14 52
65 16 65 34 12 15 13 54
66 17 66 35 13 10 11 80
67 18 67 36 14 11 17 66
68 18 68 30 11 12 12 73
69 12 69 39 12 15 13 63
70 16 70 35 12 15 14 69
71 10 71 38 8 14 13 67
72 14 72 31 11 16 15 54
73 18 73 34 14 15 13 81
74 18 74 38 14 15 10 69
75 16 75 34 12 13 11 84
76 17 76 39 9 12 19 80
77 16 77 37 13 17 13 70
78 16 78 34 11 13 17 69
79 13 79 28 12 15 13 77
80 16 80 37 12 13 9 54
81 16 81 33 12 15 11 79
82 20 82 37 12 16 10 30
83 16 83 35 12 15 9 71
84 15 84 37 12 16 12 73
85 15 85 32 11 15 12 72
86 16 86 33 10 14 13 77
87 14 87 38 9 15 13 75
88 16 88 33 12 14 12 69
89 16 89 29 12 13 15 54
90 15 90 33 12 7 22 70
91 12 91 31 9 17 13 73
92 17 92 36 15 13 15 54
93 16 93 35 12 15 13 77
94 15 94 32 12 14 15 82
95 13 95 29 12 13 10 80
96 16 96 39 10 16 11 80
97 16 97 37 13 12 16 69
98 16 98 35 9 14 11 78
99 16 99 37 12 17 11 81
100 14 100 32 10 15 10 76
101 16 101 38 14 17 10 76
102 16 102 37 11 12 16 73
103 20 103 36 15 16 12 85
104 15 104 32 11 11 11 66
105 16 105 33 11 15 16 79
106 13 106 40 12 9 19 68
107 17 107 38 12 16 11 76
108 16 108 41 12 15 16 71
109 16 109 36 11 10 15 54
110 12 110 43 7 10 24 46
111 16 111 30 12 15 14 82
112 16 112 31 14 11 15 74
113 17 113 32 11 13 11 88
114 13 114 32 11 14 15 38
115 12 115 37 10 18 12 76
116 18 116 37 13 16 10 86
117 14 117 33 13 14 14 54
118 14 118 34 8 14 13 70
119 13 119 33 11 14 9 69
120 16 120 38 12 14 15 90
121 13 121 33 11 12 15 54
122 16 122 31 13 14 14 76
123 13 123 38 12 15 11 89
124 16 124 37 14 15 8 76
125 15 125 33 13 15 11 73
126 16 126 31 15 13 11 79
127 15 127 39 10 17 8 90
128 17 128 44 11 17 10 74
129 15 129 33 9 19 11 81
130 12 130 35 11 15 13 72
131 16 131 32 10 13 11 71
132 10 132 28 11 9 20 66
133 16 133 40 8 15 10 77
134 12 134 27 11 15 15 65
135 14 135 37 12 15 12 74
136 15 136 32 12 16 14 82
137 13 137 28 9 11 23 54
138 15 138 34 11 14 14 63
139 11 139 30 10 11 16 54
140 12 140 35 8 15 11 64
141 8 141 31 9 13 12 69
142 16 142 32 8 15 10 54
143 15 143 30 9 16 14 84
144 17 144 30 15 14 12 86
145 16 145 31 11 15 12 77
146 10 146 40 8 16 11 89
147 18 147 32 13 16 12 76
148 13 148 36 12 11 13 60
149 16 149 32 12 12 11 75
150 13 150 35 9 9 19 73
151 10 151 38 7 16 12 85
152 15 152 42 13 13 17 79
153 16 153 34 9 16 9 71
154 16 154 35 6 12 12 72
155 14 155 35 8 9 19 69
156 10 156 33 8 13 18 78
157 17 157 36 15 13 15 54
158 13 158 32 6 14 14 69
159 15 159 33 9 19 11 81
160 16 160 34 11 13 9 84
161 12 161 32 8 12 18 84
162 13 162 34 8 13 16 69
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) t Connected Software Happiness Depression
5.704877 -0.004225 0.100378 0.532122 0.052012 -0.070076
Belonging
0.005756
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-6.1700 -1.1222 0.1909 1.0859 4.2380
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 5.704877 2.439532 2.339 0.0206 *
t -0.004225 0.003223 -1.311 0.1919
Connected 0.100378 0.043779 2.293 0.0232 *
Software 0.532122 0.068981 7.714 1.39e-12 ***
Happiness 0.052012 0.075436 0.689 0.4915
Depression -0.070076 0.055863 -1.254 0.2116
Belonging 0.005756 0.014555 0.395 0.6930
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 1.84 on 155 degrees of freedom
Multiple R-squared: 0.3598, Adjusted R-squared: 0.3351
F-statistic: 14.52 on 6 and 155 DF, p-value: 4.105e-13
> 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.91796656 0.16406688 0.08203344
[2,] 0.90881760 0.18236481 0.09118240
[3,] 0.89550001 0.20899998 0.10449999
[4,] 0.85243848 0.29512304 0.14756152
[5,] 0.77991545 0.44016911 0.22008455
[6,] 0.71068598 0.57862804 0.28931402
[7,] 0.70611314 0.58777371 0.29388686
[8,] 0.63151794 0.73696412 0.36848206
[9,] 0.82699195 0.34601610 0.17300805
[10,] 0.79657131 0.40685739 0.20342869
[11,] 0.73995457 0.52009087 0.26004543
[12,] 0.67142123 0.65715754 0.32857877
[13,] 0.63451849 0.73096301 0.36548151
[14,] 0.60401058 0.79197884 0.39598942
[15,] 0.57469390 0.85061220 0.42530610
[16,] 0.51875288 0.96249424 0.48124712
[17,] 0.47996140 0.95992280 0.52003860
[18,] 0.42926705 0.85853411 0.57073295
[19,] 0.47563395 0.95126790 0.52436605
[20,] 0.41927605 0.83855210 0.58072395
[21,] 0.43625802 0.87251605 0.56374198
[22,] 0.38992183 0.77984367 0.61007817
[23,] 0.38791502 0.77583003 0.61208498
[24,] 0.38286039 0.76572078 0.61713961
[25,] 0.32570272 0.65140544 0.67429728
[26,] 0.32355670 0.64711341 0.67644330
[27,] 0.81806534 0.36386933 0.18193466
[28,] 0.80081603 0.39836793 0.19918397
[29,] 0.78449266 0.43101468 0.21550734
[30,] 0.81919938 0.36160125 0.18080062
[31,] 0.80554878 0.38890245 0.19445122
[32,] 0.77785346 0.44429308 0.22214654
[33,] 0.75517527 0.48964947 0.24482473
[34,] 0.77508065 0.44983869 0.22491935
[35,] 0.73554797 0.52890406 0.26445203
[36,] 0.70349766 0.59300467 0.29650234
[37,] 0.86940061 0.26119879 0.13059939
[38,] 0.88149167 0.23701666 0.11850833
[39,] 0.85880515 0.28238970 0.14119485
[40,] 0.84224930 0.31550140 0.15775070
[41,] 0.83395048 0.33209903 0.16604952
[42,] 0.80521738 0.38956525 0.19478262
[43,] 0.77195935 0.45608130 0.22804065
[44,] 0.78895545 0.42208910 0.21104455
[45,] 0.76236478 0.47527044 0.23763522
[46,] 0.78294477 0.43411047 0.21705523
[47,] 0.77399672 0.45200655 0.22600328
[48,] 0.73726902 0.52546195 0.26273098
[49,] 0.72625435 0.54749129 0.27374565
[50,] 0.69141838 0.61716323 0.30858162
[51,] 0.69999279 0.60001441 0.30000721
[52,] 0.66388138 0.67223724 0.33611862
[53,] 0.62243694 0.75512612 0.37756306
[54,] 0.58338689 0.83322621 0.41661311
[55,] 0.54044267 0.91911466 0.45955733
[56,] 0.50244716 0.99510569 0.49755284
[57,] 0.47850460 0.95700920 0.52149540
[58,] 0.47306455 0.94612909 0.52693545
[59,] 0.59954130 0.80091741 0.40045870
[60,] 0.73979566 0.52040868 0.26020434
[61,] 0.70479509 0.59040982 0.29520491
[62,] 0.81261088 0.37477824 0.18738912
[63,] 0.78370971 0.43258058 0.21629029
[64,] 0.77039039 0.45921923 0.22960961
[65,] 0.74467484 0.51065031 0.25532516
[66,] 0.70800453 0.58399094 0.29199547
[67,] 0.76613968 0.46772063 0.23386032
[68,] 0.73062268 0.53875465 0.26937732
[69,] 0.71251592 0.57496815 0.28748408
[70,] 0.71709595 0.56580810 0.28290405
[71,] 0.68320006 0.63359989 0.31679994
[72,] 0.64346905 0.71306191 0.35653095
[73,] 0.79822525 0.40354950 0.20177475
[74,] 0.76426443 0.47147114 0.23573557
[75,] 0.73662978 0.52674044 0.26337022
[76,] 0.69782712 0.60434575 0.30217288
[77,] 0.68644450 0.62711101 0.31355550
[78,] 0.64583539 0.70832922 0.35416461
[79,] 0.60518464 0.78963071 0.39481536
[80,] 0.58383995 0.83232011 0.41616005
[81,] 0.54664598 0.90670804 0.45335402
[82,] 0.54062406 0.91875187 0.45937594
[83,] 0.49858581 0.99717161 0.50141419
[84,] 0.45380070 0.90760140 0.54619930
[85,] 0.40749600 0.81499201 0.59250400
[86,] 0.43234762 0.86469524 0.56765238
[87,] 0.39388530 0.78777060 0.60611470
[88,] 0.35134879 0.70269757 0.64865121
[89,] 0.34596636 0.69193272 0.65403364
[90,] 0.30292456 0.60584911 0.69707544
[91,] 0.26772432 0.53544865 0.73227568
[92,] 0.24414290 0.48828581 0.75585710
[93,] 0.22313594 0.44627189 0.77686406
[94,] 0.26739186 0.53478371 0.73260814
[95,] 0.22995292 0.45990584 0.77004708
[96,] 0.22025018 0.44050035 0.77974982
[97,] 0.22815747 0.45631494 0.77184253
[98,] 0.20708281 0.41416563 0.79291719
[99,] 0.18465111 0.36930223 0.81534889
[100,] 0.18168640 0.36337280 0.81831360
[101,] 0.17869611 0.35739222 0.82130389
[102,] 0.16362433 0.32724867 0.83637567
[103,] 0.14182134 0.28364268 0.85817866
[104,] 0.17019371 0.34038742 0.82980629
[105,] 0.14595985 0.29191970 0.85404015
[106,] 0.16266330 0.32532661 0.83733670
[107,] 0.17345366 0.34690733 0.82654634
[108,] 0.15183058 0.30366115 0.84816942
[109,] 0.14146688 0.28293375 0.85853312
[110,] 0.13221689 0.26443377 0.86778311
[111,] 0.14144628 0.28289257 0.85855372
[112,] 0.11743752 0.23487505 0.88256248
[113,] 0.11068060 0.22136120 0.88931940
[114,] 0.11172179 0.22344358 0.88827821
[115,] 0.08985425 0.17970850 0.91014575
[116,] 0.07035314 0.14070628 0.92964686
[117,] 0.05380100 0.10760199 0.94619900
[118,] 0.04027975 0.08055949 0.95972025
[119,] 0.04034447 0.08068894 0.95965553
[120,] 0.03653478 0.07306957 0.96346522
[121,] 0.03644855 0.07289711 0.96355145
[122,] 0.04244044 0.08488089 0.95755956
[123,] 0.04739081 0.09478162 0.95260919
[124,] 0.10530734 0.21061467 0.89469266
[125,] 0.11038983 0.22077965 0.88961017
[126,] 0.08643001 0.17286001 0.91356999
[127,] 0.06736913 0.13473826 0.93263087
[128,] 0.05756151 0.11512302 0.94243849
[129,] 0.05173065 0.10346131 0.94826935
[130,] 0.05377686 0.10755372 0.94622314
[131,] 0.03844963 0.07689925 0.96155037
[132,] 0.50693745 0.98612510 0.49306255
[133,] 0.45550612 0.91101223 0.54449388
[134,] 0.41852295 0.83704591 0.58147705
[135,] 0.33753564 0.67507128 0.66246436
[136,] 0.27491283 0.54982565 0.72508717
[137,] 0.28799162 0.57598324 0.71200838
[138,] 0.41240222 0.82480443 0.58759778
[139,] 0.64590504 0.70818992 0.35409496
[140,] 0.53041774 0.93916452 0.46958226
[141,] 0.40397908 0.80795815 0.59602092
[142,] 0.73659820 0.52680359 0.26340180
[143,] 0.62338348 0.75323304 0.37661652
> postscript(file="/var/wessaorg/rcomp/tmp/1qyjk1351951849.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/wessaorg/rcomp/tmp/26ido1351951849.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/wessaorg/rcomp/tmp/3lopl1351951849.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/wessaorg/rcomp/tmp/4gi1z1351951849.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/wessaorg/rcomp/tmp/5tgs41351951849.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.39393580 -0.12491090 2.34366334 2.83868468 -1.81224649 -2.05825346
7 8 9 10 11 12
3.53292757 -1.95145124 -2.17128985 2.12400186 0.56784259 -0.39169257
13 14 15 16 17 18
0.29558749 0.42423703 -0.67203780 -0.31579034 0.25331234 3.55144484
19 20 21 22 23 24
2.21152175 0.53276549 0.49282760 0.90841252 2.36189150 0.86377887
25 26 27 28 29 30
2.08851887 0.07398493 0.97555415 -1.42295326 0.47162160 -0.35899752
31 32 33 34 35 36
-0.73307638 -0.47270307 -1.19278108 0.14760449 -1.59844535 -6.16999200
37 38 39 40 41 42
-1.08146804 -1.89134555 1.60681024 1.25711039 0.85769892 -1.60857528
43 44 45 46 47 48
2.09819805 -0.29581996 -0.90081004 -4.66253049 -2.76188844 -0.10894128
49 50 51 52 53 54
0.77618530 -2.03047733 -0.69707286 -0.15125334 -2.75190714 0.19288148
55 56 57 58 59 60
-2.56114902 1.24827493 -0.11140915 0.70859550 -0.36650453 1.73824495
61 62 63 64 65 66
0.49700562 0.07878590 -0.47569677 -0.44595535 0.59141447 0.93338995
67 68 69 70 71 72
1.75414410 3.51431623 -3.94537972 0.49589530 -3.67907809 -0.45761644
73 74 75 76 77 78
1.40555541 0.86711558 0.42485289 3.15919685 -0.38726332 1.47644624
79 80 81 82 83 84
-1.87956044 0.17737702 0.47533679 4.23801347 0.18892872 -0.86089894
85 86 87 88 89 90
0.23510479 1.76438087 -0.24166136 0.68456101 1.43887873 0.75209823
91 92 93 94 95 96
-1.61462921 0.15254458 0.47694483 -0.05431378 -2.03581000 0.94291959
97 98 99 100 101 102
0.17328074 2.00053887 0.03433858 -0.33257516 -1.16312747 1.23562419
103 104 105 106 107 108
2.65431501 0.48788918 1.45923675 -2.18568608 1.04855351 0.18281706
109 110 111 112 113 114
1.50889203 -0.38430984 1.09617834 0.25995614 2.29525450 -1.18442262
115 116 117 118 119 120
-2.78697440 1.52719732 -1.49854260 0.90373841 -1.86257058 0.40721986
121 122 123 124 125 126
-1.24329936 0.59670277 -2.90666447 -1.00170245 -0.83634902 -0.62612406
127 128 129 130 131 132
-0.24590715 0.95655722 1.05493920 -2.80582883 2.00127998 -3.25759385
133 134 135 136 137 138
2.06231386 -1.80546221 -1.59916913 -0.05096502 1.00305080 0.50224199
139 140 141 142 143 144
-2.21190693 -1.26131687 -5.24238286 3.03575198 1.76421776 0.52807389
145 146 147 148 149 150
1.56020039 -3.93377152 2.35777338 -2.08515612 1.04207406 0.06968569
151 152 153 154 155 156
-3.08666919 -1.13573225 2.12940725 4.04213923 1.64595668 -2.47899267
157 158 159 160 161 162
0.42716798 1.41356803 1.18168847 1.17594577 -0.34001465 0.35763307
> postscript(file="/var/wessaorg/rcomp/tmp/6f35k1351951849.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.39393580 NA
1 -0.12491090 -3.39393580
2 2.34366334 -0.12491090
3 2.83868468 2.34366334
4 -1.81224649 2.83868468
5 -2.05825346 -1.81224649
6 3.53292757 -2.05825346
7 -1.95145124 3.53292757
8 -2.17128985 -1.95145124
9 2.12400186 -2.17128985
10 0.56784259 2.12400186
11 -0.39169257 0.56784259
12 0.29558749 -0.39169257
13 0.42423703 0.29558749
14 -0.67203780 0.42423703
15 -0.31579034 -0.67203780
16 0.25331234 -0.31579034
17 3.55144484 0.25331234
18 2.21152175 3.55144484
19 0.53276549 2.21152175
20 0.49282760 0.53276549
21 0.90841252 0.49282760
22 2.36189150 0.90841252
23 0.86377887 2.36189150
24 2.08851887 0.86377887
25 0.07398493 2.08851887
26 0.97555415 0.07398493
27 -1.42295326 0.97555415
28 0.47162160 -1.42295326
29 -0.35899752 0.47162160
30 -0.73307638 -0.35899752
31 -0.47270307 -0.73307638
32 -1.19278108 -0.47270307
33 0.14760449 -1.19278108
34 -1.59844535 0.14760449
35 -6.16999200 -1.59844535
36 -1.08146804 -6.16999200
37 -1.89134555 -1.08146804
38 1.60681024 -1.89134555
39 1.25711039 1.60681024
40 0.85769892 1.25711039
41 -1.60857528 0.85769892
42 2.09819805 -1.60857528
43 -0.29581996 2.09819805
44 -0.90081004 -0.29581996
45 -4.66253049 -0.90081004
46 -2.76188844 -4.66253049
47 -0.10894128 -2.76188844
48 0.77618530 -0.10894128
49 -2.03047733 0.77618530
50 -0.69707286 -2.03047733
51 -0.15125334 -0.69707286
52 -2.75190714 -0.15125334
53 0.19288148 -2.75190714
54 -2.56114902 0.19288148
55 1.24827493 -2.56114902
56 -0.11140915 1.24827493
57 0.70859550 -0.11140915
58 -0.36650453 0.70859550
59 1.73824495 -0.36650453
60 0.49700562 1.73824495
61 0.07878590 0.49700562
62 -0.47569677 0.07878590
63 -0.44595535 -0.47569677
64 0.59141447 -0.44595535
65 0.93338995 0.59141447
66 1.75414410 0.93338995
67 3.51431623 1.75414410
68 -3.94537972 3.51431623
69 0.49589530 -3.94537972
70 -3.67907809 0.49589530
71 -0.45761644 -3.67907809
72 1.40555541 -0.45761644
73 0.86711558 1.40555541
74 0.42485289 0.86711558
75 3.15919685 0.42485289
76 -0.38726332 3.15919685
77 1.47644624 -0.38726332
78 -1.87956044 1.47644624
79 0.17737702 -1.87956044
80 0.47533679 0.17737702
81 4.23801347 0.47533679
82 0.18892872 4.23801347
83 -0.86089894 0.18892872
84 0.23510479 -0.86089894
85 1.76438087 0.23510479
86 -0.24166136 1.76438087
87 0.68456101 -0.24166136
88 1.43887873 0.68456101
89 0.75209823 1.43887873
90 -1.61462921 0.75209823
91 0.15254458 -1.61462921
92 0.47694483 0.15254458
93 -0.05431378 0.47694483
94 -2.03581000 -0.05431378
95 0.94291959 -2.03581000
96 0.17328074 0.94291959
97 2.00053887 0.17328074
98 0.03433858 2.00053887
99 -0.33257516 0.03433858
100 -1.16312747 -0.33257516
101 1.23562419 -1.16312747
102 2.65431501 1.23562419
103 0.48788918 2.65431501
104 1.45923675 0.48788918
105 -2.18568608 1.45923675
106 1.04855351 -2.18568608
107 0.18281706 1.04855351
108 1.50889203 0.18281706
109 -0.38430984 1.50889203
110 1.09617834 -0.38430984
111 0.25995614 1.09617834
112 2.29525450 0.25995614
113 -1.18442262 2.29525450
114 -2.78697440 -1.18442262
115 1.52719732 -2.78697440
116 -1.49854260 1.52719732
117 0.90373841 -1.49854260
118 -1.86257058 0.90373841
119 0.40721986 -1.86257058
120 -1.24329936 0.40721986
121 0.59670277 -1.24329936
122 -2.90666447 0.59670277
123 -1.00170245 -2.90666447
124 -0.83634902 -1.00170245
125 -0.62612406 -0.83634902
126 -0.24590715 -0.62612406
127 0.95655722 -0.24590715
128 1.05493920 0.95655722
129 -2.80582883 1.05493920
130 2.00127998 -2.80582883
131 -3.25759385 2.00127998
132 2.06231386 -3.25759385
133 -1.80546221 2.06231386
134 -1.59916913 -1.80546221
135 -0.05096502 -1.59916913
136 1.00305080 -0.05096502
137 0.50224199 1.00305080
138 -2.21190693 0.50224199
139 -1.26131687 -2.21190693
140 -5.24238286 -1.26131687
141 3.03575198 -5.24238286
142 1.76421776 3.03575198
143 0.52807389 1.76421776
144 1.56020039 0.52807389
145 -3.93377152 1.56020039
146 2.35777338 -3.93377152
147 -2.08515612 2.35777338
148 1.04207406 -2.08515612
149 0.06968569 1.04207406
150 -3.08666919 0.06968569
151 -1.13573225 -3.08666919
152 2.12940725 -1.13573225
153 4.04213923 2.12940725
154 1.64595668 4.04213923
155 -2.47899267 1.64595668
156 0.42716798 -2.47899267
157 1.41356803 0.42716798
158 1.18168847 1.41356803
159 1.17594577 1.18168847
160 -0.34001465 1.17594577
161 0.35763307 -0.34001465
162 NA 0.35763307
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -0.12491090 -3.39393580
[2,] 2.34366334 -0.12491090
[3,] 2.83868468 2.34366334
[4,] -1.81224649 2.83868468
[5,] -2.05825346 -1.81224649
[6,] 3.53292757 -2.05825346
[7,] -1.95145124 3.53292757
[8,] -2.17128985 -1.95145124
[9,] 2.12400186 -2.17128985
[10,] 0.56784259 2.12400186
[11,] -0.39169257 0.56784259
[12,] 0.29558749 -0.39169257
[13,] 0.42423703 0.29558749
[14,] -0.67203780 0.42423703
[15,] -0.31579034 -0.67203780
[16,] 0.25331234 -0.31579034
[17,] 3.55144484 0.25331234
[18,] 2.21152175 3.55144484
[19,] 0.53276549 2.21152175
[20,] 0.49282760 0.53276549
[21,] 0.90841252 0.49282760
[22,] 2.36189150 0.90841252
[23,] 0.86377887 2.36189150
[24,] 2.08851887 0.86377887
[25,] 0.07398493 2.08851887
[26,] 0.97555415 0.07398493
[27,] -1.42295326 0.97555415
[28,] 0.47162160 -1.42295326
[29,] -0.35899752 0.47162160
[30,] -0.73307638 -0.35899752
[31,] -0.47270307 -0.73307638
[32,] -1.19278108 -0.47270307
[33,] 0.14760449 -1.19278108
[34,] -1.59844535 0.14760449
[35,] -6.16999200 -1.59844535
[36,] -1.08146804 -6.16999200
[37,] -1.89134555 -1.08146804
[38,] 1.60681024 -1.89134555
[39,] 1.25711039 1.60681024
[40,] 0.85769892 1.25711039
[41,] -1.60857528 0.85769892
[42,] 2.09819805 -1.60857528
[43,] -0.29581996 2.09819805
[44,] -0.90081004 -0.29581996
[45,] -4.66253049 -0.90081004
[46,] -2.76188844 -4.66253049
[47,] -0.10894128 -2.76188844
[48,] 0.77618530 -0.10894128
[49,] -2.03047733 0.77618530
[50,] -0.69707286 -2.03047733
[51,] -0.15125334 -0.69707286
[52,] -2.75190714 -0.15125334
[53,] 0.19288148 -2.75190714
[54,] -2.56114902 0.19288148
[55,] 1.24827493 -2.56114902
[56,] -0.11140915 1.24827493
[57,] 0.70859550 -0.11140915
[58,] -0.36650453 0.70859550
[59,] 1.73824495 -0.36650453
[60,] 0.49700562 1.73824495
[61,] 0.07878590 0.49700562
[62,] -0.47569677 0.07878590
[63,] -0.44595535 -0.47569677
[64,] 0.59141447 -0.44595535
[65,] 0.93338995 0.59141447
[66,] 1.75414410 0.93338995
[67,] 3.51431623 1.75414410
[68,] -3.94537972 3.51431623
[69,] 0.49589530 -3.94537972
[70,] -3.67907809 0.49589530
[71,] -0.45761644 -3.67907809
[72,] 1.40555541 -0.45761644
[73,] 0.86711558 1.40555541
[74,] 0.42485289 0.86711558
[75,] 3.15919685 0.42485289
[76,] -0.38726332 3.15919685
[77,] 1.47644624 -0.38726332
[78,] -1.87956044 1.47644624
[79,] 0.17737702 -1.87956044
[80,] 0.47533679 0.17737702
[81,] 4.23801347 0.47533679
[82,] 0.18892872 4.23801347
[83,] -0.86089894 0.18892872
[84,] 0.23510479 -0.86089894
[85,] 1.76438087 0.23510479
[86,] -0.24166136 1.76438087
[87,] 0.68456101 -0.24166136
[88,] 1.43887873 0.68456101
[89,] 0.75209823 1.43887873
[90,] -1.61462921 0.75209823
[91,] 0.15254458 -1.61462921
[92,] 0.47694483 0.15254458
[93,] -0.05431378 0.47694483
[94,] -2.03581000 -0.05431378
[95,] 0.94291959 -2.03581000
[96,] 0.17328074 0.94291959
[97,] 2.00053887 0.17328074
[98,] 0.03433858 2.00053887
[99,] -0.33257516 0.03433858
[100,] -1.16312747 -0.33257516
[101,] 1.23562419 -1.16312747
[102,] 2.65431501 1.23562419
[103,] 0.48788918 2.65431501
[104,] 1.45923675 0.48788918
[105,] -2.18568608 1.45923675
[106,] 1.04855351 -2.18568608
[107,] 0.18281706 1.04855351
[108,] 1.50889203 0.18281706
[109,] -0.38430984 1.50889203
[110,] 1.09617834 -0.38430984
[111,] 0.25995614 1.09617834
[112,] 2.29525450 0.25995614
[113,] -1.18442262 2.29525450
[114,] -2.78697440 -1.18442262
[115,] 1.52719732 -2.78697440
[116,] -1.49854260 1.52719732
[117,] 0.90373841 -1.49854260
[118,] -1.86257058 0.90373841
[119,] 0.40721986 -1.86257058
[120,] -1.24329936 0.40721986
[121,] 0.59670277 -1.24329936
[122,] -2.90666447 0.59670277
[123,] -1.00170245 -2.90666447
[124,] -0.83634902 -1.00170245
[125,] -0.62612406 -0.83634902
[126,] -0.24590715 -0.62612406
[127,] 0.95655722 -0.24590715
[128,] 1.05493920 0.95655722
[129,] -2.80582883 1.05493920
[130,] 2.00127998 -2.80582883
[131,] -3.25759385 2.00127998
[132,] 2.06231386 -3.25759385
[133,] -1.80546221 2.06231386
[134,] -1.59916913 -1.80546221
[135,] -0.05096502 -1.59916913
[136,] 1.00305080 -0.05096502
[137,] 0.50224199 1.00305080
[138,] -2.21190693 0.50224199
[139,] -1.26131687 -2.21190693
[140,] -5.24238286 -1.26131687
[141,] 3.03575198 -5.24238286
[142,] 1.76421776 3.03575198
[143,] 0.52807389 1.76421776
[144,] 1.56020039 0.52807389
[145,] -3.93377152 1.56020039
[146,] 2.35777338 -3.93377152
[147,] -2.08515612 2.35777338
[148,] 1.04207406 -2.08515612
[149,] 0.06968569 1.04207406
[150,] -3.08666919 0.06968569
[151,] -1.13573225 -3.08666919
[152,] 2.12940725 -1.13573225
[153,] 4.04213923 2.12940725
[154,] 1.64595668 4.04213923
[155,] -2.47899267 1.64595668
[156,] 0.42716798 -2.47899267
[157,] 1.41356803 0.42716798
[158,] 1.18168847 1.41356803
[159,] 1.17594577 1.18168847
[160,] -0.34001465 1.17594577
[161,] 0.35763307 -0.34001465
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -0.12491090 -3.39393580
2 2.34366334 -0.12491090
3 2.83868468 2.34366334
4 -1.81224649 2.83868468
5 -2.05825346 -1.81224649
6 3.53292757 -2.05825346
7 -1.95145124 3.53292757
8 -2.17128985 -1.95145124
9 2.12400186 -2.17128985
10 0.56784259 2.12400186
11 -0.39169257 0.56784259
12 0.29558749 -0.39169257
13 0.42423703 0.29558749
14 -0.67203780 0.42423703
15 -0.31579034 -0.67203780
16 0.25331234 -0.31579034
17 3.55144484 0.25331234
18 2.21152175 3.55144484
19 0.53276549 2.21152175
20 0.49282760 0.53276549
21 0.90841252 0.49282760
22 2.36189150 0.90841252
23 0.86377887 2.36189150
24 2.08851887 0.86377887
25 0.07398493 2.08851887
26 0.97555415 0.07398493
27 -1.42295326 0.97555415
28 0.47162160 -1.42295326
29 -0.35899752 0.47162160
30 -0.73307638 -0.35899752
31 -0.47270307 -0.73307638
32 -1.19278108 -0.47270307
33 0.14760449 -1.19278108
34 -1.59844535 0.14760449
35 -6.16999200 -1.59844535
36 -1.08146804 -6.16999200
37 -1.89134555 -1.08146804
38 1.60681024 -1.89134555
39 1.25711039 1.60681024
40 0.85769892 1.25711039
41 -1.60857528 0.85769892
42 2.09819805 -1.60857528
43 -0.29581996 2.09819805
44 -0.90081004 -0.29581996
45 -4.66253049 -0.90081004
46 -2.76188844 -4.66253049
47 -0.10894128 -2.76188844
48 0.77618530 -0.10894128
49 -2.03047733 0.77618530
50 -0.69707286 -2.03047733
51 -0.15125334 -0.69707286
52 -2.75190714 -0.15125334
53 0.19288148 -2.75190714
54 -2.56114902 0.19288148
55 1.24827493 -2.56114902
56 -0.11140915 1.24827493
57 0.70859550 -0.11140915
58 -0.36650453 0.70859550
59 1.73824495 -0.36650453
60 0.49700562 1.73824495
61 0.07878590 0.49700562
62 -0.47569677 0.07878590
63 -0.44595535 -0.47569677
64 0.59141447 -0.44595535
65 0.93338995 0.59141447
66 1.75414410 0.93338995
67 3.51431623 1.75414410
68 -3.94537972 3.51431623
69 0.49589530 -3.94537972
70 -3.67907809 0.49589530
71 -0.45761644 -3.67907809
72 1.40555541 -0.45761644
73 0.86711558 1.40555541
74 0.42485289 0.86711558
75 3.15919685 0.42485289
76 -0.38726332 3.15919685
77 1.47644624 -0.38726332
78 -1.87956044 1.47644624
79 0.17737702 -1.87956044
80 0.47533679 0.17737702
81 4.23801347 0.47533679
82 0.18892872 4.23801347
83 -0.86089894 0.18892872
84 0.23510479 -0.86089894
85 1.76438087 0.23510479
86 -0.24166136 1.76438087
87 0.68456101 -0.24166136
88 1.43887873 0.68456101
89 0.75209823 1.43887873
90 -1.61462921 0.75209823
91 0.15254458 -1.61462921
92 0.47694483 0.15254458
93 -0.05431378 0.47694483
94 -2.03581000 -0.05431378
95 0.94291959 -2.03581000
96 0.17328074 0.94291959
97 2.00053887 0.17328074
98 0.03433858 2.00053887
99 -0.33257516 0.03433858
100 -1.16312747 -0.33257516
101 1.23562419 -1.16312747
102 2.65431501 1.23562419
103 0.48788918 2.65431501
104 1.45923675 0.48788918
105 -2.18568608 1.45923675
106 1.04855351 -2.18568608
107 0.18281706 1.04855351
108 1.50889203 0.18281706
109 -0.38430984 1.50889203
110 1.09617834 -0.38430984
111 0.25995614 1.09617834
112 2.29525450 0.25995614
113 -1.18442262 2.29525450
114 -2.78697440 -1.18442262
115 1.52719732 -2.78697440
116 -1.49854260 1.52719732
117 0.90373841 -1.49854260
118 -1.86257058 0.90373841
119 0.40721986 -1.86257058
120 -1.24329936 0.40721986
121 0.59670277 -1.24329936
122 -2.90666447 0.59670277
123 -1.00170245 -2.90666447
124 -0.83634902 -1.00170245
125 -0.62612406 -0.83634902
126 -0.24590715 -0.62612406
127 0.95655722 -0.24590715
128 1.05493920 0.95655722
129 -2.80582883 1.05493920
130 2.00127998 -2.80582883
131 -3.25759385 2.00127998
132 2.06231386 -3.25759385
133 -1.80546221 2.06231386
134 -1.59916913 -1.80546221
135 -0.05096502 -1.59916913
136 1.00305080 -0.05096502
137 0.50224199 1.00305080
138 -2.21190693 0.50224199
139 -1.26131687 -2.21190693
140 -5.24238286 -1.26131687
141 3.03575198 -5.24238286
142 1.76421776 3.03575198
143 0.52807389 1.76421776
144 1.56020039 0.52807389
145 -3.93377152 1.56020039
146 2.35777338 -3.93377152
147 -2.08515612 2.35777338
148 1.04207406 -2.08515612
149 0.06968569 1.04207406
150 -3.08666919 0.06968569
151 -1.13573225 -3.08666919
152 2.12940725 -1.13573225
153 4.04213923 2.12940725
154 1.64595668 4.04213923
155 -2.47899267 1.64595668
156 0.42716798 -2.47899267
157 1.41356803 0.42716798
158 1.18168847 1.41356803
159 1.17594577 1.18168847
160 -0.34001465 1.17594577
161 0.35763307 -0.34001465
> 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/wessaorg/rcomp/tmp/7c8aj1351951849.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/wessaorg/rcomp/tmp/8etzj1351951849.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/wessaorg/rcomp/tmp/93tww1351951849.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/wessaorg/rcomp/tmp/10oc511351951849.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/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/wessaorg/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/wessaorg/rcomp/tmp/111ngx1351951849.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/wessaorg/rcomp/tmp/12f1za1351951849.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/wessaorg/rcomp/tmp/137hds1351951849.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/wessaorg/rcomp/tmp/14s33b1351951849.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/wessaorg/rcomp/tmp/154hql1351951849.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/wessaorg/rcomp/tmp/16h1921351951849.tab")
+ }
>
> try(system("convert tmp/1qyjk1351951849.ps tmp/1qyjk1351951849.png",intern=TRUE))
character(0)
> try(system("convert tmp/26ido1351951849.ps tmp/26ido1351951849.png",intern=TRUE))
character(0)
> try(system("convert tmp/3lopl1351951849.ps tmp/3lopl1351951849.png",intern=TRUE))
character(0)
> try(system("convert tmp/4gi1z1351951849.ps tmp/4gi1z1351951849.png",intern=TRUE))
character(0)
> try(system("convert tmp/5tgs41351951849.ps tmp/5tgs41351951849.png",intern=TRUE))
character(0)
> try(system("convert tmp/6f35k1351951849.ps tmp/6f35k1351951849.png",intern=TRUE))
character(0)
> try(system("convert tmp/7c8aj1351951849.ps tmp/7c8aj1351951849.png",intern=TRUE))
character(0)
> try(system("convert tmp/8etzj1351951849.ps tmp/8etzj1351951849.png",intern=TRUE))
character(0)
> try(system("convert tmp/93tww1351951849.ps tmp/93tww1351951849.png",intern=TRUE))
character(0)
> try(system("convert tmp/10oc511351951849.ps tmp/10oc511351951849.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
7.735 1.150 9.014