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(0.86,2.0,0.88,2.3,0.93,2.8,0.98,2.4,0.97,2.3,1.03,2.7,1.06,2.7,1.06,2.9,1.08,3.0,1.09,2.2,1.04,2.3,1.00,2.8,1.01,2.8,1.02,2.8,1.04,2.2,1.06,2.6,1.06,2.8,1.06,2.5,1.06,2.4,1.06,2.3,1.02,1.9,0.98,1.7,0.99,2.0,0.99,2.1,0.94,1.7,0.96,1.8,0.98,1.8,1.01,1.8,1.01,1.3,1.02,1.3,1.04,1.3,1.03,1.2,1.05,1.4,1.08,2.2,1.17,2.9,1.11,3.1,1.11,3.5,1.11,3.6,1.11,4.4,1.21,4.1,1.31,5.1,1.37,5.8,1.37,5.9,1.26,5.4,1.23,5.5,1.17,4.8,1.06,3.2,0.95,2.7,0.92,2.1,0.92,1.9,0.90,0.6,0.93,0.7,0.93,-0.2,0.97,-1.0,0.96,-1.7,0.99,-0.7,0.98,-1.0,0.96,-0.9,1.00,0.0,0.99,0.3,1.03,0.8),dim=c(2,61),dimnames=list(c('Dieselprijs','Inflatie'),1:61))
> y <- array(NA,dim=c(2,61),dimnames=list(c('Dieselprijs','Inflatie'),1:61))
> 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
Dieselprijs Inflatie
1 0.86 2.0
2 0.88 2.3
3 0.93 2.8
4 0.98 2.4
5 0.97 2.3
6 1.03 2.7
7 1.06 2.7
8 1.06 2.9
9 1.08 3.0
10 1.09 2.2
11 1.04 2.3
12 1.00 2.8
13 1.01 2.8
14 1.02 2.8
15 1.04 2.2
16 1.06 2.6
17 1.06 2.8
18 1.06 2.5
19 1.06 2.4
20 1.06 2.3
21 1.02 1.9
22 0.98 1.7
23 0.99 2.0
24 0.99 2.1
25 0.94 1.7
26 0.96 1.8
27 0.98 1.8
28 1.01 1.8
29 1.01 1.3
30 1.02 1.3
31 1.04 1.3
32 1.03 1.2
33 1.05 1.4
34 1.08 2.2
35 1.17 2.9
36 1.11 3.1
37 1.11 3.5
38 1.11 3.6
39 1.11 4.4
40 1.21 4.1
41 1.31 5.1
42 1.37 5.8
43 1.37 5.9
44 1.26 5.4
45 1.23 5.5
46 1.17 4.8
47 1.06 3.2
48 0.95 2.7
49 0.92 2.1
50 0.92 1.9
51 0.90 0.6
52 0.93 0.7
53 0.93 -0.2
54 0.97 -1.0
55 0.96 -1.7
56 0.99 -0.7
57 0.98 -1.0
58 0.96 -0.9
59 1.00 0.0
60 0.99 0.3
61 1.03 0.8
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Inflatie
0.93263 0.04866
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-0.169961 -0.040229 0.001375 0.044103 0.155116
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.932634 0.015581 59.858 < 2e-16 ***
Inflatie 0.048664 0.005667 8.587 5.61e-12 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 0.072 on 59 degrees of freedom
Multiple R-squared: 0.5555, Adjusted R-squared: 0.548
F-statistic: 73.73 on 1 and 59 DF, p-value: 5.612e-12
> 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.47774612 0.955492249 0.5222538753
[2,] 0.47401729 0.948034584 0.5259827078
[3,] 0.49104082 0.982081642 0.5089591789
[4,] 0.37036301 0.740726026 0.6296369870
[5,] 0.26176750 0.523535008 0.7382324959
[6,] 0.72210794 0.555784124 0.2778920618
[7,] 0.70950486 0.580990286 0.2904951428
[8,] 0.65795240 0.684095197 0.3420475983
[9,] 0.59202970 0.815940594 0.4079702969
[10,] 0.51743383 0.965132338 0.4825661690
[11,] 0.51499464 0.970010727 0.4850053636
[12,] 0.46582039 0.931640784 0.5341796082
[13,] 0.39528071 0.790561423 0.6047192883
[14,] 0.35656558 0.713131153 0.6434344233
[15,] 0.32716464 0.654329284 0.6728353580
[16,] 0.30332459 0.606649174 0.6966754131
[17,] 0.25912850 0.518256999 0.7408715006
[18,] 0.20931191 0.418623812 0.7906880941
[19,] 0.16823809 0.336476176 0.8317619119
[20,] 0.13625049 0.272500988 0.8637495058
[21,] 0.13063799 0.261275983 0.8693620086
[22,] 0.11564721 0.231294418 0.8843527910
[23,] 0.09509703 0.190194057 0.9049029717
[24,] 0.07652000 0.153040000 0.9234800001
[25,] 0.06584785 0.131695706 0.9341521469
[26,] 0.05461257 0.109225137 0.9453874315
[27,] 0.04813259 0.096265189 0.9518674055
[28,] 0.03713870 0.074277407 0.9628612964
[29,] 0.03021400 0.060428004 0.9697859980
[30,] 0.02633298 0.052665961 0.9736670194
[31,] 0.05785241 0.115704813 0.9421475937
[32,] 0.04716500 0.094330006 0.9528349969
[33,] 0.03485941 0.069718826 0.9651405870
[34,] 0.02467804 0.049356087 0.9753219565
[35,] 0.02005351 0.040107012 0.9799464938
[36,] 0.02217838 0.044356759 0.9778216204
[37,] 0.03903420 0.078068404 0.9609657982
[38,] 0.08471456 0.169429128 0.9152854361
[39,] 0.23237442 0.464748840 0.7676255802
[40,] 0.32076122 0.641522435 0.6792387825
[41,] 0.51633332 0.967333363 0.4836666817
[42,] 0.87223667 0.255526667 0.1277633335
[43,] 0.97391658 0.052166831 0.0260834156
[44,] 0.96606054 0.067878912 0.0339394560
[45,] 0.95117752 0.097644966 0.0488224832
[46,] 0.93634601 0.127307988 0.0636539942
[47,] 0.97347359 0.053052816 0.0265264079
[48,] 0.99150086 0.016998280 0.0084991398
[49,] 0.99981282 0.000374352 0.0001871760
[50,] 0.99926270 0.001474606 0.0007373029
[51,] 0.99701260 0.005974793 0.0029873966
[52,] 0.98904259 0.021914813 0.0109574066
> postscript(file="/var/www/html/freestat/rcomp/tmp/1dvpg1292931529.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/freestat/rcomp/tmp/2dvpg1292931529.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/freestat/rcomp/tmp/3dvpg1292931529.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/freestat/rcomp/tmp/464o11292931529.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/freestat/rcomp/tmp/564o11292931529.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 = 61
Frequency = 1
1 2 3 4 5
-0.1699612823 -0.1645604137 -0.1388922993 -0.0694267908 -0.0745604137
6 7 8 9 10
-0.0340259222 -0.0040259222 -0.0137586764 0.0013749464 0.0503059635
11 12 13 14 15
-0.0045604137 -0.0688922993 -0.0588922993 -0.0488922993 0.0003059635
16 17 18 19 20
0.0008404549 -0.0088922993 0.0057068321 0.0105732092 0.0154395863
21 22 23 24 25
-0.0050949051 -0.0353621509 -0.0399612823 -0.0448276594 -0.0753621509
26 27 28 29 30
-0.0602285280 -0.0402285280 -0.0102285280 0.0141033576 0.0241033576
31 32 33 34 35
0.0441033576 0.0389697348 0.0492369805 0.0403059635 0.0962413236
36 37 38 39 40
0.0265085693 0.0070430608 0.0021766836 -0.0367543334 0.0778447980
41 42 43 44 45
0.1291810267 0.1551163868 0.1502500096 0.0645818953 0.0297155182
46 47 48 49 50
0.0037801581 -0.0283578078 -0.1140259222 -0.1148276594 -0.1050949051
51 52 53 54 55
-0.0618320025 -0.0366983796 0.0070990146 0.0860300316 0.1100946715
56 57 58 59 60
0.0914309002 0.0960300316 0.0711636545 0.0673662603 0.0427671289
61
0.0584352433
> postscript(file="/var/www/html/freestat/rcomp/tmp/664o11292931529.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 = 61
Frequency = 1
lag(myerror, k = 1) myerror
0 -0.1699612823 NA
1 -0.1645604137 -0.1699612823
2 -0.1388922993 -0.1645604137
3 -0.0694267908 -0.1388922993
4 -0.0745604137 -0.0694267908
5 -0.0340259222 -0.0745604137
6 -0.0040259222 -0.0340259222
7 -0.0137586764 -0.0040259222
8 0.0013749464 -0.0137586764
9 0.0503059635 0.0013749464
10 -0.0045604137 0.0503059635
11 -0.0688922993 -0.0045604137
12 -0.0588922993 -0.0688922993
13 -0.0488922993 -0.0588922993
14 0.0003059635 -0.0488922993
15 0.0008404549 0.0003059635
16 -0.0088922993 0.0008404549
17 0.0057068321 -0.0088922993
18 0.0105732092 0.0057068321
19 0.0154395863 0.0105732092
20 -0.0050949051 0.0154395863
21 -0.0353621509 -0.0050949051
22 -0.0399612823 -0.0353621509
23 -0.0448276594 -0.0399612823
24 -0.0753621509 -0.0448276594
25 -0.0602285280 -0.0753621509
26 -0.0402285280 -0.0602285280
27 -0.0102285280 -0.0402285280
28 0.0141033576 -0.0102285280
29 0.0241033576 0.0141033576
30 0.0441033576 0.0241033576
31 0.0389697348 0.0441033576
32 0.0492369805 0.0389697348
33 0.0403059635 0.0492369805
34 0.0962413236 0.0403059635
35 0.0265085693 0.0962413236
36 0.0070430608 0.0265085693
37 0.0021766836 0.0070430608
38 -0.0367543334 0.0021766836
39 0.0778447980 -0.0367543334
40 0.1291810267 0.0778447980
41 0.1551163868 0.1291810267
42 0.1502500096 0.1551163868
43 0.0645818953 0.1502500096
44 0.0297155182 0.0645818953
45 0.0037801581 0.0297155182
46 -0.0283578078 0.0037801581
47 -0.1140259222 -0.0283578078
48 -0.1148276594 -0.1140259222
49 -0.1050949051 -0.1148276594
50 -0.0618320025 -0.1050949051
51 -0.0366983796 -0.0618320025
52 0.0070990146 -0.0366983796
53 0.0860300316 0.0070990146
54 0.1100946715 0.0860300316
55 0.0914309002 0.1100946715
56 0.0960300316 0.0914309002
57 0.0711636545 0.0960300316
58 0.0673662603 0.0711636545
59 0.0427671289 0.0673662603
60 0.0584352433 0.0427671289
61 NA 0.0584352433
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -0.1645604137 -0.1699612823
[2,] -0.1388922993 -0.1645604137
[3,] -0.0694267908 -0.1388922993
[4,] -0.0745604137 -0.0694267908
[5,] -0.0340259222 -0.0745604137
[6,] -0.0040259222 -0.0340259222
[7,] -0.0137586764 -0.0040259222
[8,] 0.0013749464 -0.0137586764
[9,] 0.0503059635 0.0013749464
[10,] -0.0045604137 0.0503059635
[11,] -0.0688922993 -0.0045604137
[12,] -0.0588922993 -0.0688922993
[13,] -0.0488922993 -0.0588922993
[14,] 0.0003059635 -0.0488922993
[15,] 0.0008404549 0.0003059635
[16,] -0.0088922993 0.0008404549
[17,] 0.0057068321 -0.0088922993
[18,] 0.0105732092 0.0057068321
[19,] 0.0154395863 0.0105732092
[20,] -0.0050949051 0.0154395863
[21,] -0.0353621509 -0.0050949051
[22,] -0.0399612823 -0.0353621509
[23,] -0.0448276594 -0.0399612823
[24,] -0.0753621509 -0.0448276594
[25,] -0.0602285280 -0.0753621509
[26,] -0.0402285280 -0.0602285280
[27,] -0.0102285280 -0.0402285280
[28,] 0.0141033576 -0.0102285280
[29,] 0.0241033576 0.0141033576
[30,] 0.0441033576 0.0241033576
[31,] 0.0389697348 0.0441033576
[32,] 0.0492369805 0.0389697348
[33,] 0.0403059635 0.0492369805
[34,] 0.0962413236 0.0403059635
[35,] 0.0265085693 0.0962413236
[36,] 0.0070430608 0.0265085693
[37,] 0.0021766836 0.0070430608
[38,] -0.0367543334 0.0021766836
[39,] 0.0778447980 -0.0367543334
[40,] 0.1291810267 0.0778447980
[41,] 0.1551163868 0.1291810267
[42,] 0.1502500096 0.1551163868
[43,] 0.0645818953 0.1502500096
[44,] 0.0297155182 0.0645818953
[45,] 0.0037801581 0.0297155182
[46,] -0.0283578078 0.0037801581
[47,] -0.1140259222 -0.0283578078
[48,] -0.1148276594 -0.1140259222
[49,] -0.1050949051 -0.1148276594
[50,] -0.0618320025 -0.1050949051
[51,] -0.0366983796 -0.0618320025
[52,] 0.0070990146 -0.0366983796
[53,] 0.0860300316 0.0070990146
[54,] 0.1100946715 0.0860300316
[55,] 0.0914309002 0.1100946715
[56,] 0.0960300316 0.0914309002
[57,] 0.0711636545 0.0960300316
[58,] 0.0673662603 0.0711636545
[59,] 0.0427671289 0.0673662603
[60,] 0.0584352433 0.0427671289
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -0.1645604137 -0.1699612823
2 -0.1388922993 -0.1645604137
3 -0.0694267908 -0.1388922993
4 -0.0745604137 -0.0694267908
5 -0.0340259222 -0.0745604137
6 -0.0040259222 -0.0340259222
7 -0.0137586764 -0.0040259222
8 0.0013749464 -0.0137586764
9 0.0503059635 0.0013749464
10 -0.0045604137 0.0503059635
11 -0.0688922993 -0.0045604137
12 -0.0588922993 -0.0688922993
13 -0.0488922993 -0.0588922993
14 0.0003059635 -0.0488922993
15 0.0008404549 0.0003059635
16 -0.0088922993 0.0008404549
17 0.0057068321 -0.0088922993
18 0.0105732092 0.0057068321
19 0.0154395863 0.0105732092
20 -0.0050949051 0.0154395863
21 -0.0353621509 -0.0050949051
22 -0.0399612823 -0.0353621509
23 -0.0448276594 -0.0399612823
24 -0.0753621509 -0.0448276594
25 -0.0602285280 -0.0753621509
26 -0.0402285280 -0.0602285280
27 -0.0102285280 -0.0402285280
28 0.0141033576 -0.0102285280
29 0.0241033576 0.0141033576
30 0.0441033576 0.0241033576
31 0.0389697348 0.0441033576
32 0.0492369805 0.0389697348
33 0.0403059635 0.0492369805
34 0.0962413236 0.0403059635
35 0.0265085693 0.0962413236
36 0.0070430608 0.0265085693
37 0.0021766836 0.0070430608
38 -0.0367543334 0.0021766836
39 0.0778447980 -0.0367543334
40 0.1291810267 0.0778447980
41 0.1551163868 0.1291810267
42 0.1502500096 0.1551163868
43 0.0645818953 0.1502500096
44 0.0297155182 0.0645818953
45 0.0037801581 0.0297155182
46 -0.0283578078 0.0037801581
47 -0.1140259222 -0.0283578078
48 -0.1148276594 -0.1140259222
49 -0.1050949051 -0.1148276594
50 -0.0618320025 -0.1050949051
51 -0.0366983796 -0.0618320025
52 0.0070990146 -0.0366983796
53 0.0860300316 0.0070990146
54 0.1100946715 0.0860300316
55 0.0914309002 0.1100946715
56 0.0960300316 0.0914309002
57 0.0711636545 0.0960300316
58 0.0673662603 0.0711636545
59 0.0427671289 0.0673662603
60 0.0584352433 0.0427671289
> 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/7ye641292931529.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/freestat/rcomp/tmp/8ye641292931529.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/freestat/rcomp/tmp/9r5571292931529.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/freestat/rcomp/tmp/10r5571292931529.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/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/11u5lu1292931529.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/12g6211292931529.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/13m7hu1292931529.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/14xyyf1292931529.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/151zx31292931529.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/16mzd91292931529.tab")
+ }
>
> try(system("convert tmp/1dvpg1292931529.ps tmp/1dvpg1292931529.png",intern=TRUE))
character(0)
> try(system("convert tmp/2dvpg1292931529.ps tmp/2dvpg1292931529.png",intern=TRUE))
character(0)
> try(system("convert tmp/3dvpg1292931529.ps tmp/3dvpg1292931529.png",intern=TRUE))
character(0)
> try(system("convert tmp/464o11292931529.ps tmp/464o11292931529.png",intern=TRUE))
character(0)
> try(system("convert tmp/564o11292931529.ps tmp/564o11292931529.png",intern=TRUE))
character(0)
> try(system("convert tmp/664o11292931529.ps tmp/664o11292931529.png",intern=TRUE))
character(0)
> try(system("convert tmp/7ye641292931529.ps tmp/7ye641292931529.png",intern=TRUE))
character(0)
> try(system("convert tmp/8ye641292931529.ps tmp/8ye641292931529.png",intern=TRUE))
character(0)
> try(system("convert tmp/9r5571292931529.ps tmp/9r5571292931529.png",intern=TRUE))
character(0)
> try(system("convert tmp/10r5571292931529.ps tmp/10r5571292931529.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
3.868 2.501 4.193