R version 2.8.0 (2008-10-20)
Copyright (C) 2008 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.
Natural language support but running in an English locale
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
+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
+ ,12
+ ,9
+ ,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 = 'No 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
1 13 9 13 14 13 3
2 12 9 12 8 13 5
3 15 9 10 12 16 6
4 12 9 9 7 12 6
5 10 9 10 10 11 5
6 12 9 12 7 12 3
7 15 9 13 16 18 8
8 9 9 12 11 11 4
9 12 9 12 14 14 4
10 11 9 6 6 9 4
11 11 9 5 16 14 6
12 11 9 12 11 12 6
13 15 9 11 16 11 5
14 7 9 14 12 12 4
15 11 9 14 7 13 6
16 11 9 12 13 11 4
17 10 9 12 11 12 6
18 14 9 11 15 16 6
19 10 9 11 7 9 4
20 6 9 7 9 11 4
21 11 9 9 7 13 2
22 15 9 11 14 15 7
23 11 9 11 15 10 5
24 12 9 12 7 11 4
25 14 9 12 15 13 6
26 15 9 11 17 16 6
27 9 9 11 15 15 7
28 13 9 8 14 14 5
29 13 9 9 14 14 6
30 16 9 12 8 14 4
31 13 9 10 8 8 4
32 12 9 10 14 13 7
33 14 9 12 14 15 7
34 11 9 8 8 13 4
35 9 9 12 11 11 4
36 16 9 11 16 15 6
37 12 9 12 10 15 6
38 10 9 7 8 9 5
39 13 9 11 14 13 6
40 16 9 11 16 16 7
41 14 9 12 13 13 6
42 15 9 9 5 11 3
43 5 9 15 8 12 3
44 8 9 11 10 12 4
45 11 9 11 8 12 6
46 16 9 11 13 14 7
47 17 9 11 15 14 5
48 9 9 15 6 8 4
49 9 9 11 12 13 5
50 13 9 12 16 16 6
51 10 9 12 5 13 6
52 6 10 9 15 11 6
53 12 10 12 12 14 5
54 8 10 12 8 13 4
55 14 10 13 13 13 5
56 12 10 11 14 13 5
57 11 10 9 12 12 4
58 16 10 9 16 16 6
59 8 10 11 10 15 2
60 15 10 11 15 15 8
61 7 10 12 8 12 3
62 16 10 12 16 14 6
63 14 10 9 19 12 6
64 16 10 11 14 15 6
65 9 10 9 6 12 5
66 14 10 12 13 13 5
67 11 10 12 15 12 6
68 13 10 12 7 12 5
69 15 10 12 13 13 6
70 5 10 14 4 5 2
71 15 10 11 14 13 5
72 13 10 12 13 13 5
73 11 10 11 11 14 5
74 11 10 6 14 17 6
75 12 10 10 12 13 6
76 12 10 12 15 13 6
77 12 10 13 14 12 5
78 12 10 8 13 13 5
79 14 10 12 8 14 4
80 6 10 12 6 11 2
81 7 10 12 7 12 4
82 14 10 6 13 12 6
83 14 10 11 13 16 6
84 10 10 10 11 12 5
85 13 10 12 5 12 3
86 12 10 13 12 12 6
87 9 10 11 8 10 4
88 12 10 7 11 15 5
89 16 10 11 14 15 8
90 10 10 11 9 12 4
91 14 10 11 10 16 6
92 10 10 11 13 15 6
93 16 10 12 16 16 7
94 15 10 10 16 13 6
95 12 10 11 11 12 5
96 10 10 12 8 11 4
97 8 10 7 4 13 6
98 8 10 13 7 10 3
99 11 10 8 14 15 5
100 13 10 12 11 13 6
101 16 10 11 17 16 7
102 16 10 12 15 15 7
103 14 10 14 17 18 6
104 11 10 10 5 13 3
105 4 10 10 4 10 2
106 14 10 13 10 16 8
107 9 10 10 11 13 3
108 14 10 11 15 15 8
109 8 10 10 10 14 3
110 8 10 7 9 15 4
111 11 10 10 12 14 5
112 12 10 8 15 13 7
113 11 10 12 7 13 6
114 14 10 12 13 15 6
115 15 10 12 12 16 7
116 16 10 11 14 14 6
117 16 10 12 14 14 6
118 11 10 12 8 16 6
119 14 10 12 15 14 6
120 14 10 11 12 12 4
121 12 10 12 12 13 4
122 14 10 11 16 12 5
123 8 10 11 9 12 4
124 13 10 13 15 14 6
125 16 10 12 15 14 6
126 12 10 12 6 14 5
127 16 10 12 14 16 8
128 12 10 12 15 13 6
129 11 10 8 10 14 5
130 4 10 8 6 4 4
131 16 10 12 14 16 8
132 15 10 11 12 13 6
133 10 10 12 8 16 4
134 13 10 13 11 15 6
135 15 10 12 13 14 6
136 12 10 12 9 13 4
137 14 10 11 15 14 6
138 7 10 12 13 12 3
139 19 10 12 15 15 6
140 12 10 10 14 14 5
141 12 10 11 16 13 4
142 13 10 12 14 14 6
143 15 10 12 14 16 4
144 8 10 10 10 6 4
145 12 10 12 10 13 4
146 10 10 13 4 13 6
147 8 10 12 8 14 5
148 10 10 15 15 15 6
149 15 10 11 16 14 6
150 16 10 12 12 15 8
151 13 10 11 12 13 7
152 16 10 12 15 16 7
153 9 10 11 9 12 4
154 14 10 10 12 15 6
155 14 10 11 14 12 6
156 12 10 11 11 14 2
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Tijd FindingFriends KnowingPeople Liked
2.60939 -0.24987 0.09626 0.24394 0.35748
Celebrity
0.62281
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-6.3053 -1.2374 -0.1072 1.3080 6.7526
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 2.60939 3.64815 0.715 0.475557
Tijd -0.24987 0.36380 -0.687 0.493254
FindingFriends 0.09626 0.09616 1.001 0.318391
KnowingPeople 0.24394 0.06148 3.968 0.000112 ***
Liked 0.35748 0.09745 3.668 0.000339 ***
Celebrity 0.62281 0.15643 3.981 0.000106 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 2.109 on 150 degrees of freedom
Multiple R-squared: 0.5008, Adjusted R-squared: 0.4841
F-statistic: 30.09 on 5 and 150 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.10990666 0.21981332 0.890093338
[2,] 0.04780609 0.09561218 0.952193910
[3,] 0.07272966 0.14545931 0.927270344
[4,] 0.03807835 0.07615671 0.961921645
[5,] 0.44028049 0.88056099 0.559719505
[6,] 0.76242548 0.47514905 0.237574525
[7,] 0.68203388 0.63593224 0.317966122
[8,] 0.59292816 0.81414369 0.407071843
[9,] 0.53471735 0.93056529 0.465282646
[10,] 0.44771631 0.89543262 0.552283690
[11,] 0.37040818 0.74081636 0.629591819
[12,] 0.66517527 0.66964946 0.334824729
[13,] 0.60055426 0.79889149 0.399445744
[14,] 0.56680690 0.86638620 0.433193101
[15,] 0.49602933 0.99205866 0.503970669
[16,] 0.47688239 0.95376478 0.523117609
[17,] 0.43889015 0.87778030 0.561109852
[18,] 0.38080775 0.76161549 0.619192254
[19,] 0.64847163 0.70305674 0.351528370
[20,] 0.59075810 0.81848380 0.409241901
[21,] 0.53062218 0.93875563 0.469377815
[22,] 0.68856441 0.62287117 0.311435585
[23,] 0.80563577 0.38872846 0.194364231
[24,] 0.76978904 0.46042191 0.230210955
[25,] 0.72929105 0.54141790 0.270708952
[26,] 0.68474250 0.63051501 0.315257504
[27,] 0.67857500 0.64285000 0.321425002
[28,] 0.69604673 0.60790655 0.303953275
[29,] 0.65746150 0.68507701 0.342538503
[30,] 0.60697751 0.78604498 0.393022490
[31,] 0.55673069 0.88653862 0.443269312
[32,] 0.53860545 0.92278910 0.461394552
[33,] 0.50831163 0.98337673 0.491688367
[34,] 0.81023664 0.37952673 0.189763364
[35,] 0.95197289 0.09605421 0.048027107
[36,] 0.96181335 0.07637331 0.038186653
[37,] 0.95028617 0.09942766 0.049713831
[38,] 0.95655622 0.08688757 0.043443784
[39,] 0.98299065 0.03401871 0.017009353
[40,] 0.97950703 0.04098594 0.020492972
[41,] 0.98196408 0.03607185 0.018035925
[42,] 0.97718105 0.04563790 0.022818951
[43,] 0.97195063 0.05609874 0.028049368
[44,] 0.98921377 0.02157246 0.010786230
[45,] 0.99202121 0.01595758 0.007978789
[46,] 0.99051769 0.01896462 0.009482308
[47,] 0.99461713 0.01076574 0.005382872
[48,] 0.99312256 0.01375488 0.006877439
[49,] 0.99083123 0.01833753 0.009168767
[50,] 0.99128096 0.01743807 0.008719036
[51,] 0.99231227 0.01537547 0.007687735
[52,] 0.99085518 0.01828965 0.009144824
[53,] 0.99091791 0.01816418 0.009082088
[54,] 0.99306524 0.01386952 0.006934760
[55,] 0.99114932 0.01770136 0.008850682
[56,] 0.99246009 0.01507982 0.007539909
[57,] 0.99009369 0.01981262 0.009906310
[58,] 0.98975070 0.02049860 0.010249301
[59,] 0.98931416 0.02137169 0.010685843
[60,] 0.99153770 0.01692459 0.008462296
[61,] 0.99195672 0.01608656 0.008043281
[62,] 0.98912036 0.02175929 0.010879645
[63,] 0.99092477 0.01815047 0.009075233
[64,] 0.98807294 0.02385411 0.011927055
[65,] 0.98497368 0.03005263 0.015026315
[66,] 0.98894286 0.02211428 0.011057142
[67,] 0.98511462 0.02977077 0.014885385
[68,] 0.98256812 0.03486375 0.017431877
[69,] 0.97709079 0.04581843 0.022909215
[70,] 0.96987998 0.06024004 0.030120021
[71,] 0.98114151 0.03771698 0.018858489
[72,] 0.98018204 0.03963593 0.019817963
[73,] 0.98334583 0.03330835 0.016654174
[74,] 0.98440424 0.03119153 0.015595764
[75,] 0.97917489 0.04165022 0.020825110
[76,] 0.97436942 0.05126116 0.025630578
[77,] 0.99301243 0.01397513 0.006987565
[78,] 0.99051245 0.01897509 0.009487546
[79,] 0.98707935 0.02584130 0.012920650
[80,] 0.98300381 0.03399238 0.016996190
[81,] 0.97876832 0.04246335 0.021231676
[82,] 0.97195091 0.05609818 0.028049090
[83,] 0.96606211 0.06787577 0.033937886
[84,] 0.98064065 0.03871870 0.019359350
[85,] 0.97505968 0.04988065 0.024940324
[86,] 0.97140175 0.05719650 0.028598249
[87,] 0.96383652 0.07232697 0.036163484
[88,] 0.95409424 0.09181151 0.045905757
[89,] 0.95012941 0.09974119 0.049870594
[90,] 0.93644813 0.12710374 0.063551872
[91,] 0.93297789 0.13404422 0.067022111
[92,] 0.91733655 0.16532691 0.082663454
[93,] 0.89829316 0.20341367 0.101706837
[94,] 0.88138956 0.23722087 0.118610437
[95,] 0.89257093 0.21485815 0.107429073
[96,] 0.92385056 0.15229887 0.076149436
[97,] 0.92238128 0.15523744 0.077618722
[98,] 0.90337047 0.19325906 0.096629531
[99,] 0.88485487 0.23029026 0.115145132
[100,] 0.88016940 0.23966120 0.119830602
[101,] 0.87963487 0.24073026 0.120365132
[102,] 0.90322555 0.19354889 0.096774446
[103,] 0.89339492 0.21321017 0.106605084
[104,] 0.92333019 0.15333961 0.076669807
[105,] 0.90214295 0.19571409 0.097857047
[106,] 0.87659235 0.24681529 0.123407645
[107,] 0.84697620 0.30604759 0.153023797
[108,] 0.84664775 0.30670451 0.153352253
[109,] 0.85496239 0.29007522 0.145037609
[110,] 0.84465897 0.31068206 0.155341031
[111,] 0.80771914 0.38456172 0.192280861
[112,] 0.86142115 0.27715770 0.138578848
[113,] 0.83428006 0.33143988 0.165719942
[114,] 0.80977271 0.38045457 0.190227287
[115,] 0.79969996 0.40060007 0.200300036
[116,] 0.75866757 0.48266486 0.241332430
[117,] 0.75850788 0.48298423 0.241492117
[118,] 0.73992952 0.52014096 0.260070480
[119,] 0.68693998 0.62612004 0.313060018
[120,] 0.65839759 0.68320482 0.341602408
[121,] 0.67558695 0.64882609 0.324413047
[122,] 0.66733014 0.66533971 0.332669856
[123,] 0.60668424 0.78663152 0.393315760
[124,] 0.59403584 0.81192833 0.405964164
[125,] 0.56440616 0.87118768 0.435593839
[126,] 0.48994440 0.97988880 0.510055602
[127,] 0.46342168 0.92684335 0.536578323
[128,] 0.45696224 0.91392447 0.543037763
[129,] 0.38335215 0.76670431 0.616647846
[130,] 0.44617667 0.89235334 0.553823330
[131,] 0.79439711 0.41120578 0.205602889
[132,] 0.82453488 0.35093023 0.175465117
[133,] 0.77902382 0.44195237 0.220976184
[134,] 0.69428599 0.61142801 0.305714006
[135,] 0.65533638 0.68932724 0.344663619
[136,] 0.54061403 0.91877195 0.459385974
[137,] 0.51864048 0.96271905 0.481359525
[138,] 0.63324670 0.73350660 0.366753302
[139,] 0.57059681 0.85880638 0.429403189
> postscript(file="/var/www/html/freestat/rcomp/tmp/199ud1290510525.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/freestat/rcomp/tmp/210cy1290510525.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/freestat/rcomp/tmp/310cy1290510525.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/freestat/rcomp/tmp/410cy1290510525.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/freestat/rcomp/tmp/5cat11290510525.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.45712389 0.77138780 1.29290684 1.03879217 -0.80898720 2.61842801
7 8 9 10 11 12
-1.93222016 -1.62264262 -0.42690609 2.88959452 -2.48654834 -1.22574637
13 14 15 16 17 18
2.63112984 -4.41659227 -0.80001376 -0.11051553 -2.22574637 -0.53516676
19 20 21 22 23 24
1.16433685 -3.65344849 2.17254556 0.44344487 -0.76744900 2.35310319
25 26 27 28 29 30
0.44102311 -0.02303967 -5.80049158 0.33534136 -0.38373241 5.03671262
31 32 33 34 35 36
4.37414934 -1.74532147 -0.65281937 0.77925430 -1.62264262 1.57838149
37 38 39 40 41 42
-1.05426404 0.68264785 -0.21877619 0.59808726 0.92889602 6.75257835
43 44 45 46 47 48
-4.91430118 -2.63992663 -0.39767277 2.04486603 3.80261217 0.38070103
49 50 51 52 53 54
-3.10809376 -1.87536746 -1.11961236 -6.30534881 -0.31197678 -2.35593674
55 56 57 58 59 60
1.70530723 -0.34610073 0.31459489 1.66329121 -2.21689576 -0.17343517
61 62 63 64 65 66
-2.37564251 2.08946789 0.36142067 2.31612033 -0.84459592 1.80157148
67 68 69 70 71 72
-1.95162625 2.62267490 2.17876195 -0.46722272 2.65389927 0.80157148
73 74 75 76 77 78
-0.97177608 -2.91752786 -0.38477311 -1.30911095 -0.18114452 0.18662845
79 80 81 82 83 84
3.28657856 -1.90747538 -2.75451558 2.11383212 0.20257208 -1.16054243
85 86 87 88 89 90
4.35616685 -0.31608113 -0.18721838 0.05579619 1.07050129 -0.14612424
91 92 93 94 95 96
0.93438144 -3.43994322 0.75168895 1.63948108 0.74319333 0.35903267
97 98 99 100 101 102
-2.14448875 -0.51300089 -1.77227741 0.66663486 0.60401675 1.35311011
103 104 105 106 107 108
-1.77693587 2.19121063 -2.86958928 -0.50376610 -1.27240808 -1.17343517
109 110 111 112 113 114
-2.38595634 -2.83352138 -1.11944829 -1.54686350 -0.35761933 0.46379254
115 116 117 118 119 120
0.72743476 2.67360504 2.57734079 -1.67400990 0.33340434 3.12206640
121 122 123 124 125 126
0.66831745 1.52351107 -2.14612424 -0.76285990 2.33340434 1.15164194
127 128 129 130 131 132
0.61675234 -1.30911095 -0.43904690 -2.26564451 0.61675234 2.51896265
133 134 135 136 137 138
-1.42839086 -0.14459880 1.82127725 1.40012681 0.42966859 -3.59532477
139 140 141 142 143 144
4.97591964 -0.60732119 -0.21116412 -0.42265921 2.10799043 -0.14888822
145 146 147 148 149 150
1.15619036 -0.72207422 -3.33623097 -4.31287310 1.18573213 1.46210995
151 152 153 154 155 156
-0.10384687 0.99562541 -1.14612424 0.90025748 1.38857445 1.89665249
> postscript(file="/var/www/html/freestat/rcomp/tmp/6cat11290510525.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.45712389 NA
1 0.77138780 1.45712389
2 1.29290684 0.77138780
3 1.03879217 1.29290684
4 -0.80898720 1.03879217
5 2.61842801 -0.80898720
6 -1.93222016 2.61842801
7 -1.62264262 -1.93222016
8 -0.42690609 -1.62264262
9 2.88959452 -0.42690609
10 -2.48654834 2.88959452
11 -1.22574637 -2.48654834
12 2.63112984 -1.22574637
13 -4.41659227 2.63112984
14 -0.80001376 -4.41659227
15 -0.11051553 -0.80001376
16 -2.22574637 -0.11051553
17 -0.53516676 -2.22574637
18 1.16433685 -0.53516676
19 -3.65344849 1.16433685
20 2.17254556 -3.65344849
21 0.44344487 2.17254556
22 -0.76744900 0.44344487
23 2.35310319 -0.76744900
24 0.44102311 2.35310319
25 -0.02303967 0.44102311
26 -5.80049158 -0.02303967
27 0.33534136 -5.80049158
28 -0.38373241 0.33534136
29 5.03671262 -0.38373241
30 4.37414934 5.03671262
31 -1.74532147 4.37414934
32 -0.65281937 -1.74532147
33 0.77925430 -0.65281937
34 -1.62264262 0.77925430
35 1.57838149 -1.62264262
36 -1.05426404 1.57838149
37 0.68264785 -1.05426404
38 -0.21877619 0.68264785
39 0.59808726 -0.21877619
40 0.92889602 0.59808726
41 6.75257835 0.92889602
42 -4.91430118 6.75257835
43 -2.63992663 -4.91430118
44 -0.39767277 -2.63992663
45 2.04486603 -0.39767277
46 3.80261217 2.04486603
47 0.38070103 3.80261217
48 -3.10809376 0.38070103
49 -1.87536746 -3.10809376
50 -1.11961236 -1.87536746
51 -6.30534881 -1.11961236
52 -0.31197678 -6.30534881
53 -2.35593674 -0.31197678
54 1.70530723 -2.35593674
55 -0.34610073 1.70530723
56 0.31459489 -0.34610073
57 1.66329121 0.31459489
58 -2.21689576 1.66329121
59 -0.17343517 -2.21689576
60 -2.37564251 -0.17343517
61 2.08946789 -2.37564251
62 0.36142067 2.08946789
63 2.31612033 0.36142067
64 -0.84459592 2.31612033
65 1.80157148 -0.84459592
66 -1.95162625 1.80157148
67 2.62267490 -1.95162625
68 2.17876195 2.62267490
69 -0.46722272 2.17876195
70 2.65389927 -0.46722272
71 0.80157148 2.65389927
72 -0.97177608 0.80157148
73 -2.91752786 -0.97177608
74 -0.38477311 -2.91752786
75 -1.30911095 -0.38477311
76 -0.18114452 -1.30911095
77 0.18662845 -0.18114452
78 3.28657856 0.18662845
79 -1.90747538 3.28657856
80 -2.75451558 -1.90747538
81 2.11383212 -2.75451558
82 0.20257208 2.11383212
83 -1.16054243 0.20257208
84 4.35616685 -1.16054243
85 -0.31608113 4.35616685
86 -0.18721838 -0.31608113
87 0.05579619 -0.18721838
88 1.07050129 0.05579619
89 -0.14612424 1.07050129
90 0.93438144 -0.14612424
91 -3.43994322 0.93438144
92 0.75168895 -3.43994322
93 1.63948108 0.75168895
94 0.74319333 1.63948108
95 0.35903267 0.74319333
96 -2.14448875 0.35903267
97 -0.51300089 -2.14448875
98 -1.77227741 -0.51300089
99 0.66663486 -1.77227741
100 0.60401675 0.66663486
101 1.35311011 0.60401675
102 -1.77693587 1.35311011
103 2.19121063 -1.77693587
104 -2.86958928 2.19121063
105 -0.50376610 -2.86958928
106 -1.27240808 -0.50376610
107 -1.17343517 -1.27240808
108 -2.38595634 -1.17343517
109 -2.83352138 -2.38595634
110 -1.11944829 -2.83352138
111 -1.54686350 -1.11944829
112 -0.35761933 -1.54686350
113 0.46379254 -0.35761933
114 0.72743476 0.46379254
115 2.67360504 0.72743476
116 2.57734079 2.67360504
117 -1.67400990 2.57734079
118 0.33340434 -1.67400990
119 3.12206640 0.33340434
120 0.66831745 3.12206640
121 1.52351107 0.66831745
122 -2.14612424 1.52351107
123 -0.76285990 -2.14612424
124 2.33340434 -0.76285990
125 1.15164194 2.33340434
126 0.61675234 1.15164194
127 -1.30911095 0.61675234
128 -0.43904690 -1.30911095
129 -2.26564451 -0.43904690
130 0.61675234 -2.26564451
131 2.51896265 0.61675234
132 -1.42839086 2.51896265
133 -0.14459880 -1.42839086
134 1.82127725 -0.14459880
135 1.40012681 1.82127725
136 0.42966859 1.40012681
137 -3.59532477 0.42966859
138 4.97591964 -3.59532477
139 -0.60732119 4.97591964
140 -0.21116412 -0.60732119
141 -0.42265921 -0.21116412
142 2.10799043 -0.42265921
143 -0.14888822 2.10799043
144 1.15619036 -0.14888822
145 -0.72207422 1.15619036
146 -3.33623097 -0.72207422
147 -4.31287310 -3.33623097
148 1.18573213 -4.31287310
149 1.46210995 1.18573213
150 -0.10384687 1.46210995
151 0.99562541 -0.10384687
152 -1.14612424 0.99562541
153 0.90025748 -1.14612424
154 1.38857445 0.90025748
155 1.89665249 1.38857445
156 NA 1.89665249
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 0.77138780 1.45712389
[2,] 1.29290684 0.77138780
[3,] 1.03879217 1.29290684
[4,] -0.80898720 1.03879217
[5,] 2.61842801 -0.80898720
[6,] -1.93222016 2.61842801
[7,] -1.62264262 -1.93222016
[8,] -0.42690609 -1.62264262
[9,] 2.88959452 -0.42690609
[10,] -2.48654834 2.88959452
[11,] -1.22574637 -2.48654834
[12,] 2.63112984 -1.22574637
[13,] -4.41659227 2.63112984
[14,] -0.80001376 -4.41659227
[15,] -0.11051553 -0.80001376
[16,] -2.22574637 -0.11051553
[17,] -0.53516676 -2.22574637
[18,] 1.16433685 -0.53516676
[19,] -3.65344849 1.16433685
[20,] 2.17254556 -3.65344849
[21,] 0.44344487 2.17254556
[22,] -0.76744900 0.44344487
[23,] 2.35310319 -0.76744900
[24,] 0.44102311 2.35310319
[25,] -0.02303967 0.44102311
[26,] -5.80049158 -0.02303967
[27,] 0.33534136 -5.80049158
[28,] -0.38373241 0.33534136
[29,] 5.03671262 -0.38373241
[30,] 4.37414934 5.03671262
[31,] -1.74532147 4.37414934
[32,] -0.65281937 -1.74532147
[33,] 0.77925430 -0.65281937
[34,] -1.62264262 0.77925430
[35,] 1.57838149 -1.62264262
[36,] -1.05426404 1.57838149
[37,] 0.68264785 -1.05426404
[38,] -0.21877619 0.68264785
[39,] 0.59808726 -0.21877619
[40,] 0.92889602 0.59808726
[41,] 6.75257835 0.92889602
[42,] -4.91430118 6.75257835
[43,] -2.63992663 -4.91430118
[44,] -0.39767277 -2.63992663
[45,] 2.04486603 -0.39767277
[46,] 3.80261217 2.04486603
[47,] 0.38070103 3.80261217
[48,] -3.10809376 0.38070103
[49,] -1.87536746 -3.10809376
[50,] -1.11961236 -1.87536746
[51,] -6.30534881 -1.11961236
[52,] -0.31197678 -6.30534881
[53,] -2.35593674 -0.31197678
[54,] 1.70530723 -2.35593674
[55,] -0.34610073 1.70530723
[56,] 0.31459489 -0.34610073
[57,] 1.66329121 0.31459489
[58,] -2.21689576 1.66329121
[59,] -0.17343517 -2.21689576
[60,] -2.37564251 -0.17343517
[61,] 2.08946789 -2.37564251
[62,] 0.36142067 2.08946789
[63,] 2.31612033 0.36142067
[64,] -0.84459592 2.31612033
[65,] 1.80157148 -0.84459592
[66,] -1.95162625 1.80157148
[67,] 2.62267490 -1.95162625
[68,] 2.17876195 2.62267490
[69,] -0.46722272 2.17876195
[70,] 2.65389927 -0.46722272
[71,] 0.80157148 2.65389927
[72,] -0.97177608 0.80157148
[73,] -2.91752786 -0.97177608
[74,] -0.38477311 -2.91752786
[75,] -1.30911095 -0.38477311
[76,] -0.18114452 -1.30911095
[77,] 0.18662845 -0.18114452
[78,] 3.28657856 0.18662845
[79,] -1.90747538 3.28657856
[80,] -2.75451558 -1.90747538
[81,] 2.11383212 -2.75451558
[82,] 0.20257208 2.11383212
[83,] -1.16054243 0.20257208
[84,] 4.35616685 -1.16054243
[85,] -0.31608113 4.35616685
[86,] -0.18721838 -0.31608113
[87,] 0.05579619 -0.18721838
[88,] 1.07050129 0.05579619
[89,] -0.14612424 1.07050129
[90,] 0.93438144 -0.14612424
[91,] -3.43994322 0.93438144
[92,] 0.75168895 -3.43994322
[93,] 1.63948108 0.75168895
[94,] 0.74319333 1.63948108
[95,] 0.35903267 0.74319333
[96,] -2.14448875 0.35903267
[97,] -0.51300089 -2.14448875
[98,] -1.77227741 -0.51300089
[99,] 0.66663486 -1.77227741
[100,] 0.60401675 0.66663486
[101,] 1.35311011 0.60401675
[102,] -1.77693587 1.35311011
[103,] 2.19121063 -1.77693587
[104,] -2.86958928 2.19121063
[105,] -0.50376610 -2.86958928
[106,] -1.27240808 -0.50376610
[107,] -1.17343517 -1.27240808
[108,] -2.38595634 -1.17343517
[109,] -2.83352138 -2.38595634
[110,] -1.11944829 -2.83352138
[111,] -1.54686350 -1.11944829
[112,] -0.35761933 -1.54686350
[113,] 0.46379254 -0.35761933
[114,] 0.72743476 0.46379254
[115,] 2.67360504 0.72743476
[116,] 2.57734079 2.67360504
[117,] -1.67400990 2.57734079
[118,] 0.33340434 -1.67400990
[119,] 3.12206640 0.33340434
[120,] 0.66831745 3.12206640
[121,] 1.52351107 0.66831745
[122,] -2.14612424 1.52351107
[123,] -0.76285990 -2.14612424
[124,] 2.33340434 -0.76285990
[125,] 1.15164194 2.33340434
[126,] 0.61675234 1.15164194
[127,] -1.30911095 0.61675234
[128,] -0.43904690 -1.30911095
[129,] -2.26564451 -0.43904690
[130,] 0.61675234 -2.26564451
[131,] 2.51896265 0.61675234
[132,] -1.42839086 2.51896265
[133,] -0.14459880 -1.42839086
[134,] 1.82127725 -0.14459880
[135,] 1.40012681 1.82127725
[136,] 0.42966859 1.40012681
[137,] -3.59532477 0.42966859
[138,] 4.97591964 -3.59532477
[139,] -0.60732119 4.97591964
[140,] -0.21116412 -0.60732119
[141,] -0.42265921 -0.21116412
[142,] 2.10799043 -0.42265921
[143,] -0.14888822 2.10799043
[144,] 1.15619036 -0.14888822
[145,] -0.72207422 1.15619036
[146,] -3.33623097 -0.72207422
[147,] -4.31287310 -3.33623097
[148,] 1.18573213 -4.31287310
[149,] 1.46210995 1.18573213
[150,] -0.10384687 1.46210995
[151,] 0.99562541 -0.10384687
[152,] -1.14612424 0.99562541
[153,] 0.90025748 -1.14612424
[154,] 1.38857445 0.90025748
[155,] 1.89665249 1.38857445
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 0.77138780 1.45712389
2 1.29290684 0.77138780
3 1.03879217 1.29290684
4 -0.80898720 1.03879217
5 2.61842801 -0.80898720
6 -1.93222016 2.61842801
7 -1.62264262 -1.93222016
8 -0.42690609 -1.62264262
9 2.88959452 -0.42690609
10 -2.48654834 2.88959452
11 -1.22574637 -2.48654834
12 2.63112984 -1.22574637
13 -4.41659227 2.63112984
14 -0.80001376 -4.41659227
15 -0.11051553 -0.80001376
16 -2.22574637 -0.11051553
17 -0.53516676 -2.22574637
18 1.16433685 -0.53516676
19 -3.65344849 1.16433685
20 2.17254556 -3.65344849
21 0.44344487 2.17254556
22 -0.76744900 0.44344487
23 2.35310319 -0.76744900
24 0.44102311 2.35310319
25 -0.02303967 0.44102311
26 -5.80049158 -0.02303967
27 0.33534136 -5.80049158
28 -0.38373241 0.33534136
29 5.03671262 -0.38373241
30 4.37414934 5.03671262
31 -1.74532147 4.37414934
32 -0.65281937 -1.74532147
33 0.77925430 -0.65281937
34 -1.62264262 0.77925430
35 1.57838149 -1.62264262
36 -1.05426404 1.57838149
37 0.68264785 -1.05426404
38 -0.21877619 0.68264785
39 0.59808726 -0.21877619
40 0.92889602 0.59808726
41 6.75257835 0.92889602
42 -4.91430118 6.75257835
43 -2.63992663 -4.91430118
44 -0.39767277 -2.63992663
45 2.04486603 -0.39767277
46 3.80261217 2.04486603
47 0.38070103 3.80261217
48 -3.10809376 0.38070103
49 -1.87536746 -3.10809376
50 -1.11961236 -1.87536746
51 -6.30534881 -1.11961236
52 -0.31197678 -6.30534881
53 -2.35593674 -0.31197678
54 1.70530723 -2.35593674
55 -0.34610073 1.70530723
56 0.31459489 -0.34610073
57 1.66329121 0.31459489
58 -2.21689576 1.66329121
59 -0.17343517 -2.21689576
60 -2.37564251 -0.17343517
61 2.08946789 -2.37564251
62 0.36142067 2.08946789
63 2.31612033 0.36142067
64 -0.84459592 2.31612033
65 1.80157148 -0.84459592
66 -1.95162625 1.80157148
67 2.62267490 -1.95162625
68 2.17876195 2.62267490
69 -0.46722272 2.17876195
70 2.65389927 -0.46722272
71 0.80157148 2.65389927
72 -0.97177608 0.80157148
73 -2.91752786 -0.97177608
74 -0.38477311 -2.91752786
75 -1.30911095 -0.38477311
76 -0.18114452 -1.30911095
77 0.18662845 -0.18114452
78 3.28657856 0.18662845
79 -1.90747538 3.28657856
80 -2.75451558 -1.90747538
81 2.11383212 -2.75451558
82 0.20257208 2.11383212
83 -1.16054243 0.20257208
84 4.35616685 -1.16054243
85 -0.31608113 4.35616685
86 -0.18721838 -0.31608113
87 0.05579619 -0.18721838
88 1.07050129 0.05579619
89 -0.14612424 1.07050129
90 0.93438144 -0.14612424
91 -3.43994322 0.93438144
92 0.75168895 -3.43994322
93 1.63948108 0.75168895
94 0.74319333 1.63948108
95 0.35903267 0.74319333
96 -2.14448875 0.35903267
97 -0.51300089 -2.14448875
98 -1.77227741 -0.51300089
99 0.66663486 -1.77227741
100 0.60401675 0.66663486
101 1.35311011 0.60401675
102 -1.77693587 1.35311011
103 2.19121063 -1.77693587
104 -2.86958928 2.19121063
105 -0.50376610 -2.86958928
106 -1.27240808 -0.50376610
107 -1.17343517 -1.27240808
108 -2.38595634 -1.17343517
109 -2.83352138 -2.38595634
110 -1.11944829 -2.83352138
111 -1.54686350 -1.11944829
112 -0.35761933 -1.54686350
113 0.46379254 -0.35761933
114 0.72743476 0.46379254
115 2.67360504 0.72743476
116 2.57734079 2.67360504
117 -1.67400990 2.57734079
118 0.33340434 -1.67400990
119 3.12206640 0.33340434
120 0.66831745 3.12206640
121 1.52351107 0.66831745
122 -2.14612424 1.52351107
123 -0.76285990 -2.14612424
124 2.33340434 -0.76285990
125 1.15164194 2.33340434
126 0.61675234 1.15164194
127 -1.30911095 0.61675234
128 -0.43904690 -1.30911095
129 -2.26564451 -0.43904690
130 0.61675234 -2.26564451
131 2.51896265 0.61675234
132 -1.42839086 2.51896265
133 -0.14459880 -1.42839086
134 1.82127725 -0.14459880
135 1.40012681 1.82127725
136 0.42966859 1.40012681
137 -3.59532477 0.42966859
138 4.97591964 -3.59532477
139 -0.60732119 4.97591964
140 -0.21116412 -0.60732119
141 -0.42265921 -0.21116412
142 2.10799043 -0.42265921
143 -0.14888822 2.10799043
144 1.15619036 -0.14888822
145 -0.72207422 1.15619036
146 -3.33623097 -0.72207422
147 -4.31287310 -3.33623097
148 1.18573213 -4.31287310
149 1.46210995 1.18573213
150 -0.10384687 1.46210995
151 0.99562541 -0.10384687
152 -1.14612424 0.99562541
153 0.90025748 -1.14612424
154 1.38857445 0.90025748
155 1.89665249 1.38857445
> 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/freestat/rcomp/tmp/75ja41290510525.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/freestat/rcomp/tmp/85ja41290510525.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/freestat/rcomp/tmp/9gs971290510525.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/freestat/rcomp/tmp/10gs971290510525.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/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/www/html/freestat/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/freestat/rcomp/tmp/11jtqd1290510525.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/freestat/rcomp/tmp/124bo11290510525.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/freestat/rcomp/tmp/13bu3d1290510525.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/freestat/rcomp/tmp/14m4lg1290510525.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/freestat/rcomp/tmp/15p4141290510525.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/freestat/rcomp/tmp/16bni91290510525.tab")
+ }
>
> try(system("convert tmp/199ud1290510525.ps tmp/199ud1290510525.png",intern=TRUE))
character(0)
> try(system("convert tmp/210cy1290510525.ps tmp/210cy1290510525.png",intern=TRUE))
character(0)
> try(system("convert tmp/310cy1290510525.ps tmp/310cy1290510525.png",intern=TRUE))
character(0)
> try(system("convert tmp/410cy1290510525.ps tmp/410cy1290510525.png",intern=TRUE))
character(0)
> try(system("convert tmp/5cat11290510525.ps tmp/5cat11290510525.png",intern=TRUE))
character(0)
> try(system("convert tmp/6cat11290510525.ps tmp/6cat11290510525.png",intern=TRUE))
character(0)
> try(system("convert tmp/75ja41290510525.ps tmp/75ja41290510525.png",intern=TRUE))
character(0)
> try(system("convert tmp/85ja41290510525.ps tmp/85ja41290510525.png",intern=TRUE))
character(0)
> try(system("convert tmp/9gs971290510525.ps tmp/9gs971290510525.png",intern=TRUE))
character(0)
> try(system("convert tmp/10gs971290510525.ps tmp/10gs971290510525.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
5.750 2.768 8.495