R version 2.9.0 (2009-04-17)
Copyright (C) 2009 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> x <- array(list(0.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 = '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 t
1 0.86 2.0 1
2 0.88 2.3 2
3 0.93 2.8 3
4 0.98 2.4 4
5 0.97 2.3 5
6 1.03 2.7 6
7 1.06 2.7 7
8 1.06 2.9 8
9 1.08 3.0 9
10 1.09 2.2 10
11 1.04 2.3 11
12 1.00 2.8 12
13 1.01 2.8 13
14 1.02 2.8 14
15 1.04 2.2 15
16 1.06 2.6 16
17 1.06 2.8 17
18 1.06 2.5 18
19 1.06 2.4 19
20 1.06 2.3 20
21 1.02 1.9 21
22 0.98 1.7 22
23 0.99 2.0 23
24 0.99 2.1 24
25 0.94 1.7 25
26 0.96 1.8 26
27 0.98 1.8 27
28 1.01 1.8 28
29 1.01 1.3 29
30 1.02 1.3 30
31 1.04 1.3 31
32 1.03 1.2 32
33 1.05 1.4 33
34 1.08 2.2 34
35 1.17 2.9 35
36 1.11 3.1 36
37 1.11 3.5 37
38 1.11 3.6 38
39 1.11 4.4 39
40 1.21 4.1 40
41 1.31 5.1 41
42 1.37 5.8 42
43 1.37 5.9 43
44 1.26 5.4 44
45 1.23 5.5 45
46 1.17 4.8 46
47 1.06 3.2 47
48 0.95 2.7 48
49 0.92 2.1 49
50 0.92 1.9 50
51 0.90 0.6 51
52 0.93 0.7 52
53 0.93 -0.2 53
54 0.97 -1.0 54
55 0.96 -1.7 55
56 0.99 -0.7 56
57 0.98 -1.0 57
58 0.96 -0.9 58
59 1.00 0.0 59
60 0.99 0.3 60
61 1.03 0.8 61
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Inflatie t
0.850881 0.055171 0.002172
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-0.15410 -0.02883 0.01563 0.03879 0.10791
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.8508813 0.0222060 38.318 < 2e-16 ***
Inflatie 0.0551713 0.0050847 10.850 1.38e-15 ***
t 0.0021719 0.0004698 4.623 2.16e-05 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 0.06207 on 58 degrees of freedom
Multiple R-squared: 0.6752, Adjusted R-squared: 0.664
F-statistic: 60.29 on 2 and 58 DF, p-value: 6.867e-15
> 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.0366856739 0.0733713479 0.9633143261
[2,] 0.0089803640 0.0179607279 0.9910196360
[3,] 0.0068297999 0.0136595997 0.9931702001
[4,] 0.0040774720 0.0081549440 0.9959225280
[5,] 0.0016876213 0.0033752427 0.9983123787
[6,] 0.0137429942 0.0274859885 0.9862570058
[7,] 0.1942427142 0.3884854284 0.8057572858
[8,] 0.2903804436 0.5807608873 0.7096195564
[9,] 0.3007074739 0.6014149478 0.6992925261
[10,] 0.2253337398 0.4506674795 0.7746662602
[11,] 0.1655792366 0.3311584732 0.8344207634
[12,] 0.1259987362 0.2519974723 0.8740012638
[13,] 0.0882251535 0.1764503071 0.9117748465
[14,] 0.0599792935 0.1199585871 0.9400207065
[15,] 0.0397503326 0.0795006653 0.9602496674
[16,] 0.0273015141 0.0546030282 0.9726984859
[17,] 0.0219603749 0.0439207499 0.9780396251
[18,] 0.0196921550 0.0393843101 0.9803078450
[19,] 0.0189725699 0.0379451399 0.9810274301
[20,] 0.0218616206 0.0437232413 0.9781383794
[21,] 0.0201352963 0.0402705925 0.9798647037
[22,] 0.0148800775 0.0297601550 0.9851199225
[23,] 0.0093092173 0.0186184347 0.9906907827
[24,] 0.0074044566 0.0148089132 0.9925955434
[25,] 0.0054270245 0.0108540491 0.9945729755
[26,] 0.0042575863 0.0085151726 0.9957424137
[27,] 0.0028327315 0.0056654630 0.9971672685
[28,] 0.0017756026 0.0035512052 0.9982243974
[29,] 0.0009807972 0.0019615945 0.9990192028
[30,] 0.0007791525 0.0015583049 0.9992208475
[31,] 0.0007073369 0.0014146739 0.9992926631
[32,] 0.0006826560 0.0013653120 0.9993173440
[33,] 0.0005178868 0.0010357736 0.9994821132
[34,] 0.0006719990 0.0013439980 0.9993280010
[35,] 0.0004998277 0.0009996555 0.9995001723
[36,] 0.0010300365 0.0020600731 0.9989699635
[37,] 0.0040838093 0.0081676185 0.9959161907
[38,] 0.0288220898 0.0576441795 0.9711779102
[39,] 0.0734229208 0.1468458416 0.9265770792
[40,] 0.2279500185 0.4559000370 0.7720499815
[41,] 0.7822902988 0.4354194024 0.2177097012
[42,] 0.9988514938 0.0022970123 0.0011485062
[43,] 0.9998190196 0.0003619608 0.0001809804
[44,] 0.9997415891 0.0005168217 0.0002584109
[45,] 0.9994708578 0.0010582844 0.0005291422
[46,] 0.9988610815 0.0022778371 0.0011389185
[47,] 0.9961742992 0.0076514015 0.0038257008
[48,] 0.9989633405 0.0020733190 0.0010366595
[49,] 0.9979560446 0.0040879107 0.0020439554
[50,] 0.9897288741 0.0205422518 0.0102711259
> postscript(file="/var/www/html/rcomp/tmp/16dmf1292932173.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/26dmf1292932173.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/36dmf1292932173.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/4g53i1292932173.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/5g53i1292932173.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 6
-0.103395775 -0.102119071 -0.081876624 -0.011980021 -0.018634804 0.017124772
7 8 9 10 11 12
0.044952861 0.031746693 0.044057654 0.096022771 0.038333731 -0.031423822
13 14 15 16 17 18
-0.023595732 -0.015767643 0.035163217 0.030922792 0.017716625 0.032096099
19 20 21 22 23 24
0.035441317 0.038786534 0.018683137 -0.012454517 -0.021177813 -0.028866852
25 26 27 28 29 30
-0.058970249 -0.046659288 -0.028831199 -0.001003110 0.024410621 0.032238711
31 32 33 34 35 36
0.050066800 0.043412017 0.050205850 0.033896912 0.083105102 0.009898934
37 38 39 40 41 42
-0.014341490 -0.022030529 -0.068339468 0.046040007 0.088696812 0.107905002
43 44 45 46 47 48
0.100215963 0.015629694 -0.022059345 -0.045611357 -0.069509213 -0.154095482
49 50 51 52 53 54
-0.153164622 -0.144302276 -0.094751517 -0.072440556 -0.024958311 0.057006805
55 56 57 58 59 60
0.083454794 0.056111599 0.060491073 0.032802034 0.020975967 -0.007747329
61
0.002495118
> postscript(file="/var/www/html/rcomp/tmp/6g53i1292932173.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.103395775 NA
1 -0.102119071 -0.103395775
2 -0.081876624 -0.102119071
3 -0.011980021 -0.081876624
4 -0.018634804 -0.011980021
5 0.017124772 -0.018634804
6 0.044952861 0.017124772
7 0.031746693 0.044952861
8 0.044057654 0.031746693
9 0.096022771 0.044057654
10 0.038333731 0.096022771
11 -0.031423822 0.038333731
12 -0.023595732 -0.031423822
13 -0.015767643 -0.023595732
14 0.035163217 -0.015767643
15 0.030922792 0.035163217
16 0.017716625 0.030922792
17 0.032096099 0.017716625
18 0.035441317 0.032096099
19 0.038786534 0.035441317
20 0.018683137 0.038786534
21 -0.012454517 0.018683137
22 -0.021177813 -0.012454517
23 -0.028866852 -0.021177813
24 -0.058970249 -0.028866852
25 -0.046659288 -0.058970249
26 -0.028831199 -0.046659288
27 -0.001003110 -0.028831199
28 0.024410621 -0.001003110
29 0.032238711 0.024410621
30 0.050066800 0.032238711
31 0.043412017 0.050066800
32 0.050205850 0.043412017
33 0.033896912 0.050205850
34 0.083105102 0.033896912
35 0.009898934 0.083105102
36 -0.014341490 0.009898934
37 -0.022030529 -0.014341490
38 -0.068339468 -0.022030529
39 0.046040007 -0.068339468
40 0.088696812 0.046040007
41 0.107905002 0.088696812
42 0.100215963 0.107905002
43 0.015629694 0.100215963
44 -0.022059345 0.015629694
45 -0.045611357 -0.022059345
46 -0.069509213 -0.045611357
47 -0.154095482 -0.069509213
48 -0.153164622 -0.154095482
49 -0.144302276 -0.153164622
50 -0.094751517 -0.144302276
51 -0.072440556 -0.094751517
52 -0.024958311 -0.072440556
53 0.057006805 -0.024958311
54 0.083454794 0.057006805
55 0.056111599 0.083454794
56 0.060491073 0.056111599
57 0.032802034 0.060491073
58 0.020975967 0.032802034
59 -0.007747329 0.020975967
60 0.002495118 -0.007747329
61 NA 0.002495118
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -0.102119071 -0.103395775
[2,] -0.081876624 -0.102119071
[3,] -0.011980021 -0.081876624
[4,] -0.018634804 -0.011980021
[5,] 0.017124772 -0.018634804
[6,] 0.044952861 0.017124772
[7,] 0.031746693 0.044952861
[8,] 0.044057654 0.031746693
[9,] 0.096022771 0.044057654
[10,] 0.038333731 0.096022771
[11,] -0.031423822 0.038333731
[12,] -0.023595732 -0.031423822
[13,] -0.015767643 -0.023595732
[14,] 0.035163217 -0.015767643
[15,] 0.030922792 0.035163217
[16,] 0.017716625 0.030922792
[17,] 0.032096099 0.017716625
[18,] 0.035441317 0.032096099
[19,] 0.038786534 0.035441317
[20,] 0.018683137 0.038786534
[21,] -0.012454517 0.018683137
[22,] -0.021177813 -0.012454517
[23,] -0.028866852 -0.021177813
[24,] -0.058970249 -0.028866852
[25,] -0.046659288 -0.058970249
[26,] -0.028831199 -0.046659288
[27,] -0.001003110 -0.028831199
[28,] 0.024410621 -0.001003110
[29,] 0.032238711 0.024410621
[30,] 0.050066800 0.032238711
[31,] 0.043412017 0.050066800
[32,] 0.050205850 0.043412017
[33,] 0.033896912 0.050205850
[34,] 0.083105102 0.033896912
[35,] 0.009898934 0.083105102
[36,] -0.014341490 0.009898934
[37,] -0.022030529 -0.014341490
[38,] -0.068339468 -0.022030529
[39,] 0.046040007 -0.068339468
[40,] 0.088696812 0.046040007
[41,] 0.107905002 0.088696812
[42,] 0.100215963 0.107905002
[43,] 0.015629694 0.100215963
[44,] -0.022059345 0.015629694
[45,] -0.045611357 -0.022059345
[46,] -0.069509213 -0.045611357
[47,] -0.154095482 -0.069509213
[48,] -0.153164622 -0.154095482
[49,] -0.144302276 -0.153164622
[50,] -0.094751517 -0.144302276
[51,] -0.072440556 -0.094751517
[52,] -0.024958311 -0.072440556
[53,] 0.057006805 -0.024958311
[54,] 0.083454794 0.057006805
[55,] 0.056111599 0.083454794
[56,] 0.060491073 0.056111599
[57,] 0.032802034 0.060491073
[58,] 0.020975967 0.032802034
[59,] -0.007747329 0.020975967
[60,] 0.002495118 -0.007747329
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -0.102119071 -0.103395775
2 -0.081876624 -0.102119071
3 -0.011980021 -0.081876624
4 -0.018634804 -0.011980021
5 0.017124772 -0.018634804
6 0.044952861 0.017124772
7 0.031746693 0.044952861
8 0.044057654 0.031746693
9 0.096022771 0.044057654
10 0.038333731 0.096022771
11 -0.031423822 0.038333731
12 -0.023595732 -0.031423822
13 -0.015767643 -0.023595732
14 0.035163217 -0.015767643
15 0.030922792 0.035163217
16 0.017716625 0.030922792
17 0.032096099 0.017716625
18 0.035441317 0.032096099
19 0.038786534 0.035441317
20 0.018683137 0.038786534
21 -0.012454517 0.018683137
22 -0.021177813 -0.012454517
23 -0.028866852 -0.021177813
24 -0.058970249 -0.028866852
25 -0.046659288 -0.058970249
26 -0.028831199 -0.046659288
27 -0.001003110 -0.028831199
28 0.024410621 -0.001003110
29 0.032238711 0.024410621
30 0.050066800 0.032238711
31 0.043412017 0.050066800
32 0.050205850 0.043412017
33 0.033896912 0.050205850
34 0.083105102 0.033896912
35 0.009898934 0.083105102
36 -0.014341490 0.009898934
37 -0.022030529 -0.014341490
38 -0.068339468 -0.022030529
39 0.046040007 -0.068339468
40 0.088696812 0.046040007
41 0.107905002 0.088696812
42 0.100215963 0.107905002
43 0.015629694 0.100215963
44 -0.022059345 0.015629694
45 -0.045611357 -0.022059345
46 -0.069509213 -0.045611357
47 -0.154095482 -0.069509213
48 -0.153164622 -0.154095482
49 -0.144302276 -0.153164622
50 -0.094751517 -0.144302276
51 -0.072440556 -0.094751517
52 -0.024958311 -0.072440556
53 0.057006805 -0.024958311
54 0.083454794 0.057006805
55 0.056111599 0.083454794
56 0.060491073 0.056111599
57 0.032802034 0.060491073
58 0.020975967 0.032802034
59 -0.007747329 0.020975967
60 0.002495118 -0.007747329
> 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/7rekl1292932173.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/8knk51292932173.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/9knk51292932173.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/10knk51292932173.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/11gfhe1292932173.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/121xgk1292932173.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/13fpet1292932173.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/14qhve1292932173.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/15bhc21292932173.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/16p9ra1292932173.tab")
+ }
>
> try(system("convert tmp/16dmf1292932173.ps tmp/16dmf1292932173.png",intern=TRUE))
character(0)
> try(system("convert tmp/26dmf1292932173.ps tmp/26dmf1292932173.png",intern=TRUE))
character(0)
> try(system("convert tmp/36dmf1292932173.ps tmp/36dmf1292932173.png",intern=TRUE))
character(0)
> try(system("convert tmp/4g53i1292932173.ps tmp/4g53i1292932173.png",intern=TRUE))
character(0)
> try(system("convert tmp/5g53i1292932173.ps tmp/5g53i1292932173.png",intern=TRUE))
character(0)
> try(system("convert tmp/6g53i1292932173.ps tmp/6g53i1292932173.png",intern=TRUE))
character(0)
> try(system("convert tmp/7rekl1292932173.ps tmp/7rekl1292932173.png",intern=TRUE))
character(0)
> try(system("convert tmp/8knk51292932173.ps tmp/8knk51292932173.png",intern=TRUE))
character(0)
> try(system("convert tmp/9knk51292932173.ps tmp/9knk51292932173.png",intern=TRUE))
character(0)
> try(system("convert tmp/10knk51292932173.ps tmp/10knk51292932173.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
2.546 1.644 11.339