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(13
+ ,13
+ ,14
+ ,13
+ ,3
+ ,1
+ ,12
+ ,12
+ ,8
+ ,13
+ ,5
+ ,1
+ ,15
+ ,10
+ ,12
+ ,16
+ ,6
+ ,1
+ ,12
+ ,9
+ ,7
+ ,12
+ ,6
+ ,1
+ ,10
+ ,10
+ ,10
+ ,11
+ ,5
+ ,1
+ ,12
+ ,12
+ ,7
+ ,12
+ ,3
+ ,1
+ ,15
+ ,13
+ ,16
+ ,18
+ ,8
+ ,1
+ ,9
+ ,12
+ ,11
+ ,11
+ ,4
+ ,1
+ ,12
+ ,12
+ ,14
+ ,14
+ ,4
+ ,1
+ ,11
+ ,6
+ ,6
+ ,9
+ ,4
+ ,1
+ ,11
+ ,5
+ ,16
+ ,14
+ ,6
+ ,1
+ ,11
+ ,12
+ ,11
+ ,12
+ ,6
+ ,1
+ ,15
+ ,11
+ ,16
+ ,11
+ ,5
+ ,1
+ ,7
+ ,14
+ ,12
+ ,12
+ ,4
+ ,1
+ ,11
+ ,14
+ ,7
+ ,13
+ ,6
+ ,1
+ ,11
+ ,12
+ ,13
+ ,11
+ ,4
+ ,1
+ ,10
+ ,12
+ ,11
+ ,12
+ ,6
+ ,1
+ ,14
+ ,11
+ ,15
+ ,16
+ ,6
+ ,1
+ ,10
+ ,11
+ ,7
+ ,9
+ ,4
+ ,2
+ ,6
+ ,7
+ ,9
+ ,11
+ ,4
+ ,2
+ ,11
+ ,9
+ ,7
+ ,13
+ ,2
+ ,2
+ ,15
+ ,11
+ ,14
+ ,15
+ ,7
+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+ ,4
+ ,7
+ ,14
+ ,11
+ ,15
+ ,14
+ ,6
+ ,7
+ ,7
+ ,12
+ ,13
+ ,12
+ ,3
+ ,8
+ ,19
+ ,12
+ ,15
+ ,15
+ ,6
+ ,8
+ ,12
+ ,10
+ ,14
+ ,14
+ ,5
+ ,8
+ ,12
+ ,11
+ ,16
+ ,13
+ ,4
+ ,8
+ ,13
+ ,12
+ ,14
+ ,14
+ ,6
+ ,8
+ ,15
+ ,12
+ ,14
+ ,16
+ ,4
+ ,8
+ ,8
+ ,10
+ ,10
+ ,6
+ ,4
+ ,8
+ ,12
+ ,12
+ ,10
+ ,13
+ ,4
+ ,8
+ ,10
+ ,13
+ ,4
+ ,13
+ ,6
+ ,8
+ ,8
+ ,12
+ ,8
+ ,14
+ ,5
+ ,8
+ ,10
+ ,15
+ ,15
+ ,15
+ ,6
+ ,8
+ ,15
+ ,11
+ ,16
+ ,14
+ ,6
+ ,8
+ ,16
+ ,12
+ ,12
+ ,15
+ ,8
+ ,9
+ ,13
+ ,11
+ ,12
+ ,13
+ ,7
+ ,10
+ ,16
+ ,12
+ ,15
+ ,16
+ ,7
+ ,10
+ ,9
+ ,11
+ ,9
+ ,12
+ ,4
+ ,14
+ ,14
+ ,10
+ ,12
+ ,15
+ ,6
+ ,14
+ ,14
+ ,11
+ ,14
+ ,12
+ ,6
+ ,14
+ ,12
+ ,11
+ ,11
+ ,14
+ ,2
+ ,14)
+ ,dim=c(6
+ ,156)
+ ,dimnames=list(c('Popularity'
+ ,'FindingFriends'
+ ,'KnowingPeople'
+ ,'Liked'
+ ,'Celebrity'
+ ,'Date')
+ ,1:156))
> y <- array(NA,dim=c(6,156),dimnames=list(c('Popularity','FindingFriends','KnowingPeople','Liked','Celebrity','Date'),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 = '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
Popularity FindingFriends KnowingPeople Liked Celebrity Date
1 13 13 14 13 3 1
2 12 12 8 13 5 1
3 15 10 12 16 6 1
4 12 9 7 12 6 1
5 10 10 10 11 5 1
6 12 12 7 12 3 1
7 15 13 16 18 8 1
8 9 12 11 11 4 1
9 12 12 14 14 4 1
10 11 6 6 9 4 1
11 11 5 16 14 6 1
12 11 12 11 12 6 1
13 15 11 16 11 5 1
14 7 14 12 12 4 1
15 11 14 7 13 6 1
16 11 12 13 11 4 1
17 10 12 11 12 6 1
18 14 11 15 16 6 1
19 10 11 7 9 4 2
20 6 7 9 11 4 2
21 11 9 7 13 2 2
22 15 11 14 15 7 2
23 11 11 15 10 5 2
24 12 12 7 11 4 2
25 14 12 15 13 6 2
26 15 11 17 16 6 2
27 9 11 15 15 7 2
28 13 8 14 14 5 2
29 13 9 14 14 6 2
30 16 12 8 14 4 2
31 13 10 8 8 4 2
32 12 10 14 13 7 2
33 14 12 14 15 7 2
34 11 8 8 13 4 3
35 9 12 11 11 4 3
36 16 11 16 15 6 3
37 12 12 10 15 6 3
38 10 7 8 9 5 3
39 13 11 14 13 6 3
40 16 11 16 16 7 3
41 14 12 13 13 6 3
42 15 9 5 11 3 3
43 5 15 8 12 3 3
44 8 11 10 12 4 3
45 11 11 8 12 6 3
46 16 11 13 14 7 3
47 17 11 15 14 5 3
48 9 15 6 8 4 3
49 9 11 12 13 5 3
50 13 12 16 16 6 3
51 10 12 5 13 6 3
52 6 9 15 11 6 4
53 12 12 12 14 5 4
54 8 12 8 13 4 4
55 14 13 13 13 5 4
56 12 11 14 13 5 4
57 11 9 12 12 4 4
58 16 9 16 16 6 4
59 8 11 10 15 2 4
60 15 11 15 15 8 4
61 7 12 8 12 3 4
62 16 12 16 14 6 4
63 14 9 19 12 6 4
64 16 11 14 15 6 4
65 9 9 6 12 5 4
66 14 12 13 13 5 4
67 11 12 15 12 6 4
68 13 12 7 12 5 4
69 15 12 13 13 6 5
70 5 14 4 5 2 5
71 15 11 14 13 5 5
72 13 12 13 13 5 5
73 11 11 11 14 5 5
74 11 6 14 17 6 5
75 12 10 12 13 6 5
76 12 12 15 13 6 5
77 12 13 14 12 5 5
78 12 8 13 13 5 5
79 14 12 8 14 4 5
80 6 12 6 11 2 5
81 7 12 7 12 4 5
82 14 6 13 12 6 5
83 14 11 13 16 6 5
84 10 10 11 12 5 5
85 13 12 5 12 3 5
86 12 13 12 12 6 5
87 9 11 8 10 4 6
88 12 7 11 15 5 6
89 16 11 14 15 8 6
90 10 11 9 12 4 6
91 14 11 10 16 6 6
92 10 11 13 15 6 6
93 16 12 16 16 7 6
94 15 10 16 13 6 6
95 12 11 11 12 5 6
96 10 12 8 11 4 6
97 8 7 4 13 6 6
98 8 13 7 10 3 6
99 11 8 14 15 5 6
100 13 12 11 13 6 6
101 16 11 17 16 7 6
102 16 12 15 15 7 6
103 14 14 17 18 6 6
104 11 10 5 13 3 6
105 4 10 4 10 2 6
106 14 13 10 16 8 6
107 9 10 11 13 3 7
108 14 11 15 15 8 7
109 8 10 10 14 3 7
110 8 7 9 15 4 7
111 11 10 12 14 5 7
112 12 8 15 13 7 7
113 11 12 7 13 6 7
114 14 12 13 15 6 7
115 15 12 12 16 7 7
116 16 11 14 14 6 7
117 16 12 14 14 6 7
118 11 12 8 16 6 7
119 14 12 15 14 6 7
120 14 11 12 12 4 7
121 12 12 12 13 4 7
122 14 11 16 12 5 7
123 8 11 9 12 4 7
124 13 13 15 14 6 7
125 16 12 15 14 6 7
126 12 12 6 14 5 7
127 16 12 14 16 8 7
128 12 12 15 13 6 7
129 11 8 10 14 5 7
130 4 8 6 4 4 7
131 16 12 14 16 8 7
132 15 11 12 13 6 7
133 10 12 8 16 4 7
134 13 13 11 15 6 7
135 15 12 13 14 6 7
136 12 12 9 13 4 7
137 14 11 15 14 6 7
138 7 12 13 12 3 8
139 19 12 15 15 6 8
140 12 10 14 14 5 8
141 12 11 16 13 4 8
142 13 12 14 14 6 8
143 15 12 14 16 4 8
144 8 10 10 6 4 8
145 12 12 10 13 4 8
146 10 13 4 13 6 8
147 8 12 8 14 5 8
148 10 15 15 15 6 8
149 15 11 16 14 6 8
150 16 12 12 15 8 9
151 13 11 12 13 7 10
152 16 12 15 16 7 10
153 9 11 9 12 4 14
154 14 10 12 15 6 14
155 14 11 14 12 6 14
156 12 11 11 14 2 14
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) FindingFriends KnowingPeople Liked Celebrity
0.305905 0.094633 0.243798 0.349156 0.627017
Date
-0.001197
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-6.41259 -1.27616 -0.03646 1.30004 6.90524
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.305905 1.435088 0.213 0.831491
FindingFriends 0.094633 0.096383 0.982 0.327759
KnowingPeople 0.243798 0.061591 3.958 0.000116 ***
Liked 0.349156 0.097709 3.573 0.000474 ***
Celebrity 0.627017 0.156594 4.004 9.76e-05 ***
Date -0.001197 0.062964 -0.019 0.984854
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 2.113 on 150 degrees of freedom
Multiple R-squared: 0.4992, Adjusted R-squared: 0.4825
F-statistic: 29.9 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.10973233 0.219464653 0.890267674
[2,] 0.04783346 0.095666921 0.952166539
[3,] 0.07256330 0.145126594 0.927436703
[4,] 0.03790861 0.075817212 0.962091394
[5,] 0.44021685 0.880433698 0.559783151
[6,] 0.76029122 0.479417562 0.239708781
[7,] 0.67909038 0.641819232 0.320909616
[8,] 0.58962821 0.820743587 0.410371793
[9,] 0.52974302 0.940513953 0.470256977
[10,] 0.44221813 0.884436251 0.557781874
[11,] 0.36069567 0.721391343 0.639304329
[12,] 0.54764879 0.904702414 0.452351207
[13,] 0.50898901 0.982021988 0.491010994
[14,] 0.55132698 0.897346041 0.448673020
[15,] 0.48480802 0.969616042 0.515191979
[16,] 0.47243935 0.944878692 0.527560654
[17,] 0.42851549 0.857030979 0.571484511
[18,] 0.36502984 0.730059682 0.634970159
[19,] 0.63322808 0.733543832 0.366771916
[20,] 0.57638790 0.847224208 0.423612104
[21,] 0.51514307 0.969713867 0.484856934
[22,] 0.67575326 0.648493487 0.324246744
[23,] 0.78561444 0.428771123 0.214385561
[24,] 0.74700406 0.505991887 0.252995943
[25,] 0.69915567 0.601688662 0.300844331
[26,] 0.66800657 0.663986860 0.331993430
[27,] 0.67412776 0.651744479 0.325872240
[28,] 0.68187944 0.636241119 0.318120560
[29,] 0.64889536 0.702209279 0.351104640
[30,] 0.59964639 0.800707225 0.400353612
[31,] 0.54567746 0.908645070 0.454322535
[32,] 0.51689930 0.966201393 0.483100696
[33,] 0.47695980 0.953919601 0.523040199
[34,] 0.75646681 0.487066372 0.243533186
[35,] 0.95120846 0.097583074 0.048791537
[36,] 0.96239092 0.075218159 0.037609079
[37,] 0.95116680 0.097666397 0.048833198
[38,] 0.95699710 0.086005793 0.043002896
[39,] 0.97938889 0.041222227 0.020611114
[40,] 0.97275725 0.054485496 0.027242748
[41,] 0.98040601 0.039187977 0.019593989
[42,] 0.97727161 0.045456785 0.022728392
[43,] 0.97252469 0.054950614 0.027475307
[44,] 0.99728316 0.005433675 0.002716838
[45,] 0.99608401 0.007831982 0.003915991
[46,] 0.99668299 0.006634023 0.003317011
[47,] 0.99670687 0.006586261 0.003293131
[48,] 0.99534284 0.009314319 0.004657159
[49,] 0.99350683 0.012986340 0.006493170
[50,] 0.99294999 0.014100010 0.007050005
[51,] 0.99450248 0.010995032 0.005497516
[52,] 0.99277357 0.014452862 0.007226431
[53,] 0.99351417 0.012971654 0.006485827
[54,] 0.99432347 0.011353061 0.005676530
[55,] 0.99245270 0.015094605 0.007547302
[56,] 0.99317011 0.013659775 0.006829888
[57,] 0.99132119 0.017357624 0.008678812
[58,] 0.99072550 0.018548997 0.009274498
[59,] 0.99033431 0.019331388 0.009665694
[60,] 0.99213814 0.015723728 0.007861864
[61,] 0.99245028 0.015099436 0.007549718
[62,] 0.98983211 0.020335777 0.010167889
[63,] 0.99155487 0.016890263 0.008445131
[64,] 0.98887337 0.022253269 0.011126635
[65,] 0.98601884 0.027962313 0.013981157
[66,] 0.98977069 0.020458623 0.010229311
[67,] 0.98616400 0.027671991 0.013835996
[68,] 0.98357671 0.032846583 0.016423291
[69,] 0.97825706 0.043485877 0.021742938
[70,] 0.97138848 0.057223049 0.028611524
[71,] 0.98249949 0.035001028 0.017500514
[72,] 0.98155602 0.036887962 0.018443981
[73,] 0.98438256 0.031234874 0.015617437
[74,] 0.98562521 0.028749584 0.014374792
[75,] 0.98074626 0.038507489 0.019253745
[76,] 0.97607455 0.047850905 0.023925453
[77,] 0.99413024 0.011739513 0.005869756
[78,] 0.99185681 0.016286378 0.008143189
[79,] 0.98891401 0.022171989 0.011085995
[80,] 0.98549141 0.029017188 0.014508594
[81,] 0.98187731 0.036245375 0.018122687
[82,] 0.97605616 0.047887679 0.023943839
[83,] 0.97138848 0.057223047 0.028611524
[84,] 0.98309310 0.033813802 0.016906901
[85,] 0.97814956 0.043700888 0.021850444
[86,] 0.97544714 0.049105712 0.024552856
[87,] 0.96926337 0.061473268 0.030736634
[88,] 0.96136201 0.077275979 0.038637989
[89,] 0.95776632 0.084467366 0.042233683
[90,] 0.94595125 0.108097500 0.054048750
[91,] 0.94097533 0.118049338 0.059024669
[92,] 0.92757610 0.144847810 0.072423905
[93,] 0.91004623 0.179907539 0.089953770
[94,] 0.89586645 0.208267102 0.104133551
[95,] 0.90175065 0.196498702 0.098249351
[96,] 0.93592172 0.128156569 0.064078285
[97,] 0.93312658 0.133746832 0.066873416
[98,] 0.91536643 0.169267149 0.084633575
[99,] 0.89699174 0.206016524 0.103008262
[100,] 0.89144060 0.217118799 0.108559400
[101,] 0.88726337 0.225473253 0.112736627
[102,] 0.90504062 0.189918755 0.094959377
[103,] 0.89355531 0.212889387 0.106444694
[104,] 0.92160102 0.156797962 0.078398981
[105,] 0.89999372 0.200012554 0.100006277
[106,] 0.87465358 0.250692849 0.125346424
[107,] 0.84537378 0.309252439 0.154626219
[108,] 0.84749329 0.305013414 0.152506707
[109,] 0.85781644 0.284367127 0.142183563
[110,] 0.84627410 0.307451808 0.153725904
[111,] 0.80970547 0.380589057 0.190294528
[112,] 0.86661007 0.266779851 0.133389925
[113,] 0.84172718 0.316545638 0.158272819
[114,] 0.82050045 0.358999107 0.179499554
[115,] 0.80715928 0.385681446 0.192840723
[116,] 0.76607799 0.467844027 0.233922013
[117,] 0.77007907 0.459841865 0.229920932
[118,] 0.75664030 0.486719397 0.243359699
[119,] 0.70422077 0.591558461 0.295779231
[120,] 0.67221924 0.655561528 0.327780764
[121,] 0.67845056 0.643098884 0.321549442
[122,] 0.67083468 0.658330650 0.329165325
[123,] 0.61121891 0.777562180 0.388781090
[124,] 0.59662245 0.806755092 0.403377546
[125,] 0.56962122 0.860757553 0.430378777
[126,] 0.49483920 0.989678397 0.505160802
[127,] 0.46604442 0.932088841 0.533955579
[128,] 0.46259901 0.925198022 0.537400989
[129,] 0.38692697 0.773853938 0.613073031
[130,] 0.44754860 0.895097201 0.552451399
[131,] 0.80203582 0.395928358 0.197964179
[132,] 0.82741868 0.345162638 0.172581319
[133,] 0.79055296 0.418894079 0.209447039
[134,] 0.71129838 0.577403233 0.288701616
[135,] 0.65729419 0.685411621 0.342705810
[136,] 0.54506829 0.909863425 0.454931713
[137,] 0.53684572 0.926308559 0.463154280
[138,] 0.66932569 0.661348612 0.330674306
[139,] 0.57160486 0.856790272 0.428395136
> postscript(file="/var/www/html/rcomp/tmp/191001290270358.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/2jsz31290270358.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/3jsz31290270358.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/4u1zo1290270358.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/5u1zo1290270358.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.63181853 0.93520274 1.47479392 1.18503842 -0.66481429 2.78219029
7 8 9 10 11 12
-1.73664143 -1.47086096 -0.24972137 3.01423710 -2.32891893 -1.07405098
13 14 15 16 17 18
2.77776741 -4.25308059 -0.63728294 0.04154397 -2.07405098 -0.35123177
19 20 21 22 23 24
1.29847142 -3.50890318 2.34514794 0.61590194 -0.62808184 2.50552647
25 26 27 28 29 30
0.60280023 0.16237044 -5.62789560 0.50299121 -0.21865892 5.21426113
31 32 33 34 35 36
4.49846290 -1.59115311 -0.47873115 0.94314668 -1.46846639 1.75652119
37 38 39 40 41 42
-0.87532668 0.80738646 -0.05757187 0.78034822 1.09159258 6.90523512
43 44 45 46 47 48
-4.74311193 -2.47919171 -0.24563072 2.21005269 3.97649171 0.51408983
49 50 51 52 53 54
-2.94295975 -1.68726783 -0.95802713 -6.41259408 -0.38555149 -2.43418837
55 56 57 58 59 60
1.62517382 -0.42935754 0.22367667 1.59782871 -2.27142814 -0.25251807
61 62 63 64 65 66
-2.45801540 2.01224133 0.26305984 2.24531355 -0.94055516 1.71980691
67 68 69 70 71 72
-2.04564927 2.53174805 2.09398715 -0.59978556 2.57183974 0.72100419
73 74 75 76 77 78
-1.04592359 -2.97863562 -0.47294915 -1.39360792 -0.26827049 0.09953653
79 80 81 82 83 84
3.21785298 -1.99305007 -2.84003762 2.01094159 0.14115243 -1.25297864
85 86 87 88 89 90
4.27457449 -0.40769247 -0.28969292 -0.01534990 0.99367402 -0.23180232
91 92 93 94 95 96
0.87374232 -3.50849435 0.68930698 1.55305799 0.65358556 0.26651806
97 98 99 100 101 102
-2.23747233 -0.60814451 -1.84137559 0.58277950 0.54014253 1.28226045
103 104 105 106 107 108
-1.81505155 2.11588201 -2.96583561 -0.56955794 -1.34570592 -1.24892623
109 110 111 112 113 114
-2.45106432 -2.89954051 -1.19269348 -1.63969806 -0.44083308 0.39806984
115 116 117 118 119 120
0.66569440 2.59806133 2.50342824 -1.73209841 0.25963071 3.03800235
121 122 123 124 125 126
0.59421333 1.43579517 -2.23060504 -0.83500238 2.25963071 1.08082557
127 128 129 130 131 132
0.55108229 -1.39121336 -0.51583224 -2.42206571 0.55108229 2.43481233
133 134 135 136 137 138
-1.47806433 -0.20896817 1.74722578 1.32560594 0.35426379 -3.67221394
139 140 141 142 143 144
4.91167206 -0.67909126 -0.28514644 -0.49537448 2.06034774 -0.28363660
145 146 147 148 149 150
1.08300569 -0.80287627 -3.40557222 -4.37222720 1.11166354 1.39022786
151 152 153 154 155 156
-0.18861286 0.93789364 -1.22222407 0.83951452 1.30475417 1.84590308
> postscript(file="/var/www/html/rcomp/tmp/6u1zo1290270358.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.63181853 NA
1 0.93520274 1.63181853
2 1.47479392 0.93520274
3 1.18503842 1.47479392
4 -0.66481429 1.18503842
5 2.78219029 -0.66481429
6 -1.73664143 2.78219029
7 -1.47086096 -1.73664143
8 -0.24972137 -1.47086096
9 3.01423710 -0.24972137
10 -2.32891893 3.01423710
11 -1.07405098 -2.32891893
12 2.77776741 -1.07405098
13 -4.25308059 2.77776741
14 -0.63728294 -4.25308059
15 0.04154397 -0.63728294
16 -2.07405098 0.04154397
17 -0.35123177 -2.07405098
18 1.29847142 -0.35123177
19 -3.50890318 1.29847142
20 2.34514794 -3.50890318
21 0.61590194 2.34514794
22 -0.62808184 0.61590194
23 2.50552647 -0.62808184
24 0.60280023 2.50552647
25 0.16237044 0.60280023
26 -5.62789560 0.16237044
27 0.50299121 -5.62789560
28 -0.21865892 0.50299121
29 5.21426113 -0.21865892
30 4.49846290 5.21426113
31 -1.59115311 4.49846290
32 -0.47873115 -1.59115311
33 0.94314668 -0.47873115
34 -1.46846639 0.94314668
35 1.75652119 -1.46846639
36 -0.87532668 1.75652119
37 0.80738646 -0.87532668
38 -0.05757187 0.80738646
39 0.78034822 -0.05757187
40 1.09159258 0.78034822
41 6.90523512 1.09159258
42 -4.74311193 6.90523512
43 -2.47919171 -4.74311193
44 -0.24563072 -2.47919171
45 2.21005269 -0.24563072
46 3.97649171 2.21005269
47 0.51408983 3.97649171
48 -2.94295975 0.51408983
49 -1.68726783 -2.94295975
50 -0.95802713 -1.68726783
51 -6.41259408 -0.95802713
52 -0.38555149 -6.41259408
53 -2.43418837 -0.38555149
54 1.62517382 -2.43418837
55 -0.42935754 1.62517382
56 0.22367667 -0.42935754
57 1.59782871 0.22367667
58 -2.27142814 1.59782871
59 -0.25251807 -2.27142814
60 -2.45801540 -0.25251807
61 2.01224133 -2.45801540
62 0.26305984 2.01224133
63 2.24531355 0.26305984
64 -0.94055516 2.24531355
65 1.71980691 -0.94055516
66 -2.04564927 1.71980691
67 2.53174805 -2.04564927
68 2.09398715 2.53174805
69 -0.59978556 2.09398715
70 2.57183974 -0.59978556
71 0.72100419 2.57183974
72 -1.04592359 0.72100419
73 -2.97863562 -1.04592359
74 -0.47294915 -2.97863562
75 -1.39360792 -0.47294915
76 -0.26827049 -1.39360792
77 0.09953653 -0.26827049
78 3.21785298 0.09953653
79 -1.99305007 3.21785298
80 -2.84003762 -1.99305007
81 2.01094159 -2.84003762
82 0.14115243 2.01094159
83 -1.25297864 0.14115243
84 4.27457449 -1.25297864
85 -0.40769247 4.27457449
86 -0.28969292 -0.40769247
87 -0.01534990 -0.28969292
88 0.99367402 -0.01534990
89 -0.23180232 0.99367402
90 0.87374232 -0.23180232
91 -3.50849435 0.87374232
92 0.68930698 -3.50849435
93 1.55305799 0.68930698
94 0.65358556 1.55305799
95 0.26651806 0.65358556
96 -2.23747233 0.26651806
97 -0.60814451 -2.23747233
98 -1.84137559 -0.60814451
99 0.58277950 -1.84137559
100 0.54014253 0.58277950
101 1.28226045 0.54014253
102 -1.81505155 1.28226045
103 2.11588201 -1.81505155
104 -2.96583561 2.11588201
105 -0.56955794 -2.96583561
106 -1.34570592 -0.56955794
107 -1.24892623 -1.34570592
108 -2.45106432 -1.24892623
109 -2.89954051 -2.45106432
110 -1.19269348 -2.89954051
111 -1.63969806 -1.19269348
112 -0.44083308 -1.63969806
113 0.39806984 -0.44083308
114 0.66569440 0.39806984
115 2.59806133 0.66569440
116 2.50342824 2.59806133
117 -1.73209841 2.50342824
118 0.25963071 -1.73209841
119 3.03800235 0.25963071
120 0.59421333 3.03800235
121 1.43579517 0.59421333
122 -2.23060504 1.43579517
123 -0.83500238 -2.23060504
124 2.25963071 -0.83500238
125 1.08082557 2.25963071
126 0.55108229 1.08082557
127 -1.39121336 0.55108229
128 -0.51583224 -1.39121336
129 -2.42206571 -0.51583224
130 0.55108229 -2.42206571
131 2.43481233 0.55108229
132 -1.47806433 2.43481233
133 -0.20896817 -1.47806433
134 1.74722578 -0.20896817
135 1.32560594 1.74722578
136 0.35426379 1.32560594
137 -3.67221394 0.35426379
138 4.91167206 -3.67221394
139 -0.67909126 4.91167206
140 -0.28514644 -0.67909126
141 -0.49537448 -0.28514644
142 2.06034774 -0.49537448
143 -0.28363660 2.06034774
144 1.08300569 -0.28363660
145 -0.80287627 1.08300569
146 -3.40557222 -0.80287627
147 -4.37222720 -3.40557222
148 1.11166354 -4.37222720
149 1.39022786 1.11166354
150 -0.18861286 1.39022786
151 0.93789364 -0.18861286
152 -1.22222407 0.93789364
153 0.83951452 -1.22222407
154 1.30475417 0.83951452
155 1.84590308 1.30475417
156 NA 1.84590308
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 0.93520274 1.63181853
[2,] 1.47479392 0.93520274
[3,] 1.18503842 1.47479392
[4,] -0.66481429 1.18503842
[5,] 2.78219029 -0.66481429
[6,] -1.73664143 2.78219029
[7,] -1.47086096 -1.73664143
[8,] -0.24972137 -1.47086096
[9,] 3.01423710 -0.24972137
[10,] -2.32891893 3.01423710
[11,] -1.07405098 -2.32891893
[12,] 2.77776741 -1.07405098
[13,] -4.25308059 2.77776741
[14,] -0.63728294 -4.25308059
[15,] 0.04154397 -0.63728294
[16,] -2.07405098 0.04154397
[17,] -0.35123177 -2.07405098
[18,] 1.29847142 -0.35123177
[19,] -3.50890318 1.29847142
[20,] 2.34514794 -3.50890318
[21,] 0.61590194 2.34514794
[22,] -0.62808184 0.61590194
[23,] 2.50552647 -0.62808184
[24,] 0.60280023 2.50552647
[25,] 0.16237044 0.60280023
[26,] -5.62789560 0.16237044
[27,] 0.50299121 -5.62789560
[28,] -0.21865892 0.50299121
[29,] 5.21426113 -0.21865892
[30,] 4.49846290 5.21426113
[31,] -1.59115311 4.49846290
[32,] -0.47873115 -1.59115311
[33,] 0.94314668 -0.47873115
[34,] -1.46846639 0.94314668
[35,] 1.75652119 -1.46846639
[36,] -0.87532668 1.75652119
[37,] 0.80738646 -0.87532668
[38,] -0.05757187 0.80738646
[39,] 0.78034822 -0.05757187
[40,] 1.09159258 0.78034822
[41,] 6.90523512 1.09159258
[42,] -4.74311193 6.90523512
[43,] -2.47919171 -4.74311193
[44,] -0.24563072 -2.47919171
[45,] 2.21005269 -0.24563072
[46,] 3.97649171 2.21005269
[47,] 0.51408983 3.97649171
[48,] -2.94295975 0.51408983
[49,] -1.68726783 -2.94295975
[50,] -0.95802713 -1.68726783
[51,] -6.41259408 -0.95802713
[52,] -0.38555149 -6.41259408
[53,] -2.43418837 -0.38555149
[54,] 1.62517382 -2.43418837
[55,] -0.42935754 1.62517382
[56,] 0.22367667 -0.42935754
[57,] 1.59782871 0.22367667
[58,] -2.27142814 1.59782871
[59,] -0.25251807 -2.27142814
[60,] -2.45801540 -0.25251807
[61,] 2.01224133 -2.45801540
[62,] 0.26305984 2.01224133
[63,] 2.24531355 0.26305984
[64,] -0.94055516 2.24531355
[65,] 1.71980691 -0.94055516
[66,] -2.04564927 1.71980691
[67,] 2.53174805 -2.04564927
[68,] 2.09398715 2.53174805
[69,] -0.59978556 2.09398715
[70,] 2.57183974 -0.59978556
[71,] 0.72100419 2.57183974
[72,] -1.04592359 0.72100419
[73,] -2.97863562 -1.04592359
[74,] -0.47294915 -2.97863562
[75,] -1.39360792 -0.47294915
[76,] -0.26827049 -1.39360792
[77,] 0.09953653 -0.26827049
[78,] 3.21785298 0.09953653
[79,] -1.99305007 3.21785298
[80,] -2.84003762 -1.99305007
[81,] 2.01094159 -2.84003762
[82,] 0.14115243 2.01094159
[83,] -1.25297864 0.14115243
[84,] 4.27457449 -1.25297864
[85,] -0.40769247 4.27457449
[86,] -0.28969292 -0.40769247
[87,] -0.01534990 -0.28969292
[88,] 0.99367402 -0.01534990
[89,] -0.23180232 0.99367402
[90,] 0.87374232 -0.23180232
[91,] -3.50849435 0.87374232
[92,] 0.68930698 -3.50849435
[93,] 1.55305799 0.68930698
[94,] 0.65358556 1.55305799
[95,] 0.26651806 0.65358556
[96,] -2.23747233 0.26651806
[97,] -0.60814451 -2.23747233
[98,] -1.84137559 -0.60814451
[99,] 0.58277950 -1.84137559
[100,] 0.54014253 0.58277950
[101,] 1.28226045 0.54014253
[102,] -1.81505155 1.28226045
[103,] 2.11588201 -1.81505155
[104,] -2.96583561 2.11588201
[105,] -0.56955794 -2.96583561
[106,] -1.34570592 -0.56955794
[107,] -1.24892623 -1.34570592
[108,] -2.45106432 -1.24892623
[109,] -2.89954051 -2.45106432
[110,] -1.19269348 -2.89954051
[111,] -1.63969806 -1.19269348
[112,] -0.44083308 -1.63969806
[113,] 0.39806984 -0.44083308
[114,] 0.66569440 0.39806984
[115,] 2.59806133 0.66569440
[116,] 2.50342824 2.59806133
[117,] -1.73209841 2.50342824
[118,] 0.25963071 -1.73209841
[119,] 3.03800235 0.25963071
[120,] 0.59421333 3.03800235
[121,] 1.43579517 0.59421333
[122,] -2.23060504 1.43579517
[123,] -0.83500238 -2.23060504
[124,] 2.25963071 -0.83500238
[125,] 1.08082557 2.25963071
[126,] 0.55108229 1.08082557
[127,] -1.39121336 0.55108229
[128,] -0.51583224 -1.39121336
[129,] -2.42206571 -0.51583224
[130,] 0.55108229 -2.42206571
[131,] 2.43481233 0.55108229
[132,] -1.47806433 2.43481233
[133,] -0.20896817 -1.47806433
[134,] 1.74722578 -0.20896817
[135,] 1.32560594 1.74722578
[136,] 0.35426379 1.32560594
[137,] -3.67221394 0.35426379
[138,] 4.91167206 -3.67221394
[139,] -0.67909126 4.91167206
[140,] -0.28514644 -0.67909126
[141,] -0.49537448 -0.28514644
[142,] 2.06034774 -0.49537448
[143,] -0.28363660 2.06034774
[144,] 1.08300569 -0.28363660
[145,] -0.80287627 1.08300569
[146,] -3.40557222 -0.80287627
[147,] -4.37222720 -3.40557222
[148,] 1.11166354 -4.37222720
[149,] 1.39022786 1.11166354
[150,] -0.18861286 1.39022786
[151,] 0.93789364 -0.18861286
[152,] -1.22222407 0.93789364
[153,] 0.83951452 -1.22222407
[154,] 1.30475417 0.83951452
[155,] 1.84590308 1.30475417
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 0.93520274 1.63181853
2 1.47479392 0.93520274
3 1.18503842 1.47479392
4 -0.66481429 1.18503842
5 2.78219029 -0.66481429
6 -1.73664143 2.78219029
7 -1.47086096 -1.73664143
8 -0.24972137 -1.47086096
9 3.01423710 -0.24972137
10 -2.32891893 3.01423710
11 -1.07405098 -2.32891893
12 2.77776741 -1.07405098
13 -4.25308059 2.77776741
14 -0.63728294 -4.25308059
15 0.04154397 -0.63728294
16 -2.07405098 0.04154397
17 -0.35123177 -2.07405098
18 1.29847142 -0.35123177
19 -3.50890318 1.29847142
20 2.34514794 -3.50890318
21 0.61590194 2.34514794
22 -0.62808184 0.61590194
23 2.50552647 -0.62808184
24 0.60280023 2.50552647
25 0.16237044 0.60280023
26 -5.62789560 0.16237044
27 0.50299121 -5.62789560
28 -0.21865892 0.50299121
29 5.21426113 -0.21865892
30 4.49846290 5.21426113
31 -1.59115311 4.49846290
32 -0.47873115 -1.59115311
33 0.94314668 -0.47873115
34 -1.46846639 0.94314668
35 1.75652119 -1.46846639
36 -0.87532668 1.75652119
37 0.80738646 -0.87532668
38 -0.05757187 0.80738646
39 0.78034822 -0.05757187
40 1.09159258 0.78034822
41 6.90523512 1.09159258
42 -4.74311193 6.90523512
43 -2.47919171 -4.74311193
44 -0.24563072 -2.47919171
45 2.21005269 -0.24563072
46 3.97649171 2.21005269
47 0.51408983 3.97649171
48 -2.94295975 0.51408983
49 -1.68726783 -2.94295975
50 -0.95802713 -1.68726783
51 -6.41259408 -0.95802713
52 -0.38555149 -6.41259408
53 -2.43418837 -0.38555149
54 1.62517382 -2.43418837
55 -0.42935754 1.62517382
56 0.22367667 -0.42935754
57 1.59782871 0.22367667
58 -2.27142814 1.59782871
59 -0.25251807 -2.27142814
60 -2.45801540 -0.25251807
61 2.01224133 -2.45801540
62 0.26305984 2.01224133
63 2.24531355 0.26305984
64 -0.94055516 2.24531355
65 1.71980691 -0.94055516
66 -2.04564927 1.71980691
67 2.53174805 -2.04564927
68 2.09398715 2.53174805
69 -0.59978556 2.09398715
70 2.57183974 -0.59978556
71 0.72100419 2.57183974
72 -1.04592359 0.72100419
73 -2.97863562 -1.04592359
74 -0.47294915 -2.97863562
75 -1.39360792 -0.47294915
76 -0.26827049 -1.39360792
77 0.09953653 -0.26827049
78 3.21785298 0.09953653
79 -1.99305007 3.21785298
80 -2.84003762 -1.99305007
81 2.01094159 -2.84003762
82 0.14115243 2.01094159
83 -1.25297864 0.14115243
84 4.27457449 -1.25297864
85 -0.40769247 4.27457449
86 -0.28969292 -0.40769247
87 -0.01534990 -0.28969292
88 0.99367402 -0.01534990
89 -0.23180232 0.99367402
90 0.87374232 -0.23180232
91 -3.50849435 0.87374232
92 0.68930698 -3.50849435
93 1.55305799 0.68930698
94 0.65358556 1.55305799
95 0.26651806 0.65358556
96 -2.23747233 0.26651806
97 -0.60814451 -2.23747233
98 -1.84137559 -0.60814451
99 0.58277950 -1.84137559
100 0.54014253 0.58277950
101 1.28226045 0.54014253
102 -1.81505155 1.28226045
103 2.11588201 -1.81505155
104 -2.96583561 2.11588201
105 -0.56955794 -2.96583561
106 -1.34570592 -0.56955794
107 -1.24892623 -1.34570592
108 -2.45106432 -1.24892623
109 -2.89954051 -2.45106432
110 -1.19269348 -2.89954051
111 -1.63969806 -1.19269348
112 -0.44083308 -1.63969806
113 0.39806984 -0.44083308
114 0.66569440 0.39806984
115 2.59806133 0.66569440
116 2.50342824 2.59806133
117 -1.73209841 2.50342824
118 0.25963071 -1.73209841
119 3.03800235 0.25963071
120 0.59421333 3.03800235
121 1.43579517 0.59421333
122 -2.23060504 1.43579517
123 -0.83500238 -2.23060504
124 2.25963071 -0.83500238
125 1.08082557 2.25963071
126 0.55108229 1.08082557
127 -1.39121336 0.55108229
128 -0.51583224 -1.39121336
129 -2.42206571 -0.51583224
130 0.55108229 -2.42206571
131 2.43481233 0.55108229
132 -1.47806433 2.43481233
133 -0.20896817 -1.47806433
134 1.74722578 -0.20896817
135 1.32560594 1.74722578
136 0.35426379 1.32560594
137 -3.67221394 0.35426379
138 4.91167206 -3.67221394
139 -0.67909126 4.91167206
140 -0.28514644 -0.67909126
141 -0.49537448 -0.28514644
142 2.06034774 -0.49537448
143 -0.28363660 2.06034774
144 1.08300569 -0.28363660
145 -0.80287627 1.08300569
146 -3.40557222 -0.80287627
147 -4.37222720 -3.40557222
148 1.11166354 -4.37222720
149 1.39022786 1.11166354
150 -0.18861286 1.39022786
151 0.93789364 -0.18861286
152 -1.22222407 0.93789364
153 0.83951452 -1.22222407
154 1.30475417 0.83951452
155 1.84590308 1.30475417
> 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/75by91290270358.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/85by91290270358.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/9ykxc1290270358.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/10ykxc1290270358.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/1112wi1290270358.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/12mlu61290270358.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/13t4rh1290270358.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/14f5bg1290270359.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/15iosl1290270359.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/16wypu1290270359.tab")
+ }
>
> try(system("convert tmp/191001290270358.ps tmp/191001290270358.png",intern=TRUE))
character(0)
> try(system("convert tmp/2jsz31290270358.ps tmp/2jsz31290270358.png",intern=TRUE))
character(0)
> try(system("convert tmp/3jsz31290270358.ps tmp/3jsz31290270358.png",intern=TRUE))
character(0)
> try(system("convert tmp/4u1zo1290270358.ps tmp/4u1zo1290270358.png",intern=TRUE))
character(0)
> try(system("convert tmp/5u1zo1290270358.ps tmp/5u1zo1290270358.png",intern=TRUE))
character(0)
> try(system("convert tmp/6u1zo1290270358.ps tmp/6u1zo1290270358.png",intern=TRUE))
character(0)
> try(system("convert tmp/75by91290270358.ps tmp/75by91290270358.png",intern=TRUE))
character(0)
> try(system("convert tmp/85by91290270358.ps tmp/85by91290270358.png",intern=TRUE))
character(0)
> try(system("convert tmp/9ykxc1290270358.ps tmp/9ykxc1290270358.png",intern=TRUE))
character(0)
> try(system("convert tmp/10ykxc1290270358.ps tmp/10ykxc1290270358.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
4.080 1.763 8.937