R version 2.13.0 (2011-04-13)
Copyright (C) 2011 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: i486-pc-linux-gnu (32-bit)
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(4.1,24.3,1.7,19,8,37.2,5,27.3,6,21.5,4.8,19.2,3.8,16.8,2.7,14.9,1,18.2,8.4,34.8,6.1,29.6,4.8,25.3,2.2,17.5,0.6,13.7,2.8,17.9,7.4,24.8,6.3,25.3,2.3,21.7,1.1,13.8,3.4,17.2,6.1,26.7,2.9,17.9,1.9,15.8,0.6,16.3,7.2,26.8,1.6,17.8,2.5,17.2,3.5,18.3,4,16.9,0.9,11.9,1.7,13.8,8.9,27.9,5.2,21.4,3.6,18.6,0.7,12.6,1.4,14.2,3.7,19.6,4.8,18.9,5.6,26.4,6.2,31.1,1.4,16.2,1.8,18.9,8.6,35.8,7.2,24.2,2.7,18.2,2.9,19.6,3.6,22.8,1.7,12,0.5,9,0.4,11,7.4,34.3,6.2,27.3,5.8,24.8,4.1,21,3.6,17.2,8.4,30,2.8,14,9,38.9,2.9,14.1,4.1,19.9),dim=c(2,60),dimnames=list(c('afstand','schadebedrag'),1:60))
> y <- array(NA,dim=c(2,60),dimnames=list(c('afstand','schadebedrag'),1:60))
> 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
> 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
afstand schadebedrag
1 4.1 24.3
2 1.7 19.0
3 8.0 37.2
4 5.0 27.3
5 6.0 21.5
6 4.8 19.2
7 3.8 16.8
8 2.7 14.9
9 1.0 18.2
10 8.4 34.8
11 6.1 29.6
12 4.8 25.3
13 2.2 17.5
14 0.6 13.7
15 2.8 17.9
16 7.4 24.8
17 6.3 25.3
18 2.3 21.7
19 1.1 13.8
20 3.4 17.2
21 6.1 26.7
22 2.9 17.9
23 1.9 15.8
24 0.6 16.3
25 7.2 26.8
26 1.6 17.8
27 2.5 17.2
28 3.5 18.3
29 4.0 16.9
30 0.9 11.9
31 1.7 13.8
32 8.9 27.9
33 5.2 21.4
34 3.6 18.6
35 0.7 12.6
36 1.4 14.2
37 3.7 19.6
38 4.8 18.9
39 5.6 26.4
40 6.2 31.1
41 1.4 16.2
42 1.8 18.9
43 8.6 35.8
44 7.2 24.2
45 2.7 18.2
46 2.9 19.6
47 3.6 22.8
48 1.7 12.0
49 0.5 9.0
50 0.4 11.0
51 7.4 34.3
52 6.2 27.3
53 5.8 24.8
54 4.1 21.0
55 3.6 17.2
56 8.4 30.0
57 2.8 14.0
58 9.0 38.9
59 2.9 14.1
60 4.1 19.9
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) schadebedrag
-2.7160 0.3205
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-2.1164 -0.7066 -0.1323 0.6818 2.6751
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -2.71600 0.45652 -5.949 1.65e-07 ***
schadebedrag 0.32046 0.02068 15.493 < 2e-16 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 1.094 on 58 degrees of freedom
Multiple R-squared: 0.8054, Adjusted R-squared: 0.802
F-statistic: 240 on 1 and 58 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.8947777 0.21044456 0.10522228
[2,] 0.8996085 0.20078296 0.10039148
[3,] 0.8514098 0.29718030 0.14859015
[4,] 0.7729483 0.45410341 0.22705171
[5,] 0.9333375 0.13332492 0.06666246
[6,] 0.9118209 0.17635814 0.08817907
[7,] 0.8708014 0.25839729 0.12919865
[8,] 0.8200902 0.35981962 0.17990981
[9,] 0.7774995 0.44500110 0.22250055
[10,] 0.7685787 0.46284270 0.23142135
[11,] 0.6952907 0.60941857 0.30470929
[12,] 0.8876957 0.22460868 0.11230434
[13,] 0.8775094 0.24498112 0.12249056
[14,] 0.9327018 0.13459639 0.06729819
[15,] 0.9096493 0.18070140 0.09035070
[16,] 0.8865025 0.22699498 0.11349749
[17,] 0.8488755 0.30224909 0.15112455
[18,] 0.7983648 0.40327039 0.20163519
[19,] 0.7472373 0.50552530 0.25276265
[20,] 0.8435490 0.31290193 0.15645096
[21,] 0.8652091 0.26958189 0.13479094
[22,] 0.8860226 0.22795488 0.11397744
[23,] 0.8498024 0.30039520 0.15019760
[24,] 0.8089601 0.38207987 0.19103994
[25,] 0.8304019 0.33919622 0.16959811
[26,] 0.7817349 0.43653026 0.21826513
[27,] 0.7234066 0.55318682 0.27659341
[28,] 0.9382458 0.12350835 0.06175418
[29,] 0.9363628 0.12727447 0.06363724
[30,] 0.9109320 0.17813600 0.08906800
[31,] 0.8929446 0.21411086 0.10705543
[32,] 0.8650984 0.26980315 0.13490158
[33,] 0.8171720 0.36565599 0.18282799
[34,] 0.8513515 0.29729706 0.14864853
[35,] 0.7995156 0.40096875 0.20048437
[36,] 0.7932736 0.41345271 0.20672636
[37,] 0.8112184 0.37756324 0.18878162
[38,] 0.8987737 0.20245252 0.10122626
[39,] 0.8540006 0.29199876 0.14599938
[40,] 0.9662226 0.06755471 0.03377735
[41,] 0.9549755 0.09004895 0.04502448
[42,] 0.9531859 0.09362824 0.04681412
[43,] 0.9704201 0.05915973 0.02957987
[44,] 0.9481625 0.10367502 0.05183751
[45,] 0.9208692 0.15826166 0.07913083
[46,] 0.9661961 0.06760784 0.03380392
[47,] 0.9637668 0.07246647 0.03623323
[48,] 0.9274124 0.14517529 0.07258764
[49,] 0.8606609 0.27867821 0.13933910
[50,] 0.8039632 0.39207359 0.19603680
[51,] 0.6581968 0.68360641 0.34180321
> postscript(file="/var/wessaorg/rcomp/tmp/1j3sj1321356232.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/wessaorg/rcomp/tmp/2qnyh1321356232.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/wessaorg/rcomp/tmp/32e5y1321356232.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/wessaorg/rcomp/tmp/4j1sh1321356232.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/wessaorg/rcomp/tmp/5abc91321356232.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 = 60
Frequency = 1
1 2 3 4 5 6
-0.971269483 -1.672811025 -1.205253278 -1.032661063 1.826029325 1.363096203
7 8 9 10 11 12
1.132209467 0.641090801 -2.116439937 -0.036140014 -0.669727942 -0.591733343
13 14 15 16 17 18
-0.692115235 -1.074352567 -0.220300779 2.168498587 0.908266657 -1.938063447
19 20 21 22 23 24
-0.606398953 0.604023923 0.259617253 -0.120300779 -0.447326673 -1.907558603
25 26 27 28 29 30
1.327570867 -1.388254393 -0.295976077 0.351513677 1.300163081 -0.197517619
31 32 33 34 35 36
-0.006398953 2.675060621 1.058075711 0.355374519 -0.621842321 -0.434584497
37 38 39 40 41 42
0.134910659 1.459235361 -0.144243589 -1.050423732 -1.075512217 -1.540764639
43 44 45 46 47 48
-0.156603874 2.160776903 -0.416439937 -0.665089341 -0.990573693 0.570435995
49 50 51 52 53 54
0.331827576 -0.409100144 -0.875908084 0.167338937 0.568498587 0.086261255
55 56 57 58 59 60
0.804023923 1.502086514 1.029508275 -0.750041840 1.097461889 0.438771501
> postscript(file="/var/wessaorg/rcomp/tmp/6iflc1321356232.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 = 60
Frequency = 1
lag(myerror, k = 1) myerror
0 -0.971269483 NA
1 -1.672811025 -0.971269483
2 -1.205253278 -1.672811025
3 -1.032661063 -1.205253278
4 1.826029325 -1.032661063
5 1.363096203 1.826029325
6 1.132209467 1.363096203
7 0.641090801 1.132209467
8 -2.116439937 0.641090801
9 -0.036140014 -2.116439937
10 -0.669727942 -0.036140014
11 -0.591733343 -0.669727942
12 -0.692115235 -0.591733343
13 -1.074352567 -0.692115235
14 -0.220300779 -1.074352567
15 2.168498587 -0.220300779
16 0.908266657 2.168498587
17 -1.938063447 0.908266657
18 -0.606398953 -1.938063447
19 0.604023923 -0.606398953
20 0.259617253 0.604023923
21 -0.120300779 0.259617253
22 -0.447326673 -0.120300779
23 -1.907558603 -0.447326673
24 1.327570867 -1.907558603
25 -1.388254393 1.327570867
26 -0.295976077 -1.388254393
27 0.351513677 -0.295976077
28 1.300163081 0.351513677
29 -0.197517619 1.300163081
30 -0.006398953 -0.197517619
31 2.675060621 -0.006398953
32 1.058075711 2.675060621
33 0.355374519 1.058075711
34 -0.621842321 0.355374519
35 -0.434584497 -0.621842321
36 0.134910659 -0.434584497
37 1.459235361 0.134910659
38 -0.144243589 1.459235361
39 -1.050423732 -0.144243589
40 -1.075512217 -1.050423732
41 -1.540764639 -1.075512217
42 -0.156603874 -1.540764639
43 2.160776903 -0.156603874
44 -0.416439937 2.160776903
45 -0.665089341 -0.416439937
46 -0.990573693 -0.665089341
47 0.570435995 -0.990573693
48 0.331827576 0.570435995
49 -0.409100144 0.331827576
50 -0.875908084 -0.409100144
51 0.167338937 -0.875908084
52 0.568498587 0.167338937
53 0.086261255 0.568498587
54 0.804023923 0.086261255
55 1.502086514 0.804023923
56 1.029508275 1.502086514
57 -0.750041840 1.029508275
58 1.097461889 -0.750041840
59 0.438771501 1.097461889
60 NA 0.438771501
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -1.672811025 -0.971269483
[2,] -1.205253278 -1.672811025
[3,] -1.032661063 -1.205253278
[4,] 1.826029325 -1.032661063
[5,] 1.363096203 1.826029325
[6,] 1.132209467 1.363096203
[7,] 0.641090801 1.132209467
[8,] -2.116439937 0.641090801
[9,] -0.036140014 -2.116439937
[10,] -0.669727942 -0.036140014
[11,] -0.591733343 -0.669727942
[12,] -0.692115235 -0.591733343
[13,] -1.074352567 -0.692115235
[14,] -0.220300779 -1.074352567
[15,] 2.168498587 -0.220300779
[16,] 0.908266657 2.168498587
[17,] -1.938063447 0.908266657
[18,] -0.606398953 -1.938063447
[19,] 0.604023923 -0.606398953
[20,] 0.259617253 0.604023923
[21,] -0.120300779 0.259617253
[22,] -0.447326673 -0.120300779
[23,] -1.907558603 -0.447326673
[24,] 1.327570867 -1.907558603
[25,] -1.388254393 1.327570867
[26,] -0.295976077 -1.388254393
[27,] 0.351513677 -0.295976077
[28,] 1.300163081 0.351513677
[29,] -0.197517619 1.300163081
[30,] -0.006398953 -0.197517619
[31,] 2.675060621 -0.006398953
[32,] 1.058075711 2.675060621
[33,] 0.355374519 1.058075711
[34,] -0.621842321 0.355374519
[35,] -0.434584497 -0.621842321
[36,] 0.134910659 -0.434584497
[37,] 1.459235361 0.134910659
[38,] -0.144243589 1.459235361
[39,] -1.050423732 -0.144243589
[40,] -1.075512217 -1.050423732
[41,] -1.540764639 -1.075512217
[42,] -0.156603874 -1.540764639
[43,] 2.160776903 -0.156603874
[44,] -0.416439937 2.160776903
[45,] -0.665089341 -0.416439937
[46,] -0.990573693 -0.665089341
[47,] 0.570435995 -0.990573693
[48,] 0.331827576 0.570435995
[49,] -0.409100144 0.331827576
[50,] -0.875908084 -0.409100144
[51,] 0.167338937 -0.875908084
[52,] 0.568498587 0.167338937
[53,] 0.086261255 0.568498587
[54,] 0.804023923 0.086261255
[55,] 1.502086514 0.804023923
[56,] 1.029508275 1.502086514
[57,] -0.750041840 1.029508275
[58,] 1.097461889 -0.750041840
[59,] 0.438771501 1.097461889
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -1.672811025 -0.971269483
2 -1.205253278 -1.672811025
3 -1.032661063 -1.205253278
4 1.826029325 -1.032661063
5 1.363096203 1.826029325
6 1.132209467 1.363096203
7 0.641090801 1.132209467
8 -2.116439937 0.641090801
9 -0.036140014 -2.116439937
10 -0.669727942 -0.036140014
11 -0.591733343 -0.669727942
12 -0.692115235 -0.591733343
13 -1.074352567 -0.692115235
14 -0.220300779 -1.074352567
15 2.168498587 -0.220300779
16 0.908266657 2.168498587
17 -1.938063447 0.908266657
18 -0.606398953 -1.938063447
19 0.604023923 -0.606398953
20 0.259617253 0.604023923
21 -0.120300779 0.259617253
22 -0.447326673 -0.120300779
23 -1.907558603 -0.447326673
24 1.327570867 -1.907558603
25 -1.388254393 1.327570867
26 -0.295976077 -1.388254393
27 0.351513677 -0.295976077
28 1.300163081 0.351513677
29 -0.197517619 1.300163081
30 -0.006398953 -0.197517619
31 2.675060621 -0.006398953
32 1.058075711 2.675060621
33 0.355374519 1.058075711
34 -0.621842321 0.355374519
35 -0.434584497 -0.621842321
36 0.134910659 -0.434584497
37 1.459235361 0.134910659
38 -0.144243589 1.459235361
39 -1.050423732 -0.144243589
40 -1.075512217 -1.050423732
41 -1.540764639 -1.075512217
42 -0.156603874 -1.540764639
43 2.160776903 -0.156603874
44 -0.416439937 2.160776903
45 -0.665089341 -0.416439937
46 -0.990573693 -0.665089341
47 0.570435995 -0.990573693
48 0.331827576 0.570435995
49 -0.409100144 0.331827576
50 -0.875908084 -0.409100144
51 0.167338937 -0.875908084
52 0.568498587 0.167338937
53 0.086261255 0.568498587
54 0.804023923 0.086261255
55 1.502086514 0.804023923
56 1.029508275 1.502086514
57 -0.750041840 1.029508275
58 1.097461889 -0.750041840
59 0.438771501 1.097461889
> 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/wessaorg/rcomp/tmp/7u5co1321356232.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/wessaorg/rcomp/tmp/8y2ki1321356232.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/wessaorg/rcomp/tmp/96d2w1321356232.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/wessaorg/rcomp/tmp/1000d21321356232.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/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/wessaorg/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/wessaorg/rcomp/tmp/11fi1y1321356232.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/wessaorg/rcomp/tmp/12kugv1321356233.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/wessaorg/rcomp/tmp/135t4o1321356233.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/wessaorg/rcomp/tmp/148p021321356233.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/wessaorg/rcomp/tmp/15udrt1321356233.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/wessaorg/rcomp/tmp/16fbcl1321356233.tab")
+ }
>
> try(system("convert tmp/1j3sj1321356232.ps tmp/1j3sj1321356232.png",intern=TRUE))
character(0)
> try(system("convert tmp/2qnyh1321356232.ps tmp/2qnyh1321356232.png",intern=TRUE))
character(0)
> try(system("convert tmp/32e5y1321356232.ps tmp/32e5y1321356232.png",intern=TRUE))
character(0)
> try(system("convert tmp/4j1sh1321356232.ps tmp/4j1sh1321356232.png",intern=TRUE))
character(0)
> try(system("convert tmp/5abc91321356232.ps tmp/5abc91321356232.png",intern=TRUE))
character(0)
> try(system("convert tmp/6iflc1321356232.ps tmp/6iflc1321356232.png",intern=TRUE))
character(0)
> try(system("convert tmp/7u5co1321356232.ps tmp/7u5co1321356232.png",intern=TRUE))
character(0)
> try(system("convert tmp/8y2ki1321356232.ps tmp/8y2ki1321356232.png",intern=TRUE))
character(0)
> try(system("convert tmp/96d2w1321356232.ps tmp/96d2w1321356232.png",intern=TRUE))
character(0)
> try(system("convert tmp/1000d21321356232.ps tmp/1000d21321356232.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
3.087 0.474 3.609