R version 2.15.2 (2012-10-26) -- "Trick or Treat"
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(41
+ ,38
+ ,12
+ ,14
+ ,12
+ ,53
+ ,32
+ ,39
+ ,32
+ ,11
+ ,18
+ ,11
+ ,86
+ ,51
+ ,30
+ ,35
+ ,15
+ ,11
+ ,14
+ ,66
+ ,42
+ ,31
+ ,33
+ ,6
+ ,12
+ ,12
+ ,67
+ ,41
+ ,34
+ ,37
+ ,13
+ ,16
+ ,21
+ ,76
+ ,46
+ ,35
+ ,29
+ ,10
+ ,18
+ ,12
+ ,78
+ ,47
+ ,39
+ ,31
+ ,12
+ ,14
+ ,22
+ ,53
+ ,37
+ ,34
+ ,36
+ ,14
+ ,14
+ ,11
+ ,80
+ ,49
+ ,36
+ ,35
+ ,12
+ ,15
+ ,10
+ ,74
+ ,45
+ ,37
+ ,38
+ ,6
+ ,15
+ ,13
+ ,76
+ ,47
+ ,38
+ ,31
+ ,10
+ ,17
+ ,10
+ ,79
+ ,49
+ ,36
+ ,34
+ ,12
+ ,19
+ ,8
+ ,54
+ ,33
+ ,38
+ ,35
+ ,12
+ ,10
+ ,15
+ ,67
+ ,42
+ ,39
+ ,38
+ ,11
+ ,16
+ ,14
+ ,54
+ ,33
+ ,33
+ ,37
+ ,15
+ ,18
+ ,10
+ ,87
+ ,53
+ ,32
+ ,33
+ ,12
+ ,14
+ ,14
+ ,58
+ ,36
+ ,36
+ ,32
+ ,10
+ ,14
+ ,14
+ ,75
+ ,45
+ ,38
+ ,38
+ ,12
+ ,17
+ ,11
+ ,88
+ ,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belonging_Final
')
+ ,1:162))
> y <- array(NA,dim=c(7,162),dimnames=list(c('Connected','Separate','Software','Happiness','Depression','Belonging','Belonging_Final
'),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 = '1'
> par3 <- 'No Linear Trend'
> par2 <- 'Do not include Seasonal Dummies'
> par1 <- '1'
> #'GNU S' R Code compiled by R2WASP v. 1.0.44 ()
> #Author: Prof. Dr. P. Wessa
> #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/
> #Source of accompanying publication: Office for Research, Development, and Education
> #Technical description: Write here your technical program description (don't use hard returns!)
> library(lattice)
> library(lmtest)
Loading required package: zoo
Attaching package: 'zoo'
The following object(s) are masked from 'package:base':
as.Date, 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
Connected Separate Software Happiness Depression Belonging
1 41 38 12 14 12 53
2 39 32 11 18 11 86
3 30 35 15 11 14 66
4 31 33 6 12 12 67
5 34 37 13 16 21 76
6 35 29 10 18 12 78
7 39 31 12 14 22 53
8 34 36 14 14 11 80
9 36 35 12 15 10 74
10 37 38 6 15 13 76
11 38 31 10 17 10 79
12 36 34 12 19 8 54
13 38 35 12 10 15 67
14 39 38 11 16 14 54
15 33 37 15 18 10 87
16 32 33 12 14 14 58
17 36 32 10 14 14 75
18 38 38 12 17 11 88
19 39 38 11 14 10 64
20 32 32 12 16 13 57
21 32 33 11 18 7 66
22 31 31 12 11 14 68
23 39 38 13 14 12 54
24 37 39 11 12 14 56
25 39 32 9 17 11 86
26 41 32 13 9 9 80
27 36 35 10 16 11 76
28 33 37 14 14 15 69
29 33 33 12 15 14 78
30 34 33 10 11 13 67
31 31 28 12 16 9 80
32 27 32 8 13 15 54
33 37 31 10 17 10 71
34 34 37 12 15 11 84
35 34 30 12 14 13 74
36 32 33 7 16 8 71
37 29 31 6 9 20 63
38 36 33 12 15 12 71
39 29 31 10 17 10 76
40 35 33 10 13 10 69
41 37 32 10 15 9 74
42 34 33 12 16 14 75
43 38 32 15 16 8 54
44 35 33 10 12 14 52
45 38 28 10 12 11 69
46 37 35 12 11 13 68
47 38 39 13 15 9 65
48 33 34 11 15 11 75
49 36 38 11 17 15 74
50 38 32 12 13 11 75
51 32 38 14 16 10 72
52 32 30 10 14 14 67
53 32 33 12 11 18 63
54 34 38 13 12 14 62
55 32 32 5 12 11 63
56 37 32 6 15 12 76
57 39 34 12 16 13 74
58 29 34 12 15 9 67
59 37 36 11 12 10 73
60 35 34 10 12 15 70
61 30 28 7 8 20 53
62 38 34 12 13 12 77
63 34 35 14 11 12 77
64 31 35 11 14 14 52
65 34 31 12 15 13 54
66 35 37 13 10 11 80
67 36 35 14 11 17 66
68 30 27 11 12 12 73
69 39 40 12 15 13 63
70 35 37 12 15 14 69
71 38 36 8 14 13 67
72 31 38 11 16 15 54
73 34 39 14 15 13 81
74 38 41 14 15 10 69
75 34 27 12 13 11 84
76 39 30 9 12 19 80
77 37 37 13 17 13 70
78 34 31 11 13 17 69
79 28 31 12 15 13 77
80 37 27 12 13 9 54
81 33 36 12 15 11 79
82 37 38 12 16 10 30
83 35 37 12 15 9 71
84 37 33 12 16 12 73
85 32 34 11 15 12 72
86 33 31 10 14 13 77
87 38 39 9 15 13 75
88 33 34 12 14 12 69
89 29 32 12 13 15 54
90 33 33 12 7 22 70
91 31 36 9 17 13 73
92 36 32 15 13 15 54
93 35 41 12 15 13 77
94 32 28 12 14 15 82
95 29 30 12 13 10 80
96 39 36 10 16 11 80
97 37 35 13 12 16 69
98 35 31 9 14 11 78
99 37 34 12 17 11 81
100 32 36 10 15 10 76
101 38 36 14 17 10 76
102 37 35 11 12 16 73
103 36 37 15 16 12 85
104 32 28 11 11 11 66
105 33 39 11 15 16 79
106 40 32 12 9 19 68
107 38 35 12 16 11 76
108 41 39 12 15 16 71
109 36 35 11 10 15 54
110 43 42 7 10 24 46
111 30 34 12 15 14 82
112 31 33 14 11 15 74
113 32 41 11 13 11 88
114 32 33 11 14 15 38
115 37 34 10 18 12 76
116 37 32 13 16 10 86
117 33 40 13 14 14 54
118 34 40 8 14 13 70
119 33 35 11 14 9 69
120 38 36 12 14 15 90
121 33 37 11 12 15 54
122 31 27 13 14 14 76
123 38 39 12 15 11 89
124 37 38 14 15 8 76
125 33 31 13 15 11 73
126 31 33 15 13 11 79
127 39 32 10 17 8 90
128 44 39 11 17 10 74
129 33 36 9 19 11 81
130 35 33 11 15 13 72
131 32 33 10 13 11 71
132 28 32 11 9 20 66
133 40 37 8 15 10 77
134 27 30 11 15 15 65
135 37 38 12 15 12 74
136 32 29 12 16 14 82
137 28 22 9 11 23 54
138 34 35 11 14 14 63
139 30 35 10 11 16 54
140 35 34 8 15 11 64
141 31 35 9 13 12 69
142 32 34 8 15 10 54
143 30 34 9 16 14 84
144 30 35 15 14 12 86
145 31 23 11 15 12 77
146 40 31 8 16 11 89
147 32 27 13 16 12 76
148 36 36 12 11 13 60
149 32 31 12 12 11 75
150 35 32 9 9 19 73
151 38 39 7 16 12 85
152 42 37 13 13 17 79
153 34 38 9 16 9 71
154 35 39 6 12 12 72
155 35 34 8 9 19 69
156 33 31 8 13 18 78
157 36 32 15 13 15 54
158 32 37 6 14 14 69
159 33 36 9 19 11 81
160 34 32 11 13 9 84
161 32 35 8 12 18 84
162 34 36 8 13 16 69
Belonging_Final\r
1 32
2 51
3 42
4 41
5 46
6 47
7 37
8 49
9 45
10 47
11 49
12 33
13 42
14 33
15 53
16 36
17 45
18 54
19 41
20 36
21 41
22 44
23 33
24 37
25 52
26 47
27 43
28 44
29 45
30 44
31 49
32 33
33 43
34 54
35 42
36 44
37 37
38 43
39 46
40 42
41 45
42 44
43 33
44 31
45 42
46 40
47 43
48 46
49 42
50 45
51 44
52 40
53 37
54 46
55 36
56 47
57 45
58 42
59 43
60 43
61 32
62 45
63 45
64 31
65 33
66 49
67 42
68 41
69 38
70 42
71 44
72 33
73 48
74 40
75 50
76 49
77 43
78 44
79 47
80 33
81 46
82 0
83 45
84 43
85 44
86 47
87 45
88 42
89 33
90 43
91 46
92 33
93 46
94 48
95 47
96 47
97 43
98 46
99 48
100 46
101 45
102 45
103 52
104 42
105 47
106 41
107 47
108 43
109 33
110 30
111 49
112 44
113 55
114 11
115 47
116 53
117 33
118 44
119 42
120 55
121 33
122 46
123 54
124 47
125 45
126 47
127 55
128 44
129 53
130 44
131 42
132 40
133 46
134 40
135 46
136 53
137 33
138 42
139 35
140 40
141 41
142 33
143 51
144 53
145 46
146 55
147 47
148 38
149 46
150 46
151 53
152 47
153 41
154 44
155 43
156 51
157 33
158 43
159 53
160 51
161 50
162 46
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Separate Software
20.82070 0.34198 0.03830
Happiness Depression Belonging
0.05677 -0.04771 0.04830
`Belonging_Final\\r`
-0.04355
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-6.2640 -2.2959 -0.2287 2.1233 7.2746
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 20.82070 4.12209 5.051 1.22e-06 ***
Separate 0.34198 0.07168 4.771 4.20e-06 ***
Software 0.03830 0.11807 0.324 0.746
Happiness 0.05677 0.13076 0.434 0.665
Depression -0.04771 0.09643 -0.495 0.621
Belonging 0.04830 0.07618 0.634 0.527
`Belonging_Final\\r` -0.04355 0.10950 -0.398 0.691
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 3.17 on 155 degrees of freedom
Multiple R-squared: 0.151, Adjusted R-squared: 0.1181
F-statistic: 4.593 on 6 and 155 DF, p-value: 0.0002546
> 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.3291001 0.65820012 0.67089994
[2,] 0.1880822 0.37616443 0.81191778
[3,] 0.8040232 0.39195360 0.19597680
[4,] 0.8771639 0.24567220 0.12283610
[5,] 0.8209764 0.35804727 0.17902364
[6,] 0.7884943 0.42301139 0.21150569
[7,] 0.8104091 0.37918182 0.18959091
[8,] 0.7532914 0.49341722 0.24670861
[9,] 0.7025135 0.59497310 0.29748655
[10,] 0.6542121 0.69157589 0.34578795
[11,] 0.6888021 0.62239587 0.31119793
[12,] 0.7132105 0.57357905 0.28678952
[13,] 0.6677727 0.66445455 0.33222727
[14,] 0.6431618 0.71367635 0.35683818
[15,] 0.5747339 0.85053211 0.42526606
[16,] 0.5988694 0.80226128 0.40113064
[17,] 0.8073973 0.38520544 0.19260272
[18,] 0.7752202 0.44955955 0.22477978
[19,] 0.7519732 0.49605358 0.24802679
[20,] 0.7419180 0.51616404 0.25808202
[21,] 0.6918968 0.61620640 0.30810320
[22,] 0.6646188 0.67076236 0.33538118
[23,] 0.8627693 0.27446130 0.13723065
[24,] 0.8498635 0.30027298 0.15013649
[25,] 0.8289466 0.34210674 0.17105337
[26,] 0.7897839 0.42043213 0.21021607
[27,] 0.7823355 0.43532902 0.21766451
[28,] 0.7963708 0.40725833 0.20362916
[29,] 0.7602606 0.47947876 0.23973938
[30,] 0.8172785 0.36544303 0.18272152
[31,] 0.7795687 0.44086255 0.22043127
[32,] 0.7643515 0.47129702 0.23564851
[33,] 0.7232175 0.55356500 0.27678250
[34,] 0.7215174 0.55696515 0.27848257
[35,] 0.6794083 0.64118350 0.32059175
[36,] 0.7515311 0.49693772 0.24846886
[37,] 0.7199133 0.56017332 0.28008666
[38,] 0.6845875 0.63082500 0.31541250
[39,] 0.6574517 0.68509662 0.34254831
[40,] 0.6095311 0.78093788 0.39046894
[41,] 0.6160013 0.76799741 0.38399871
[42,] 0.6723344 0.65533128 0.32766564
[43,] 0.6359476 0.72810483 0.36405242
[44,] 0.6075053 0.78498941 0.39249470
[45,] 0.5629516 0.87409687 0.43704843
[46,] 0.5304487 0.93910255 0.46955127
[47,] 0.5335020 0.93299604 0.46649802
[48,] 0.5623568 0.87528641 0.43764321
[49,] 0.6776947 0.64461061 0.32230531
[50,] 0.6419554 0.71608928 0.35804464
[51,] 0.5975503 0.80489932 0.40244966
[52,] 0.5589178 0.88216448 0.44108224
[53,] 0.5493343 0.90133148 0.45066574
[54,] 0.5139529 0.97209429 0.48604715
[55,] 0.5247794 0.95044115 0.47522058
[56,] 0.4794744 0.95894881 0.52052560
[57,] 0.4362237 0.87244733 0.56377633
[58,] 0.3997831 0.79956610 0.60021695
[59,] 0.3866135 0.77322697 0.61338651
[60,] 0.3667295 0.73345902 0.63327049
[61,] 0.3252075 0.65041494 0.67479253
[62,] 0.3230916 0.64618320 0.67690840
[63,] 0.3653778 0.73075567 0.63462217
[64,] 0.3546766 0.70935310 0.64532345
[65,] 0.3143029 0.62860577 0.68569711
[66,] 0.2816635 0.56332707 0.71833646
[67,] 0.3819809 0.76396187 0.61801907
[68,] 0.3429373 0.68587465 0.65706268
[69,] 0.3031667 0.60633349 0.69683325
[70,] 0.4084678 0.81693562 0.59153219
[71,] 0.4933475 0.98669499 0.50665250
[72,] 0.4796778 0.95935569 0.52032216
[73,] 0.4407094 0.88141881 0.55929060
[74,] 0.3979640 0.79592804 0.60203598
[75,] 0.3799154 0.75983088 0.62008456
[76,] 0.3656147 0.73122945 0.63438527
[77,] 0.3250994 0.65019878 0.67490061
[78,] 0.2954420 0.59088398 0.70455801
[79,] 0.2653475 0.53069496 0.73465252
[80,] 0.2957592 0.59151839 0.70424080
[81,] 0.2576650 0.51532995 0.74233502
[82,] 0.2902140 0.58042790 0.70978605
[83,] 0.2747634 0.54952671 0.72523665
[84,] 0.2572300 0.51445996 0.74277002
[85,] 0.2236228 0.44724554 0.77637723
[86,] 0.2546398 0.50927955 0.74536022
[87,] 0.2569722 0.51394450 0.74302775
[88,] 0.2388156 0.47763130 0.76118435
[89,] 0.2121780 0.42435602 0.78782199
[90,] 0.1899184 0.37983678 0.81008161
[91,] 0.1911712 0.38234230 0.80882885
[92,] 0.1743502 0.34870032 0.82564984
[93,] 0.1597463 0.31949267 0.84025366
[94,] 0.1323188 0.26463751 0.86768124
[95,] 0.1114480 0.22289608 0.88855196
[96,] 0.1222225 0.24444499 0.87777750
[97,] 0.2337484 0.46749678 0.76625161
[98,] 0.2253724 0.45074477 0.77462762
[99,] 0.2585314 0.51706281 0.74146859
[100,] 0.2482121 0.49642428 0.75178786
[101,] 0.4764107 0.95282141 0.52358930
[102,] 0.5496771 0.90064582 0.45032291
[103,] 0.5344947 0.93101061 0.46550531
[104,] 0.6375099 0.72498016 0.36249008
[105,] 0.5985764 0.80284714 0.40142357
[106,] 0.5696143 0.86077139 0.43038569
[107,] 0.5428604 0.91427928 0.45713964
[108,] 0.5213750 0.95724995 0.47862497
[109,] 0.4921547 0.98430930 0.50784535
[110,] 0.4524332 0.90486639 0.54756680
[111,] 0.4178340 0.83566801 0.58216599
[112,] 0.3736927 0.74738536 0.62630732
[113,] 0.3278667 0.65573337 0.67213331
[114,] 0.2815895 0.56317896 0.71841052
[115,] 0.2373731 0.47474616 0.76262692
[116,] 0.1967495 0.39349890 0.80325055
[117,] 0.2133858 0.42677160 0.78661420
[118,] 0.2325373 0.46507464 0.76746268
[119,] 0.4509457 0.90189131 0.54905435
[120,] 0.4162269 0.83245374 0.58377313
[121,] 0.3695963 0.73919268 0.63040366
[122,] 0.3290475 0.65809509 0.67095245
[123,] 0.4011139 0.80222785 0.59888607
[124,] 0.4811140 0.96222804 0.51888598
[125,] 0.5826830 0.83463410 0.41731705
[126,] 0.5292627 0.94147460 0.47073730
[127,] 0.4660344 0.93206888 0.53396556
[128,] 0.4190518 0.83810358 0.58094821
[129,] 0.3511830 0.70236594 0.64881703
[130,] 0.3791040 0.75820791 0.62089604
[131,] 0.3292866 0.65857328 0.67071336
[132,] 0.3208335 0.64166695 0.67916653
[133,] 0.2635449 0.52708975 0.73645513
[134,] 0.3345274 0.66905476 0.66547262
[135,] 0.6615820 0.67683597 0.33841798
[136,] 0.5744740 0.85105196 0.42552598
[137,] 0.9747338 0.05053236 0.02526618
[138,] 0.9644480 0.07110394 0.03555197
[139,] 0.9548201 0.09035972 0.04517986
[140,] 0.9423992 0.11520156 0.05760078
[141,] 0.8878934 0.22421320 0.11210660
[142,] 0.8879203 0.22415946 0.11207973
[143,] 0.9650433 0.06991345 0.03495672
> postscript(file="/var/fisher/rcomp/tmp/1qomp1352144945.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/2ykrl1352144945.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/30cdy1352144945.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/493am1352144945.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/5oopl1352144945.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 7
5.3357624 4.3846018 -4.6798791 -2.8952953 -1.5459446 1.7087761 6.4245066
8 9 10 11 12 13 14
-1.6684071 0.7612989 1.0987711 4.0249574 1.2242190 3.4911947 3.3511876
15 16 17 18 19 20 21
-3.4874067 -1.9262213 2.0631574 1.3852358 3.1392522 -1.6971957 -2.6176770
22 23 24 25 26 27 28
-2.2065705 3.2927125 1.3138898 4.5615177 6.8391503 0.6451292 -2.5059564
29 30 31 32 33 34 35
-1.5570973 0.1866511 -2.0649369 -6.2640060 3.1500798 -1.9660285 0.5404660
36 37 38 39 40 41 42
-2.4140951 -3.6403006 1.5984950 -4.9607839 0.7462631 2.8161225 -0.5125118
43 44 45 46 47 48 49
3.9636071 1.3359845 5.5606530 2.2035946 1.6549887 -1.8154632 -0.2319754
50 51 52 53 54 55 56
3.9001969 -4.3449547 -1.0842088 -1.7630149 -1.3185919 -1.5872684 3.1029434
57 58 59 60 61 62 63
4.1896464 -5.7369645 1.5891355 0.6948667 -1.3306055 3.1673431 -1.1376868
64 65 66 67 68 69 70
-3.4998191 0.7158163 -0.7450014 1.5015569 -2.3247097 2.4210138 -0.6209472
71 72 73 74 75 76 77
3.0669851 -4.6010994 -2.7475483 0.6565842 1.3931268 6.0702118 1.1747452
78 79 80 81 82 83 84
0.8130181 -5.7854469 5.0064327 -2.7309319 0.8441620 -0.8254684 2.4451176
85 86 87 88 89 90 91
-2.7099419 -0.6520805 1.6031027 -1.6336581 -4.4171938 -0.4218932 -4.3443449
92 93 94 95 96 97 98
2.4679154 -2.2488053 -0.8052687 -4.6179676 3.2841367 2.3340105 1.1989383
99 100 101 102 103 104 105
1.8299792 -3.5571435 2.1325743 2.3044936 -0.2253805 -0.2759641 -3.4364630
106 107 108 109 110 111 112
6.6729097 2.7427337 4.7374617 1.7654778 7.2099876 -4.9180898 -3.2092282
113 114 115 116 117 118 119
-5.3317707 -1.9629012 2.0954766 2.4609390 -3.2958232 -2.4458459 -2.0804810
120 121 122 123 124 125 126
2.3773114 -2.0320288 -1.3465819 1.1084972 0.5538305 -0.8130590 -3.6627856
127 128 129 130 131 132 133
4.3175206 7.2745779 -2.6348885 0.6797520 -2.3026289 -5.1880250 4.1291670
134 135 136 137 138 139 140
-6.0349602 0.8743318 -1.0907594 -1.3872452 -0.5521010 -4.1181855 0.5694576
141 142 143 144 145 146 147
-3.8475253 -2.3000776 -4.8694772 -5.4326268 -0.1025654 5.9843093 -0.5120032
148 149 150 151 152 153 154
1.1609345 -1.6575002 1.7640360 1.4405830 6.3321627 -2.2835292 -1.0580443
155 156 157 158 159 160 161
1.1809324 -0.1542533 2.4679154 -3.2908435 -2.6348885 -0.3303571 -2.7987691
162
-0.7426093
> postscript(file="/var/fisher/rcomp/tmp/6gm3o1352144945.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 5.3357624 NA
1 4.3846018 5.3357624
2 -4.6798791 4.3846018
3 -2.8952953 -4.6798791
4 -1.5459446 -2.8952953
5 1.7087761 -1.5459446
6 6.4245066 1.7087761
7 -1.6684071 6.4245066
8 0.7612989 -1.6684071
9 1.0987711 0.7612989
10 4.0249574 1.0987711
11 1.2242190 4.0249574
12 3.4911947 1.2242190
13 3.3511876 3.4911947
14 -3.4874067 3.3511876
15 -1.9262213 -3.4874067
16 2.0631574 -1.9262213
17 1.3852358 2.0631574
18 3.1392522 1.3852358
19 -1.6971957 3.1392522
20 -2.6176770 -1.6971957
21 -2.2065705 -2.6176770
22 3.2927125 -2.2065705
23 1.3138898 3.2927125
24 4.5615177 1.3138898
25 6.8391503 4.5615177
26 0.6451292 6.8391503
27 -2.5059564 0.6451292
28 -1.5570973 -2.5059564
29 0.1866511 -1.5570973
30 -2.0649369 0.1866511
31 -6.2640060 -2.0649369
32 3.1500798 -6.2640060
33 -1.9660285 3.1500798
34 0.5404660 -1.9660285
35 -2.4140951 0.5404660
36 -3.6403006 -2.4140951
37 1.5984950 -3.6403006
38 -4.9607839 1.5984950
39 0.7462631 -4.9607839
40 2.8161225 0.7462631
41 -0.5125118 2.8161225
42 3.9636071 -0.5125118
43 1.3359845 3.9636071
44 5.5606530 1.3359845
45 2.2035946 5.5606530
46 1.6549887 2.2035946
47 -1.8154632 1.6549887
48 -0.2319754 -1.8154632
49 3.9001969 -0.2319754
50 -4.3449547 3.9001969
51 -1.0842088 -4.3449547
52 -1.7630149 -1.0842088
53 -1.3185919 -1.7630149
54 -1.5872684 -1.3185919
55 3.1029434 -1.5872684
56 4.1896464 3.1029434
57 -5.7369645 4.1896464
58 1.5891355 -5.7369645
59 0.6948667 1.5891355
60 -1.3306055 0.6948667
61 3.1673431 -1.3306055
62 -1.1376868 3.1673431
63 -3.4998191 -1.1376868
64 0.7158163 -3.4998191
65 -0.7450014 0.7158163
66 1.5015569 -0.7450014
67 -2.3247097 1.5015569
68 2.4210138 -2.3247097
69 -0.6209472 2.4210138
70 3.0669851 -0.6209472
71 -4.6010994 3.0669851
72 -2.7475483 -4.6010994
73 0.6565842 -2.7475483
74 1.3931268 0.6565842
75 6.0702118 1.3931268
76 1.1747452 6.0702118
77 0.8130181 1.1747452
78 -5.7854469 0.8130181
79 5.0064327 -5.7854469
80 -2.7309319 5.0064327
81 0.8441620 -2.7309319
82 -0.8254684 0.8441620
83 2.4451176 -0.8254684
84 -2.7099419 2.4451176
85 -0.6520805 -2.7099419
86 1.6031027 -0.6520805
87 -1.6336581 1.6031027
88 -4.4171938 -1.6336581
89 -0.4218932 -4.4171938
90 -4.3443449 -0.4218932
91 2.4679154 -4.3443449
92 -2.2488053 2.4679154
93 -0.8052687 -2.2488053
94 -4.6179676 -0.8052687
95 3.2841367 -4.6179676
96 2.3340105 3.2841367
97 1.1989383 2.3340105
98 1.8299792 1.1989383
99 -3.5571435 1.8299792
100 2.1325743 -3.5571435
101 2.3044936 2.1325743
102 -0.2253805 2.3044936
103 -0.2759641 -0.2253805
104 -3.4364630 -0.2759641
105 6.6729097 -3.4364630
106 2.7427337 6.6729097
107 4.7374617 2.7427337
108 1.7654778 4.7374617
109 7.2099876 1.7654778
110 -4.9180898 7.2099876
111 -3.2092282 -4.9180898
112 -5.3317707 -3.2092282
113 -1.9629012 -5.3317707
114 2.0954766 -1.9629012
115 2.4609390 2.0954766
116 -3.2958232 2.4609390
117 -2.4458459 -3.2958232
118 -2.0804810 -2.4458459
119 2.3773114 -2.0804810
120 -2.0320288 2.3773114
121 -1.3465819 -2.0320288
122 1.1084972 -1.3465819
123 0.5538305 1.1084972
124 -0.8130590 0.5538305
125 -3.6627856 -0.8130590
126 4.3175206 -3.6627856
127 7.2745779 4.3175206
128 -2.6348885 7.2745779
129 0.6797520 -2.6348885
130 -2.3026289 0.6797520
131 -5.1880250 -2.3026289
132 4.1291670 -5.1880250
133 -6.0349602 4.1291670
134 0.8743318 -6.0349602
135 -1.0907594 0.8743318
136 -1.3872452 -1.0907594
137 -0.5521010 -1.3872452
138 -4.1181855 -0.5521010
139 0.5694576 -4.1181855
140 -3.8475253 0.5694576
141 -2.3000776 -3.8475253
142 -4.8694772 -2.3000776
143 -5.4326268 -4.8694772
144 -0.1025654 -5.4326268
145 5.9843093 -0.1025654
146 -0.5120032 5.9843093
147 1.1609345 -0.5120032
148 -1.6575002 1.1609345
149 1.7640360 -1.6575002
150 1.4405830 1.7640360
151 6.3321627 1.4405830
152 -2.2835292 6.3321627
153 -1.0580443 -2.2835292
154 1.1809324 -1.0580443
155 -0.1542533 1.1809324
156 2.4679154 -0.1542533
157 -3.2908435 2.4679154
158 -2.6348885 -3.2908435
159 -0.3303571 -2.6348885
160 -2.7987691 -0.3303571
161 -0.7426093 -2.7987691
162 NA -0.7426093
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 4.3846018 5.3357624
[2,] -4.6798791 4.3846018
[3,] -2.8952953 -4.6798791
[4,] -1.5459446 -2.8952953
[5,] 1.7087761 -1.5459446
[6,] 6.4245066 1.7087761
[7,] -1.6684071 6.4245066
[8,] 0.7612989 -1.6684071
[9,] 1.0987711 0.7612989
[10,] 4.0249574 1.0987711
[11,] 1.2242190 4.0249574
[12,] 3.4911947 1.2242190
[13,] 3.3511876 3.4911947
[14,] -3.4874067 3.3511876
[15,] -1.9262213 -3.4874067
[16,] 2.0631574 -1.9262213
[17,] 1.3852358 2.0631574
[18,] 3.1392522 1.3852358
[19,] -1.6971957 3.1392522
[20,] -2.6176770 -1.6971957
[21,] -2.2065705 -2.6176770
[22,] 3.2927125 -2.2065705
[23,] 1.3138898 3.2927125
[24,] 4.5615177 1.3138898
[25,] 6.8391503 4.5615177
[26,] 0.6451292 6.8391503
[27,] -2.5059564 0.6451292
[28,] -1.5570973 -2.5059564
[29,] 0.1866511 -1.5570973
[30,] -2.0649369 0.1866511
[31,] -6.2640060 -2.0649369
[32,] 3.1500798 -6.2640060
[33,] -1.9660285 3.1500798
[34,] 0.5404660 -1.9660285
[35,] -2.4140951 0.5404660
[36,] -3.6403006 -2.4140951
[37,] 1.5984950 -3.6403006
[38,] -4.9607839 1.5984950
[39,] 0.7462631 -4.9607839
[40,] 2.8161225 0.7462631
[41,] -0.5125118 2.8161225
[42,] 3.9636071 -0.5125118
[43,] 1.3359845 3.9636071
[44,] 5.5606530 1.3359845
[45,] 2.2035946 5.5606530
[46,] 1.6549887 2.2035946
[47,] -1.8154632 1.6549887
[48,] -0.2319754 -1.8154632
[49,] 3.9001969 -0.2319754
[50,] -4.3449547 3.9001969
[51,] -1.0842088 -4.3449547
[52,] -1.7630149 -1.0842088
[53,] -1.3185919 -1.7630149
[54,] -1.5872684 -1.3185919
[55,] 3.1029434 -1.5872684
[56,] 4.1896464 3.1029434
[57,] -5.7369645 4.1896464
[58,] 1.5891355 -5.7369645
[59,] 0.6948667 1.5891355
[60,] -1.3306055 0.6948667
[61,] 3.1673431 -1.3306055
[62,] -1.1376868 3.1673431
[63,] -3.4998191 -1.1376868
[64,] 0.7158163 -3.4998191
[65,] -0.7450014 0.7158163
[66,] 1.5015569 -0.7450014
[67,] -2.3247097 1.5015569
[68,] 2.4210138 -2.3247097
[69,] -0.6209472 2.4210138
[70,] 3.0669851 -0.6209472
[71,] -4.6010994 3.0669851
[72,] -2.7475483 -4.6010994
[73,] 0.6565842 -2.7475483
[74,] 1.3931268 0.6565842
[75,] 6.0702118 1.3931268
[76,] 1.1747452 6.0702118
[77,] 0.8130181 1.1747452
[78,] -5.7854469 0.8130181
[79,] 5.0064327 -5.7854469
[80,] -2.7309319 5.0064327
[81,] 0.8441620 -2.7309319
[82,] -0.8254684 0.8441620
[83,] 2.4451176 -0.8254684
[84,] -2.7099419 2.4451176
[85,] -0.6520805 -2.7099419
[86,] 1.6031027 -0.6520805
[87,] -1.6336581 1.6031027
[88,] -4.4171938 -1.6336581
[89,] -0.4218932 -4.4171938
[90,] -4.3443449 -0.4218932
[91,] 2.4679154 -4.3443449
[92,] -2.2488053 2.4679154
[93,] -0.8052687 -2.2488053
[94,] -4.6179676 -0.8052687
[95,] 3.2841367 -4.6179676
[96,] 2.3340105 3.2841367
[97,] 1.1989383 2.3340105
[98,] 1.8299792 1.1989383
[99,] -3.5571435 1.8299792
[100,] 2.1325743 -3.5571435
[101,] 2.3044936 2.1325743
[102,] -0.2253805 2.3044936
[103,] -0.2759641 -0.2253805
[104,] -3.4364630 -0.2759641
[105,] 6.6729097 -3.4364630
[106,] 2.7427337 6.6729097
[107,] 4.7374617 2.7427337
[108,] 1.7654778 4.7374617
[109,] 7.2099876 1.7654778
[110,] -4.9180898 7.2099876
[111,] -3.2092282 -4.9180898
[112,] -5.3317707 -3.2092282
[113,] -1.9629012 -5.3317707
[114,] 2.0954766 -1.9629012
[115,] 2.4609390 2.0954766
[116,] -3.2958232 2.4609390
[117,] -2.4458459 -3.2958232
[118,] -2.0804810 -2.4458459
[119,] 2.3773114 -2.0804810
[120,] -2.0320288 2.3773114
[121,] -1.3465819 -2.0320288
[122,] 1.1084972 -1.3465819
[123,] 0.5538305 1.1084972
[124,] -0.8130590 0.5538305
[125,] -3.6627856 -0.8130590
[126,] 4.3175206 -3.6627856
[127,] 7.2745779 4.3175206
[128,] -2.6348885 7.2745779
[129,] 0.6797520 -2.6348885
[130,] -2.3026289 0.6797520
[131,] -5.1880250 -2.3026289
[132,] 4.1291670 -5.1880250
[133,] -6.0349602 4.1291670
[134,] 0.8743318 -6.0349602
[135,] -1.0907594 0.8743318
[136,] -1.3872452 -1.0907594
[137,] -0.5521010 -1.3872452
[138,] -4.1181855 -0.5521010
[139,] 0.5694576 -4.1181855
[140,] -3.8475253 0.5694576
[141,] -2.3000776 -3.8475253
[142,] -4.8694772 -2.3000776
[143,] -5.4326268 -4.8694772
[144,] -0.1025654 -5.4326268
[145,] 5.9843093 -0.1025654
[146,] -0.5120032 5.9843093
[147,] 1.1609345 -0.5120032
[148,] -1.6575002 1.1609345
[149,] 1.7640360 -1.6575002
[150,] 1.4405830 1.7640360
[151,] 6.3321627 1.4405830
[152,] -2.2835292 6.3321627
[153,] -1.0580443 -2.2835292
[154,] 1.1809324 -1.0580443
[155,] -0.1542533 1.1809324
[156,] 2.4679154 -0.1542533
[157,] -3.2908435 2.4679154
[158,] -2.6348885 -3.2908435
[159,] -0.3303571 -2.6348885
[160,] -2.7987691 -0.3303571
[161,] -0.7426093 -2.7987691
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 4.3846018 5.3357624
2 -4.6798791 4.3846018
3 -2.8952953 -4.6798791
4 -1.5459446 -2.8952953
5 1.7087761 -1.5459446
6 6.4245066 1.7087761
7 -1.6684071 6.4245066
8 0.7612989 -1.6684071
9 1.0987711 0.7612989
10 4.0249574 1.0987711
11 1.2242190 4.0249574
12 3.4911947 1.2242190
13 3.3511876 3.4911947
14 -3.4874067 3.3511876
15 -1.9262213 -3.4874067
16 2.0631574 -1.9262213
17 1.3852358 2.0631574
18 3.1392522 1.3852358
19 -1.6971957 3.1392522
20 -2.6176770 -1.6971957
21 -2.2065705 -2.6176770
22 3.2927125 -2.2065705
23 1.3138898 3.2927125
24 4.5615177 1.3138898
25 6.8391503 4.5615177
26 0.6451292 6.8391503
27 -2.5059564 0.6451292
28 -1.5570973 -2.5059564
29 0.1866511 -1.5570973
30 -2.0649369 0.1866511
31 -6.2640060 -2.0649369
32 3.1500798 -6.2640060
33 -1.9660285 3.1500798
34 0.5404660 -1.9660285
35 -2.4140951 0.5404660
36 -3.6403006 -2.4140951
37 1.5984950 -3.6403006
38 -4.9607839 1.5984950
39 0.7462631 -4.9607839
40 2.8161225 0.7462631
41 -0.5125118 2.8161225
42 3.9636071 -0.5125118
43 1.3359845 3.9636071
44 5.5606530 1.3359845
45 2.2035946 5.5606530
46 1.6549887 2.2035946
47 -1.8154632 1.6549887
48 -0.2319754 -1.8154632
49 3.9001969 -0.2319754
50 -4.3449547 3.9001969
51 -1.0842088 -4.3449547
52 -1.7630149 -1.0842088
53 -1.3185919 -1.7630149
54 -1.5872684 -1.3185919
55 3.1029434 -1.5872684
56 4.1896464 3.1029434
57 -5.7369645 4.1896464
58 1.5891355 -5.7369645
59 0.6948667 1.5891355
60 -1.3306055 0.6948667
61 3.1673431 -1.3306055
62 -1.1376868 3.1673431
63 -3.4998191 -1.1376868
64 0.7158163 -3.4998191
65 -0.7450014 0.7158163
66 1.5015569 -0.7450014
67 -2.3247097 1.5015569
68 2.4210138 -2.3247097
69 -0.6209472 2.4210138
70 3.0669851 -0.6209472
71 -4.6010994 3.0669851
72 -2.7475483 -4.6010994
73 0.6565842 -2.7475483
74 1.3931268 0.6565842
75 6.0702118 1.3931268
76 1.1747452 6.0702118
77 0.8130181 1.1747452
78 -5.7854469 0.8130181
79 5.0064327 -5.7854469
80 -2.7309319 5.0064327
81 0.8441620 -2.7309319
82 -0.8254684 0.8441620
83 2.4451176 -0.8254684
84 -2.7099419 2.4451176
85 -0.6520805 -2.7099419
86 1.6031027 -0.6520805
87 -1.6336581 1.6031027
88 -4.4171938 -1.6336581
89 -0.4218932 -4.4171938
90 -4.3443449 -0.4218932
91 2.4679154 -4.3443449
92 -2.2488053 2.4679154
93 -0.8052687 -2.2488053
94 -4.6179676 -0.8052687
95 3.2841367 -4.6179676
96 2.3340105 3.2841367
97 1.1989383 2.3340105
98 1.8299792 1.1989383
99 -3.5571435 1.8299792
100 2.1325743 -3.5571435
101 2.3044936 2.1325743
102 -0.2253805 2.3044936
103 -0.2759641 -0.2253805
104 -3.4364630 -0.2759641
105 6.6729097 -3.4364630
106 2.7427337 6.6729097
107 4.7374617 2.7427337
108 1.7654778 4.7374617
109 7.2099876 1.7654778
110 -4.9180898 7.2099876
111 -3.2092282 -4.9180898
112 -5.3317707 -3.2092282
113 -1.9629012 -5.3317707
114 2.0954766 -1.9629012
115 2.4609390 2.0954766
116 -3.2958232 2.4609390
117 -2.4458459 -3.2958232
118 -2.0804810 -2.4458459
119 2.3773114 -2.0804810
120 -2.0320288 2.3773114
121 -1.3465819 -2.0320288
122 1.1084972 -1.3465819
123 0.5538305 1.1084972
124 -0.8130590 0.5538305
125 -3.6627856 -0.8130590
126 4.3175206 -3.6627856
127 7.2745779 4.3175206
128 -2.6348885 7.2745779
129 0.6797520 -2.6348885
130 -2.3026289 0.6797520
131 -5.1880250 -2.3026289
132 4.1291670 -5.1880250
133 -6.0349602 4.1291670
134 0.8743318 -6.0349602
135 -1.0907594 0.8743318
136 -1.3872452 -1.0907594
137 -0.5521010 -1.3872452
138 -4.1181855 -0.5521010
139 0.5694576 -4.1181855
140 -3.8475253 0.5694576
141 -2.3000776 -3.8475253
142 -4.8694772 -2.3000776
143 -5.4326268 -4.8694772
144 -0.1025654 -5.4326268
145 5.9843093 -0.1025654
146 -0.5120032 5.9843093
147 1.1609345 -0.5120032
148 -1.6575002 1.1609345
149 1.7640360 -1.6575002
150 1.4405830 1.7640360
151 6.3321627 1.4405830
152 -2.2835292 6.3321627
153 -1.0580443 -2.2835292
154 1.1809324 -1.0580443
155 -0.1542533 1.1809324
156 2.4679154 -0.1542533
157 -3.2908435 2.4679154
158 -2.6348885 -3.2908435
159 -0.3303571 -2.6348885
160 -2.7987691 -0.3303571
161 -0.7426093 -2.7987691
> 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/7suou1352144945.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/8uh5p1352144945.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/9jjk21352144945.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/10zzge1352144945.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/11m2201352144945.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/12jk2m1352144945.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/13h7va1352144945.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/14ym1z1352144945.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/151gkl1352144945.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/16rs6s1352144945.tab")
+ }
>
> try(system("convert tmp/1qomp1352144945.ps tmp/1qomp1352144945.png",intern=TRUE))
character(0)
> try(system("convert tmp/2ykrl1352144945.ps tmp/2ykrl1352144945.png",intern=TRUE))
character(0)
> try(system("convert tmp/30cdy1352144945.ps tmp/30cdy1352144945.png",intern=TRUE))
character(0)
> try(system("convert tmp/493am1352144945.ps tmp/493am1352144945.png",intern=TRUE))
character(0)
> try(system("convert tmp/5oopl1352144945.ps tmp/5oopl1352144945.png",intern=TRUE))
character(0)
> try(system("convert tmp/6gm3o1352144945.ps tmp/6gm3o1352144945.png",intern=TRUE))
character(0)
> try(system("convert tmp/7suou1352144945.ps tmp/7suou1352144945.png",intern=TRUE))
character(0)
> try(system("convert tmp/8uh5p1352144945.ps tmp/8uh5p1352144945.png",intern=TRUE))
character(0)
> try(system("convert tmp/9jjk21352144945.ps tmp/9jjk21352144945.png",intern=TRUE))
character(0)
> try(system("convert tmp/10zzge1352144945.ps tmp/10zzge1352144945.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
8.069 1.139 9.202