R version 2.9.0 (2009-04-17)
Copyright (C) 2009 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> x <- array(list(9
+ ,13
+ ,13
+ ,14
+ ,13
+ ,3
+ ,9
+ ,12
+ ,12
+ ,8
+ ,13
+ ,5
+ ,9
+ ,15
+ ,10
+ ,12
+ ,16
+ ,6
+ ,9
+ ,12
+ ,9
+ ,7
+ ,12
+ ,6
+ ,9
+ ,10
+ ,10
+ ,10
+ ,11
+ ,5
+ ,9
+ ,12
+ ,12
+ ,7
+ ,12
+ ,3
+ ,9
+ ,15
+ ,13
+ ,16
+ ,18
+ ,8
+ ,9
+ ,9
+ ,12
+ ,11
+ ,11
+ ,4
+ ,9
+ ,12
+ ,12
+ ,14
+ ,14
+ ,4
+ ,9
+ ,11
+ ,6
+ ,6
+ ,9
+ ,4
+ ,9
+ ,11
+ ,5
+ ,16
+ ,14
+ ,6
+ ,9
+ ,11
+ ,12
+ ,11
+ ,12
+ ,6
+ ,9
+ ,15
+ ,11
+ ,16
+ ,11
+ ,5
+ ,9
+ ,7
+ ,14
+ ,12
+ ,12
+ ,4
+ ,9
+ ,11
+ ,14
+ ,7
+ ,13
+ ,6
+ ,9
+ ,11
+ ,12
+ ,13
+ ,11
+ ,4
+ ,9
+ ,10
+ ,12
+ ,11
+ ,12
+ ,6
+ ,9
+ ,14
+ ,11
+ ,15
+ ,16
+ ,6
+ ,9
+ ,10
+ ,11
+ ,7
+ ,9
+ ,4
+ ,9
+ ,6
+ ,7
+ ,9
+ ,11
+ ,4
+ ,9
+ ,11
+ ,9
+ ,7
+ ,13
+ ,2
+ ,9
+ ,15
+ ,11
+ ,14
+ ,15
+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+ ,13
+ ,4
+ ,10
+ ,14
+ ,11
+ ,15
+ ,14
+ ,6
+ ,10
+ ,7
+ ,12
+ ,13
+ ,12
+ ,3
+ ,10
+ ,19
+ ,12
+ ,15
+ ,15
+ ,6
+ ,10
+ ,12
+ ,10
+ ,14
+ ,14
+ ,5
+ ,10
+ ,12
+ ,11
+ ,16
+ ,13
+ ,4
+ ,10
+ ,13
+ ,12
+ ,14
+ ,14
+ ,6
+ ,10
+ ,15
+ ,12
+ ,14
+ ,16
+ ,4
+ ,10
+ ,8
+ ,10
+ ,10
+ ,6
+ ,4
+ ,10
+ ,12
+ ,12
+ ,10
+ ,13
+ ,4
+ ,10
+ ,10
+ ,13
+ ,4
+ ,13
+ ,6
+ ,10
+ ,8
+ ,12
+ ,8
+ ,14
+ ,5
+ ,10
+ ,10
+ ,15
+ ,15
+ ,15
+ ,6
+ ,10
+ ,15
+ ,11
+ ,16
+ ,14
+ ,6
+ ,10
+ ,16
+ ,12
+ ,12
+ ,15
+ ,8
+ ,10
+ ,13
+ ,11
+ ,12
+ ,13
+ ,7
+ ,10
+ ,16
+ ,12
+ ,15
+ ,16
+ ,7
+ ,10
+ ,9
+ ,11
+ ,9
+ ,12
+ ,4
+ ,10
+ ,14
+ ,10
+ ,12
+ ,15
+ ,6
+ ,10
+ ,14
+ ,11
+ ,14
+ ,12
+ ,6
+ ,10
+ ,12
+ ,11
+ ,11
+ ,14
+ ,2)
+ ,dim=c(6
+ ,156)
+ ,dimnames=list(c('Tijd'
+ ,'Popularity'
+ ,'FindingFriends'
+ ,'KnowingPeople'
+ ,'Liked'
+ ,'Celebrity')
+ ,1:156))
> y <- array(NA,dim=c(6,156),dimnames=list(c('Tijd','Popularity','FindingFriends','KnowingPeople','Liked','Celebrity'),1:156))
> for (i in 1:dim(x)[1])
+ {
+ for (j in 1:dim(x)[2])
+ {
+ y[i,j] <- as.numeric(x[i,j])
+ }
+ }
> par3 = 'Linear Trend'
> par2 = 'Do not include Seasonal Dummies'
> par1 = '2'
> #'GNU S' R Code compiled by R2WASP v. 1.0.44 ()
> #Author: Prof. Dr. P. Wessa
> #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/
> #Source of accompanying publication: Office for Research, Development, and Education
> #Technical description: Write here your technical program description (don't use hard returns!)
> library(lattice)
> library(lmtest)
Loading required package: zoo
Attaching package: 'zoo'
The following object(s) are masked from package:base :
as.Date.numeric
> n25 <- 25 #minimum number of obs. for Goldfeld-Quandt test
> par1 <- as.numeric(par1)
> x <- t(y)
> k <- length(x[1,])
> n <- length(x[,1])
> x1 <- cbind(x[,par1], x[,1:k!=par1])
> mycolnames <- c(colnames(x)[par1], colnames(x)[1:k!=par1])
> colnames(x1) <- mycolnames #colnames(x)[par1]
> x <- x1
> if (par3 == 'First Differences'){
+ x2 <- array(0, dim=c(n-1,k), dimnames=list(1:(n-1), paste('(1-B)',colnames(x),sep='')))
+ for (i in 1:n-1) {
+ for (j in 1:k) {
+ x2[i,j] <- x[i+1,j] - x[i,j]
+ }
+ }
+ x <- x2
+ }
> if (par2 == 'Include Monthly Dummies'){
+ x2 <- array(0, dim=c(n,11), dimnames=list(1:n, paste('M', seq(1:11), sep ='')))
+ for (i in 1:11){
+ x2[seq(i,n,12),i] <- 1
+ }
+ x <- cbind(x, x2)
+ }
> if (par2 == 'Include Quarterly Dummies'){
+ x2 <- array(0, dim=c(n,3), dimnames=list(1:n, paste('Q', seq(1:3), sep ='')))
+ for (i in 1:3){
+ x2[seq(i,n,4),i] <- 1
+ }
+ x <- cbind(x, x2)
+ }
> k <- length(x[1,])
> if (par3 == 'Linear Trend'){
+ x <- cbind(x, c(1:n))
+ colnames(x)[k+1] <- 't'
+ }
> x
Popularity Tijd FindingFriends KnowingPeople Liked Celebrity t
1 13 9 13 14 13 3 1
2 12 9 12 8 13 5 2
3 15 9 10 12 16 6 3
4 12 9 9 7 12 6 4
5 10 9 10 10 11 5 5
6 12 9 12 7 12 3 6
7 15 9 13 16 18 8 7
8 9 9 12 11 11 4 8
9 12 9 12 14 14 4 9
10 11 9 6 6 9 4 10
11 11 9 5 16 14 6 11
12 11 9 12 11 12 6 12
13 15 9 11 16 11 5 13
14 7 9 14 12 12 4 14
15 11 9 14 7 13 6 15
16 11 9 12 13 11 4 16
17 10 9 12 11 12 6 17
18 14 9 11 15 16 6 18
19 10 9 11 7 9 4 19
20 6 9 7 9 11 4 20
21 11 9 9 7 13 2 21
22 15 9 11 14 15 7 22
23 11 9 11 15 10 5 23
24 12 9 12 7 11 4 24
25 14 9 12 15 13 6 25
26 15 9 11 17 16 6 26
27 9 9 11 15 15 7 27
28 13 9 8 14 14 5 28
29 13 9 9 14 14 6 29
30 16 9 12 8 14 4 30
31 13 9 10 8 8 4 31
32 12 9 10 14 13 7 32
33 14 9 12 14 15 7 33
34 11 9 8 8 13 4 34
35 9 9 12 11 11 4 35
36 16 9 11 16 15 6 36
37 12 9 12 10 15 6 37
38 10 9 7 8 9 5 38
39 13 9 11 14 13 6 39
40 16 9 11 16 16 7 40
41 14 9 12 13 13 6 41
42 15 9 9 5 11 3 42
43 5 9 15 8 12 3 43
44 8 9 11 10 12 4 44
45 11 9 11 8 12 6 45
46 16 9 11 13 14 7 46
47 17 9 11 15 14 5 47
48 9 9 15 6 8 4 48
49 9 9 11 12 13 5 49
50 13 9 12 16 16 6 50
51 10 9 12 5 13 6 51
52 6 10 9 15 11 6 52
53 12 10 12 12 14 5 53
54 8 10 12 8 13 4 54
55 14 10 13 13 13 5 55
56 12 10 11 14 13 5 56
57 11 10 9 12 12 4 57
58 16 10 9 16 16 6 58
59 8 10 11 10 15 2 59
60 15 10 11 15 15 8 60
61 7 10 12 8 12 3 61
62 16 10 12 16 14 6 62
63 14 10 9 19 12 6 63
64 16 10 11 14 15 6 64
65 9 10 9 6 12 5 65
66 14 10 12 13 13 5 66
67 11 10 12 15 12 6 67
68 13 10 12 7 12 5 68
69 15 10 12 13 13 6 69
70 5 10 14 4 5 2 70
71 15 10 11 14 13 5 71
72 13 10 12 13 13 5 72
73 11 10 11 11 14 5 73
74 11 10 6 14 17 6 74
75 12 10 10 12 13 6 75
76 12 10 12 15 13 6 76
77 12 10 13 14 12 5 77
78 12 10 8 13 13 5 78
79 14 10 12 8 14 4 79
80 6 10 12 6 11 2 80
81 7 10 12 7 12 4 81
82 14 10 6 13 12 6 82
83 14 10 11 13 16 6 83
84 10 10 10 11 12 5 84
85 13 10 12 5 12 3 85
86 12 10 13 12 12 6 86
87 9 10 11 8 10 4 87
88 12 10 7 11 15 5 88
89 16 10 11 14 15 8 89
90 10 10 11 9 12 4 90
91 14 10 11 10 16 6 91
92 10 10 11 13 15 6 92
93 16 10 12 16 16 7 93
94 15 10 10 16 13 6 94
95 12 10 11 11 12 5 95
96 10 10 12 8 11 4 96
97 8 10 7 4 13 6 97
98 8 10 13 7 10 3 98
99 11 10 8 14 15 5 99
100 13 10 12 11 13 6 100
101 16 10 11 17 16 7 101
102 16 10 12 15 15 7 102
103 14 10 14 17 18 6 103
104 11 10 10 5 13 3 104
105 4 10 10 4 10 2 105
106 14 10 13 10 16 8 106
107 9 10 10 11 13 3 107
108 14 10 11 15 15 8 108
109 8 10 10 10 14 3 109
110 8 10 7 9 15 4 110
111 11 10 10 12 14 5 111
112 12 10 8 15 13 7 112
113 11 10 12 7 13 6 113
114 14 10 12 13 15 6 114
115 15 10 12 12 16 7 115
116 16 10 11 14 14 6 116
117 16 10 12 14 14 6 117
118 11 10 12 8 16 6 118
119 14 10 12 15 14 6 119
120 14 10 11 12 12 4 120
121 12 10 12 12 13 4 121
122 14 10 11 16 12 5 122
123 8 10 11 9 12 4 123
124 13 10 13 15 14 6 124
125 16 10 12 15 14 6 125
126 12 10 12 6 14 5 126
127 16 10 12 14 16 8 127
128 12 10 12 15 13 6 128
129 11 10 8 10 14 5 129
130 4 10 8 6 4 4 130
131 16 10 12 14 16 8 131
132 15 10 11 12 13 6 132
133 10 10 12 8 16 4 133
134 13 10 13 11 15 6 134
135 15 10 12 13 14 6 135
136 12 10 12 9 13 4 136
137 14 10 11 15 14 6 137
138 7 10 12 13 12 3 138
139 19 10 12 15 15 6 139
140 12 10 10 14 14 5 140
141 12 10 11 16 13 4 141
142 13 10 12 14 14 6 142
143 15 10 12 14 16 4 143
144 8 10 10 10 6 4 144
145 12 10 12 10 13 4 145
146 10 10 13 4 13 6 146
147 8 10 12 8 14 5 147
148 10 10 15 15 15 6 148
149 15 10 11 16 14 6 149
150 16 10 12 12 15 8 150
151 13 10 11 12 13 7 151
152 16 10 12 15 16 7 152
153 9 10 11 9 12 4 153
154 14 10 10 12 15 6 154
155 14 10 11 14 12 6 155
156 12 10 11 11 14 2 156
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Tijd FindingFriends KnowingPeople Liked
5.484952 -0.566538 0.088851 0.246618 0.354441
Celebrity t
0.614550 0.004096
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-6.11764 -1.22117 -0.04477 1.20608 6.66661
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 5.484952 5.872612 0.934 0.351821
Tijd -0.566538 0.623760 -0.908 0.365206
FindingFriends 0.088851 0.097080 0.915 0.361547
KnowingPeople 0.246618 0.061755 3.993 0.000102 ***
Liked 0.354441 0.097772 3.625 0.000396 ***
Celebrity 0.614550 0.157303 3.907 0.000141 ***
t 0.004096 0.006547 0.626 0.532503
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 2.113 on 149 degrees of freedom
Multiple R-squared: 0.5021, Adjusted R-squared: 0.482
F-statistic: 25.04 on 6 and 149 DF, p-value: < 2.2e-16
> if (n > n25) {
+ kp3 <- k + 3
+ nmkm3 <- n - k - 3
+ gqarr <- array(NA, dim=c(nmkm3-kp3+1,3))
+ numgqtests <- 0
+ numsignificant1 <- 0
+ numsignificant5 <- 0
+ numsignificant10 <- 0
+ for (mypoint in kp3:nmkm3) {
+ j <- 0
+ numgqtests <- numgqtests + 1
+ for (myalt in c('greater', 'two.sided', 'less')) {
+ j <- j + 1
+ gqarr[mypoint-kp3+1,j] <- gqtest(mylm, point=mypoint, alternative=myalt)$p.value
+ }
+ if (gqarr[mypoint-kp3+1,2] < 0.01) numsignificant1 <- numsignificant1 + 1
+ if (gqarr[mypoint-kp3+1,2] < 0.05) numsignificant5 <- numsignificant5 + 1
+ if (gqarr[mypoint-kp3+1,2] < 0.10) numsignificant10 <- numsignificant10 + 1
+ }
+ gqarr
+ }
[,1] [,2] [,3]
[1,] 0.07417122 0.14834243 0.925828783
[2,] 0.11220230 0.22440460 0.887797699
[3,] 0.07412445 0.14824890 0.925875552
[4,] 0.55114034 0.89771932 0.448859662
[5,] 0.72184822 0.55630356 0.278151780
[6,] 0.65571518 0.68856963 0.344284817
[7,] 0.58008245 0.83983510 0.419917550
[8,] 0.49404672 0.98809343 0.505953283
[9,] 0.45716412 0.91432824 0.542835881
[10,] 0.39870269 0.79740538 0.601297308
[11,] 0.52764601 0.94470798 0.472353988
[12,] 0.52731065 0.94537870 0.472689351
[13,] 0.56637981 0.86724039 0.433620193
[14,] 0.50352452 0.99295096 0.496475481
[15,] 0.51781506 0.96436988 0.482184941
[16,] 0.49117391 0.98234781 0.508826094
[17,] 0.43417420 0.86834841 0.565825797
[18,] 0.66550677 0.66898645 0.334493226
[19,] 0.61729969 0.76540062 0.382700311
[20,] 0.56221037 0.87557926 0.437789629
[21,] 0.72485606 0.55028788 0.275143940
[22,] 0.81527214 0.36945573 0.184727864
[23,] 0.78184934 0.43630133 0.218150664
[24,] 0.73713018 0.52573965 0.262869824
[25,] 0.70099150 0.59801701 0.299008503
[26,] 0.70754767 0.58490466 0.292452330
[27,] 0.71141128 0.57717745 0.288588724
[28,] 0.68066831 0.63866339 0.319331693
[29,] 0.62996090 0.74007820 0.370039098
[30,] 0.57676414 0.84647172 0.423235861
[31,] 0.54632794 0.90734412 0.453672060
[32,] 0.50342660 0.99314681 0.496573404
[33,] 0.76019326 0.47961349 0.239806743
[34,] 0.95519968 0.08960065 0.044800323
[35,] 0.96617191 0.06765617 0.033828085
[36,] 0.95567358 0.08865284 0.044326420
[37,] 0.96028317 0.07943367 0.039716834
[38,] 0.98249463 0.03501074 0.017505369
[39,] 0.97862627 0.04274746 0.021373731
[40,] 0.98304559 0.03390883 0.016954415
[41,] 0.97887915 0.04224169 0.021120847
[42,] 0.97430177 0.05139645 0.025698226
[43,] 0.98992540 0.02014920 0.010074598
[44,] 0.99251988 0.01496024 0.007480119
[45,] 0.99116459 0.01767081 0.008835407
[46,] 0.99490868 0.01018264 0.005091322
[47,] 0.99347072 0.01305856 0.006529279
[48,] 0.99121165 0.01757671 0.008788355
[49,] 0.99150894 0.01698211 0.008491057
[50,] 0.99261330 0.01477340 0.007386700
[51,] 0.99122780 0.01754439 0.008772196
[52,] 0.99149344 0.01701311 0.008506556
[53,] 0.99331276 0.01337448 0.006687239
[54,] 0.99139738 0.01720524 0.008602622
[55,] 0.99245024 0.01509952 0.007549760
[56,] 0.99009636 0.01980728 0.009903638
[57,] 0.98956639 0.02086722 0.010433610
[58,] 0.98926542 0.02146916 0.010734581
[59,] 0.99126103 0.01747793 0.008738966
[60,] 0.99158391 0.01683218 0.008416088
[61,] 0.98863562 0.02272876 0.011364381
[62,] 0.99045339 0.01909323 0.009546615
[63,] 0.98748207 0.02503585 0.012517926
[64,] 0.98422592 0.03154816 0.015774079
[65,] 0.98848027 0.02303946 0.011519729
[66,] 0.98446795 0.03106410 0.015532052
[67,] 0.98176314 0.03647372 0.018236862
[68,] 0.97603948 0.04792105 0.023960524
[69,] 0.96847500 0.06305000 0.031525002
[70,] 0.97991153 0.04017694 0.020088471
[71,] 0.97905105 0.04189791 0.020948955
[72,] 0.98244188 0.03511623 0.017558115
[73,] 0.98331044 0.03337912 0.016689562
[74,] 0.97769123 0.04461754 0.022308770
[75,] 0.97268222 0.05463556 0.027317779
[76,] 0.99259679 0.01480641 0.007403205
[77,] 0.98979739 0.02040522 0.010202608
[78,] 0.98628478 0.02743044 0.013715222
[79,] 0.98218367 0.03563266 0.017816328
[80,] 0.97788547 0.04422907 0.022114533
[81,] 0.97119140 0.05761720 0.028808601
[82,] 0.96609315 0.06781371 0.033906853
[83,] 0.97925653 0.04148694 0.020743470
[84,] 0.97317677 0.05364647 0.026823234
[85,] 0.96963095 0.06073809 0.030369045
[86,] 0.96247478 0.07505043 0.037525217
[87,] 0.95395293 0.09209414 0.046047072
[88,] 0.94982009 0.10035982 0.050179909
[89,] 0.93708882 0.12582236 0.062911179
[90,] 0.93197014 0.13605972 0.068029858
[91,] 0.91807144 0.16385712 0.081928559
[92,] 0.89832993 0.20334014 0.101670071
[93,] 0.88412355 0.23175291 0.115876454
[94,] 0.88616666 0.22766668 0.113833342
[95,] 0.92447454 0.15105091 0.075525457
[96,] 0.92154588 0.15690825 0.078454124
[97,] 0.90067863 0.19864275 0.099321374
[98,] 0.87965654 0.24068693 0.120343463
[99,] 0.87005481 0.25989038 0.129945191
[100,] 0.86599809 0.26800381 0.134001906
[101,] 0.88936448 0.22127105 0.110635524
[102,] 0.87895395 0.24209211 0.121046053
[103,] 0.91675370 0.16649259 0.083246295
[104,] 0.89301024 0.21397953 0.106989765
[105,] 0.86718537 0.26562926 0.132814628
[106,] 0.83686780 0.32626441 0.163132205
[107,] 0.83087969 0.33824062 0.169120312
[108,] 0.83468548 0.33062905 0.165314523
[109,] 0.82765140 0.34469720 0.172348600
[110,] 0.78934212 0.42131576 0.210657881
[111,] 0.83803511 0.32392977 0.161964886
[112,] 0.80746366 0.38507269 0.192536345
[113,] 0.78163384 0.43673232 0.218366161
[114,] 0.76783675 0.46432650 0.232163252
[115,] 0.72315022 0.55369957 0.276849783
[116,] 0.72296616 0.55406767 0.277033837
[117,] 0.71117506 0.57764989 0.288824944
[118,] 0.65220730 0.69558541 0.347792704
[119,] 0.61309052 0.77381896 0.386909478
[120,] 0.62714191 0.74571618 0.372858092
[121,] 0.62858344 0.74283311 0.371416556
[122,] 0.57274783 0.85450434 0.427252171
[123,] 0.54032323 0.91935353 0.459676766
[124,] 0.52591451 0.94817097 0.474085487
[125,] 0.44914590 0.89829179 0.550854104
[126,] 0.40405807 0.80811614 0.595941932
[127,] 0.39064461 0.78128922 0.609355389
[128,] 0.31689269 0.63378538 0.683107311
[129,] 0.38277005 0.76554010 0.617229951
[130,] 0.75220454 0.49559092 0.247795459
[131,] 0.75592658 0.48814684 0.244073420
[132,] 0.70727340 0.58545320 0.292726599
[133,] 0.62138561 0.75722879 0.378614395
[134,] 0.54409759 0.91180483 0.455902414
[135,] 0.41745985 0.83491970 0.582540152
[136,] 0.47737668 0.95475337 0.522623315
[137,] 0.61728992 0.76542016 0.382710079
> postscript(file="/var/www/html/rcomp/tmp/1drsy1290531503.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> plot(x[,1], type='l', main='Actuals and Interpolation', ylab='value of Actuals and Interpolation (dots)', xlab='time or index')
> points(x[,1]-mysum$resid)
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/2drsy1290531503.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> plot(mysum$resid, type='b', pch=19, main='Residuals', ylab='value of Residuals', xlab='time or index')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/3drsy1290531503.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> hist(mysum$resid, main='Residual Histogram', xlab='values of Residuals')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/46i911290531503.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> densityplot(~mysum$resid,col='black',main='Residual Density Plot', xlab='values of Residuals')
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/56i911290531503.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> qqnorm(mysum$resid, main='Residual Normal Q-Q Plot')
> qqline(mysum$resid)
> grid()
> dev.off()
null device
1
> (myerror <- as.ts(mysum$resid))
Time Series:
Start = 1
End = 156
Frequency = 1
1 2 3 4 5 6
1.55069942 0.88606007 1.39532267 1.13093014 -0.73287842 2.69983423
7 8 9 10 11 12
-1.81206613 -1.55493620 -0.36220841 2.91194781 -2.47077775 -1.15486077
13 14 15 16 17 18
2.66579767 -4.35827287 -0.71282197 -0.08093911 -2.17534071 -0.49482065
19 20 21 22 23 24
1.18421141 -3.66659805 2.16505586 0.47530445 -0.77410347 2.36599799
25 26 27 28 29 30
0.45098015 -0.02082355 -5.79179299 0.30082214 -0.40667454 5.03148085
31 32 33 34 35 36
4.33173429 -1.76792195 -0.65860242 0.72494214 -1.66552788 1.53927531
37 38 39 40 41 42
-1.07396668 0.60062445 -0.27089518 0.55390043 0.87867934 6.66660790
43 44 45 46 47 48
-4.96488783 -2.72136451 -0.46132487 1.97805948 3.70982786 0.31108249
49 50 51 52 53 54
-3.20407037 -1.96136076 -1.18934053 -6.11763823 -0.09720874 -2.14584380
55 56 57 58 59 60
1.91357202 -0.15943947 0.47639247 1.83896215 -2.05049084 0.02502754
61 62 63 64 65 66
-2.20552479 2.26490768 0.49639466 2.48436046 -0.69122011 1.95736715
67 68 69 70 71 72
-1.80007229 2.78332142 2.33052950 -0.33798233 2.77912071 0.93279122
73 74 75 76 77 78
-0.84366000 -2.82122689 -0.26972693 -1.19137742 -0.06871598 0.26361930
79 80 81 82 83 84
3.39731526 -1.82112264 -2.65537674 2.16482890 0.29871296 -1.09098239
85 86 87 88 89 90
4.43602400 -0.22689456 -0.12883669 0.09586295 1.15286139 -0.09662463
91 92 93 94 95 96
1.00579756 -3.38370970 0.81449989 1.66597930 0.77511074 0.39100718
97 98 99 100 101 102
-2.12034565 -0.49042737 -1.77789643 0.69678888 0.62396548 1.37869473
103 104 105 106 107 108
-1.74511228 2.18146099 -2.89814410 -0.46244364 -1.31053198 -1.17157988
109 110 111 112 113 114
-2.42654769 -2.88646410 -1.15707404 -1.59797867 -0.36998896 0.43732757
115 116 117 118 119 120
0.71085815 2.62581033 2.53286334 -1.70041012 0.27805386 3.04064323
121 122 123 124 125 126
0.59325500 1.43143156 -2.23179223 -0.83127708 2.25347793 1.08348914
127 128 129 130 131 132
0.55392161 -1.40436879 -0.55986482 -2.41852874 0.53753766 2.40795076
133 134 135 136 137 138
-1.53275056 -0.24020819 1.70575306 1.27166768 0.29317708 -3.75400337
139 140 141 142 143 144
4.84169287 -0.76909270 -0.38628376 -0.56953636 1.94658455 -0.34892705
145 146 147 148 149 150
0.98818629 -0.85415507 -3.49576161 -4.46172403 0.99740772 1.30739013
151 152 153 154 155 156
-0.28442270 0.81945410 -1.35467187 0.69780755 1.17494927 1.66002206
> postscript(file="/var/www/html/rcomp/tmp/6g9qm1290531503.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> dum <- cbind(lag(myerror,k=1),myerror)
> dum
Time Series:
Start = 0
End = 156
Frequency = 1
lag(myerror, k = 1) myerror
0 1.55069942 NA
1 0.88606007 1.55069942
2 1.39532267 0.88606007
3 1.13093014 1.39532267
4 -0.73287842 1.13093014
5 2.69983423 -0.73287842
6 -1.81206613 2.69983423
7 -1.55493620 -1.81206613
8 -0.36220841 -1.55493620
9 2.91194781 -0.36220841
10 -2.47077775 2.91194781
11 -1.15486077 -2.47077775
12 2.66579767 -1.15486077
13 -4.35827287 2.66579767
14 -0.71282197 -4.35827287
15 -0.08093911 -0.71282197
16 -2.17534071 -0.08093911
17 -0.49482065 -2.17534071
18 1.18421141 -0.49482065
19 -3.66659805 1.18421141
20 2.16505586 -3.66659805
21 0.47530445 2.16505586
22 -0.77410347 0.47530445
23 2.36599799 -0.77410347
24 0.45098015 2.36599799
25 -0.02082355 0.45098015
26 -5.79179299 -0.02082355
27 0.30082214 -5.79179299
28 -0.40667454 0.30082214
29 5.03148085 -0.40667454
30 4.33173429 5.03148085
31 -1.76792195 4.33173429
32 -0.65860242 -1.76792195
33 0.72494214 -0.65860242
34 -1.66552788 0.72494214
35 1.53927531 -1.66552788
36 -1.07396668 1.53927531
37 0.60062445 -1.07396668
38 -0.27089518 0.60062445
39 0.55390043 -0.27089518
40 0.87867934 0.55390043
41 6.66660790 0.87867934
42 -4.96488783 6.66660790
43 -2.72136451 -4.96488783
44 -0.46132487 -2.72136451
45 1.97805948 -0.46132487
46 3.70982786 1.97805948
47 0.31108249 3.70982786
48 -3.20407037 0.31108249
49 -1.96136076 -3.20407037
50 -1.18934053 -1.96136076
51 -6.11763823 -1.18934053
52 -0.09720874 -6.11763823
53 -2.14584380 -0.09720874
54 1.91357202 -2.14584380
55 -0.15943947 1.91357202
56 0.47639247 -0.15943947
57 1.83896215 0.47639247
58 -2.05049084 1.83896215
59 0.02502754 -2.05049084
60 -2.20552479 0.02502754
61 2.26490768 -2.20552479
62 0.49639466 2.26490768
63 2.48436046 0.49639466
64 -0.69122011 2.48436046
65 1.95736715 -0.69122011
66 -1.80007229 1.95736715
67 2.78332142 -1.80007229
68 2.33052950 2.78332142
69 -0.33798233 2.33052950
70 2.77912071 -0.33798233
71 0.93279122 2.77912071
72 -0.84366000 0.93279122
73 -2.82122689 -0.84366000
74 -0.26972693 -2.82122689
75 -1.19137742 -0.26972693
76 -0.06871598 -1.19137742
77 0.26361930 -0.06871598
78 3.39731526 0.26361930
79 -1.82112264 3.39731526
80 -2.65537674 -1.82112264
81 2.16482890 -2.65537674
82 0.29871296 2.16482890
83 -1.09098239 0.29871296
84 4.43602400 -1.09098239
85 -0.22689456 4.43602400
86 -0.12883669 -0.22689456
87 0.09586295 -0.12883669
88 1.15286139 0.09586295
89 -0.09662463 1.15286139
90 1.00579756 -0.09662463
91 -3.38370970 1.00579756
92 0.81449989 -3.38370970
93 1.66597930 0.81449989
94 0.77511074 1.66597930
95 0.39100718 0.77511074
96 -2.12034565 0.39100718
97 -0.49042737 -2.12034565
98 -1.77789643 -0.49042737
99 0.69678888 -1.77789643
100 0.62396548 0.69678888
101 1.37869473 0.62396548
102 -1.74511228 1.37869473
103 2.18146099 -1.74511228
104 -2.89814410 2.18146099
105 -0.46244364 -2.89814410
106 -1.31053198 -0.46244364
107 -1.17157988 -1.31053198
108 -2.42654769 -1.17157988
109 -2.88646410 -2.42654769
110 -1.15707404 -2.88646410
111 -1.59797867 -1.15707404
112 -0.36998896 -1.59797867
113 0.43732757 -0.36998896
114 0.71085815 0.43732757
115 2.62581033 0.71085815
116 2.53286334 2.62581033
117 -1.70041012 2.53286334
118 0.27805386 -1.70041012
119 3.04064323 0.27805386
120 0.59325500 3.04064323
121 1.43143156 0.59325500
122 -2.23179223 1.43143156
123 -0.83127708 -2.23179223
124 2.25347793 -0.83127708
125 1.08348914 2.25347793
126 0.55392161 1.08348914
127 -1.40436879 0.55392161
128 -0.55986482 -1.40436879
129 -2.41852874 -0.55986482
130 0.53753766 -2.41852874
131 2.40795076 0.53753766
132 -1.53275056 2.40795076
133 -0.24020819 -1.53275056
134 1.70575306 -0.24020819
135 1.27166768 1.70575306
136 0.29317708 1.27166768
137 -3.75400337 0.29317708
138 4.84169287 -3.75400337
139 -0.76909270 4.84169287
140 -0.38628376 -0.76909270
141 -0.56953636 -0.38628376
142 1.94658455 -0.56953636
143 -0.34892705 1.94658455
144 0.98818629 -0.34892705
145 -0.85415507 0.98818629
146 -3.49576161 -0.85415507
147 -4.46172403 -3.49576161
148 0.99740772 -4.46172403
149 1.30739013 0.99740772
150 -0.28442270 1.30739013
151 0.81945410 -0.28442270
152 -1.35467187 0.81945410
153 0.69780755 -1.35467187
154 1.17494927 0.69780755
155 1.66002206 1.17494927
156 NA 1.66002206
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 0.88606007 1.55069942
[2,] 1.39532267 0.88606007
[3,] 1.13093014 1.39532267
[4,] -0.73287842 1.13093014
[5,] 2.69983423 -0.73287842
[6,] -1.81206613 2.69983423
[7,] -1.55493620 -1.81206613
[8,] -0.36220841 -1.55493620
[9,] 2.91194781 -0.36220841
[10,] -2.47077775 2.91194781
[11,] -1.15486077 -2.47077775
[12,] 2.66579767 -1.15486077
[13,] -4.35827287 2.66579767
[14,] -0.71282197 -4.35827287
[15,] -0.08093911 -0.71282197
[16,] -2.17534071 -0.08093911
[17,] -0.49482065 -2.17534071
[18,] 1.18421141 -0.49482065
[19,] -3.66659805 1.18421141
[20,] 2.16505586 -3.66659805
[21,] 0.47530445 2.16505586
[22,] -0.77410347 0.47530445
[23,] 2.36599799 -0.77410347
[24,] 0.45098015 2.36599799
[25,] -0.02082355 0.45098015
[26,] -5.79179299 -0.02082355
[27,] 0.30082214 -5.79179299
[28,] -0.40667454 0.30082214
[29,] 5.03148085 -0.40667454
[30,] 4.33173429 5.03148085
[31,] -1.76792195 4.33173429
[32,] -0.65860242 -1.76792195
[33,] 0.72494214 -0.65860242
[34,] -1.66552788 0.72494214
[35,] 1.53927531 -1.66552788
[36,] -1.07396668 1.53927531
[37,] 0.60062445 -1.07396668
[38,] -0.27089518 0.60062445
[39,] 0.55390043 -0.27089518
[40,] 0.87867934 0.55390043
[41,] 6.66660790 0.87867934
[42,] -4.96488783 6.66660790
[43,] -2.72136451 -4.96488783
[44,] -0.46132487 -2.72136451
[45,] 1.97805948 -0.46132487
[46,] 3.70982786 1.97805948
[47,] 0.31108249 3.70982786
[48,] -3.20407037 0.31108249
[49,] -1.96136076 -3.20407037
[50,] -1.18934053 -1.96136076
[51,] -6.11763823 -1.18934053
[52,] -0.09720874 -6.11763823
[53,] -2.14584380 -0.09720874
[54,] 1.91357202 -2.14584380
[55,] -0.15943947 1.91357202
[56,] 0.47639247 -0.15943947
[57,] 1.83896215 0.47639247
[58,] -2.05049084 1.83896215
[59,] 0.02502754 -2.05049084
[60,] -2.20552479 0.02502754
[61,] 2.26490768 -2.20552479
[62,] 0.49639466 2.26490768
[63,] 2.48436046 0.49639466
[64,] -0.69122011 2.48436046
[65,] 1.95736715 -0.69122011
[66,] -1.80007229 1.95736715
[67,] 2.78332142 -1.80007229
[68,] 2.33052950 2.78332142
[69,] -0.33798233 2.33052950
[70,] 2.77912071 -0.33798233
[71,] 0.93279122 2.77912071
[72,] -0.84366000 0.93279122
[73,] -2.82122689 -0.84366000
[74,] -0.26972693 -2.82122689
[75,] -1.19137742 -0.26972693
[76,] -0.06871598 -1.19137742
[77,] 0.26361930 -0.06871598
[78,] 3.39731526 0.26361930
[79,] -1.82112264 3.39731526
[80,] -2.65537674 -1.82112264
[81,] 2.16482890 -2.65537674
[82,] 0.29871296 2.16482890
[83,] -1.09098239 0.29871296
[84,] 4.43602400 -1.09098239
[85,] -0.22689456 4.43602400
[86,] -0.12883669 -0.22689456
[87,] 0.09586295 -0.12883669
[88,] 1.15286139 0.09586295
[89,] -0.09662463 1.15286139
[90,] 1.00579756 -0.09662463
[91,] -3.38370970 1.00579756
[92,] 0.81449989 -3.38370970
[93,] 1.66597930 0.81449989
[94,] 0.77511074 1.66597930
[95,] 0.39100718 0.77511074
[96,] -2.12034565 0.39100718
[97,] -0.49042737 -2.12034565
[98,] -1.77789643 -0.49042737
[99,] 0.69678888 -1.77789643
[100,] 0.62396548 0.69678888
[101,] 1.37869473 0.62396548
[102,] -1.74511228 1.37869473
[103,] 2.18146099 -1.74511228
[104,] -2.89814410 2.18146099
[105,] -0.46244364 -2.89814410
[106,] -1.31053198 -0.46244364
[107,] -1.17157988 -1.31053198
[108,] -2.42654769 -1.17157988
[109,] -2.88646410 -2.42654769
[110,] -1.15707404 -2.88646410
[111,] -1.59797867 -1.15707404
[112,] -0.36998896 -1.59797867
[113,] 0.43732757 -0.36998896
[114,] 0.71085815 0.43732757
[115,] 2.62581033 0.71085815
[116,] 2.53286334 2.62581033
[117,] -1.70041012 2.53286334
[118,] 0.27805386 -1.70041012
[119,] 3.04064323 0.27805386
[120,] 0.59325500 3.04064323
[121,] 1.43143156 0.59325500
[122,] -2.23179223 1.43143156
[123,] -0.83127708 -2.23179223
[124,] 2.25347793 -0.83127708
[125,] 1.08348914 2.25347793
[126,] 0.55392161 1.08348914
[127,] -1.40436879 0.55392161
[128,] -0.55986482 -1.40436879
[129,] -2.41852874 -0.55986482
[130,] 0.53753766 -2.41852874
[131,] 2.40795076 0.53753766
[132,] -1.53275056 2.40795076
[133,] -0.24020819 -1.53275056
[134,] 1.70575306 -0.24020819
[135,] 1.27166768 1.70575306
[136,] 0.29317708 1.27166768
[137,] -3.75400337 0.29317708
[138,] 4.84169287 -3.75400337
[139,] -0.76909270 4.84169287
[140,] -0.38628376 -0.76909270
[141,] -0.56953636 -0.38628376
[142,] 1.94658455 -0.56953636
[143,] -0.34892705 1.94658455
[144,] 0.98818629 -0.34892705
[145,] -0.85415507 0.98818629
[146,] -3.49576161 -0.85415507
[147,] -4.46172403 -3.49576161
[148,] 0.99740772 -4.46172403
[149,] 1.30739013 0.99740772
[150,] -0.28442270 1.30739013
[151,] 0.81945410 -0.28442270
[152,] -1.35467187 0.81945410
[153,] 0.69780755 -1.35467187
[154,] 1.17494927 0.69780755
[155,] 1.66002206 1.17494927
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 0.88606007 1.55069942
2 1.39532267 0.88606007
3 1.13093014 1.39532267
4 -0.73287842 1.13093014
5 2.69983423 -0.73287842
6 -1.81206613 2.69983423
7 -1.55493620 -1.81206613
8 -0.36220841 -1.55493620
9 2.91194781 -0.36220841
10 -2.47077775 2.91194781
11 -1.15486077 -2.47077775
12 2.66579767 -1.15486077
13 -4.35827287 2.66579767
14 -0.71282197 -4.35827287
15 -0.08093911 -0.71282197
16 -2.17534071 -0.08093911
17 -0.49482065 -2.17534071
18 1.18421141 -0.49482065
19 -3.66659805 1.18421141
20 2.16505586 -3.66659805
21 0.47530445 2.16505586
22 -0.77410347 0.47530445
23 2.36599799 -0.77410347
24 0.45098015 2.36599799
25 -0.02082355 0.45098015
26 -5.79179299 -0.02082355
27 0.30082214 -5.79179299
28 -0.40667454 0.30082214
29 5.03148085 -0.40667454
30 4.33173429 5.03148085
31 -1.76792195 4.33173429
32 -0.65860242 -1.76792195
33 0.72494214 -0.65860242
34 -1.66552788 0.72494214
35 1.53927531 -1.66552788
36 -1.07396668 1.53927531
37 0.60062445 -1.07396668
38 -0.27089518 0.60062445
39 0.55390043 -0.27089518
40 0.87867934 0.55390043
41 6.66660790 0.87867934
42 -4.96488783 6.66660790
43 -2.72136451 -4.96488783
44 -0.46132487 -2.72136451
45 1.97805948 -0.46132487
46 3.70982786 1.97805948
47 0.31108249 3.70982786
48 -3.20407037 0.31108249
49 -1.96136076 -3.20407037
50 -1.18934053 -1.96136076
51 -6.11763823 -1.18934053
52 -0.09720874 -6.11763823
53 -2.14584380 -0.09720874
54 1.91357202 -2.14584380
55 -0.15943947 1.91357202
56 0.47639247 -0.15943947
57 1.83896215 0.47639247
58 -2.05049084 1.83896215
59 0.02502754 -2.05049084
60 -2.20552479 0.02502754
61 2.26490768 -2.20552479
62 0.49639466 2.26490768
63 2.48436046 0.49639466
64 -0.69122011 2.48436046
65 1.95736715 -0.69122011
66 -1.80007229 1.95736715
67 2.78332142 -1.80007229
68 2.33052950 2.78332142
69 -0.33798233 2.33052950
70 2.77912071 -0.33798233
71 0.93279122 2.77912071
72 -0.84366000 0.93279122
73 -2.82122689 -0.84366000
74 -0.26972693 -2.82122689
75 -1.19137742 -0.26972693
76 -0.06871598 -1.19137742
77 0.26361930 -0.06871598
78 3.39731526 0.26361930
79 -1.82112264 3.39731526
80 -2.65537674 -1.82112264
81 2.16482890 -2.65537674
82 0.29871296 2.16482890
83 -1.09098239 0.29871296
84 4.43602400 -1.09098239
85 -0.22689456 4.43602400
86 -0.12883669 -0.22689456
87 0.09586295 -0.12883669
88 1.15286139 0.09586295
89 -0.09662463 1.15286139
90 1.00579756 -0.09662463
91 -3.38370970 1.00579756
92 0.81449989 -3.38370970
93 1.66597930 0.81449989
94 0.77511074 1.66597930
95 0.39100718 0.77511074
96 -2.12034565 0.39100718
97 -0.49042737 -2.12034565
98 -1.77789643 -0.49042737
99 0.69678888 -1.77789643
100 0.62396548 0.69678888
101 1.37869473 0.62396548
102 -1.74511228 1.37869473
103 2.18146099 -1.74511228
104 -2.89814410 2.18146099
105 -0.46244364 -2.89814410
106 -1.31053198 -0.46244364
107 -1.17157988 -1.31053198
108 -2.42654769 -1.17157988
109 -2.88646410 -2.42654769
110 -1.15707404 -2.88646410
111 -1.59797867 -1.15707404
112 -0.36998896 -1.59797867
113 0.43732757 -0.36998896
114 0.71085815 0.43732757
115 2.62581033 0.71085815
116 2.53286334 2.62581033
117 -1.70041012 2.53286334
118 0.27805386 -1.70041012
119 3.04064323 0.27805386
120 0.59325500 3.04064323
121 1.43143156 0.59325500
122 -2.23179223 1.43143156
123 -0.83127708 -2.23179223
124 2.25347793 -0.83127708
125 1.08348914 2.25347793
126 0.55392161 1.08348914
127 -1.40436879 0.55392161
128 -0.55986482 -1.40436879
129 -2.41852874 -0.55986482
130 0.53753766 -2.41852874
131 2.40795076 0.53753766
132 -1.53275056 2.40795076
133 -0.24020819 -1.53275056
134 1.70575306 -0.24020819
135 1.27166768 1.70575306
136 0.29317708 1.27166768
137 -3.75400337 0.29317708
138 4.84169287 -3.75400337
139 -0.76909270 4.84169287
140 -0.38628376 -0.76909270
141 -0.56953636 -0.38628376
142 1.94658455 -0.56953636
143 -0.34892705 1.94658455
144 0.98818629 -0.34892705
145 -0.85415507 0.98818629
146 -3.49576161 -0.85415507
147 -4.46172403 -3.49576161
148 0.99740772 -4.46172403
149 1.30739013 0.99740772
150 -0.28442270 1.30739013
151 0.81945410 -0.28442270
152 -1.35467187 0.81945410
153 0.69780755 -1.35467187
154 1.17494927 0.69780755
155 1.66002206 1.17494927
> plot(z,main=paste('Residual Lag plot, lowess, and regression line'), ylab='values of Residuals', xlab='lagged values of Residuals')
> lines(lowess(z))
> abline(lm(z))
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/791p71290531503.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> acf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Autocorrelation Function')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/891p71290531503.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> pacf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Partial Autocorrelation Function')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/991p71290531503.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> opar <- par(mfrow = c(2,2), oma = c(0, 0, 1.1, 0))
> plot(mylm, las = 1, sub='Residual Diagnostics')
> par(opar)
> dev.off()
null device
1
> if (n > n25) {
+ postscript(file="/var/www/html/rcomp/tmp/10ks7s1290531503.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
+ plot(kp3:nmkm3,gqarr[,2], main='Goldfeld-Quandt test',ylab='2-sided p-value',xlab='breakpoint')
+ grid()
+ dev.off()
+ }
null device
1
>
> #Note: the /var/www/html/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/www/html/rcomp/createtable")
>
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Estimated Regression Equation', 1, TRUE)
> a<-table.row.end(a)
> myeq <- colnames(x)[1]
> myeq <- paste(myeq, '[t] = ', sep='')
> for (i in 1:k){
+ if (mysum$coefficients[i,1] > 0) myeq <- paste(myeq, '+', '')
+ myeq <- paste(myeq, mysum$coefficients[i,1], sep=' ')
+ if (rownames(mysum$coefficients)[i] != '(Intercept)') {
+ myeq <- paste(myeq, rownames(mysum$coefficients)[i], sep='')
+ if (rownames(mysum$coefficients)[i] != 't') myeq <- paste(myeq, '[t]', sep='')
+ }
+ }
> myeq <- paste(myeq, ' + e[t]')
> a<-table.row.start(a)
> a<-table.element(a, myeq)
> a<-table.row.end(a)
> a<-table.end(a)
> table.save(a,file="/var/www/html/rcomp/tmp/11ykmi1290531503.tab")
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a,hyperlink('http://www.xycoon.com/ols1.htm','Multiple Linear Regression - Ordinary Least Squares',''), 6, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a,'Variable',header=TRUE)
> a<-table.element(a,'Parameter',header=TRUE)
> a<-table.element(a,'S.D.',header=TRUE)
> a<-table.element(a,'T-STAT
H0: parameter = 0',header=TRUE)
> a<-table.element(a,'2-tail p-value',header=TRUE)
> a<-table.element(a,'1-tail p-value',header=TRUE)
> a<-table.row.end(a)
> for (i in 1:k){
+ a<-table.row.start(a)
+ a<-table.element(a,rownames(mysum$coefficients)[i],header=TRUE)
+ a<-table.element(a,mysum$coefficients[i,1])
+ a<-table.element(a, round(mysum$coefficients[i,2],6))
+ a<-table.element(a, round(mysum$coefficients[i,3],4))
+ a<-table.element(a, round(mysum$coefficients[i,4],6))
+ a<-table.element(a, round(mysum$coefficients[i,4]/2,6))
+ a<-table.row.end(a)
+ }
> a<-table.end(a)
> table.save(a,file="/var/www/html/rcomp/tmp/121k361290531503.tab")
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Regression Statistics', 2, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple R',1,TRUE)
> a<-table.element(a, sqrt(mysum$r.squared))
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'R-squared',1,TRUE)
> a<-table.element(a, mysum$r.squared)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Adjusted R-squared',1,TRUE)
> a<-table.element(a, mysum$adj.r.squared)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (value)',1,TRUE)
> a<-table.element(a, mysum$fstatistic[1])
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (DF numerator)',1,TRUE)
> a<-table.element(a, mysum$fstatistic[2])
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (DF denominator)',1,TRUE)
> a<-table.element(a, mysum$fstatistic[3])
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'p-value',1,TRUE)
> a<-table.element(a, 1-pf(mysum$fstatistic[1],mysum$fstatistic[2],mysum$fstatistic[3]))
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Residual Statistics', 2, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Residual Standard Deviation',1,TRUE)
> a<-table.element(a, mysum$sigma)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Sum Squared Residuals',1,TRUE)
> a<-table.element(a, sum(myerror*myerror))
> a<-table.row.end(a)
> a<-table.end(a)
> table.save(a,file="/var/www/html/rcomp/tmp/13fujf1290531503.tab")
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Actuals, Interpolation, and Residuals', 4, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Time or Index', 1, TRUE)
> a<-table.element(a, 'Actuals', 1, TRUE)
> a<-table.element(a, 'Interpolation
Forecast', 1, TRUE)
> a<-table.element(a, 'Residuals
Prediction Error', 1, TRUE)
> a<-table.row.end(a)
> for (i in 1:n) {
+ a<-table.row.start(a)
+ a<-table.element(a,i, 1, TRUE)
+ a<-table.element(a,x[i])
+ a<-table.element(a,x[i]-mysum$resid[i])
+ a<-table.element(a,mysum$resid[i])
+ a<-table.row.end(a)
+ }
> a<-table.end(a)
> table.save(a,file="/var/www/html/rcomp/tmp/141uz31290531503.tab")
> if (n > n25) {
+ a<-table.start()
+ a<-table.row.start(a)
+ a<-table.element(a,'Goldfeld-Quandt test for Heteroskedasticity',4,TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'p-values',header=TRUE)
+ a<-table.element(a,'Alternative Hypothesis',3,header=TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'breakpoint index',header=TRUE)
+ a<-table.element(a,'greater',header=TRUE)
+ a<-table.element(a,'2-sided',header=TRUE)
+ a<-table.element(a,'less',header=TRUE)
+ a<-table.row.end(a)
+ for (mypoint in kp3:nmkm3) {
+ a<-table.row.start(a)
+ a<-table.element(a,mypoint,header=TRUE)
+ a<-table.element(a,gqarr[mypoint-kp3+1,1])
+ a<-table.element(a,gqarr[mypoint-kp3+1,2])
+ a<-table.element(a,gqarr[mypoint-kp3+1,3])
+ a<-table.row.end(a)
+ }
+ a<-table.end(a)
+ table.save(a,file="/var/www/html/rcomp/tmp/154dg91290531503.tab")
+ a<-table.start()
+ a<-table.row.start(a)
+ a<-table.element(a,'Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity',4,TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'Description',header=TRUE)
+ a<-table.element(a,'# significant tests',header=TRUE)
+ a<-table.element(a,'% significant tests',header=TRUE)
+ a<-table.element(a,'OK/NOK',header=TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'1% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant1)
+ a<-table.element(a,numsignificant1/numgqtests)
+ if (numsignificant1/numgqtests < 0.01) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'5% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant5)
+ a<-table.element(a,numsignificant5/numgqtests)
+ if (numsignificant5/numgqtests < 0.05) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'10% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant10)
+ a<-table.element(a,numsignificant10/numgqtests)
+ if (numsignificant10/numgqtests < 0.1) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.end(a)
+ table.save(a,file="/var/www/html/rcomp/tmp/168ewf1290531503.tab")
+ }
>
> try(system("convert tmp/1drsy1290531503.ps tmp/1drsy1290531503.png",intern=TRUE))
character(0)
> try(system("convert tmp/2drsy1290531503.ps tmp/2drsy1290531503.png",intern=TRUE))
character(0)
> try(system("convert tmp/3drsy1290531503.ps tmp/3drsy1290531503.png",intern=TRUE))
character(0)
> try(system("convert tmp/46i911290531503.ps tmp/46i911290531503.png",intern=TRUE))
character(0)
> try(system("convert tmp/56i911290531503.ps tmp/56i911290531503.png",intern=TRUE))
character(0)
> try(system("convert tmp/6g9qm1290531503.ps tmp/6g9qm1290531503.png",intern=TRUE))
character(0)
> try(system("convert tmp/791p71290531503.ps tmp/791p71290531503.png",intern=TRUE))
character(0)
> try(system("convert tmp/891p71290531503.ps tmp/891p71290531503.png",intern=TRUE))
character(0)
> try(system("convert tmp/991p71290531503.ps tmp/991p71290531503.png",intern=TRUE))
character(0)
> try(system("convert tmp/10ks7s1290531503.ps tmp/10ks7s1290531503.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
3.995 1.751 8.643