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(0
+ ,9
+ ,15
+ ,10
+ ,12
+ ,16
+ ,6
+ ,3
+ ,9
+ ,12
+ ,9
+ ,7
+ ,12
+ ,6
+ ,3
+ ,9
+ ,10
+ ,10
+ ,10
+ ,11
+ ,5
+ ,1
+ ,9
+ ,12
+ ,12
+ ,7
+ ,12
+ ,3
+ ,3
+ ,9
+ ,15
+ ,13
+ ,16
+ ,18
+ ,8
+ ,1
+ ,9
+ ,9
+ ,12
+ ,11
+ ,11
+ ,4
+ ,4
+ ,9
+ ,12
+ ,12
+ ,14
+ ,14
+ ,4
+ ,0
+ ,9
+ ,11
+ ,6
+ ,6
+ ,9
+ ,4
+ ,3
+ ,9
+ ,11
+ ,5
+ ,16
+ ,14
+ ,6
+ ,2
+ ,9
+ ,11
+ ,12
+ ,11
+ ,12
+ ,6
+ ,4
+ ,9
+ ,15
+ ,11
+ ,16
+ ,11
+ ,5
+ ,3
+ ,9
+ ,7
+ ,14
+ ,12
+ ,12
+ ,4
+ ,1
+ ,9
+ ,11
+ ,14
+ ,7
+ ,13
+ ,6
+ ,1
+ ,9
+ ,11
+ ,12
+ ,13
+ ,11
+ ,4
+ ,2
+ ,9
+ ,10
+ ,12
+ ,11
+ ,12
+ ,6
+ ,3
+ ,9
+ ,14
+ ,11
+ ,15
+ ,16
+ ,6
+ ,1
+ ,9
+ ,10
+ ,11
+ ,7
+ ,9
+ ,4
+ ,1
+ ,9
+ ,6
+ ,7
+ ,9
+ ,11
+ ,4
+ ,2
+ ,9
+ ,11
+ ,9
+ ,7
+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14
+ ,16
+ ,4
+ ,5
+ ,10
+ ,8
+ ,10
+ ,10
+ ,6
+ ,4
+ ,2
+ ,10
+ ,12
+ ,12
+ ,10
+ ,13
+ ,4
+ ,1
+ ,10
+ ,10
+ ,13
+ ,4
+ ,13
+ ,6
+ ,1
+ ,10
+ ,8
+ ,12
+ ,8
+ ,14
+ ,5
+ ,4
+ ,10
+ ,10
+ ,15
+ ,15
+ ,15
+ ,6
+ ,3
+ ,10
+ ,15
+ ,11
+ ,16
+ ,14
+ ,6
+ ,0
+ ,10
+ ,16
+ ,12
+ ,12
+ ,15
+ ,8
+ ,3
+ ,10
+ ,13
+ ,11
+ ,12
+ ,13
+ ,7
+ ,3
+ ,10
+ ,16
+ ,12
+ ,15
+ ,16
+ ,7
+ ,0
+ ,10
+ ,9
+ ,11
+ ,9
+ ,12
+ ,4
+ ,2
+ ,10
+ ,14
+ ,10
+ ,12
+ ,15
+ ,6
+ ,5
+ ,10
+ ,14
+ ,11
+ ,14
+ ,12
+ ,6
+ ,2
+ ,10
+ ,12
+ ,11
+ ,11
+ ,14
+ ,2)
+ ,dim=c(7
+ ,154)
+ ,dimnames=list(c('aantalVrienden'
+ ,'maand'
+ ,'Popularity'
+ ,'FindingFriends'
+ ,'KnowingPeople'
+ ,'Liked'
+ ,'Celebrity
')
+ ,1:154))
> y <- array(NA,dim=c(7,154),dimnames=list(c('aantalVrienden','maand','Popularity','FindingFriends','KnowingPeople','Liked','Celebrity
'),1:154))
> 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'
> #'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
aantalVrienden maand Popularity FindingFriends KnowingPeople Liked
1 0 9 15 10 12 16
2 3 9 12 9 7 12
3 3 9 10 10 10 11
4 1 9 12 12 7 12
5 3 9 15 13 16 18
6 1 9 9 12 11 11
7 4 9 12 12 14 14
8 0 9 11 6 6 9
9 3 9 11 5 16 14
10 2 9 11 12 11 12
11 4 9 15 11 16 11
12 3 9 7 14 12 12
13 1 9 11 14 7 13
14 1 9 11 12 13 11
15 2 9 10 12 11 12
16 3 9 14 11 15 16
17 1 9 10 11 7 9
18 1 9 6 7 9 11
19 2 9 11 9 7 13
20 3 9 15 11 14 15
21 4 9 11 11 15 10
22 2 9 12 12 7 11
23 1 9 14 12 15 13
24 2 9 15 11 17 16
25 2 9 9 11 15 15
26 4 9 13 8 14 14
27 2 9 13 9 14 14
28 3 9 16 12 8 14
29 3 9 13 10 8 8
30 3 9 12 10 14 13
31 4 9 14 12 14 15
32 2 9 11 8 8 13
33 2 9 9 12 11 11
34 4 9 16 11 16 15
35 3 9 12 12 10 15
36 4 9 10 7 8 9
37 2 9 13 11 14 13
38 5 9 16 11 16 16
39 3 9 14 12 13 13
40 1 9 15 9 5 11
41 1 9 5 15 8 12
42 1 9 8 11 10 12
43 2 9 11 11 8 12
44 3 9 16 11 13 14
45 9 9 17 11 15 14
46 0 9 9 15 6 8
47 0 9 9 11 12 13
48 2 9 13 12 16 16
49 2 9 10 12 5 13
50 3 9 6 9 15 11
51 1 9 12 12 12 14
52 2 10 8 12 8 13
53 0 10 14 13 13 13
54 5 10 12 11 14 13
55 2 10 11 9 12 12
56 4 10 16 9 16 16
57 3 10 8 11 10 15
58 0 10 15 11 15 15
59 0 10 7 12 8 12
60 4 10 16 12 16 14
61 1 10 14 9 19 12
62 1 10 16 11 14 15
63 4 10 9 9 6 12
64 2 10 14 12 13 13
65 4 10 11 12 15 12
66 1 10 13 12 7 12
67 4 10 15 12 13 13
68 2 10 5 14 4 5
69 5 10 15 11 14 13
70 4 10 13 12 13 13
71 4 10 11 11 11 14
72 4 10 11 6 14 17
73 4 10 12 10 12 13
74 3 10 12 12 15 13
75 3 10 12 13 14 12
76 3 10 12 8 13 13
77 2 10 14 12 8 14
78 1 10 6 12 6 11
79 1 10 7 12 7 12
80 5 10 14 6 13 12
81 4 10 14 11 13 16
82 2 10 10 10 11 12
83 3 10 13 12 5 12
84 2 10 12 13 12 12
85 2 10 9 11 8 10
86 2 10 12 7 11 15
87 2 10 16 11 14 15
88 3 10 10 11 9 12
89 2 10 14 11 10 16
90 3 10 10 11 13 15
91 4 10 16 12 16 16
92 3 10 15 10 16 13
93 3 10 12 11 11 12
94 0 10 10 12 8 11
95 1 10 8 7 4 13
96 2 10 8 13 7 10
97 2 10 11 8 14 15
98 3 10 13 12 11 13
99 4 10 16 11 17 16
100 4 10 16 12 15 15
101 1 10 14 14 17 18
102 2 10 11 10 5 13
103 2 10 4 10 4 10
104 3 10 14 13 10 16
105 3 10 9 10 11 13
106 3 10 14 11 15 15
107 1 10 8 10 10 14
108 1 10 8 7 9 15
109 1 10 11 10 12 14
110 1 10 12 8 15 13
111 0 10 11 12 7 13
112 1 10 14 12 13 15
113 3 10 15 12 12 16
114 3 10 16 11 14 14
115 0 10 16 12 14 14
116 2 10 11 12 8 16
117 5 10 14 12 15 14
118 2 10 14 11 12 12
119 3 10 12 12 12 13
120 3 10 14 11 16 12
121 5 10 8 11 9 12
122 4 10 13 13 15 14
123 4 10 16 12 15 14
124 0 10 12 12 6 14
125 3 10 16 12 14 16
126 0 10 12 12 15 13
127 2 10 11 8 10 14
128 0 10 4 8 6 4
129 6 10 16 12 14 16
130 3 10 15 11 12 13
131 1 10 10 12 8 16
132 6 10 13 13 11 15
133 2 10 15 12 13 14
134 1 10 12 12 9 13
135 3 10 14 11 15 14
136 1 10 7 12 13 12
137 2 10 19 12 15 15
138 4 10 12 10 14 14
139 1 10 12 11 16 13
140 2 10 13 12 14 14
141 0 10 15 12 14 16
142 5 10 8 10 10 6
143 2 10 12 12 10 13
144 1 10 10 13 4 13
145 1 10 8 12 8 14
146 4 10 10 15 15 15
147 3 10 15 11 16 14
148 0 10 16 12 12 15
149 3 10 13 11 12 13
150 3 10 16 12 15 16
151 0 10 9 11 9 12
152 2 10 14 10 12 15
153 5 10 14 11 14 12
154 2 10 12 11 11 14
Celebrity\r
1 6
2 6
3 5
4 3
5 8
6 4
7 4
8 4
9 6
10 6
11 5
12 4
13 6
14 4
15 6
16 6
17 4
18 4
19 2
20 7
21 5
22 4
23 6
24 6
25 7
26 5
27 6
28 4
29 4
30 7
31 7
32 4
33 4
34 6
35 6
36 5
37 6
38 7
39 6
40 3
41 3
42 4
43 6
44 7
45 5
46 4
47 5
48 6
49 6
50 6
51 5
52 4
53 5
54 5
55 4
56 6
57 2
58 8
59 3
60 6
61 6
62 6
63 5
64 5
65 6
66 5
67 6
68 2
69 5
70 5
71 5
72 6
73 6
74 6
75 5
76 5
77 4
78 2
79 4
80 6
81 6
82 5
83 3
84 6
85 4
86 5
87 8
88 4
89 6
90 6
91 7
92 6
93 5
94 4
95 6
96 3
97 5
98 6
99 7
100 7
101 6
102 3
103 2
104 8
105 3
106 8
107 3
108 4
109 5
110 7
111 6
112 6
113 7
114 6
115 6
116 6
117 6
118 4
119 4
120 5
121 4
122 6
123 6
124 5
125 8
126 6
127 5
128 4
129 8
130 6
131 4
132 6
133 6
134 4
135 6
136 3
137 6
138 5
139 4
140 6
141 4
142 4
143 4
144 6
145 5
146 6
147 6
148 8
149 7
150 7
151 4
152 6
153 6
154 2
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) maand Popularity FindingFriends KnowingPeople
0.76637 0.04872 0.09915 -0.06099 0.12833
Liked `Celebrity\r`
-0.07612 0.03140
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-3.104122 -0.811917 0.005374 0.842514 5.764351
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.76637 2.45177 0.313 0.75504
maand 0.04872 0.24646 0.198 0.84358
Popularity 0.09915 0.05499 1.803 0.07344 .
FindingFriends -0.06099 0.06525 -0.935 0.35147
KnowingPeople 0.12833 0.04399 2.917 0.00409 **
Liked -0.07612 0.06851 -1.111 0.26834
`Celebrity\r` 0.03140 0.11314 0.277 0.78179
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 1.419 on 147 degrees of freedom
Multiple R-squared: 0.1621, Adjusted R-squared: 0.1279
F-statistic: 4.741 on 6 and 147 DF, p-value: 0.0001915
> 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.86387766 0.27224469 0.1361223
[2,] 0.79647810 0.40704381 0.2035219
[3,] 0.69029428 0.61941145 0.3097057
[4,] 0.58054039 0.83891923 0.4194596
[5,] 0.62992603 0.74014794 0.3700740
[6,] 0.53213906 0.93572189 0.4678609
[7,] 0.43554139 0.87108278 0.5644586
[8,] 0.34559501 0.69119002 0.6544050
[9,] 0.27089970 0.54179940 0.7291003
[10,] 0.25882082 0.51764165 0.7411792
[11,] 0.19578838 0.39157676 0.8042116
[12,] 0.16245639 0.32491278 0.8375436
[13,] 0.12660266 0.25320533 0.8733973
[14,] 0.19075936 0.38151871 0.8092406
[15,] 0.16982095 0.33964189 0.8301791
[16,] 0.13401737 0.26803474 0.8659826
[17,] 0.14385900 0.28771800 0.8561410
[18,] 0.11292707 0.22585413 0.8870729
[19,] 0.10878559 0.21757118 0.8912144
[20,] 0.09240963 0.18481926 0.9075904
[21,] 0.07049416 0.14098832 0.9295058
[22,] 0.07315640 0.14631281 0.9268436
[23,] 0.05446325 0.10892649 0.9455368
[24,] 0.03853776 0.07707551 0.9614622
[25,] 0.02990604 0.05981208 0.9700940
[26,] 0.02662949 0.05325898 0.9733705
[27,] 0.04275635 0.08551271 0.9572436
[28,] 0.03498398 0.06996796 0.9650160
[29,] 0.04500049 0.09000097 0.9549995
[30,] 0.03250524 0.06501048 0.9674948
[31,] 0.02713641 0.05427281 0.9728636
[32,] 0.01904109 0.03808217 0.9809589
[33,] 0.01482095 0.02964190 0.9851791
[34,] 0.01016061 0.02032121 0.9898394
[35,] 0.00684277 0.01368554 0.9931572
[36,] 0.36640636 0.73281273 0.6335936
[37,] 0.34762507 0.69525014 0.6523749
[38,] 0.38349860 0.76699721 0.6165014
[39,] 0.35660000 0.71320001 0.6434000
[40,] 0.34497129 0.68994258 0.6550287
[41,] 0.32008280 0.64016560 0.6799172
[42,] 0.30307475 0.60614951 0.6969252
[43,] 0.25964678 0.51929355 0.7403532
[44,] 0.38279341 0.76558682 0.6172066
[45,] 0.48073388 0.96146776 0.5192661
[46,] 0.43733953 0.87467906 0.5626605
[47,] 0.39647541 0.79295082 0.6035246
[48,] 0.39811260 0.79622520 0.6018874
[49,] 0.56685670 0.86628661 0.4331433
[50,] 0.55068336 0.89863328 0.4493166
[51,] 0.51777433 0.96445135 0.4822257
[52,] 0.62898535 0.74202929 0.3710146
[53,] 0.64758621 0.70482757 0.3524138
[54,] 0.76891445 0.46217110 0.2310855
[55,] 0.73601518 0.52796964 0.2639848
[56,] 0.73947837 0.52104327 0.2605216
[57,] 0.71028859 0.57942282 0.2897114
[58,] 0.70307670 0.59384660 0.2969233
[59,] 0.68638607 0.62722787 0.3136139
[60,] 0.72462939 0.55074123 0.2753706
[61,] 0.71977940 0.56044120 0.2802206
[62,] 0.74116414 0.51767172 0.2588359
[63,] 0.73437366 0.53125268 0.2656263
[64,] 0.73100864 0.53798273 0.2689914
[65,] 0.69006686 0.61986628 0.3099331
[66,] 0.64748614 0.70502771 0.3525139
[67,] 0.60456935 0.79086129 0.3954306
[68,] 0.55947230 0.88105540 0.4405277
[69,] 0.51325796 0.97348409 0.4867420
[70,] 0.46961735 0.93923470 0.5303826
[71,] 0.51084315 0.97831369 0.4891568
[72,] 0.50807007 0.98385986 0.4919299
[73,] 0.46314941 0.92629883 0.5368506
[74,] 0.46130569 0.92261139 0.5386943
[75,] 0.42396801 0.84793602 0.5760320
[76,] 0.37740296 0.75480593 0.6225970
[77,] 0.34422590 0.68845179 0.6557741
[78,] 0.32456079 0.64912159 0.6754392
[79,] 0.30477703 0.60955405 0.6952230
[80,] 0.26595666 0.53191332 0.7340433
[81,] 0.23358341 0.46716681 0.7664166
[82,] 0.20948488 0.41896975 0.7905151
[83,] 0.17894691 0.35789381 0.8210531
[84,] 0.15383914 0.30767828 0.8461609
[85,] 0.17699898 0.35399795 0.8230010
[86,] 0.14753109 0.29506219 0.8524689
[87,] 0.12208476 0.24416953 0.8779152
[88,] 0.10381029 0.20762058 0.8961897
[89,] 0.08559000 0.17118001 0.9144100
[90,] 0.07332538 0.14665076 0.9266746
[91,] 0.06392762 0.12785525 0.9360724
[92,] 0.07813956 0.15627913 0.9218604
[93,] 0.07036688 0.14073376 0.9296331
[94,] 0.06551259 0.13102517 0.9344874
[95,] 0.05401657 0.10803313 0.9459834
[96,] 0.05023358 0.10046715 0.9497664
[97,] 0.03837732 0.07675464 0.9616227
[98,] 0.03063702 0.06127404 0.9693630
[99,] 0.02496330 0.04992659 0.9750367
[100,] 0.02205050 0.04410101 0.9779495
[101,] 0.02885426 0.05770853 0.9711457
[102,] 0.03136980 0.06273959 0.9686302
[103,] 0.03332525 0.06665050 0.9666748
[104,] 0.02509754 0.05019507 0.9749025
[105,] 0.01843882 0.03687763 0.9815612
[106,] 0.04371741 0.08743482 0.9562826
[107,] 0.03296036 0.06592073 0.9670396
[108,] 0.03925213 0.07850426 0.9607479
[109,] 0.02972644 0.05945288 0.9702736
[110,] 0.02352475 0.04704950 0.9764752
[111,] 0.01669264 0.03338528 0.9833074
[112,] 0.06240681 0.12481361 0.9375932
[113,] 0.05184914 0.10369827 0.9481509
[114,] 0.04225693 0.08451386 0.9577431
[115,] 0.03793399 0.07586798 0.9620660
[116,] 0.02711436 0.05422872 0.9728856
[117,] 0.07632725 0.15265449 0.9236728
[118,] 0.06201954 0.12403909 0.9379805
[119,] 0.08681372 0.17362744 0.9131863
[120,] 0.19283319 0.38566638 0.8071668
[121,] 0.15095315 0.30190630 0.8490468
[122,] 0.12178636 0.24357272 0.8782136
[123,] 0.59483262 0.81033476 0.4051674
[124,] 0.52128794 0.95742413 0.4787121
[125,] 0.44512989 0.89025977 0.5548701
[126,] 0.36435372 0.72870744 0.6356463
[127,] 0.38953617 0.77907234 0.6104638
[128,] 0.31371345 0.62742690 0.6862865
[129,] 0.36448014 0.72896029 0.6355199
[130,] 0.49649054 0.99298109 0.5035095
[131,] 0.42952319 0.85904639 0.5704768
[132,] 0.50141884 0.99716231 0.4985812
[133,] 0.39163050 0.78326100 0.6083695
[134,] 0.26686757 0.53373514 0.7331324
[135,] 0.29223270 0.58446539 0.7077673
> postscript(file="/var/www/html/rcomp/tmp/1hl6u1291221426.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/www/html/rcomp/tmp/29u6f1291221426.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/www/html/rcomp/tmp/39u6f1291221426.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/www/html/rcomp/tmp/49u6f1291221426.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/www/html/rcomp/tmp/59u6f1291221426.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 = 154
Frequency = 1
1 2 3 4 5 6
-2.592502103 0.981098019 0.810688697 -0.741739591 0.166627683 -1.065104717
7 8 9 10 11 12
1.480830848 -2.139981877 -0.166403366 -0.250077488 0.605956727 1.202984502
13 14 15 16 17 18
-0.538663764 -1.520063825 -0.150924165 0.182664559 -0.864194634 -0.815952436
19 20 21 22 23 24
0.281957818 0.104317290 1.054771509 0.150740234 -1.984717638 -1.173141225
25 26 27 28 29 30
-0.429088999 1.106313971 -0.864089432 0.854174936 0.572902393 0.188535746
31 32 33 34 35 36
1.264462644 0.029848692 -0.065104717 0.779906939 1.007469646 1.732115582
37 38 39 40 41 42
-0.818230114 1.824636248 0.271934823 -1.041647933 0.006983534 -0.822492451
43 44 45 46 47 48
0.073909173 0.057365455 5.764350537 -1.468871702 -2.133568926 -0.785516318
49 50 51 52 53 54
0.695157960 0.473283376 -1.293912124 0.522558751 -2.684395746 2.263600611
55 56 57 58 59 60
-0.547306974 0.685329590 1.419954611 -3.104122405 -1.423017235 0.716056195
61 62 63 64 65 66
-2.805841423 -2.012158632 2.389561622 -0.745387776 1.187899559 -0.952401812
67 68 69 70 71 72
1.124063468 0.909100631 1.966140640 1.353765548 1.823857368 1.330897320
73 74 75 76 77 78
1.427865608 0.164870978 0.309459929 0.208950751 0.003763552 -0.111940760
79 80 81 82 83 84
-0.326086438 1.781139868 1.390598988 -0.290230823 1.367041515 -0.465283044
85 86 87 88 89 90
0.134039170 -0.443139333 -1.074949498 1.058809101 -0.224422321 0.711087540
91 92 93 94 95 96
0.836910247 -0.382899284 0.572454560 -1.827997381 -0.331887345 0.514898217
97 98 99 100 101 102
-0.667972671 0.579022575 0.647591986 0.889111735 -1.787480359 0.519488844
103 104 105 106 107 108
1.144909546 0.834770873 0.947838109 -0.004969082 -0.748557595 -0.758478145
109 110 111 112 113 114
-1.365460892 -2.110492576 -1.709365856 -1.624533724 0.449368492 -0.088283374
115 116 117 118 119 120
-3.027291344 0.390682140 2.042689073 -0.722782884 0.612640535 -0.267483239
121 122 123 124 125 126
3.257115748 1.202834426 0.844382426 -1.572672774 0.062167274 -2.835129022
127 128 129 130 131 132
-0.230792492 -1.753266296 3.062167274 0.191397668 -0.447373669 3.792264090
133 134 135 136 137 138
-0.799811790 -1.002380774 -0.018302957 -1.064648387 -1.376952803 1.278733323
139 140 141 142 143 144
-1.961656416 -0.729831373 -2.713097669 2.611049034 -0.130707004 -0.164241812
145 146 147 148 149 150
-0.432711940 1.698403199 -0.245782511 -2.757305008 0.358308882 -0.034763523
151 152 153 154
-1.842037576 -0.618191554 1.957773788 -0.181109656
> postscript(file="/var/www/html/rcomp/tmp/62l5i1291221426.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 = 154
Frequency = 1
lag(myerror, k = 1) myerror
0 -2.592502103 NA
1 0.981098019 -2.592502103
2 0.810688697 0.981098019
3 -0.741739591 0.810688697
4 0.166627683 -0.741739591
5 -1.065104717 0.166627683
6 1.480830848 -1.065104717
7 -2.139981877 1.480830848
8 -0.166403366 -2.139981877
9 -0.250077488 -0.166403366
10 0.605956727 -0.250077488
11 1.202984502 0.605956727
12 -0.538663764 1.202984502
13 -1.520063825 -0.538663764
14 -0.150924165 -1.520063825
15 0.182664559 -0.150924165
16 -0.864194634 0.182664559
17 -0.815952436 -0.864194634
18 0.281957818 -0.815952436
19 0.104317290 0.281957818
20 1.054771509 0.104317290
21 0.150740234 1.054771509
22 -1.984717638 0.150740234
23 -1.173141225 -1.984717638
24 -0.429088999 -1.173141225
25 1.106313971 -0.429088999
26 -0.864089432 1.106313971
27 0.854174936 -0.864089432
28 0.572902393 0.854174936
29 0.188535746 0.572902393
30 1.264462644 0.188535746
31 0.029848692 1.264462644
32 -0.065104717 0.029848692
33 0.779906939 -0.065104717
34 1.007469646 0.779906939
35 1.732115582 1.007469646
36 -0.818230114 1.732115582
37 1.824636248 -0.818230114
38 0.271934823 1.824636248
39 -1.041647933 0.271934823
40 0.006983534 -1.041647933
41 -0.822492451 0.006983534
42 0.073909173 -0.822492451
43 0.057365455 0.073909173
44 5.764350537 0.057365455
45 -1.468871702 5.764350537
46 -2.133568926 -1.468871702
47 -0.785516318 -2.133568926
48 0.695157960 -0.785516318
49 0.473283376 0.695157960
50 -1.293912124 0.473283376
51 0.522558751 -1.293912124
52 -2.684395746 0.522558751
53 2.263600611 -2.684395746
54 -0.547306974 2.263600611
55 0.685329590 -0.547306974
56 1.419954611 0.685329590
57 -3.104122405 1.419954611
58 -1.423017235 -3.104122405
59 0.716056195 -1.423017235
60 -2.805841423 0.716056195
61 -2.012158632 -2.805841423
62 2.389561622 -2.012158632
63 -0.745387776 2.389561622
64 1.187899559 -0.745387776
65 -0.952401812 1.187899559
66 1.124063468 -0.952401812
67 0.909100631 1.124063468
68 1.966140640 0.909100631
69 1.353765548 1.966140640
70 1.823857368 1.353765548
71 1.330897320 1.823857368
72 1.427865608 1.330897320
73 0.164870978 1.427865608
74 0.309459929 0.164870978
75 0.208950751 0.309459929
76 0.003763552 0.208950751
77 -0.111940760 0.003763552
78 -0.326086438 -0.111940760
79 1.781139868 -0.326086438
80 1.390598988 1.781139868
81 -0.290230823 1.390598988
82 1.367041515 -0.290230823
83 -0.465283044 1.367041515
84 0.134039170 -0.465283044
85 -0.443139333 0.134039170
86 -1.074949498 -0.443139333
87 1.058809101 -1.074949498
88 -0.224422321 1.058809101
89 0.711087540 -0.224422321
90 0.836910247 0.711087540
91 -0.382899284 0.836910247
92 0.572454560 -0.382899284
93 -1.827997381 0.572454560
94 -0.331887345 -1.827997381
95 0.514898217 -0.331887345
96 -0.667972671 0.514898217
97 0.579022575 -0.667972671
98 0.647591986 0.579022575
99 0.889111735 0.647591986
100 -1.787480359 0.889111735
101 0.519488844 -1.787480359
102 1.144909546 0.519488844
103 0.834770873 1.144909546
104 0.947838109 0.834770873
105 -0.004969082 0.947838109
106 -0.748557595 -0.004969082
107 -0.758478145 -0.748557595
108 -1.365460892 -0.758478145
109 -2.110492576 -1.365460892
110 -1.709365856 -2.110492576
111 -1.624533724 -1.709365856
112 0.449368492 -1.624533724
113 -0.088283374 0.449368492
114 -3.027291344 -0.088283374
115 0.390682140 -3.027291344
116 2.042689073 0.390682140
117 -0.722782884 2.042689073
118 0.612640535 -0.722782884
119 -0.267483239 0.612640535
120 3.257115748 -0.267483239
121 1.202834426 3.257115748
122 0.844382426 1.202834426
123 -1.572672774 0.844382426
124 0.062167274 -1.572672774
125 -2.835129022 0.062167274
126 -0.230792492 -2.835129022
127 -1.753266296 -0.230792492
128 3.062167274 -1.753266296
129 0.191397668 3.062167274
130 -0.447373669 0.191397668
131 3.792264090 -0.447373669
132 -0.799811790 3.792264090
133 -1.002380774 -0.799811790
134 -0.018302957 -1.002380774
135 -1.064648387 -0.018302957
136 -1.376952803 -1.064648387
137 1.278733323 -1.376952803
138 -1.961656416 1.278733323
139 -0.729831373 -1.961656416
140 -2.713097669 -0.729831373
141 2.611049034 -2.713097669
142 -0.130707004 2.611049034
143 -0.164241812 -0.130707004
144 -0.432711940 -0.164241812
145 1.698403199 -0.432711940
146 -0.245782511 1.698403199
147 -2.757305008 -0.245782511
148 0.358308882 -2.757305008
149 -0.034763523 0.358308882
150 -1.842037576 -0.034763523
151 -0.618191554 -1.842037576
152 1.957773788 -0.618191554
153 -0.181109656 1.957773788
154 NA -0.181109656
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 0.981098019 -2.592502103
[2,] 0.810688697 0.981098019
[3,] -0.741739591 0.810688697
[4,] 0.166627683 -0.741739591
[5,] -1.065104717 0.166627683
[6,] 1.480830848 -1.065104717
[7,] -2.139981877 1.480830848
[8,] -0.166403366 -2.139981877
[9,] -0.250077488 -0.166403366
[10,] 0.605956727 -0.250077488
[11,] 1.202984502 0.605956727
[12,] -0.538663764 1.202984502
[13,] -1.520063825 -0.538663764
[14,] -0.150924165 -1.520063825
[15,] 0.182664559 -0.150924165
[16,] -0.864194634 0.182664559
[17,] -0.815952436 -0.864194634
[18,] 0.281957818 -0.815952436
[19,] 0.104317290 0.281957818
[20,] 1.054771509 0.104317290
[21,] 0.150740234 1.054771509
[22,] -1.984717638 0.150740234
[23,] -1.173141225 -1.984717638
[24,] -0.429088999 -1.173141225
[25,] 1.106313971 -0.429088999
[26,] -0.864089432 1.106313971
[27,] 0.854174936 -0.864089432
[28,] 0.572902393 0.854174936
[29,] 0.188535746 0.572902393
[30,] 1.264462644 0.188535746
[31,] 0.029848692 1.264462644
[32,] -0.065104717 0.029848692
[33,] 0.779906939 -0.065104717
[34,] 1.007469646 0.779906939
[35,] 1.732115582 1.007469646
[36,] -0.818230114 1.732115582
[37,] 1.824636248 -0.818230114
[38,] 0.271934823 1.824636248
[39,] -1.041647933 0.271934823
[40,] 0.006983534 -1.041647933
[41,] -0.822492451 0.006983534
[42,] 0.073909173 -0.822492451
[43,] 0.057365455 0.073909173
[44,] 5.764350537 0.057365455
[45,] -1.468871702 5.764350537
[46,] -2.133568926 -1.468871702
[47,] -0.785516318 -2.133568926
[48,] 0.695157960 -0.785516318
[49,] 0.473283376 0.695157960
[50,] -1.293912124 0.473283376
[51,] 0.522558751 -1.293912124
[52,] -2.684395746 0.522558751
[53,] 2.263600611 -2.684395746
[54,] -0.547306974 2.263600611
[55,] 0.685329590 -0.547306974
[56,] 1.419954611 0.685329590
[57,] -3.104122405 1.419954611
[58,] -1.423017235 -3.104122405
[59,] 0.716056195 -1.423017235
[60,] -2.805841423 0.716056195
[61,] -2.012158632 -2.805841423
[62,] 2.389561622 -2.012158632
[63,] -0.745387776 2.389561622
[64,] 1.187899559 -0.745387776
[65,] -0.952401812 1.187899559
[66,] 1.124063468 -0.952401812
[67,] 0.909100631 1.124063468
[68,] 1.966140640 0.909100631
[69,] 1.353765548 1.966140640
[70,] 1.823857368 1.353765548
[71,] 1.330897320 1.823857368
[72,] 1.427865608 1.330897320
[73,] 0.164870978 1.427865608
[74,] 0.309459929 0.164870978
[75,] 0.208950751 0.309459929
[76,] 0.003763552 0.208950751
[77,] -0.111940760 0.003763552
[78,] -0.326086438 -0.111940760
[79,] 1.781139868 -0.326086438
[80,] 1.390598988 1.781139868
[81,] -0.290230823 1.390598988
[82,] 1.367041515 -0.290230823
[83,] -0.465283044 1.367041515
[84,] 0.134039170 -0.465283044
[85,] -0.443139333 0.134039170
[86,] -1.074949498 -0.443139333
[87,] 1.058809101 -1.074949498
[88,] -0.224422321 1.058809101
[89,] 0.711087540 -0.224422321
[90,] 0.836910247 0.711087540
[91,] -0.382899284 0.836910247
[92,] 0.572454560 -0.382899284
[93,] -1.827997381 0.572454560
[94,] -0.331887345 -1.827997381
[95,] 0.514898217 -0.331887345
[96,] -0.667972671 0.514898217
[97,] 0.579022575 -0.667972671
[98,] 0.647591986 0.579022575
[99,] 0.889111735 0.647591986
[100,] -1.787480359 0.889111735
[101,] 0.519488844 -1.787480359
[102,] 1.144909546 0.519488844
[103,] 0.834770873 1.144909546
[104,] 0.947838109 0.834770873
[105,] -0.004969082 0.947838109
[106,] -0.748557595 -0.004969082
[107,] -0.758478145 -0.748557595
[108,] -1.365460892 -0.758478145
[109,] -2.110492576 -1.365460892
[110,] -1.709365856 -2.110492576
[111,] -1.624533724 -1.709365856
[112,] 0.449368492 -1.624533724
[113,] -0.088283374 0.449368492
[114,] -3.027291344 -0.088283374
[115,] 0.390682140 -3.027291344
[116,] 2.042689073 0.390682140
[117,] -0.722782884 2.042689073
[118,] 0.612640535 -0.722782884
[119,] -0.267483239 0.612640535
[120,] 3.257115748 -0.267483239
[121,] 1.202834426 3.257115748
[122,] 0.844382426 1.202834426
[123,] -1.572672774 0.844382426
[124,] 0.062167274 -1.572672774
[125,] -2.835129022 0.062167274
[126,] -0.230792492 -2.835129022
[127,] -1.753266296 -0.230792492
[128,] 3.062167274 -1.753266296
[129,] 0.191397668 3.062167274
[130,] -0.447373669 0.191397668
[131,] 3.792264090 -0.447373669
[132,] -0.799811790 3.792264090
[133,] -1.002380774 -0.799811790
[134,] -0.018302957 -1.002380774
[135,] -1.064648387 -0.018302957
[136,] -1.376952803 -1.064648387
[137,] 1.278733323 -1.376952803
[138,] -1.961656416 1.278733323
[139,] -0.729831373 -1.961656416
[140,] -2.713097669 -0.729831373
[141,] 2.611049034 -2.713097669
[142,] -0.130707004 2.611049034
[143,] -0.164241812 -0.130707004
[144,] -0.432711940 -0.164241812
[145,] 1.698403199 -0.432711940
[146,] -0.245782511 1.698403199
[147,] -2.757305008 -0.245782511
[148,] 0.358308882 -2.757305008
[149,] -0.034763523 0.358308882
[150,] -1.842037576 -0.034763523
[151,] -0.618191554 -1.842037576
[152,] 1.957773788 -0.618191554
[153,] -0.181109656 1.957773788
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 0.981098019 -2.592502103
2 0.810688697 0.981098019
3 -0.741739591 0.810688697
4 0.166627683 -0.741739591
5 -1.065104717 0.166627683
6 1.480830848 -1.065104717
7 -2.139981877 1.480830848
8 -0.166403366 -2.139981877
9 -0.250077488 -0.166403366
10 0.605956727 -0.250077488
11 1.202984502 0.605956727
12 -0.538663764 1.202984502
13 -1.520063825 -0.538663764
14 -0.150924165 -1.520063825
15 0.182664559 -0.150924165
16 -0.864194634 0.182664559
17 -0.815952436 -0.864194634
18 0.281957818 -0.815952436
19 0.104317290 0.281957818
20 1.054771509 0.104317290
21 0.150740234 1.054771509
22 -1.984717638 0.150740234
23 -1.173141225 -1.984717638
24 -0.429088999 -1.173141225
25 1.106313971 -0.429088999
26 -0.864089432 1.106313971
27 0.854174936 -0.864089432
28 0.572902393 0.854174936
29 0.188535746 0.572902393
30 1.264462644 0.188535746
31 0.029848692 1.264462644
32 -0.065104717 0.029848692
33 0.779906939 -0.065104717
34 1.007469646 0.779906939
35 1.732115582 1.007469646
36 -0.818230114 1.732115582
37 1.824636248 -0.818230114
38 0.271934823 1.824636248
39 -1.041647933 0.271934823
40 0.006983534 -1.041647933
41 -0.822492451 0.006983534
42 0.073909173 -0.822492451
43 0.057365455 0.073909173
44 5.764350537 0.057365455
45 -1.468871702 5.764350537
46 -2.133568926 -1.468871702
47 -0.785516318 -2.133568926
48 0.695157960 -0.785516318
49 0.473283376 0.695157960
50 -1.293912124 0.473283376
51 0.522558751 -1.293912124
52 -2.684395746 0.522558751
53 2.263600611 -2.684395746
54 -0.547306974 2.263600611
55 0.685329590 -0.547306974
56 1.419954611 0.685329590
57 -3.104122405 1.419954611
58 -1.423017235 -3.104122405
59 0.716056195 -1.423017235
60 -2.805841423 0.716056195
61 -2.012158632 -2.805841423
62 2.389561622 -2.012158632
63 -0.745387776 2.389561622
64 1.187899559 -0.745387776
65 -0.952401812 1.187899559
66 1.124063468 -0.952401812
67 0.909100631 1.124063468
68 1.966140640 0.909100631
69 1.353765548 1.966140640
70 1.823857368 1.353765548
71 1.330897320 1.823857368
72 1.427865608 1.330897320
73 0.164870978 1.427865608
74 0.309459929 0.164870978
75 0.208950751 0.309459929
76 0.003763552 0.208950751
77 -0.111940760 0.003763552
78 -0.326086438 -0.111940760
79 1.781139868 -0.326086438
80 1.390598988 1.781139868
81 -0.290230823 1.390598988
82 1.367041515 -0.290230823
83 -0.465283044 1.367041515
84 0.134039170 -0.465283044
85 -0.443139333 0.134039170
86 -1.074949498 -0.443139333
87 1.058809101 -1.074949498
88 -0.224422321 1.058809101
89 0.711087540 -0.224422321
90 0.836910247 0.711087540
91 -0.382899284 0.836910247
92 0.572454560 -0.382899284
93 -1.827997381 0.572454560
94 -0.331887345 -1.827997381
95 0.514898217 -0.331887345
96 -0.667972671 0.514898217
97 0.579022575 -0.667972671
98 0.647591986 0.579022575
99 0.889111735 0.647591986
100 -1.787480359 0.889111735
101 0.519488844 -1.787480359
102 1.144909546 0.519488844
103 0.834770873 1.144909546
104 0.947838109 0.834770873
105 -0.004969082 0.947838109
106 -0.748557595 -0.004969082
107 -0.758478145 -0.748557595
108 -1.365460892 -0.758478145
109 -2.110492576 -1.365460892
110 -1.709365856 -2.110492576
111 -1.624533724 -1.709365856
112 0.449368492 -1.624533724
113 -0.088283374 0.449368492
114 -3.027291344 -0.088283374
115 0.390682140 -3.027291344
116 2.042689073 0.390682140
117 -0.722782884 2.042689073
118 0.612640535 -0.722782884
119 -0.267483239 0.612640535
120 3.257115748 -0.267483239
121 1.202834426 3.257115748
122 0.844382426 1.202834426
123 -1.572672774 0.844382426
124 0.062167274 -1.572672774
125 -2.835129022 0.062167274
126 -0.230792492 -2.835129022
127 -1.753266296 -0.230792492
128 3.062167274 -1.753266296
129 0.191397668 3.062167274
130 -0.447373669 0.191397668
131 3.792264090 -0.447373669
132 -0.799811790 3.792264090
133 -1.002380774 -0.799811790
134 -0.018302957 -1.002380774
135 -1.064648387 -0.018302957
136 -1.376952803 -1.064648387
137 1.278733323 -1.376952803
138 -1.961656416 1.278733323
139 -0.729831373 -1.961656416
140 -2.713097669 -0.729831373
141 2.611049034 -2.713097669
142 -0.130707004 2.611049034
143 -0.164241812 -0.130707004
144 -0.432711940 -0.164241812
145 1.698403199 -0.432711940
146 -0.245782511 1.698403199
147 -2.757305008 -0.245782511
148 0.358308882 -2.757305008
149 -0.034763523 0.358308882
150 -1.842037576 -0.034763523
151 -0.618191554 -1.842037576
152 1.957773788 -0.618191554
153 -0.181109656 1.957773788
> 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/7vv431291221426.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/www/html/rcomp/tmp/8vv431291221426.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/www/html/rcomp/tmp/96ml61291221426.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/www/html/rcomp/tmp/106ml61291221426.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/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/11rmku1291221426.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/12un1i1291221426.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/13jofu1291221426.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/14m6ez1291221426.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/15q7c51291221426.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/16t7bt1291221426.tab")
+ }
>
> try(system("convert tmp/1hl6u1291221426.ps tmp/1hl6u1291221426.png",intern=TRUE))
character(0)
> try(system("convert tmp/29u6f1291221426.ps tmp/29u6f1291221426.png",intern=TRUE))
character(0)
> try(system("convert tmp/39u6f1291221426.ps tmp/39u6f1291221426.png",intern=TRUE))
character(0)
> try(system("convert tmp/49u6f1291221426.ps tmp/49u6f1291221426.png",intern=TRUE))
character(0)
> try(system("convert tmp/59u6f1291221426.ps tmp/59u6f1291221426.png",intern=TRUE))
character(0)
> try(system("convert tmp/62l5i1291221426.ps tmp/62l5i1291221426.png",intern=TRUE))
character(0)
> try(system("convert tmp/7vv431291221426.ps tmp/7vv431291221426.png",intern=TRUE))
character(0)
> try(system("convert tmp/8vv431291221426.ps tmp/8vv431291221426.png",intern=TRUE))
character(0)
> try(system("convert tmp/96ml61291221426.ps tmp/96ml61291221426.png",intern=TRUE))
character(0)
> try(system("convert tmp/106ml61291221426.ps tmp/106ml61291221426.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
4.192 1.875 11.023