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(15
+ ,11
+ ,12
+ ,13
+ ,6
+ ,12
+ ,12
+ ,7
+ ,11
+ ,4
+ ,15
+ ,12
+ ,13
+ ,14
+ ,6
+ ,12
+ ,11
+ ,11
+ ,12
+ ,5
+ ,14
+ ,11
+ ,16
+ ,12
+ ,5
+ ,8
+ ,10
+ ,10
+ ,6
+ ,4
+ ,11
+ ,11
+ ,15
+ ,10
+ ,5
+ ,15
+ ,9
+ ,5
+ ,11
+ ,3
+ ,4
+ ,10
+ ,4
+ ,10
+ ,2
+ ,13
+ ,12
+ ,7
+ ,12
+ ,5
+ ,19
+ ,12
+ ,15
+ ,15
+ ,6
+ ,10
+ ,12
+ ,5
+ ,13
+ ,6
+ ,15
+ ,13
+ ,16
+ ,18
+ ,8
+ ,6
+ ,9
+ ,15
+ ,11
+ ,6
+ ,7
+ ,12
+ ,13
+ ,12
+ ,3
+ ,14
+ ,12
+ ,13
+ ,13
+ ,6
+ ,16
+ ,12
+ ,15
+ ,14
+ ,6
+ ,14
+ ,13
+ ,10
+ ,16
+ ,8
+ ,15
+ ,11
+ ,17
+ ,16
+ ,6
+ ,12
+ ,12
+ ,9
+ ,13
+ ,4
+ ,9
+ ,15
+ ,6
+ ,8
+ ,4
+ ,12
+ ,11
+ ,11
+ ,14
+ ,2
+ ,14
+ ,12
+ ,13
+ ,15
+ ,6
+ ,12
+ ,10
+ ,12
+ ,13
+ ,6
+ ,14
+ ,11
+ ,10
+ ,16
+ ,6
+ ,10
+ ,13
+ ,4
+ ,13
+ ,6
+ ,14
+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,13
+ ,5
+ ,9
+ ,12
+ ,11
+ ,11
+ ,4
+ ,13
+ ,11
+ ,12
+ ,13
+ ,7
+ ,13
+ ,12
+ ,5
+ ,12
+ ,3
+ ,12
+ ,12
+ ,12
+ ,14
+ ,5
+ ,11
+ ,8
+ ,14
+ ,15
+ ,5
+ ,12
+ ,11
+ ,14
+ ,13
+ ,5
+ ,14
+ ,11
+ ,13
+ ,16
+ ,6
+ ,11
+ ,6
+ ,14
+ ,17
+ ,6
+ ,13
+ ,13
+ ,14
+ ,13
+ ,3
+ ,14
+ ,12
+ ,15
+ ,14
+ ,6
+ ,13
+ ,12
+ ,13
+ ,13
+ ,5
+ ,16
+ ,12
+ ,14
+ ,16
+ ,8
+ ,13
+ ,12
+ ,11
+ ,13
+ ,6
+ ,12
+ ,12
+ ,14
+ ,14
+ ,4
+ ,9
+ ,10
+ ,11
+ ,13
+ ,3
+ ,14
+ ,12
+ ,8
+ ,14
+ ,4
+ ,15
+ ,12
+ ,12
+ ,16
+ ,7)
+ ,dim=c(5
+ ,146)
+ ,dimnames=list(c('Popularity'
+ ,'FindingFriends'
+ ,'KnowingPeople'
+ ,'Liked'
+ ,'Celebrity')
+ ,1:146))
> y <- array(NA,dim=c(5,146),dimnames=list(c('Popularity','FindingFriends','KnowingPeople','Liked','Celebrity'),1:146))
> 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
FindingFriends Popularity KnowingPeople Liked Celebrity
1 11 15 12 13 6
2 12 12 7 11 4
3 12 15 13 14 6
4 11 12 11 12 5
5 11 14 16 12 5
6 10 8 10 6 4
7 11 11 15 10 5
8 9 15 5 11 3
9 10 4 4 10 2
10 12 13 7 12 5
11 12 19 15 15 6
12 12 10 5 13 6
13 13 15 16 18 8
14 9 6 15 11 6
15 12 7 13 12 3
16 12 14 13 13 6
17 12 16 15 14 6
18 13 14 10 16 8
19 11 15 17 16 6
20 12 12 9 13 4
21 15 9 6 8 4
22 11 12 11 14 2
23 12 14 13 15 6
24 10 12 12 13 6
25 11 14 10 16 6
26 13 10 4 13 6
27 6 14 13 12 6
28 12 16 15 15 7
29 12 10 8 11 4
30 10 8 10 14 3
31 12 12 8 13 5
32 12 11 7 13 6
33 11 8 9 12 4
34 9 13 14 14 6
35 10 11 5 13 3
36 12 12 7 12 3
37 12 16 16 14 6
38 12 13 16 16 6
39 14 5 4 5 2
40 10 14 12 15 6
41 10 13 8 8 4
42 11 16 17 16 7
43 10 15 12 16 6
44 10 11 12 14 5
45 12 15 13 13 6
46 11 16 14 14 6
47 8 13 14 14 5
48 12 11 15 12 6
49 10 12 14 13 7
50 7 12 11 15 5
51 11 10 13 15 6
52 7 8 4 13 6
53 11 9 8 10 4
54 8 12 13 13 5
55 11 14 15 14 6
56 12 12 15 13 6
57 8 11 8 13 4
58 14 14 17 18 6
59 14 7 12 12 4
60 11 16 13 14 7
61 12 16 14 16 8
62 14 11 7 13 6
63 9 16 16 16 6
64 13 13 11 15 6
65 8 11 10 14 5
66 11 13 14 13 6
67 9 14 19 12 6
68 12 15 14 16 4
69 7 10 8 9 5
70 11 15 15 15 8
71 12 11 8 16 6
72 11 11 8 12 6
73 12 6 6 11 2
74 9 11 7 13 2
75 11 12 16 13 4
76 13 13 15 14 6
77 12 12 10 15 6
78 12 8 8 14 5
79 11 9 9 12 4
80 12 10 8 16 4
81 12 16 14 14 6
82 11 15 14 13 5
83 11 14 14 12 6
84 8 12 15 13 7
85 9 12 7 12 6
86 12 12 12 13 4
87 13 8 7 10 3
88 12 16 12 15 8
89 6 11 6 9 4
90 12 12 10 13 4
91 11 9 12 13 5
92 13 14 13 13 5
93 11 15 14 15 7
94 12 8 8 13 4
95 10 12 14 14 5
96 10 10 10 11 5
97 11 16 14 15 8
98 11 8 10 15 2
99 9 9 6 12 5
100 7 8 9 15 4
101 11 11 11 14 5
102 12 16 16 16 7
103 12 13 14 14 6
104 15 5 8 12 3
105 11 15 16 11 5
106 10 15 16 13 6
107 13 12 14 12 5
108 13 12 12 12 6
109 11 16 16 16 7
110 12 12 15 13 6
111 12 10 11 12 6
112 12 12 6 14 5
113 8 4 6 4 4
114 5 11 16 14 6
115 11 16 16 15 6
116 12 7 8 12 3
117 12 9 11 11 4
118 11 14 12 12 4
119 12 11 13 11 4
120 10 10 11 12 5
121 7 6 9 11 4
122 12 14 15 13 6
123 12 11 11 12 6
124 9 11 12 12 4
125 12 16 8 14 4
126 12 7 7 12 4
127 11 8 10 12 4
128 11 10 9 12 4
129 12 14 13 13 5
130 12 9 11 11 4
131 11 13 12 13 7
132 12 13 5 12 3
133 12 12 12 14 5
134 8 11 14 15 5
135 11 12 14 13 5
136 11 14 13 16 6
137 6 11 14 17 6
138 13 13 14 13 3
139 12 14 15 14 6
140 12 13 13 13 5
141 12 16 14 16 8
142 12 13 11 13 6
143 12 12 14 14 4
144 10 9 11 13 3
145 12 14 8 14 4
146 12 15 12 16 7
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Popularity KnowingPeople Liked Celebrity
10.17094 0.10082 -0.04575 0.04592 -0.08825
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-5.661 -0.769 0.287 0.972 4.405
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 10.17094 0.92659 10.977 <2e-16 ***
Popularity 0.10082 0.07373 1.367 0.174
KnowingPeople -0.04575 0.05610 -0.816 0.416
Liked 0.04592 0.08776 0.523 0.602
Celebrity -0.08825 0.14518 -0.608 0.544
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 1.803 on 141 degrees of freedom
Multiple R-squared: 0.02018, Adjusted R-squared: -0.00762
F-statistic: 0.7259 on 4 and 141 DF, p-value: 0.5757
> 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.091967485 0.183934971 0.908032515
[2,] 0.075175585 0.150351171 0.924824415
[3,] 0.036485922 0.072971844 0.963514078
[4,] 0.016728724 0.033457448 0.983271276
[5,] 0.008202594 0.016405187 0.991797406
[6,] 0.003660754 0.007321509 0.996339246
[7,] 0.020174843 0.040349686 0.979825157
[8,] 0.024735905 0.049471810 0.975264095
[9,] 0.014007005 0.028014010 0.985992995
[10,] 0.007091477 0.014182954 0.992908523
[11,] 0.003803688 0.007607376 0.996196312
[12,] 0.003162028 0.006324056 0.996837972
[13,] 0.001829916 0.003659831 0.998170084
[14,] 0.086243311 0.172486622 0.913756689
[15,] 0.059504875 0.119009749 0.940495125
[16,] 0.039847188 0.079694375 0.960152812
[17,] 0.041265506 0.082531011 0.958734494
[18,] 0.032259792 0.064519584 0.967740208
[19,] 0.024479510 0.048959019 0.975520490
[20,] 0.342067634 0.684135268 0.657932366
[21,] 0.289413157 0.578826315 0.710586843
[22,] 0.246313713 0.492627427 0.753686287
[23,] 0.218391997 0.436783995 0.781608003
[24,] 0.176940146 0.353880291 0.823059854
[25,] 0.142050250 0.284100501 0.857949750
[26,] 0.109800937 0.219601873 0.890199063
[27,] 0.128011056 0.256022112 0.871988944
[28,] 0.120239626 0.240479251 0.879760374
[29,] 0.098539370 0.197078740 0.901460630
[30,] 0.081773809 0.163547619 0.918226191
[31,] 0.066452473 0.132904945 0.933547527
[32,] 0.127525761 0.255051522 0.872474239
[33,] 0.116701016 0.233402033 0.883298984
[34,] 0.104473010 0.208946020 0.895526990
[35,] 0.081023980 0.162047959 0.918976020
[36,] 0.073724772 0.147449544 0.926275228
[37,] 0.062456040 0.124912080 0.937543960
[38,] 0.050283618 0.100567237 0.949716382
[39,] 0.037607922 0.075215844 0.962392078
[40,] 0.063497483 0.126994967 0.936502517
[41,] 0.054971388 0.109942777 0.945028612
[42,] 0.047531113 0.095062226 0.952468887
[43,] 0.140682874 0.281365748 0.859317126
[44,] 0.113580697 0.227161395 0.886419303
[45,] 0.281892768 0.563785536 0.718107232
[46,] 0.240826728 0.481653457 0.759173272
[47,] 0.305921203 0.611842405 0.694078797
[48,] 0.262917462 0.525834924 0.737082538
[49,] 0.241081708 0.482163416 0.758918292
[50,] 0.315299815 0.630599630 0.684700185
[51,] 0.416200775 0.832401551 0.583799225
[52,] 0.546785721 0.906428557 0.453214279
[53,] 0.498321686 0.996643371 0.501678314
[54,] 0.457908812 0.915817624 0.542091188
[55,] 0.533272835 0.933454330 0.466727165
[56,] 0.556971889 0.886056223 0.443028111
[57,] 0.559091203 0.881817593 0.440908797
[58,] 0.641731734 0.716536531 0.358268266
[59,] 0.595407316 0.809185367 0.404592684
[60,] 0.592934381 0.814131238 0.407065619
[61,] 0.561234852 0.877530297 0.438765148
[62,] 0.714335980 0.571328040 0.285664020
[63,] 0.671762131 0.656475739 0.328237869
[64,] 0.637929642 0.724140717 0.362070358
[65,] 0.591984738 0.816030523 0.408015262
[66,] 0.564248162 0.871503677 0.435751838
[67,] 0.609863089 0.780273822 0.390136911
[68,] 0.563873233 0.872253533 0.436126767
[69,] 0.581531953 0.836936094 0.418468047
[70,] 0.547187015 0.905625970 0.452812985
[71,] 0.528060397 0.943879206 0.471939603
[72,] 0.479698977 0.959397953 0.520301023
[73,] 0.441953762 0.883907523 0.558046238
[74,] 0.402195415 0.804390831 0.597804585
[75,] 0.361019261 0.722038522 0.638980739
[76,] 0.316272790 0.632545579 0.683727210
[77,] 0.362160115 0.724320229 0.637839885
[78,] 0.374414747 0.748829493 0.625585253
[79,] 0.338072587 0.676145175 0.661927413
[80,] 0.352014110 0.704028220 0.647985890
[81,] 0.316082681 0.632165363 0.683917319
[82,] 0.714651114 0.570697772 0.285348886
[83,] 0.676295255 0.647409490 0.323704745
[84,] 0.638636626 0.722726747 0.361363374
[85,] 0.629287822 0.741424355 0.370712178
[86,] 0.580148827 0.839702345 0.419851173
[87,] 0.559020555 0.881958889 0.440979445
[88,] 0.519340035 0.961319931 0.480659965
[89,] 0.480793179 0.961586358 0.519206821
[90,] 0.429583250 0.859166500 0.570416750
[91,] 0.384415059 0.768830118 0.615584941
[92,] 0.398363255 0.796726511 0.601636745
[93,] 0.548230680 0.903538641 0.451769320
[94,] 0.494957119 0.989914238 0.505042881
[95,] 0.455957103 0.911914206 0.544042897
[96,] 0.424342302 0.848684604 0.575657698
[97,] 0.774256403 0.451487194 0.225743597
[98,] 0.749665416 0.500669169 0.250334584
[99,] 0.746705256 0.506589489 0.253294744
[100,] 0.757682280 0.484635441 0.242317720
[101,] 0.767530596 0.464938808 0.232469404
[102,] 0.721224965 0.557550069 0.278775035
[103,] 0.713971097 0.572057805 0.286028903
[104,] 0.718399515 0.563200970 0.281600485
[105,] 0.669455829 0.661088342 0.330544171
[106,] 0.794296669 0.411406663 0.205703331
[107,] 0.977623932 0.044752135 0.022376068
[108,] 0.968603784 0.062792432 0.031396216
[109,] 0.977788037 0.044423927 0.022211963
[110,] 0.972706276 0.054587447 0.027293724
[111,] 0.977109774 0.045780453 0.022890226
[112,] 0.966252345 0.067495310 0.033747655
[113,] 0.955922428 0.088155143 0.044077572
[114,] 0.986790257 0.026419487 0.013209743
[115,] 0.979268776 0.041462447 0.020731224
[116,] 0.967841320 0.064317360 0.032158680
[117,] 0.991655186 0.016689628 0.008344814
[118,] 0.987871173 0.024257654 0.012128827
[119,] 0.995955877 0.008088245 0.004044123
[120,] 0.996254233 0.007491533 0.003745767
[121,] 0.992674334 0.014651332 0.007325666
[122,] 0.991844420 0.016311159 0.008155580
[123,] 0.993321285 0.013357429 0.006678715
[124,] 0.987423490 0.025153021 0.012576510
[125,] 0.987986355 0.024027291 0.012013645
[126,] 0.990955383 0.018089233 0.009044617
[127,] 0.986975939 0.026048122 0.013024061
[128,] 0.973935077 0.052129846 0.026064923
[129,] 0.945293247 0.109413506 0.054706753
[130,] 0.996164776 0.007670447 0.003835224
[131,] 0.983743296 0.032513408 0.016256704
> postscript(file="/var/www/html/rcomp/tmp/1cugl1291292116.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/2cugl1291292116.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/3mmy61291292116.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/4mmy61291292116.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/5mmy61291292116.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 = 146
Frequency = 1
1 2 3 4 5 6
-0.201696481 0.787354442 0.798131204 0.012679268 0.039781272 -0.442524707
7 8 9 10 11 12
0.388330558 -2.694851434 -0.673924497 0.728868530 0.440431255 0.982162291
13 14 15 16 17 18
1.928200505 -1.065241964 1.431763158 0.944870377 0.788808225 1.846372194
19 20 21 22 23 24
-0.110717507 0.787009812 4.181824004 -0.343921066 0.853029827 -0.899239786
25 26 27 28 29 30
-0.330134329 1.936414331 -5.009209347 0.831141211 1.034740199 -0.898140171
31 32 33 34 35 36
0.829515113 0.972839313 0.236205681 -1.954483039 -1.383416391 0.653180906
37 38 39 40 41 42
0.834556185 1.045172330 3.454857981 -1.192718133 -1.129955670 -0.123283144
43 44 45 46 47 48
-1.339457307 -0.932594424 0.844051479 -0.256939735 -3.042736301 1.384743268
49 50 51 52 53 54
-0.719490604 -4.125081558 0.256305420 -3.861947872 0.181479373 -2.941745087
55 56 57 58 59 60
-0.009553978 1.238004094 -3.157919250 2.898260841 3.474268459 -0.214434434
61 62 63 64 65 66
0.827726237 2.972839313 -2.257284365 1.862352805 -3.024090344 0.091437236
67 68 69 70 71 72
-1.734721587 0.575532090 -3.785165989 0.020213371 0.880826446 0.064507548
73 74 75 76 77 78
1.170013350 -2.380173732 0.107245532 2.091264921 0.917423743 1.186870431
79 80 81 82 83 84
0.135386782 0.805138822 0.743060265 -0.198453822 0.036538613 -2.673742644
85 86 87 88 89 90
-2.082059311 0.924253692 2.148297050 0.782150592 -5.065734069 0.832757772
91 92 93 94 95 96
0.314963648 1.856617116 -0.113787850 1.144537445 -0.941917402 -0.785510619
97 98 99 100 101 102
-0.126353488 -0.032313708 -1.913603837 -3.901555145 0.021657616 0.830968896
103 104 105 106 107 108
1.045516961 4.404661155 -0.015117351 -1.018704641 2.149923148 2.146680490
109 110 111 112 113 114
-0.169031104 1.238004094 1.302570326 0.692098917 -2.130400403 -5.661349323
115 116 117 118 119 120
-0.211364090 1.203023358 1.272802978 -0.231463830 1.162661101 -0.785682935
121 122 123 124 125 126
-3.516236247 1.036366297 1.201751428 -1.929007134 0.292065983 1.245528659
127 128 129 130 131 132
0.281953641 0.034567884 0.856617116 1.272802978 0.088194577 0.460866087
133 134 135 136 137 138
0.966586678 -2.887018779 0.104002873 -0.192890449 -4.890606069 1.826677452
139 140 141 142 143 144
0.990446022 0.957436015 0.827726237 0.954193356 0.969829337 -0.907290834
145 146
0.493703779 0.748795954
> postscript(file="/var/www/html/rcomp/tmp/6xvx91291292116.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 = 146
Frequency = 1
lag(myerror, k = 1) myerror
0 -0.201696481 NA
1 0.787354442 -0.201696481
2 0.798131204 0.787354442
3 0.012679268 0.798131204
4 0.039781272 0.012679268
5 -0.442524707 0.039781272
6 0.388330558 -0.442524707
7 -2.694851434 0.388330558
8 -0.673924497 -2.694851434
9 0.728868530 -0.673924497
10 0.440431255 0.728868530
11 0.982162291 0.440431255
12 1.928200505 0.982162291
13 -1.065241964 1.928200505
14 1.431763158 -1.065241964
15 0.944870377 1.431763158
16 0.788808225 0.944870377
17 1.846372194 0.788808225
18 -0.110717507 1.846372194
19 0.787009812 -0.110717507
20 4.181824004 0.787009812
21 -0.343921066 4.181824004
22 0.853029827 -0.343921066
23 -0.899239786 0.853029827
24 -0.330134329 -0.899239786
25 1.936414331 -0.330134329
26 -5.009209347 1.936414331
27 0.831141211 -5.009209347
28 1.034740199 0.831141211
29 -0.898140171 1.034740199
30 0.829515113 -0.898140171
31 0.972839313 0.829515113
32 0.236205681 0.972839313
33 -1.954483039 0.236205681
34 -1.383416391 -1.954483039
35 0.653180906 -1.383416391
36 0.834556185 0.653180906
37 1.045172330 0.834556185
38 3.454857981 1.045172330
39 -1.192718133 3.454857981
40 -1.129955670 -1.192718133
41 -0.123283144 -1.129955670
42 -1.339457307 -0.123283144
43 -0.932594424 -1.339457307
44 0.844051479 -0.932594424
45 -0.256939735 0.844051479
46 -3.042736301 -0.256939735
47 1.384743268 -3.042736301
48 -0.719490604 1.384743268
49 -4.125081558 -0.719490604
50 0.256305420 -4.125081558
51 -3.861947872 0.256305420
52 0.181479373 -3.861947872
53 -2.941745087 0.181479373
54 -0.009553978 -2.941745087
55 1.238004094 -0.009553978
56 -3.157919250 1.238004094
57 2.898260841 -3.157919250
58 3.474268459 2.898260841
59 -0.214434434 3.474268459
60 0.827726237 -0.214434434
61 2.972839313 0.827726237
62 -2.257284365 2.972839313
63 1.862352805 -2.257284365
64 -3.024090344 1.862352805
65 0.091437236 -3.024090344
66 -1.734721587 0.091437236
67 0.575532090 -1.734721587
68 -3.785165989 0.575532090
69 0.020213371 -3.785165989
70 0.880826446 0.020213371
71 0.064507548 0.880826446
72 1.170013350 0.064507548
73 -2.380173732 1.170013350
74 0.107245532 -2.380173732
75 2.091264921 0.107245532
76 0.917423743 2.091264921
77 1.186870431 0.917423743
78 0.135386782 1.186870431
79 0.805138822 0.135386782
80 0.743060265 0.805138822
81 -0.198453822 0.743060265
82 0.036538613 -0.198453822
83 -2.673742644 0.036538613
84 -2.082059311 -2.673742644
85 0.924253692 -2.082059311
86 2.148297050 0.924253692
87 0.782150592 2.148297050
88 -5.065734069 0.782150592
89 0.832757772 -5.065734069
90 0.314963648 0.832757772
91 1.856617116 0.314963648
92 -0.113787850 1.856617116
93 1.144537445 -0.113787850
94 -0.941917402 1.144537445
95 -0.785510619 -0.941917402
96 -0.126353488 -0.785510619
97 -0.032313708 -0.126353488
98 -1.913603837 -0.032313708
99 -3.901555145 -1.913603837
100 0.021657616 -3.901555145
101 0.830968896 0.021657616
102 1.045516961 0.830968896
103 4.404661155 1.045516961
104 -0.015117351 4.404661155
105 -1.018704641 -0.015117351
106 2.149923148 -1.018704641
107 2.146680490 2.149923148
108 -0.169031104 2.146680490
109 1.238004094 -0.169031104
110 1.302570326 1.238004094
111 0.692098917 1.302570326
112 -2.130400403 0.692098917
113 -5.661349323 -2.130400403
114 -0.211364090 -5.661349323
115 1.203023358 -0.211364090
116 1.272802978 1.203023358
117 -0.231463830 1.272802978
118 1.162661101 -0.231463830
119 -0.785682935 1.162661101
120 -3.516236247 -0.785682935
121 1.036366297 -3.516236247
122 1.201751428 1.036366297
123 -1.929007134 1.201751428
124 0.292065983 -1.929007134
125 1.245528659 0.292065983
126 0.281953641 1.245528659
127 0.034567884 0.281953641
128 0.856617116 0.034567884
129 1.272802978 0.856617116
130 0.088194577 1.272802978
131 0.460866087 0.088194577
132 0.966586678 0.460866087
133 -2.887018779 0.966586678
134 0.104002873 -2.887018779
135 -0.192890449 0.104002873
136 -4.890606069 -0.192890449
137 1.826677452 -4.890606069
138 0.990446022 1.826677452
139 0.957436015 0.990446022
140 0.827726237 0.957436015
141 0.954193356 0.827726237
142 0.969829337 0.954193356
143 -0.907290834 0.969829337
144 0.493703779 -0.907290834
145 0.748795954 0.493703779
146 NA 0.748795954
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 0.787354442 -0.201696481
[2,] 0.798131204 0.787354442
[3,] 0.012679268 0.798131204
[4,] 0.039781272 0.012679268
[5,] -0.442524707 0.039781272
[6,] 0.388330558 -0.442524707
[7,] -2.694851434 0.388330558
[8,] -0.673924497 -2.694851434
[9,] 0.728868530 -0.673924497
[10,] 0.440431255 0.728868530
[11,] 0.982162291 0.440431255
[12,] 1.928200505 0.982162291
[13,] -1.065241964 1.928200505
[14,] 1.431763158 -1.065241964
[15,] 0.944870377 1.431763158
[16,] 0.788808225 0.944870377
[17,] 1.846372194 0.788808225
[18,] -0.110717507 1.846372194
[19,] 0.787009812 -0.110717507
[20,] 4.181824004 0.787009812
[21,] -0.343921066 4.181824004
[22,] 0.853029827 -0.343921066
[23,] -0.899239786 0.853029827
[24,] -0.330134329 -0.899239786
[25,] 1.936414331 -0.330134329
[26,] -5.009209347 1.936414331
[27,] 0.831141211 -5.009209347
[28,] 1.034740199 0.831141211
[29,] -0.898140171 1.034740199
[30,] 0.829515113 -0.898140171
[31,] 0.972839313 0.829515113
[32,] 0.236205681 0.972839313
[33,] -1.954483039 0.236205681
[34,] -1.383416391 -1.954483039
[35,] 0.653180906 -1.383416391
[36,] 0.834556185 0.653180906
[37,] 1.045172330 0.834556185
[38,] 3.454857981 1.045172330
[39,] -1.192718133 3.454857981
[40,] -1.129955670 -1.192718133
[41,] -0.123283144 -1.129955670
[42,] -1.339457307 -0.123283144
[43,] -0.932594424 -1.339457307
[44,] 0.844051479 -0.932594424
[45,] -0.256939735 0.844051479
[46,] -3.042736301 -0.256939735
[47,] 1.384743268 -3.042736301
[48,] -0.719490604 1.384743268
[49,] -4.125081558 -0.719490604
[50,] 0.256305420 -4.125081558
[51,] -3.861947872 0.256305420
[52,] 0.181479373 -3.861947872
[53,] -2.941745087 0.181479373
[54,] -0.009553978 -2.941745087
[55,] 1.238004094 -0.009553978
[56,] -3.157919250 1.238004094
[57,] 2.898260841 -3.157919250
[58,] 3.474268459 2.898260841
[59,] -0.214434434 3.474268459
[60,] 0.827726237 -0.214434434
[61,] 2.972839313 0.827726237
[62,] -2.257284365 2.972839313
[63,] 1.862352805 -2.257284365
[64,] -3.024090344 1.862352805
[65,] 0.091437236 -3.024090344
[66,] -1.734721587 0.091437236
[67,] 0.575532090 -1.734721587
[68,] -3.785165989 0.575532090
[69,] 0.020213371 -3.785165989
[70,] 0.880826446 0.020213371
[71,] 0.064507548 0.880826446
[72,] 1.170013350 0.064507548
[73,] -2.380173732 1.170013350
[74,] 0.107245532 -2.380173732
[75,] 2.091264921 0.107245532
[76,] 0.917423743 2.091264921
[77,] 1.186870431 0.917423743
[78,] 0.135386782 1.186870431
[79,] 0.805138822 0.135386782
[80,] 0.743060265 0.805138822
[81,] -0.198453822 0.743060265
[82,] 0.036538613 -0.198453822
[83,] -2.673742644 0.036538613
[84,] -2.082059311 -2.673742644
[85,] 0.924253692 -2.082059311
[86,] 2.148297050 0.924253692
[87,] 0.782150592 2.148297050
[88,] -5.065734069 0.782150592
[89,] 0.832757772 -5.065734069
[90,] 0.314963648 0.832757772
[91,] 1.856617116 0.314963648
[92,] -0.113787850 1.856617116
[93,] 1.144537445 -0.113787850
[94,] -0.941917402 1.144537445
[95,] -0.785510619 -0.941917402
[96,] -0.126353488 -0.785510619
[97,] -0.032313708 -0.126353488
[98,] -1.913603837 -0.032313708
[99,] -3.901555145 -1.913603837
[100,] 0.021657616 -3.901555145
[101,] 0.830968896 0.021657616
[102,] 1.045516961 0.830968896
[103,] 4.404661155 1.045516961
[104,] -0.015117351 4.404661155
[105,] -1.018704641 -0.015117351
[106,] 2.149923148 -1.018704641
[107,] 2.146680490 2.149923148
[108,] -0.169031104 2.146680490
[109,] 1.238004094 -0.169031104
[110,] 1.302570326 1.238004094
[111,] 0.692098917 1.302570326
[112,] -2.130400403 0.692098917
[113,] -5.661349323 -2.130400403
[114,] -0.211364090 -5.661349323
[115,] 1.203023358 -0.211364090
[116,] 1.272802978 1.203023358
[117,] -0.231463830 1.272802978
[118,] 1.162661101 -0.231463830
[119,] -0.785682935 1.162661101
[120,] -3.516236247 -0.785682935
[121,] 1.036366297 -3.516236247
[122,] 1.201751428 1.036366297
[123,] -1.929007134 1.201751428
[124,] 0.292065983 -1.929007134
[125,] 1.245528659 0.292065983
[126,] 0.281953641 1.245528659
[127,] 0.034567884 0.281953641
[128,] 0.856617116 0.034567884
[129,] 1.272802978 0.856617116
[130,] 0.088194577 1.272802978
[131,] 0.460866087 0.088194577
[132,] 0.966586678 0.460866087
[133,] -2.887018779 0.966586678
[134,] 0.104002873 -2.887018779
[135,] -0.192890449 0.104002873
[136,] -4.890606069 -0.192890449
[137,] 1.826677452 -4.890606069
[138,] 0.990446022 1.826677452
[139,] 0.957436015 0.990446022
[140,] 0.827726237 0.957436015
[141,] 0.954193356 0.827726237
[142,] 0.969829337 0.954193356
[143,] -0.907290834 0.969829337
[144,] 0.493703779 -0.907290834
[145,] 0.748795954 0.493703779
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 0.787354442 -0.201696481
2 0.798131204 0.787354442
3 0.012679268 0.798131204
4 0.039781272 0.012679268
5 -0.442524707 0.039781272
6 0.388330558 -0.442524707
7 -2.694851434 0.388330558
8 -0.673924497 -2.694851434
9 0.728868530 -0.673924497
10 0.440431255 0.728868530
11 0.982162291 0.440431255
12 1.928200505 0.982162291
13 -1.065241964 1.928200505
14 1.431763158 -1.065241964
15 0.944870377 1.431763158
16 0.788808225 0.944870377
17 1.846372194 0.788808225
18 -0.110717507 1.846372194
19 0.787009812 -0.110717507
20 4.181824004 0.787009812
21 -0.343921066 4.181824004
22 0.853029827 -0.343921066
23 -0.899239786 0.853029827
24 -0.330134329 -0.899239786
25 1.936414331 -0.330134329
26 -5.009209347 1.936414331
27 0.831141211 -5.009209347
28 1.034740199 0.831141211
29 -0.898140171 1.034740199
30 0.829515113 -0.898140171
31 0.972839313 0.829515113
32 0.236205681 0.972839313
33 -1.954483039 0.236205681
34 -1.383416391 -1.954483039
35 0.653180906 -1.383416391
36 0.834556185 0.653180906
37 1.045172330 0.834556185
38 3.454857981 1.045172330
39 -1.192718133 3.454857981
40 -1.129955670 -1.192718133
41 -0.123283144 -1.129955670
42 -1.339457307 -0.123283144
43 -0.932594424 -1.339457307
44 0.844051479 -0.932594424
45 -0.256939735 0.844051479
46 -3.042736301 -0.256939735
47 1.384743268 -3.042736301
48 -0.719490604 1.384743268
49 -4.125081558 -0.719490604
50 0.256305420 -4.125081558
51 -3.861947872 0.256305420
52 0.181479373 -3.861947872
53 -2.941745087 0.181479373
54 -0.009553978 -2.941745087
55 1.238004094 -0.009553978
56 -3.157919250 1.238004094
57 2.898260841 -3.157919250
58 3.474268459 2.898260841
59 -0.214434434 3.474268459
60 0.827726237 -0.214434434
61 2.972839313 0.827726237
62 -2.257284365 2.972839313
63 1.862352805 -2.257284365
64 -3.024090344 1.862352805
65 0.091437236 -3.024090344
66 -1.734721587 0.091437236
67 0.575532090 -1.734721587
68 -3.785165989 0.575532090
69 0.020213371 -3.785165989
70 0.880826446 0.020213371
71 0.064507548 0.880826446
72 1.170013350 0.064507548
73 -2.380173732 1.170013350
74 0.107245532 -2.380173732
75 2.091264921 0.107245532
76 0.917423743 2.091264921
77 1.186870431 0.917423743
78 0.135386782 1.186870431
79 0.805138822 0.135386782
80 0.743060265 0.805138822
81 -0.198453822 0.743060265
82 0.036538613 -0.198453822
83 -2.673742644 0.036538613
84 -2.082059311 -2.673742644
85 0.924253692 -2.082059311
86 2.148297050 0.924253692
87 0.782150592 2.148297050
88 -5.065734069 0.782150592
89 0.832757772 -5.065734069
90 0.314963648 0.832757772
91 1.856617116 0.314963648
92 -0.113787850 1.856617116
93 1.144537445 -0.113787850
94 -0.941917402 1.144537445
95 -0.785510619 -0.941917402
96 -0.126353488 -0.785510619
97 -0.032313708 -0.126353488
98 -1.913603837 -0.032313708
99 -3.901555145 -1.913603837
100 0.021657616 -3.901555145
101 0.830968896 0.021657616
102 1.045516961 0.830968896
103 4.404661155 1.045516961
104 -0.015117351 4.404661155
105 -1.018704641 -0.015117351
106 2.149923148 -1.018704641
107 2.146680490 2.149923148
108 -0.169031104 2.146680490
109 1.238004094 -0.169031104
110 1.302570326 1.238004094
111 0.692098917 1.302570326
112 -2.130400403 0.692098917
113 -5.661349323 -2.130400403
114 -0.211364090 -5.661349323
115 1.203023358 -0.211364090
116 1.272802978 1.203023358
117 -0.231463830 1.272802978
118 1.162661101 -0.231463830
119 -0.785682935 1.162661101
120 -3.516236247 -0.785682935
121 1.036366297 -3.516236247
122 1.201751428 1.036366297
123 -1.929007134 1.201751428
124 0.292065983 -1.929007134
125 1.245528659 0.292065983
126 0.281953641 1.245528659
127 0.034567884 0.281953641
128 0.856617116 0.034567884
129 1.272802978 0.856617116
130 0.088194577 1.272802978
131 0.460866087 0.088194577
132 0.966586678 0.460866087
133 -2.887018779 0.966586678
134 0.104002873 -2.887018779
135 -0.192890449 0.104002873
136 -4.890606069 -0.192890449
137 1.826677452 -4.890606069
138 0.990446022 1.826677452
139 0.957436015 0.990446022
140 0.827726237 0.957436015
141 0.954193356 0.827726237
142 0.969829337 0.954193356
143 -0.907290834 0.969829337
144 0.493703779 -0.907290834
145 0.748795954 0.493703779
> 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/78meu1291292116.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/88meu1291292116.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/98meu1291292116.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/10ivdx1291292116.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/11mecl1291292116.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/12pes91291292116.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/133oqh1291292116.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/14zyr01291292117.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/153hqo1291292117.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/16oioc1291292117.tab")
+ }
>
> try(system("convert tmp/1cugl1291292116.ps tmp/1cugl1291292116.png",intern=TRUE))
character(0)
> try(system("convert tmp/2cugl1291292116.ps tmp/2cugl1291292116.png",intern=TRUE))
character(0)
> try(system("convert tmp/3mmy61291292116.ps tmp/3mmy61291292116.png",intern=TRUE))
character(0)
> try(system("convert tmp/4mmy61291292116.ps tmp/4mmy61291292116.png",intern=TRUE))
character(0)
> try(system("convert tmp/5mmy61291292116.ps tmp/5mmy61291292116.png",intern=TRUE))
character(0)
> try(system("convert tmp/6xvx91291292116.ps tmp/6xvx91291292116.png",intern=TRUE))
character(0)
> try(system("convert tmp/78meu1291292116.ps tmp/78meu1291292116.png",intern=TRUE))
character(0)
> try(system("convert tmp/88meu1291292116.ps tmp/88meu1291292116.png",intern=TRUE))
character(0)
> try(system("convert tmp/98meu1291292116.ps tmp/98meu1291292116.png",intern=TRUE))
character(0)
> try(system("convert tmp/10ivdx1291292116.ps tmp/10ivdx1291292116.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
3.814 1.894 10.010