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(167.16,179.84,174.44,180.35,193.17,195.16,202.43,189.91,195.98,212.09,205.81,204.31,196.07,199.98,199.10,198.31,195.72,223.04,238.41,259.73,326.54,335.15,321.81,368.62,369.59,425.00,439.72,362.23,328.76,348.55,328.18,329.34,295.55,237.38,226.85,220.14,239.36,224.69,230.98,233.47,256.70,253.41,224.95,210.37,191.09,198.85,211.04,206.25,201.19,194.37,191.08,192.87,181.61,157.67,196.14,246.35,271.90),dim=c(1,57),dimnames=list(c('tarweprijs'),1:57))
> y <- array(NA,dim=c(1,57),dimnames=list(c('tarweprijs'),1:57))
> 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 = 'Include Monthly 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
tarweprijs M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11 t
1 167.16 1 0 0 0 0 0 0 0 0 0 0 1
2 179.84 0 1 0 0 0 0 0 0 0 0 0 2
3 174.44 0 0 1 0 0 0 0 0 0 0 0 3
4 180.35 0 0 0 1 0 0 0 0 0 0 0 4
5 193.17 0 0 0 0 1 0 0 0 0 0 0 5
6 195.16 0 0 0 0 0 1 0 0 0 0 0 6
7 202.43 0 0 0 0 0 0 1 0 0 0 0 7
8 189.91 0 0 0 0 0 0 0 1 0 0 0 8
9 195.98 0 0 0 0 0 0 0 0 1 0 0 9
10 212.09 0 0 0 0 0 0 0 0 0 1 0 10
11 205.81 0 0 0 0 0 0 0 0 0 0 1 11
12 204.31 0 0 0 0 0 0 0 0 0 0 0 12
13 196.07 1 0 0 0 0 0 0 0 0 0 0 13
14 199.98 0 1 0 0 0 0 0 0 0 0 0 14
15 199.10 0 0 1 0 0 0 0 0 0 0 0 15
16 198.31 0 0 0 1 0 0 0 0 0 0 0 16
17 195.72 0 0 0 0 1 0 0 0 0 0 0 17
18 223.04 0 0 0 0 0 1 0 0 0 0 0 18
19 238.41 0 0 0 0 0 0 1 0 0 0 0 19
20 259.73 0 0 0 0 0 0 0 1 0 0 0 20
21 326.54 0 0 0 0 0 0 0 0 1 0 0 21
22 335.15 0 0 0 0 0 0 0 0 0 1 0 22
23 321.81 0 0 0 0 0 0 0 0 0 0 1 23
24 368.62 0 0 0 0 0 0 0 0 0 0 0 24
25 369.59 1 0 0 0 0 0 0 0 0 0 0 25
26 425.00 0 1 0 0 0 0 0 0 0 0 0 26
27 439.72 0 0 1 0 0 0 0 0 0 0 0 27
28 362.23 0 0 0 1 0 0 0 0 0 0 0 28
29 328.76 0 0 0 0 1 0 0 0 0 0 0 29
30 348.55 0 0 0 0 0 1 0 0 0 0 0 30
31 328.18 0 0 0 0 0 0 1 0 0 0 0 31
32 329.34 0 0 0 0 0 0 0 1 0 0 0 32
33 295.55 0 0 0 0 0 0 0 0 1 0 0 33
34 237.38 0 0 0 0 0 0 0 0 0 1 0 34
35 226.85 0 0 0 0 0 0 0 0 0 0 1 35
36 220.14 0 0 0 0 0 0 0 0 0 0 0 36
37 239.36 1 0 0 0 0 0 0 0 0 0 0 37
38 224.69 0 1 0 0 0 0 0 0 0 0 0 38
39 230.98 0 0 1 0 0 0 0 0 0 0 0 39
40 233.47 0 0 0 1 0 0 0 0 0 0 0 40
41 256.70 0 0 0 0 1 0 0 0 0 0 0 41
42 253.41 0 0 0 0 0 1 0 0 0 0 0 42
43 224.95 0 0 0 0 0 0 1 0 0 0 0 43
44 210.37 0 0 0 0 0 0 0 1 0 0 0 44
45 191.09 0 0 0 0 0 0 0 0 1 0 0 45
46 198.85 0 0 0 0 0 0 0 0 0 1 0 46
47 211.04 0 0 0 0 0 0 0 0 0 0 1 47
48 206.25 0 0 0 0 0 0 0 0 0 0 0 48
49 201.19 1 0 0 0 0 0 0 0 0 0 0 49
50 194.37 0 1 0 0 0 0 0 0 0 0 0 50
51 191.08 0 0 1 0 0 0 0 0 0 0 0 51
52 192.87 0 0 0 1 0 0 0 0 0 0 0 52
53 181.61 0 0 0 0 1 0 0 0 0 0 0 53
54 157.67 0 0 0 0 0 1 0 0 0 0 0 54
55 196.14 0 0 0 0 0 0 1 0 0 0 0 55
56 246.35 0 0 0 0 0 0 0 1 0 0 0 56
57 271.90 0 0 0 0 0 0 0 0 1 0 0 57
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) M1 M2 M3 M4 M5
246.0707 -14.5295 -4.5528 -2.3901 -16.1334 -18.5127
M6 M7 M8 M9 M10 M11
-14.2640 -11.9333 -2.9406 6.0061 -3.7119 -8.3272
t
0.1253
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-80.90 -44.89 -31.52 16.34 192.66
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 246.0707 41.9485 5.866 5.31e-07 ***
M1 -14.5295 50.6724 -0.287 0.776
M2 -4.5528 50.6390 -0.090 0.929
M3 -2.3901 50.6130 -0.047 0.963
M4 -16.1334 50.5945 -0.319 0.751
M5 -18.5127 50.5833 -0.366 0.716
M6 -14.2640 50.5796 -0.282 0.779
M7 -11.9333 50.5833 -0.236 0.815
M8 -2.9406 50.5945 -0.058 0.954
M9 6.0061 50.6130 0.119 0.906
M10 -3.7119 53.3297 -0.070 0.945
M11 -8.3272 53.3191 -0.156 0.877
t 0.1253 0.6132 0.204 0.839
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 75.4 on 44 degrees of freedom
Multiple R-squared: 0.01324, Adjusted R-squared: -0.2559
F-statistic: 0.0492 on 12 and 44 DF, p-value: 1
> 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,] 2.287602e-04 0.0004575203 0.99977124
[2,] 4.431320e-04 0.0008862639 0.99955687
[3,] 9.808471e-05 0.0001961694 0.99990192
[4,] 5.235626e-05 0.0001047125 0.99994764
[5,] 1.369742e-03 0.0027394831 0.99863026
[6,] 6.625547e-02 0.1325109471 0.93374453
[7,] 1.141321e-01 0.2282642535 0.88586787
[8,] 1.200271e-01 0.2400541735 0.87997291
[9,] 2.320169e-01 0.4640338447 0.76798308
[10,] 2.988023e-01 0.5976046647 0.70119767
[11,] 5.833407e-01 0.8333186601 0.41665933
[12,] 8.910380e-01 0.2179239105 0.10896196
[13,] 8.949360e-01 0.2101280835 0.10506404
[14,] 8.595545e-01 0.2808910238 0.14044551
[15,] 8.868689e-01 0.2262621412 0.11313107
[16,] 9.001461e-01 0.1997078973 0.09985395
[17,] 9.047459e-01 0.1905081201 0.09525406
[18,] 9.133900e-01 0.1732199405 0.08660997
[19,] 9.451556e-01 0.1096887220 0.05484436
[20,] 9.474746e-01 0.1050507869 0.05252539
[21,] 9.465887e-01 0.1068225046 0.05341125
[22,] 9.250897e-01 0.1498205581 0.07491028
[23,] 8.963895e-01 0.2072210243 0.10361051
[24,] 8.427423e-01 0.3145153770 0.15725769
[25,] 7.453793e-01 0.5092413586 0.25462068
[26,] 6.635536e-01 0.6728927373 0.33644637
> postscript(file="/var/www/html/freestat/rcomp/tmp/16bvf1291062325.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/2z2ui1291062325.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/3z2ui1291062325.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/4z2ui1291062325.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/5rutl1291062325.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 = 57
Frequency = 1
1 2 3 4 5 6 7
-64.506571 -61.928571 -69.616571 -50.088571 -35.014571 -37.398571 -32.584571
8 9 10 11 12 13 14
-54.222571 -57.224571 -31.521929 -33.311929 -43.264429 -37.100286 -43.292286
15 16 17 18 19 20 21
-46.460286 -33.632286 -33.968286 -11.022286 1.891714 14.093714 71.831714
22 23 24 25 26 27 28
90.034357 81.184357 119.541857 134.916000 180.224000 192.656000 128.784000
29 30 31 32 33 34 35
97.568000 112.984000 90.158000 82.200000 39.338000 -9.239357 -15.279357
36 37 38 39 40 41 42
-30.441857 3.182286 -21.589714 -17.587714 -1.479714 24.004286 16.340286
43 44 45 46 47 48 49
-14.575714 -38.273714 -66.625714 -49.273071 -32.593071 -45.835571 -36.491429
50 51 52 53 54 55 56
-53.413429 -58.991429 -43.583429 -52.589429 -80.903429 -44.889429 -3.797429
57
12.680571
> postscript(file="/var/www/html/freestat/rcomp/tmp/6rutl1291062325.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 = 57
Frequency = 1
lag(myerror, k = 1) myerror
0 -64.506571 NA
1 -61.928571 -64.506571
2 -69.616571 -61.928571
3 -50.088571 -69.616571
4 -35.014571 -50.088571
5 -37.398571 -35.014571
6 -32.584571 -37.398571
7 -54.222571 -32.584571
8 -57.224571 -54.222571
9 -31.521929 -57.224571
10 -33.311929 -31.521929
11 -43.264429 -33.311929
12 -37.100286 -43.264429
13 -43.292286 -37.100286
14 -46.460286 -43.292286
15 -33.632286 -46.460286
16 -33.968286 -33.632286
17 -11.022286 -33.968286
18 1.891714 -11.022286
19 14.093714 1.891714
20 71.831714 14.093714
21 90.034357 71.831714
22 81.184357 90.034357
23 119.541857 81.184357
24 134.916000 119.541857
25 180.224000 134.916000
26 192.656000 180.224000
27 128.784000 192.656000
28 97.568000 128.784000
29 112.984000 97.568000
30 90.158000 112.984000
31 82.200000 90.158000
32 39.338000 82.200000
33 -9.239357 39.338000
34 -15.279357 -9.239357
35 -30.441857 -15.279357
36 3.182286 -30.441857
37 -21.589714 3.182286
38 -17.587714 -21.589714
39 -1.479714 -17.587714
40 24.004286 -1.479714
41 16.340286 24.004286
42 -14.575714 16.340286
43 -38.273714 -14.575714
44 -66.625714 -38.273714
45 -49.273071 -66.625714
46 -32.593071 -49.273071
47 -45.835571 -32.593071
48 -36.491429 -45.835571
49 -53.413429 -36.491429
50 -58.991429 -53.413429
51 -43.583429 -58.991429
52 -52.589429 -43.583429
53 -80.903429 -52.589429
54 -44.889429 -80.903429
55 -3.797429 -44.889429
56 12.680571 -3.797429
57 NA 12.680571
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -61.928571 -64.506571
[2,] -69.616571 -61.928571
[3,] -50.088571 -69.616571
[4,] -35.014571 -50.088571
[5,] -37.398571 -35.014571
[6,] -32.584571 -37.398571
[7,] -54.222571 -32.584571
[8,] -57.224571 -54.222571
[9,] -31.521929 -57.224571
[10,] -33.311929 -31.521929
[11,] -43.264429 -33.311929
[12,] -37.100286 -43.264429
[13,] -43.292286 -37.100286
[14,] -46.460286 -43.292286
[15,] -33.632286 -46.460286
[16,] -33.968286 -33.632286
[17,] -11.022286 -33.968286
[18,] 1.891714 -11.022286
[19,] 14.093714 1.891714
[20,] 71.831714 14.093714
[21,] 90.034357 71.831714
[22,] 81.184357 90.034357
[23,] 119.541857 81.184357
[24,] 134.916000 119.541857
[25,] 180.224000 134.916000
[26,] 192.656000 180.224000
[27,] 128.784000 192.656000
[28,] 97.568000 128.784000
[29,] 112.984000 97.568000
[30,] 90.158000 112.984000
[31,] 82.200000 90.158000
[32,] 39.338000 82.200000
[33,] -9.239357 39.338000
[34,] -15.279357 -9.239357
[35,] -30.441857 -15.279357
[36,] 3.182286 -30.441857
[37,] -21.589714 3.182286
[38,] -17.587714 -21.589714
[39,] -1.479714 -17.587714
[40,] 24.004286 -1.479714
[41,] 16.340286 24.004286
[42,] -14.575714 16.340286
[43,] -38.273714 -14.575714
[44,] -66.625714 -38.273714
[45,] -49.273071 -66.625714
[46,] -32.593071 -49.273071
[47,] -45.835571 -32.593071
[48,] -36.491429 -45.835571
[49,] -53.413429 -36.491429
[50,] -58.991429 -53.413429
[51,] -43.583429 -58.991429
[52,] -52.589429 -43.583429
[53,] -80.903429 -52.589429
[54,] -44.889429 -80.903429
[55,] -3.797429 -44.889429
[56,] 12.680571 -3.797429
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -61.928571 -64.506571
2 -69.616571 -61.928571
3 -50.088571 -69.616571
4 -35.014571 -50.088571
5 -37.398571 -35.014571
6 -32.584571 -37.398571
7 -54.222571 -32.584571
8 -57.224571 -54.222571
9 -31.521929 -57.224571
10 -33.311929 -31.521929
11 -43.264429 -33.311929
12 -37.100286 -43.264429
13 -43.292286 -37.100286
14 -46.460286 -43.292286
15 -33.632286 -46.460286
16 -33.968286 -33.632286
17 -11.022286 -33.968286
18 1.891714 -11.022286
19 14.093714 1.891714
20 71.831714 14.093714
21 90.034357 71.831714
22 81.184357 90.034357
23 119.541857 81.184357
24 134.916000 119.541857
25 180.224000 134.916000
26 192.656000 180.224000
27 128.784000 192.656000
28 97.568000 128.784000
29 112.984000 97.568000
30 90.158000 112.984000
31 82.200000 90.158000
32 39.338000 82.200000
33 -9.239357 39.338000
34 -15.279357 -9.239357
35 -30.441857 -15.279357
36 3.182286 -30.441857
37 -21.589714 3.182286
38 -17.587714 -21.589714
39 -1.479714 -17.587714
40 24.004286 -1.479714
41 16.340286 24.004286
42 -14.575714 16.340286
43 -38.273714 -14.575714
44 -66.625714 -38.273714
45 -49.273071 -66.625714
46 -32.593071 -49.273071
47 -45.835571 -32.593071
48 -36.491429 -45.835571
49 -53.413429 -36.491429
50 -58.991429 -53.413429
51 -43.583429 -58.991429
52 -52.589429 -43.583429
53 -80.903429 -52.589429
54 -44.889429 -80.903429
55 -3.797429 -44.889429
56 12.680571 -3.797429
> 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/72ls61291062325.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/82ls61291062325.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/9dcs91291062325.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/10dcs91291062325.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/11ydqx1291062325.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/122d721291062325.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/13yn5b1291062325.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/14j63z1291062325.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/15s99c1291062325.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/16q70b1291062325.tab")
+ }
>
> try(system("convert tmp/16bvf1291062325.ps tmp/16bvf1291062325.png",intern=TRUE))
character(0)
> try(system("convert tmp/2z2ui1291062325.ps tmp/2z2ui1291062325.png",intern=TRUE))
character(0)
> try(system("convert tmp/3z2ui1291062325.ps tmp/3z2ui1291062325.png",intern=TRUE))
character(0)
> try(system("convert tmp/4z2ui1291062325.ps tmp/4z2ui1291062325.png",intern=TRUE))
character(0)
> try(system("convert tmp/5rutl1291062325.ps tmp/5rutl1291062325.png",intern=TRUE))
character(0)
> try(system("convert tmp/6rutl1291062325.ps tmp/6rutl1291062325.png",intern=TRUE))
character(0)
> try(system("convert tmp/72ls61291062325.ps tmp/72ls61291062325.png",intern=TRUE))
character(0)
> try(system("convert tmp/82ls61291062325.ps tmp/82ls61291062325.png",intern=TRUE))
character(0)
> try(system("convert tmp/9dcs91291062325.ps tmp/9dcs91291062325.png",intern=TRUE))
character(0)
> try(system("convert tmp/10dcs91291062325.ps tmp/10dcs91291062325.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
3.737 2.479 4.081