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(25.60,0,23.70,0,22.00,0,21.30,0,20.70,0,20.40,0,20.30,0,20.40,0,19.80,0,19.50,0,23.10,0,23.50,0,23.50,0,22.90,0,21.90,0,21.50,0,20.50,0,20.20,0,19.40,0,19.20,0,18.80,0,18.80,0,22.60,0,23.30,0,23.00,0,21.40,0,19.90,0,18.80,0,18.60,0,18.40,0,18.60,0,19.90,0,19.20,0,18.40,0,21.10,0,20.50,0,19.10,0,18.10,0,17.00,0,17.10,0,17.40,1,16.80,1,15.30,1,14.30,1,13.40,1,15.30,1,22.10,1,23.70,1,22.20,1,19.50,1,16.60,1,17.30,1,19.80,1,21.20,1,21.50,1,20.60,1,19.10,1,19.60,1,23.50,1,24.00,1),dim=c(2,60),dimnames=list(c('Y','X'),1:60))
> y <- array(NA,dim=c(2,60),dimnames=list(c('Y','X'),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
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
Y X
1 25.6 0
2 23.7 0
3 22.0 0
4 21.3 0
5 20.7 0
6 20.4 0
7 20.3 0
8 20.4 0
9 19.8 0
10 19.5 0
11 23.1 0
12 23.5 0
13 23.5 0
14 22.9 0
15 21.9 0
16 21.5 0
17 20.5 0
18 20.2 0
19 19.4 0
20 19.2 0
21 18.8 0
22 18.8 0
23 22.6 0
24 23.3 0
25 23.0 0
26 21.4 0
27 19.9 0
28 18.8 0
29 18.6 0
30 18.4 0
31 18.6 0
32 19.9 0
33 19.2 0
34 18.4 0
35 21.1 0
36 20.5 0
37 19.1 0
38 18.1 0
39 17.0 0
40 17.1 0
41 17.4 1
42 16.8 1
43 15.3 1
44 14.3 1
45 13.4 1
46 15.3 1
47 22.1 1
48 23.7 1
49 22.2 1
50 19.5 1
51 16.6 1
52 17.3 1
53 19.8 1
54 21.2 1
55 21.5 1
56 20.6 1
57 19.1 1
58 19.6 1
59 23.5 1
60 24.0 1
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) X
20.55 -1.39
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-5.760 -1.753 -0.105 2.042 5.050
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 20.5500 0.3906 52.617 <2e-16 ***
X -1.3900 0.6765 -2.055 0.0444 *
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 2.47 on 58 degrees of freedom
Multiple R-squared: 0.06786, Adjusted R-squared: 0.05178
F-statistic: 4.222 on 1 and 58 DF, p-value: 0.04441
> 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.550550632 0.898898735 0.4494494
[2,] 0.491620941 0.983241881 0.5083791
[3,] 0.421563704 0.843127408 0.5784363
[4,] 0.338095117 0.676190234 0.6619049
[5,] 0.292452149 0.584904299 0.7075479
[6,] 0.258312813 0.516625626 0.7416872
[7,] 0.223896360 0.447792720 0.7761036
[8,] 0.212176532 0.424353064 0.7878235
[9,] 0.198704602 0.397409205 0.8012954
[10,] 0.161409929 0.322819857 0.8385901
[11,] 0.114728769 0.229457537 0.8852712
[12,] 0.079183576 0.158367153 0.9208164
[13,] 0.059526991 0.119053982 0.9404730
[14,] 0.046530742 0.093061484 0.9534693
[15,] 0.045265548 0.090531096 0.9547345
[16,] 0.044551590 0.089103180 0.9554484
[17,] 0.047945068 0.095890136 0.9520549
[18,] 0.048102047 0.096204093 0.9518980
[19,] 0.041440086 0.082880173 0.9585599
[20,] 0.047164642 0.094329284 0.9528354
[21,] 0.049961099 0.099922199 0.9500389
[22,] 0.037483485 0.074966971 0.9625165
[23,] 0.028837043 0.057674086 0.9711630
[24,] 0.028153859 0.056307719 0.9718461
[25,] 0.027841261 0.055682522 0.9721587
[26,] 0.027894672 0.055789343 0.9721053
[27,] 0.025031680 0.050063361 0.9749683
[28,] 0.017359460 0.034718921 0.9826405
[29,] 0.012825515 0.025651029 0.9871745
[30,] 0.011165897 0.022331793 0.9888341
[31,] 0.008210842 0.016421685 0.9917892
[32,] 0.005913751 0.011827502 0.9940862
[33,] 0.004412076 0.008824152 0.9955879
[34,] 0.003946039 0.007892078 0.9960540
[35,] 0.004762920 0.009525840 0.9952371
[36,] 0.004990774 0.009981547 0.9950092
[37,] 0.003149318 0.006298635 0.9968507
[38,] 0.002233200 0.004466399 0.9977668
[39,] 0.002927960 0.005855919 0.9970720
[40,] 0.008043587 0.016087174 0.9919564
[41,] 0.059604639 0.119209278 0.9403954
[42,] 0.168980877 0.337961754 0.8310191
[43,] 0.254201243 0.508402486 0.7457988
[44,] 0.450509481 0.901018961 0.5494905
[45,] 0.462015215 0.924030429 0.5379848
[46,] 0.371982050 0.743964101 0.6280179
[47,] 0.512891016 0.974217967 0.4871090
[48,] 0.670607159 0.658785681 0.3293928
[49,] 0.598276887 0.803446226 0.4017231
[50,] 0.465940099 0.931880197 0.5340599
[51,] 0.321629165 0.643258330 0.6783708
> postscript(file="/var/www/html/rcomp/tmp/177141258647534.ps",horizontal=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/232rs1258647534.ps",horizontal=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/3awou1258647534.ps",horizontal=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/4amb21258647534.ps",horizontal=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/5q7ot1258647534.ps",horizontal=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 7 8 9 10 11 12 13
5.05 3.15 1.45 0.75 0.15 -0.15 -0.25 -0.15 -0.75 -1.05 2.55 2.95 2.95
14 15 16 17 18 19 20 21 22 23 24 25 26
2.35 1.35 0.95 -0.05 -0.35 -1.15 -1.35 -1.75 -1.75 2.05 2.75 2.45 0.85
27 28 29 30 31 32 33 34 35 36 37 38 39
-0.65 -1.75 -1.95 -2.15 -1.95 -0.65 -1.35 -2.15 0.55 -0.05 -1.45 -2.45 -3.55
40 41 42 43 44 45 46 47 48 49 50 51 52
-3.45 -1.76 -2.36 -3.86 -4.86 -5.76 -3.86 2.94 4.54 3.04 0.34 -2.56 -1.86
53 54 55 56 57 58 59 60
0.64 2.04 2.34 1.44 -0.06 0.44 4.34 4.84
> postscript(file="/var/www/html/rcomp/tmp/6mjwq1258647534.ps",horizontal=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 5.05 NA
1 3.15 5.05
2 1.45 3.15
3 0.75 1.45
4 0.15 0.75
5 -0.15 0.15
6 -0.25 -0.15
7 -0.15 -0.25
8 -0.75 -0.15
9 -1.05 -0.75
10 2.55 -1.05
11 2.95 2.55
12 2.95 2.95
13 2.35 2.95
14 1.35 2.35
15 0.95 1.35
16 -0.05 0.95
17 -0.35 -0.05
18 -1.15 -0.35
19 -1.35 -1.15
20 -1.75 -1.35
21 -1.75 -1.75
22 2.05 -1.75
23 2.75 2.05
24 2.45 2.75
25 0.85 2.45
26 -0.65 0.85
27 -1.75 -0.65
28 -1.95 -1.75
29 -2.15 -1.95
30 -1.95 -2.15
31 -0.65 -1.95
32 -1.35 -0.65
33 -2.15 -1.35
34 0.55 -2.15
35 -0.05 0.55
36 -1.45 -0.05
37 -2.45 -1.45
38 -3.55 -2.45
39 -3.45 -3.55
40 -1.76 -3.45
41 -2.36 -1.76
42 -3.86 -2.36
43 -4.86 -3.86
44 -5.76 -4.86
45 -3.86 -5.76
46 2.94 -3.86
47 4.54 2.94
48 3.04 4.54
49 0.34 3.04
50 -2.56 0.34
51 -1.86 -2.56
52 0.64 -1.86
53 2.04 0.64
54 2.34 2.04
55 1.44 2.34
56 -0.06 1.44
57 0.44 -0.06
58 4.34 0.44
59 4.84 4.34
60 NA 4.84
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 3.15 5.05
[2,] 1.45 3.15
[3,] 0.75 1.45
[4,] 0.15 0.75
[5,] -0.15 0.15
[6,] -0.25 -0.15
[7,] -0.15 -0.25
[8,] -0.75 -0.15
[9,] -1.05 -0.75
[10,] 2.55 -1.05
[11,] 2.95 2.55
[12,] 2.95 2.95
[13,] 2.35 2.95
[14,] 1.35 2.35
[15,] 0.95 1.35
[16,] -0.05 0.95
[17,] -0.35 -0.05
[18,] -1.15 -0.35
[19,] -1.35 -1.15
[20,] -1.75 -1.35
[21,] -1.75 -1.75
[22,] 2.05 -1.75
[23,] 2.75 2.05
[24,] 2.45 2.75
[25,] 0.85 2.45
[26,] -0.65 0.85
[27,] -1.75 -0.65
[28,] -1.95 -1.75
[29,] -2.15 -1.95
[30,] -1.95 -2.15
[31,] -0.65 -1.95
[32,] -1.35 -0.65
[33,] -2.15 -1.35
[34,] 0.55 -2.15
[35,] -0.05 0.55
[36,] -1.45 -0.05
[37,] -2.45 -1.45
[38,] -3.55 -2.45
[39,] -3.45 -3.55
[40,] -1.76 -3.45
[41,] -2.36 -1.76
[42,] -3.86 -2.36
[43,] -4.86 -3.86
[44,] -5.76 -4.86
[45,] -3.86 -5.76
[46,] 2.94 -3.86
[47,] 4.54 2.94
[48,] 3.04 4.54
[49,] 0.34 3.04
[50,] -2.56 0.34
[51,] -1.86 -2.56
[52,] 0.64 -1.86
[53,] 2.04 0.64
[54,] 2.34 2.04
[55,] 1.44 2.34
[56,] -0.06 1.44
[57,] 0.44 -0.06
[58,] 4.34 0.44
[59,] 4.84 4.34
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 3.15 5.05
2 1.45 3.15
3 0.75 1.45
4 0.15 0.75
5 -0.15 0.15
6 -0.25 -0.15
7 -0.15 -0.25
8 -0.75 -0.15
9 -1.05 -0.75
10 2.55 -1.05
11 2.95 2.55
12 2.95 2.95
13 2.35 2.95
14 1.35 2.35
15 0.95 1.35
16 -0.05 0.95
17 -0.35 -0.05
18 -1.15 -0.35
19 -1.35 -1.15
20 -1.75 -1.35
21 -1.75 -1.75
22 2.05 -1.75
23 2.75 2.05
24 2.45 2.75
25 0.85 2.45
26 -0.65 0.85
27 -1.75 -0.65
28 -1.95 -1.75
29 -2.15 -1.95
30 -1.95 -2.15
31 -0.65 -1.95
32 -1.35 -0.65
33 -2.15 -1.35
34 0.55 -2.15
35 -0.05 0.55
36 -1.45 -0.05
37 -2.45 -1.45
38 -3.55 -2.45
39 -3.45 -3.55
40 -1.76 -3.45
41 -2.36 -1.76
42 -3.86 -2.36
43 -4.86 -3.86
44 -5.76 -4.86
45 -3.86 -5.76
46 2.94 -3.86
47 4.54 2.94
48 3.04 4.54
49 0.34 3.04
50 -2.56 0.34
51 -1.86 -2.56
52 0.64 -1.86
53 2.04 0.64
54 2.34 2.04
55 1.44 2.34
56 -0.06 1.44
57 0.44 -0.06
58 4.34 0.44
59 4.84 4.34
> 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/71yop1258647534.ps",horizontal=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/818mc1258647534.ps",horizontal=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/9vcxq1258647534.ps",horizontal=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/10v9631258647534.ps",horizontal=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/11sw7u1258647534.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/12yzcf1258647534.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/13gven1258647534.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/14wzy01258647534.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/159neq1258647534.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/16px801258647535.tab")
+ }
>
> system("convert tmp/177141258647534.ps tmp/177141258647534.png")
> system("convert tmp/232rs1258647534.ps tmp/232rs1258647534.png")
> system("convert tmp/3awou1258647534.ps tmp/3awou1258647534.png")
> system("convert tmp/4amb21258647534.ps tmp/4amb21258647534.png")
> system("convert tmp/5q7ot1258647534.ps tmp/5q7ot1258647534.png")
> system("convert tmp/6mjwq1258647534.ps tmp/6mjwq1258647534.png")
> system("convert tmp/71yop1258647534.ps tmp/71yop1258647534.png")
> system("convert tmp/818mc1258647534.ps tmp/818mc1258647534.png")
> system("convert tmp/9vcxq1258647534.ps tmp/9vcxq1258647534.png")
> system("convert tmp/10v9631258647534.ps tmp/10v9631258647534.png")
>
>
> proc.time()
user system elapsed
2.487 1.582 2.879