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(110.3672031
+ ,0
+ ,102.1880309
+ ,114.0150276
+ ,108.1560276
+ ,0
+ ,0
+ ,0
+ ,96.8602511
+ ,0
+ ,110.3672031
+ ,102.1880309
+ ,114.0150276
+ ,0
+ ,0
+ ,0
+ ,94.1944583
+ ,0
+ ,96.8602511
+ ,110.3672031
+ ,102.1880309
+ ,0
+ ,0
+ ,0
+ ,99.51621961
+ ,0
+ ,94.1944583
+ ,96.8602511
+ ,110.3672031
+ ,0
+ ,0
+ ,0
+ ,94.06333487
+ ,0
+ ,99.51621961
+ ,94.1944583
+ ,96.8602511
+ ,0
+ ,0
+ ,0
+ ,97.5541476
+ ,0
+ ,94.06333487
+ ,99.51621961
+ ,94.1944583
+ ,0
+ ,0
+ ,0
+ ,78.15062422
+ ,0
+ ,97.5541476
+ ,94.06333487
+ ,99.51621961
+ ,0
+ ,0
+ ,0
+ ,81.2434643
+ ,0
+ ,78.15062422
+ ,97.5541476
+ ,94.06333487
+ ,0
+ ,0
+ ,0
+ ,92.36262465
+ ,0
+ ,81.2434643
+ ,78.15062422
+ ,97.5541476
+ ,0
+ ,0
+ ,0
+ ,96.06324371
+ ,0
+ ,92.36262465
+ ,81.2434643
+ ,78.15062422
+ ,0
+ ,0
+ ,0
+ ,114.0523777
+ ,0
+ ,96.06324371
+ ,92.36262465
+ ,81.2434643
+ ,0
+ ,0
+ ,0
+ ,110.6616666
+ ,0
+ ,114.0523777
+ ,96.06324371
+ ,92.36262465
+ ,0
+ ,0
+ ,0
+ ,104.9171949
+ ,0
+ ,110.6616666
+ ,114.0523777
+ ,96.06324371
+ ,0
+ ,0
+ ,0
+ ,90.00187193
+ ,0
+ ,104.9171949
+ ,110.6616666
+ ,114.0523777
+ ,0
+ ,0
+ ,0
+ ,95.7008067
+ ,0
+ ,90.00187193
+ ,104.9171949
+ ,110.6616666
+ ,0
+ ,0
+ ,0
+ ,86.02741157
+ ,0
+ ,95.7008067
+ ,90.00187193
+ ,104.9171949
+ ,0
+ ,0
+ ,0
+ ,84.85287668
+ ,0
+ ,86.02741157
+ ,95.7008067
+ ,90.00187193
+ ,0
+ ,0
+ ,0
+ ,100.04328
+ ,0
+ ,84.85287668
+ ,86.02741157
+ ,95.7008067
+ ,0
+ ,0
+ ,0
+ ,80.91713823
+ ,0
+ ,100.04328
+ ,84.85287668
+ ,86.02741157
+ ,0
+ ,0
+ ,0
+ ,74.06539709
+ ,0
+ ,80.91713823
+ ,100.04328
+ ,84.85287668
+ ,0
+ ,0
+ ,0
+ ,77.30281369
+ ,0
+ ,74.06539709
+ ,80.91713823
+ ,100.04328
+ ,0
+ ,0
+ ,0
+ ,97.23043249
+ ,0
+ ,77.30281369
+ ,74.06539709
+ ,80.91713823
+ ,0
+ ,0
+ ,0
+ ,90.75515676
+ ,0
+ ,97.23043249
+ ,77.30281369
+ ,74.06539709
+ ,0
+ ,0
+ ,0
+ ,100.5614455
+ ,0
+ ,90.75515676
+ ,97.23043249
+ ,77.30281369
+ ,0
+ ,0
+ ,0
+ ,92.01293267
+ ,0
+ ,100.5614455
+ ,90.75515676
+ ,97.23043249
+ ,0
+ ,0
+ ,0
+ ,99.24012138
+ ,0
+ ,92.01293267
+ ,100.5614455
+ ,90.75515676
+ ,0
+ ,0
+ ,0
+ ,105.8672755
+ ,0
+ ,99.24012138
+ ,92.01293267
+ ,100.5614455
+ ,0
+ ,0
+ ,0
+ ,90.9920463
+ ,0
+ ,105.8672755
+ ,99.24012138
+ ,92.01293267
+ ,0
+ ,0
+ ,0
+ ,93.30624423
+ ,0
+ ,90.9920463
+ ,105.8672755
+ ,99.24012138
+ ,0
+ ,0
+ ,0
+ ,91.17419413
+ ,0
+ ,93.30624423
+ ,90.9920463
+ ,105.8672755
+ ,0
+ ,0
+ ,0
+ ,77.33295039
+ ,0
+ ,91.17419413
+ ,93.30624423
+ ,90.9920463
+ ,0
+ ,0
+ ,0
+ ,91.1277721
+ ,0
+ ,77.33295039
+ ,91.17419413
+ ,93.30624423
+ ,0
+ ,0
+ ,0
+ ,85.01249943
+ ,0
+ ,91.1277721
+ ,77.33295039
+ ,91.17419413
+ ,0
+ ,0
+ ,0
+ ,83.90390242
+ ,0
+ ,85.01249943
+ ,91.1277721
+ ,77.33295039
+ ,0
+ ,0
+ ,0
+ ,104.8626302
+ ,0
+ ,83.90390242
+ ,85.01249943
+ ,91.1277721
+ ,0
+ ,0
+ ,0
+ ,110.9039108
+ ,0
+ ,104.8626302
+ ,83.90390242
+ ,85.01249943
+ ,0
+ ,0
+ ,0
+ ,95.43714373
+ ,0
+ ,110.9039108
+ ,104.8626302
+ ,83.90390242
+ ,0
+ ,0
+ ,0
+ ,111.6238727
+ ,0
+ ,95.43714373
+ ,110.9039108
+ ,104.8626302
+ ,0
+ ,0
+ ,0
+ ,108.8925403
+ ,0
+ ,111.6238727
+ ,95.43714373
+ ,110.9039108
+ ,0
+ ,0
+ ,0
+ ,96.17511682
+ ,0
+ ,108.8925403
+ ,111.6238727
+ ,95.43714373
+ ,0
+ ,0
+ ,0
+ ,101.9740205
+ ,0
+ ,96.17511682
+ ,108.8925403
+ ,111.6238727
+ ,0
+ ,0
+ ,0
+ ,99.11953031
+ ,0
+ ,101.9740205
+ ,96.17511682
+ ,108.8925403
+ ,0
+ ,0
+ ,0
+ ,86.78158147
+ ,0
+ ,99.11953031
+ ,101.9740205
+ ,96.17511682
+ ,0
+ ,0
+ ,0
+ ,118.4195003
+ ,0
+ ,86.78158147
+ ,99.11953031
+ ,101.9740205
+ ,0
+ ,0
+ ,0
+ ,118.7441447
+ ,0
+ ,118.4195003
+ ,86.78158147
+ ,99.11953031
+ ,0
+ ,0
+ ,0
+ ,106.5296192
+ ,0
+ ,118.7441447
+ ,118.4195003
+ ,86.78158147
+ ,0
+ ,0
+ ,0
+ ,134.7772694
+ ,0
+ ,106.5296192
+ ,118.7441447
+ ,118.4195003
+ ,0
+ ,0
+ ,0
+ ,104.6778714
+ ,0
+ ,134.7772694
+ ,106.5296192
+ ,118.7441447
+ ,0
+ ,0
+ ,0
+ ,105.2954304
+ ,0
+ ,104.6778714
+ ,134.7772694
+ ,106.5296192
+ ,0
+ ,0
+ ,0
+ ,139.4139849
+ ,0
+ ,105.2954304
+ ,104.6778714
+ ,134.7772694
+ ,0
+ ,0
+ ,0
+ ,103.6060491
+ ,0
+ ,139.4139849
+ ,105.2954304
+ ,104.6778714
+ ,0
+ ,0
+ ,0
+ ,99.78182974
+ ,0
+ ,103.6060491
+ ,139.4139849
+ ,105.2954304
+ ,0
+ ,0
+ ,0
+ ,103.4610301
+ ,0
+ ,99.78182974
+ ,103.6060491
+ ,139.4139849
+ ,0
+ ,0
+ ,0
+ ,120.0594945
+ ,0
+ ,103.4610301
+ ,99.78182974
+ ,103.6060491
+ ,0
+ ,0
+ ,0
+ ,96.71377168
+ ,0
+ ,120.0594945
+ ,103.4610301
+ ,99.78182974
+ ,0
+ ,0
+ ,0
+ ,107.1308929
+ ,0
+ ,96.71377168
+ ,120.0594945
+ ,103.4610301
+ ,0
+ ,0
+ ,0
+ ,105.3608372
+ ,0
+ ,107.1308929
+ ,96.71377168
+ ,120.0594945
+ ,0
+ ,0
+ ,0
+ ,111.6942359
+ ,0
+ ,105.3608372
+ ,107.1308929
+ ,96.71377168
+ ,0
+ ,0
+ ,0
+ ,132.0519998
+ ,0
+ ,111.6942359
+ ,105.3608372
+ ,107.1308929
+ ,0
+ ,0
+ ,0
+ ,126.8037879
+ ,0
+ ,132.0519998
+ ,111.6942359
+ ,105.3608372
+ ,0
+ ,0
+ ,0
+ ,154.4824253
+ ,0
+ ,126.8037879
+ ,132.0519998
+ ,111.6942359
+ ,1
+ ,0
+ ,0
+ ,141.5570984
+ ,0
+ ,154.4824253
+ ,126.8037879
+ ,132.0519998
+ ,0
+ ,0
+ ,0
+ ,109.9506882
+ ,0
+ ,141.5570984
+ ,154.4824253
+ ,126.8037879
+ ,0
+ ,0
+ ,0
+ ,127.904198
+ ,0
+ ,109.9506882
+ ,141.5570984
+ ,154.4824253
+ ,0
+ ,0
+ ,0
+ ,133.0888617
+ ,0
+ ,127.904198
+ ,109.9506882
+ ,141.5570984
+ ,0
+ ,0
+ ,0
+ ,120.0796299
+ ,0
+ ,133.0888617
+ ,127.904198
+ ,109.9506882
+ ,0
+ ,0
+ ,0
+ ,117.5557142
+ ,0
+ ,120.0796299
+ ,133.0888617
+ ,127.904198
+ ,0
+ ,0
+ ,0
+ ,143.0362309
+ ,0
+ ,117.5557142
+ ,120.0796299
+ ,133.0888617
+ ,0
+ ,0
+ ,0
+ ,159.982927
+ ,1
+ ,143.0362309
+ ,117.5557142
+ ,120.0796299
+ ,0
+ ,1
+ ,0
+ ,128.5991124
+ ,1
+ ,159.982927
+ ,143.0362309
+ ,117.5557142
+ ,0
+ ,0
+ ,0
+ ,149.7373327
+ ,1
+ ,128.5991124
+ ,159.982927
+ ,143.0362309
+ ,0
+ ,0
+ ,0
+ ,126.8169313
+ ,1
+ ,149.7373327
+ ,128.5991124
+ ,159.982927
+ ,0
+ ,0
+ ,0
+ ,140.9639674
+ ,1
+ ,126.8169313
+ ,149.7373327
+ ,128.5991124
+ ,0
+ ,0
+ ,0
+ ,137.6691981
+ ,1
+ ,140.9639674
+ ,126.8169313
+ ,149.7373327
+ ,0
+ ,0
+ ,0
+ ,117.9402337
+ ,1
+ ,137.6691981
+ ,140.9639674
+ ,126.8169313
+ ,0
+ ,0
+ ,0
+ ,122.3095247
+ ,1
+ ,117.9402337
+ ,137.6691981
+ ,140.9639674
+ ,0
+ ,0
+ ,0
+ ,127.7804207
+ ,1
+ ,122.3095247
+ ,117.9402337
+ ,137.6691981
+ ,0
+ ,0
+ ,0
+ ,136.1677176
+ ,1
+ ,127.7804207
+ ,122.3095247
+ ,117.9402337
+ ,0
+ ,0
+ ,0
+ ,116.2405856
+ ,1
+ ,136.1677176
+ ,127.7804207
+ ,122.3095247
+ ,0
+ ,0
+ ,0
+ ,123.1576893
+ ,1
+ ,116.2405856
+ ,136.1677176
+ ,127.7804207
+ ,0
+ ,0
+ ,0
+ ,116.3400234
+ ,1
+ ,123.1576893
+ ,116.2405856
+ ,136.1677176
+ ,0
+ ,0
+ ,0
+ ,108.6119282
+ ,1
+ ,116.3400234
+ ,123.1576893
+ ,116.2405856
+ ,0
+ ,0
+ ,0
+ ,125.8982264
+ ,1
+ ,108.6119282
+ ,116.3400234
+ ,123.1576893
+ ,0
+ ,0
+ ,0
+ ,112.8003105
+ ,1
+ ,125.8982264
+ ,108.6119282
+ ,116.3400234
+ ,0
+ ,0
+ ,0
+ ,107.5182447
+ ,1
+ ,112.8003105
+ ,125.8982264
+ ,108.6119282
+ ,0
+ ,0
+ ,0
+ ,135.0955413
+ ,1
+ ,107.5182447
+ ,112.8003105
+ ,125.8982264
+ ,0
+ ,0
+ ,0
+ ,115.5096488
+ ,1
+ ,135.0955413
+ ,107.5182447
+ ,112.8003105
+ ,0
+ ,0
+ ,0
+ ,115.8640759
+ ,1
+ ,115.5096488
+ ,135.0955413
+ ,107.5182447
+ ,0
+ ,0
+ ,0
+ ,104.5883906
+ ,1
+ ,115.8640759
+ ,115.5096488
+ ,135.0955413
+ ,0
+ ,0
+ ,0
+ ,163.7213386
+ ,1
+ ,104.5883906
+ ,115.8640759
+ ,115.5096488
+ ,0
+ ,0
+ ,1
+ ,113.4482275
+ ,1
+ ,163.7213386
+ ,104.5883906
+ ,115.8640759
+ ,0
+ ,0
+ ,0
+ ,98.0428844
+ ,1
+ ,113.4482275
+ ,163.7213386
+ ,104.5883906
+ ,0
+ ,0
+ ,0
+ ,116.7868521
+ ,1
+ ,98.0428844
+ ,113.4482275
+ ,163.7213386
+ ,0
+ ,0
+ ,0
+ ,126.5330444
+ ,1
+ ,116.7868521
+ ,98.0428844
+ ,113.4482275
+ ,0
+ ,0
+ ,0
+ ,113.0336597
+ ,1
+ ,126.5330444
+ ,116.7868521
+ ,98.0428844
+ ,0
+ ,0
+ ,0
+ ,124.3392163
+ ,1
+ ,113.0336597
+ ,126.5330444
+ ,116.7868521
+ ,0
+ ,0
+ ,0
+ ,109.8298759
+ ,1
+ ,124.3392163
+ ,113.0336597
+ ,126.5330444
+ ,0
+ ,0
+ ,0
+ ,124.4434777
+ ,1
+ ,109.8298759
+ ,124.3392163
+ ,113.0336597
+ ,0
+ ,0
+ ,0
+ ,111.5039454
+ ,1
+ ,124.4434777
+ ,109.8298759
+ ,124.3392163
+ ,0
+ ,0
+ ,0
+ ,102.0350019
+ ,1
+ ,111.5039454
+ ,124.4434777
+ ,109.8298759
+ ,0
+ ,0
+ ,0
+ ,116.8726598
+ ,1
+ ,102.0350019
+ ,111.5039454
+ ,124.4434777
+ ,0
+ ,0
+ ,0
+ ,112.2073122
+ ,1
+ ,116.8726598
+ ,102.0350019
+ ,111.5039454
+ ,0
+ ,0
+ ,0
+ ,101.1513902
+ ,1
+ ,112.2073122
+ ,116.8726598
+ ,102.0350019
+ ,0
+ ,0
+ ,0
+ ,124.4255108
+ ,1
+ ,101.1513902
+ ,112.2073122
+ ,116.8726598
+ ,0
+ ,0
+ ,0)
+ ,dim=c(8
+ ,104)
+ ,dimnames=list(c('BouwV'
+ ,'X'
+ ,'Y1'
+ ,'Y2'
+ ,'Y3'
+ ,'D1'
+ ,'D2'
+ ,'D3')
+ ,1:104))
> y <- array(NA,dim=c(8,104),dimnames=list(c('BouwV','X','Y1','Y2','Y3','D1','D2','D3'),1:104))
> 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
BouwV X Y1 Y2 Y3 D1 D2 D3 M1 M2 M3 M4 M5 M6 M7 M8
1 110.36720 0 102.18803 114.01503 108.15603 0 0 0 1 0 0 0 0 0 0 0
2 96.86025 0 110.36720 102.18803 114.01503 0 0 0 0 1 0 0 0 0 0 0
3 94.19446 0 96.86025 110.36720 102.18803 0 0 0 0 0 1 0 0 0 0 0
4 99.51622 0 94.19446 96.86025 110.36720 0 0 0 0 0 0 1 0 0 0 0
5 94.06333 0 99.51622 94.19446 96.86025 0 0 0 0 0 0 0 1 0 0 0
6 97.55415 0 94.06333 99.51622 94.19446 0 0 0 0 0 0 0 0 1 0 0
7 78.15062 0 97.55415 94.06333 99.51622 0 0 0 0 0 0 0 0 0 1 0
8 81.24346 0 78.15062 97.55415 94.06333 0 0 0 0 0 0 0 0 0 0 1
9 92.36262 0 81.24346 78.15062 97.55415 0 0 0 0 0 0 0 0 0 0 0
10 96.06324 0 92.36262 81.24346 78.15062 0 0 0 0 0 0 0 0 0 0 0
11 114.05238 0 96.06324 92.36262 81.24346 0 0 0 0 0 0 0 0 0 0 0
12 110.66167 0 114.05238 96.06324 92.36262 0 0 0 0 0 0 0 0 0 0 0
13 104.91719 0 110.66167 114.05238 96.06324 0 0 0 1 0 0 0 0 0 0 0
14 90.00187 0 104.91719 110.66167 114.05238 0 0 0 0 1 0 0 0 0 0 0
15 95.70081 0 90.00187 104.91719 110.66167 0 0 0 0 0 1 0 0 0 0 0
16 86.02741 0 95.70081 90.00187 104.91719 0 0 0 0 0 0 1 0 0 0 0
17 84.85288 0 86.02741 95.70081 90.00187 0 0 0 0 0 0 0 1 0 0 0
18 100.04328 0 84.85288 86.02741 95.70081 0 0 0 0 0 0 0 0 1 0 0
19 80.91714 0 100.04328 84.85288 86.02741 0 0 0 0 0 0 0 0 0 1 0
20 74.06540 0 80.91714 100.04328 84.85288 0 0 0 0 0 0 0 0 0 0 1
21 77.30281 0 74.06540 80.91714 100.04328 0 0 0 0 0 0 0 0 0 0 0
22 97.23043 0 77.30281 74.06540 80.91714 0 0 0 0 0 0 0 0 0 0 0
23 90.75516 0 97.23043 77.30281 74.06540 0 0 0 0 0 0 0 0 0 0 0
24 100.56145 0 90.75516 97.23043 77.30281 0 0 0 0 0 0 0 0 0 0 0
25 92.01293 0 100.56145 90.75516 97.23043 0 0 0 1 0 0 0 0 0 0 0
26 99.24012 0 92.01293 100.56145 90.75516 0 0 0 0 1 0 0 0 0 0 0
27 105.86728 0 99.24012 92.01293 100.56145 0 0 0 0 0 1 0 0 0 0 0
28 90.99205 0 105.86728 99.24012 92.01293 0 0 0 0 0 0 1 0 0 0 0
29 93.30624 0 90.99205 105.86728 99.24012 0 0 0 0 0 0 0 1 0 0 0
30 91.17419 0 93.30624 90.99205 105.86728 0 0 0 0 0 0 0 0 1 0 0
31 77.33295 0 91.17419 93.30624 90.99205 0 0 0 0 0 0 0 0 0 1 0
32 91.12777 0 77.33295 91.17419 93.30624 0 0 0 0 0 0 0 0 0 0 1
33 85.01250 0 91.12777 77.33295 91.17419 0 0 0 0 0 0 0 0 0 0 0
34 83.90390 0 85.01250 91.12777 77.33295 0 0 0 0 0 0 0 0 0 0 0
35 104.86263 0 83.90390 85.01250 91.12777 0 0 0 0 0 0 0 0 0 0 0
36 110.90391 0 104.86263 83.90390 85.01250 0 0 0 0 0 0 0 0 0 0 0
37 95.43714 0 110.90391 104.86263 83.90390 0 0 0 1 0 0 0 0 0 0 0
38 111.62387 0 95.43714 110.90391 104.86263 0 0 0 0 1 0 0 0 0 0 0
39 108.89254 0 111.62387 95.43714 110.90391 0 0 0 0 0 1 0 0 0 0 0
40 96.17512 0 108.89254 111.62387 95.43714 0 0 0 0 0 0 1 0 0 0 0
41 101.97402 0 96.17512 108.89254 111.62387 0 0 0 0 0 0 0 1 0 0 0
42 99.11953 0 101.97402 96.17512 108.89254 0 0 0 0 0 0 0 0 1 0 0
43 86.78158 0 99.11953 101.97402 96.17512 0 0 0 0 0 0 0 0 0 1 0
44 118.41950 0 86.78158 99.11953 101.97402 0 0 0 0 0 0 0 0 0 0 1
45 118.74414 0 118.41950 86.78158 99.11953 0 0 0 0 0 0 0 0 0 0 0
46 106.52962 0 118.74414 118.41950 86.78158 0 0 0 0 0 0 0 0 0 0 0
47 134.77727 0 106.52962 118.74414 118.41950 0 0 0 0 0 0 0 0 0 0 0
48 104.67787 0 134.77727 106.52962 118.74414 0 0 0 0 0 0 0 0 0 0 0
49 105.29543 0 104.67787 134.77727 106.52962 0 0 0 1 0 0 0 0 0 0 0
50 139.41398 0 105.29543 104.67787 134.77727 0 0 0 0 1 0 0 0 0 0 0
51 103.60605 0 139.41398 105.29543 104.67787 0 0 0 0 0 1 0 0 0 0 0
52 99.78183 0 103.60605 139.41398 105.29543 0 0 0 0 0 0 1 0 0 0 0
53 103.46103 0 99.78183 103.60605 139.41398 0 0 0 0 0 0 0 1 0 0 0
54 120.05949 0 103.46103 99.78183 103.60605 0 0 0 0 0 0 0 0 1 0 0
55 96.71377 0 120.05949 103.46103 99.78183 0 0 0 0 0 0 0 0 0 1 0
56 107.13089 0 96.71377 120.05949 103.46103 0 0 0 0 0 0 0 0 0 0 1
57 105.36084 0 107.13089 96.71377 120.05949 0 0 0 0 0 0 0 0 0 0 0
58 111.69424 0 105.36084 107.13089 96.71377 0 0 0 0 0 0 0 0 0 0 0
59 132.05200 0 111.69424 105.36084 107.13089 0 0 0 0 0 0 0 0 0 0 0
60 126.80379 0 132.05200 111.69424 105.36084 0 0 0 0 0 0 0 0 0 0 0
61 154.48243 0 126.80379 132.05200 111.69424 1 0 0 1 0 0 0 0 0 0 0
62 141.55710 0 154.48243 126.80379 132.05200 0 0 0 0 1 0 0 0 0 0 0
63 109.95069 0 141.55710 154.48243 126.80379 0 0 0 0 0 1 0 0 0 0 0
64 127.90420 0 109.95069 141.55710 154.48243 0 0 0 0 0 0 1 0 0 0 0
65 133.08886 0 127.90420 109.95069 141.55710 0 0 0 0 0 0 0 1 0 0 0
66 120.07963 0 133.08886 127.90420 109.95069 0 0 0 0 0 0 0 0 1 0 0
67 117.55571 0 120.07963 133.08886 127.90420 0 0 0 0 0 0 0 0 0 1 0
68 143.03623 0 117.55571 120.07963 133.08886 0 0 0 0 0 0 0 0 0 0 1
69 159.98293 1 143.03623 117.55571 120.07963 0 1 0 0 0 0 0 0 0 0 0
70 128.59911 1 159.98293 143.03623 117.55571 0 0 0 0 0 0 0 0 0 0 0
71 149.73733 1 128.59911 159.98293 143.03623 0 0 0 0 0 0 0 0 0 0 0
72 126.81693 1 149.73733 128.59911 159.98293 0 0 0 0 0 0 0 0 0 0 0
73 140.96397 1 126.81693 149.73733 128.59911 0 0 0 1 0 0 0 0 0 0 0
74 137.66920 1 140.96397 126.81693 149.73733 0 0 0 0 1 0 0 0 0 0 0
75 117.94023 1 137.66920 140.96397 126.81693 0 0 0 0 0 1 0 0 0 0 0
76 122.30952 1 117.94023 137.66920 140.96397 0 0 0 0 0 0 1 0 0 0 0
77 127.78042 1 122.30952 117.94023 137.66920 0 0 0 0 0 0 0 1 0 0 0
78 136.16772 1 127.78042 122.30952 117.94023 0 0 0 0 0 0 0 0 1 0 0
79 116.24059 1 136.16772 127.78042 122.30952 0 0 0 0 0 0 0 0 0 1 0
80 123.15769 1 116.24059 136.16772 127.78042 0 0 0 0 0 0 0 0 0 0 1
81 116.34002 1 123.15769 116.24059 136.16772 0 0 0 0 0 0 0 0 0 0 0
82 108.61193 1 116.34002 123.15769 116.24059 0 0 0 0 0 0 0 0 0 0 0
83 125.89823 1 108.61193 116.34002 123.15769 0 0 0 0 0 0 0 0 0 0 0
84 112.80031 1 125.89823 108.61193 116.34002 0 0 0 0 0 0 0 0 0 0 0
85 107.51824 1 112.80031 125.89823 108.61193 0 0 0 1 0 0 0 0 0 0 0
86 135.09554 1 107.51824 112.80031 125.89823 0 0 0 0 1 0 0 0 0 0 0
87 115.50965 1 135.09554 107.51824 112.80031 0 0 0 0 0 1 0 0 0 0 0
88 115.86408 1 115.50965 135.09554 107.51824 0 0 0 0 0 0 1 0 0 0 0
89 104.58839 1 115.86408 115.50965 135.09554 0 0 0 0 0 0 0 1 0 0 0
90 163.72134 1 104.58839 115.86408 115.50965 0 0 1 0 0 0 0 0 1 0 0
91 113.44823 1 163.72134 104.58839 115.86408 0 0 0 0 0 0 0 0 0 1 0
92 98.04288 1 113.44823 163.72134 104.58839 0 0 0 0 0 0 0 0 0 0 1
93 116.78685 1 98.04288 113.44823 163.72134 0 0 0 0 0 0 0 0 0 0 0
94 126.53304 1 116.78685 98.04288 113.44823 0 0 0 0 0 0 0 0 0 0 0
95 113.03366 1 126.53304 116.78685 98.04288 0 0 0 0 0 0 0 0 0 0 0
96 124.33922 1 113.03366 126.53304 116.78685 0 0 0 0 0 0 0 0 0 0 0
97 109.82988 1 124.33922 113.03366 126.53304 0 0 0 1 0 0 0 0 0 0 0
98 124.44348 1 109.82988 124.33922 113.03366 0 0 0 0 1 0 0 0 0 0 0
99 111.50395 1 124.44348 109.82988 124.33922 0 0 0 0 0 1 0 0 0 0 0
100 102.03500 1 111.50395 124.44348 109.82988 0 0 0 0 0 0 1 0 0 0 0
101 116.87266 1 102.03500 111.50395 124.44348 0 0 0 0 0 0 0 1 0 0 0
102 112.20731 1 116.87266 102.03500 111.50395 0 0 0 0 0 0 0 0 1 0 0
103 101.15139 1 112.20731 116.87266 102.03500 0 0 0 0 0 0 0 0 0 1 0
104 124.42551 1 101.15139 112.20731 116.87266 0 0 0 0 0 0 0 0 0 0 1
M9 M10 M11 t
1 0 0 0 1
2 0 0 0 2
3 0 0 0 3
4 0 0 0 4
5 0 0 0 5
6 0 0 0 6
7 0 0 0 7
8 0 0 0 8
9 1 0 0 9
10 0 1 0 10
11 0 0 1 11
12 0 0 0 12
13 0 0 0 13
14 0 0 0 14
15 0 0 0 15
16 0 0 0 16
17 0 0 0 17
18 0 0 0 18
19 0 0 0 19
20 0 0 0 20
21 1 0 0 21
22 0 1 0 22
23 0 0 1 23
24 0 0 0 24
25 0 0 0 25
26 0 0 0 26
27 0 0 0 27
28 0 0 0 28
29 0 0 0 29
30 0 0 0 30
31 0 0 0 31
32 0 0 0 32
33 1 0 0 33
34 0 1 0 34
35 0 0 1 35
36 0 0 0 36
37 0 0 0 37
38 0 0 0 38
39 0 0 0 39
40 0 0 0 40
41 0 0 0 41
42 0 0 0 42
43 0 0 0 43
44 0 0 0 44
45 1 0 0 45
46 0 1 0 46
47 0 0 1 47
48 0 0 0 48
49 0 0 0 49
50 0 0 0 50
51 0 0 0 51
52 0 0 0 52
53 0 0 0 53
54 0 0 0 54
55 0 0 0 55
56 0 0 0 56
57 1 0 0 57
58 0 1 0 58
59 0 0 1 59
60 0 0 0 60
61 0 0 0 61
62 0 0 0 62
63 0 0 0 63
64 0 0 0 64
65 0 0 0 65
66 0 0 0 66
67 0 0 0 67
68 0 0 0 68
69 1 0 0 69
70 0 1 0 70
71 0 0 1 71
72 0 0 0 72
73 0 0 0 73
74 0 0 0 74
75 0 0 0 75
76 0 0 0 76
77 0 0 0 77
78 0 0 0 78
79 0 0 0 79
80 0 0 0 80
81 1 0 0 81
82 0 1 0 82
83 0 0 1 83
84 0 0 0 84
85 0 0 0 85
86 0 0 0 86
87 0 0 0 87
88 0 0 0 88
89 0 0 0 89
90 0 0 0 90
91 0 0 0 91
92 0 0 0 92
93 1 0 0 93
94 0 1 0 94
95 0 0 1 95
96 0 0 0 96
97 0 0 0 97
98 0 0 0 98
99 0 0 0 99
100 0 0 0 100
101 0 0 0 101
102 0 0 0 102
103 0 0 0 103
104 0 0 0 104
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) X Y1 Y2 Y3 D1
31.80825 -7.02864 0.23897 0.02737 0.40219 35.16469
D2 D3 M1 M2 M3 M4
46.44886 48.36934 -2.53493 2.46210 -9.05816 -8.97052
M5 M6 M7 M8 M9 M10
-8.52014 -0.58179 -15.66246 -2.13163 -9.61420 1.19846
M11 t
11.05018 0.18369
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-20.8121 -5.2559 0.0677 5.8684 19.1843
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 31.80825 9.39588 3.385 0.001083 **
X -7.02864 3.59364 -1.956 0.053806 .
Y1 0.23897 0.08333 2.868 0.005229 **
Y2 0.02737 0.08401 0.326 0.745350
Y3 0.40219 0.08121 4.952 3.74e-06 ***
D1 35.16469 10.23979 3.434 0.000926 ***
D2 46.44886 10.67411 4.352 3.78e-05 ***
D3 48.36934 10.19150 4.746 8.42e-06 ***
M1 -2.53493 4.92466 -0.515 0.608085
M2 2.46210 4.75244 0.518 0.605771
M3 -9.05816 4.62051 -1.960 0.053261 .
M4 -8.97052 4.91392 -1.826 0.071475 .
M5 -8.52014 4.90451 -1.737 0.086016 .
M6 -0.58179 4.81218 -0.121 0.904059
M7 -15.66246 4.60884 -3.398 0.001039 **
M8 -2.13163 5.15491 -0.414 0.680283
M9 -9.61420 5.28955 -1.818 0.072693 .
M10 1.19846 4.84207 0.248 0.805117
M11 11.05018 4.84643 2.280 0.025137 *
t 0.18369 0.06358 2.889 0.004915 **
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 9.424 on 84 degrees of freedom
Multiple R-squared: 0.7899, Adjusted R-squared: 0.7424
F-statistic: 16.63 on 19 and 84 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.6996706 0.6006588 0.3003294
[2,] 0.5632169 0.8735661 0.4367831
[3,] 0.4460069 0.8920138 0.5539931
[4,] 0.5110251 0.9779499 0.4889749
[5,] 0.6952467 0.6095066 0.3047533
[6,] 0.5961847 0.8076307 0.4038153
[7,] 0.5316725 0.9366551 0.4683275
[8,] 0.4686677 0.9373353 0.5313323
[9,] 0.3823929 0.7647857 0.6176071
[10,] 0.4809493 0.9618987 0.5190507
[11,] 0.3994795 0.7989591 0.6005205
[12,] 0.3928922 0.7857843 0.6071078
[13,] 0.3362328 0.6724656 0.6637672
[14,] 0.3065985 0.6131969 0.6934015
[15,] 0.2439661 0.4879322 0.7560339
[16,] 0.3555754 0.7111507 0.6444246
[17,] 0.3158327 0.6316655 0.6841673
[18,] 0.2594776 0.5189551 0.7405224
[19,] 0.2083197 0.4166393 0.7916803
[20,] 0.2133322 0.4266643 0.7866678
[21,] 0.1900699 0.3801398 0.8099301
[22,] 0.4450870 0.8901741 0.5549130
[23,] 0.5722933 0.8554133 0.4277067
[24,] 0.5210688 0.9578624 0.4789312
[25,] 0.4665799 0.9331597 0.5334201
[26,] 0.7203728 0.5592543 0.2796272
[27,] 0.6764725 0.6470551 0.3235275
[28,] 0.7552684 0.4894632 0.2447316
[29,] 0.7238811 0.5522378 0.2761189
[30,] 0.6798629 0.6402742 0.3201371
[31,] 0.7644558 0.4710884 0.2355442
[32,] 0.7504190 0.4991621 0.2495810
[33,] 0.7422681 0.5154639 0.2577319
[34,] 0.7565970 0.4868060 0.2434030
[35,] 0.7318587 0.5362825 0.2681413
[36,] 0.7166198 0.5667604 0.2833802
[37,] 0.6715980 0.6568041 0.3284020
[38,] 0.6114013 0.7771975 0.3885987
[39,] 0.5383345 0.9233310 0.4616655
[40,] 0.4808980 0.9617959 0.5191020
[41,] 0.4815654 0.9631308 0.5184346
[42,] 0.4202091 0.8404181 0.5797909
[43,] 0.3709846 0.7419692 0.6290154
[44,] 0.3385411 0.6770821 0.6614589
[45,] 0.3501212 0.7002424 0.6498788
[46,] 0.3259787 0.6519575 0.6740213
[47,] 0.2552852 0.5105704 0.7447148
[48,] 0.2054630 0.4109261 0.7945370
[49,] 0.2492285 0.4984570 0.7507715
[50,] 0.2413426 0.4826853 0.7586574
[51,] 0.5709194 0.8581611 0.4290806
[52,] 0.4763247 0.9526495 0.5236753
[53,] 0.3893744 0.7787488 0.6106256
[54,] 0.2931704 0.5863409 0.7068296
[55,] 0.2452259 0.4904519 0.7547741
[56,] 0.3596273 0.7192547 0.6403727
[57,] 0.2936487 0.5872973 0.7063513
[58,] 0.2072898 0.4145795 0.7927102
[59,] 0.1242408 0.2484816 0.8757592
> postscript(file="/var/www/html/rcomp/tmp/1aqhz1258652951.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/2pdl61258652951.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/3sw111258652951.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/4nop51258652951.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/5tiu51258652951.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 = 104
Frequency = 1
1 2 3 4 5
9.870142e+00 -1.280475e+01 3.626531e+00 6.394140e+00 4.540842e+00
6 7 8 9 10
2.139140e+00 -5.192694e+00 -9.080052e+00 7.726093e+00 5.492542e+00
11 12 13 14 15
1.101364e+01 9.617298e+00 5.053520e+00 -2.081207e+01 1.308643e+00
16 17 18 19 20
-7.279246e+00 -9.334198e-01 4.388351e+00 4.519216e-01 -1.548730e+01
21 22 23 24 25
-8.899563e+00 7.138019e+00 -1.146759e+01 8.904982e+00 -7.473131e+00
26 27 28 29 30
-1.048005e+00 1.147866e+01 -2.011256e+00 1.354025e-01 -1.292989e+01
31 32 33 34 35
-5.445321e+00 -2.929827e+00 -3.806310e+00 -9.260716e+00 -3.453255e+00
36 37 38 39 40
1.093597e+01 -3.751082e+00 2.356126e+00 5.086930e+00 -1.471625e+00
41 42 43 44 45
2.968270e-01 -1.061879e+01 -2.421532e+00 1.619608e+01 1.774504e+01
46 47 48 49 50
-1.447276e+00 6.950392e+00 -1.882892e+01 -4.528096e+00 1.372514e+01
51 52 53 54 55
-6.810548e+00 -3.531611e+00 -1.231461e+01 9.788975e+00 -1.188877e+00
56 57 58 59 60
-8.415789e-01 -3.838779e+00 1.025547e+00 5.693202e+00 6.985211e+00
61 62 63 64 65
3.330669e-16 2.400343e+00 -1.342771e+01 1.028997e+00 7.353014e+00
66 67 68 69 70
-2.796833e+00 5.322286e+00 1.596231e+01 1.887379e-15 3.365943e-01
71 72 73 74 75
8.227062e+00 -1.483486e+01 1.918428e+01 -5.460559e-01 6.800143e-01
76 77 78 79 80
3.892874e+00 9.550802e+00 1.632393e+01 7.382439e+00 2.916968e+00
81 82 83 84 85
-1.082574e+00 -1.035266e+01 -3.850401e+00 -7.259083e+00 -4.424990e+00
86 87 88 89 90
1.263995e+01 3.213078e+00 9.346006e+00 -1.320366e+01 -2.109424e-15
91 92 93 94 95
-9.714036e-01 -1.516149e+01 -7.843906e+00 7.067947e+00 -1.311305e+01
96 97 98 99 100
4.479398e+00 -1.393064e+01 4.089330e+00 -5.155603e+00 -6.368279e+00
101 102 103 104
4.574800e+00 -6.294886e+00 2.063180e+00 8.424888e+00
> postscript(file="/var/www/html/rcomp/tmp/6m9m71258652951.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 = 104
Frequency = 1
lag(myerror, k = 1) myerror
0 9.870142e+00 NA
1 -1.280475e+01 9.870142e+00
2 3.626531e+00 -1.280475e+01
3 6.394140e+00 3.626531e+00
4 4.540842e+00 6.394140e+00
5 2.139140e+00 4.540842e+00
6 -5.192694e+00 2.139140e+00
7 -9.080052e+00 -5.192694e+00
8 7.726093e+00 -9.080052e+00
9 5.492542e+00 7.726093e+00
10 1.101364e+01 5.492542e+00
11 9.617298e+00 1.101364e+01
12 5.053520e+00 9.617298e+00
13 -2.081207e+01 5.053520e+00
14 1.308643e+00 -2.081207e+01
15 -7.279246e+00 1.308643e+00
16 -9.334198e-01 -7.279246e+00
17 4.388351e+00 -9.334198e-01
18 4.519216e-01 4.388351e+00
19 -1.548730e+01 4.519216e-01
20 -8.899563e+00 -1.548730e+01
21 7.138019e+00 -8.899563e+00
22 -1.146759e+01 7.138019e+00
23 8.904982e+00 -1.146759e+01
24 -7.473131e+00 8.904982e+00
25 -1.048005e+00 -7.473131e+00
26 1.147866e+01 -1.048005e+00
27 -2.011256e+00 1.147866e+01
28 1.354025e-01 -2.011256e+00
29 -1.292989e+01 1.354025e-01
30 -5.445321e+00 -1.292989e+01
31 -2.929827e+00 -5.445321e+00
32 -3.806310e+00 -2.929827e+00
33 -9.260716e+00 -3.806310e+00
34 -3.453255e+00 -9.260716e+00
35 1.093597e+01 -3.453255e+00
36 -3.751082e+00 1.093597e+01
37 2.356126e+00 -3.751082e+00
38 5.086930e+00 2.356126e+00
39 -1.471625e+00 5.086930e+00
40 2.968270e-01 -1.471625e+00
41 -1.061879e+01 2.968270e-01
42 -2.421532e+00 -1.061879e+01
43 1.619608e+01 -2.421532e+00
44 1.774504e+01 1.619608e+01
45 -1.447276e+00 1.774504e+01
46 6.950392e+00 -1.447276e+00
47 -1.882892e+01 6.950392e+00
48 -4.528096e+00 -1.882892e+01
49 1.372514e+01 -4.528096e+00
50 -6.810548e+00 1.372514e+01
51 -3.531611e+00 -6.810548e+00
52 -1.231461e+01 -3.531611e+00
53 9.788975e+00 -1.231461e+01
54 -1.188877e+00 9.788975e+00
55 -8.415789e-01 -1.188877e+00
56 -3.838779e+00 -8.415789e-01
57 1.025547e+00 -3.838779e+00
58 5.693202e+00 1.025547e+00
59 6.985211e+00 5.693202e+00
60 3.330669e-16 6.985211e+00
61 2.400343e+00 3.330669e-16
62 -1.342771e+01 2.400343e+00
63 1.028997e+00 -1.342771e+01
64 7.353014e+00 1.028997e+00
65 -2.796833e+00 7.353014e+00
66 5.322286e+00 -2.796833e+00
67 1.596231e+01 5.322286e+00
68 1.887379e-15 1.596231e+01
69 3.365943e-01 1.887379e-15
70 8.227062e+00 3.365943e-01
71 -1.483486e+01 8.227062e+00
72 1.918428e+01 -1.483486e+01
73 -5.460559e-01 1.918428e+01
74 6.800143e-01 -5.460559e-01
75 3.892874e+00 6.800143e-01
76 9.550802e+00 3.892874e+00
77 1.632393e+01 9.550802e+00
78 7.382439e+00 1.632393e+01
79 2.916968e+00 7.382439e+00
80 -1.082574e+00 2.916968e+00
81 -1.035266e+01 -1.082574e+00
82 -3.850401e+00 -1.035266e+01
83 -7.259083e+00 -3.850401e+00
84 -4.424990e+00 -7.259083e+00
85 1.263995e+01 -4.424990e+00
86 3.213078e+00 1.263995e+01
87 9.346006e+00 3.213078e+00
88 -1.320366e+01 9.346006e+00
89 -2.109424e-15 -1.320366e+01
90 -9.714036e-01 -2.109424e-15
91 -1.516149e+01 -9.714036e-01
92 -7.843906e+00 -1.516149e+01
93 7.067947e+00 -7.843906e+00
94 -1.311305e+01 7.067947e+00
95 4.479398e+00 -1.311305e+01
96 -1.393064e+01 4.479398e+00
97 4.089330e+00 -1.393064e+01
98 -5.155603e+00 4.089330e+00
99 -6.368279e+00 -5.155603e+00
100 4.574800e+00 -6.368279e+00
101 -6.294886e+00 4.574800e+00
102 2.063180e+00 -6.294886e+00
103 8.424888e+00 2.063180e+00
104 NA 8.424888e+00
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -1.280475e+01 9.870142e+00
[2,] 3.626531e+00 -1.280475e+01
[3,] 6.394140e+00 3.626531e+00
[4,] 4.540842e+00 6.394140e+00
[5,] 2.139140e+00 4.540842e+00
[6,] -5.192694e+00 2.139140e+00
[7,] -9.080052e+00 -5.192694e+00
[8,] 7.726093e+00 -9.080052e+00
[9,] 5.492542e+00 7.726093e+00
[10,] 1.101364e+01 5.492542e+00
[11,] 9.617298e+00 1.101364e+01
[12,] 5.053520e+00 9.617298e+00
[13,] -2.081207e+01 5.053520e+00
[14,] 1.308643e+00 -2.081207e+01
[15,] -7.279246e+00 1.308643e+00
[16,] -9.334198e-01 -7.279246e+00
[17,] 4.388351e+00 -9.334198e-01
[18,] 4.519216e-01 4.388351e+00
[19,] -1.548730e+01 4.519216e-01
[20,] -8.899563e+00 -1.548730e+01
[21,] 7.138019e+00 -8.899563e+00
[22,] -1.146759e+01 7.138019e+00
[23,] 8.904982e+00 -1.146759e+01
[24,] -7.473131e+00 8.904982e+00
[25,] -1.048005e+00 -7.473131e+00
[26,] 1.147866e+01 -1.048005e+00
[27,] -2.011256e+00 1.147866e+01
[28,] 1.354025e-01 -2.011256e+00
[29,] -1.292989e+01 1.354025e-01
[30,] -5.445321e+00 -1.292989e+01
[31,] -2.929827e+00 -5.445321e+00
[32,] -3.806310e+00 -2.929827e+00
[33,] -9.260716e+00 -3.806310e+00
[34,] -3.453255e+00 -9.260716e+00
[35,] 1.093597e+01 -3.453255e+00
[36,] -3.751082e+00 1.093597e+01
[37,] 2.356126e+00 -3.751082e+00
[38,] 5.086930e+00 2.356126e+00
[39,] -1.471625e+00 5.086930e+00
[40,] 2.968270e-01 -1.471625e+00
[41,] -1.061879e+01 2.968270e-01
[42,] -2.421532e+00 -1.061879e+01
[43,] 1.619608e+01 -2.421532e+00
[44,] 1.774504e+01 1.619608e+01
[45,] -1.447276e+00 1.774504e+01
[46,] 6.950392e+00 -1.447276e+00
[47,] -1.882892e+01 6.950392e+00
[48,] -4.528096e+00 -1.882892e+01
[49,] 1.372514e+01 -4.528096e+00
[50,] -6.810548e+00 1.372514e+01
[51,] -3.531611e+00 -6.810548e+00
[52,] -1.231461e+01 -3.531611e+00
[53,] 9.788975e+00 -1.231461e+01
[54,] -1.188877e+00 9.788975e+00
[55,] -8.415789e-01 -1.188877e+00
[56,] -3.838779e+00 -8.415789e-01
[57,] 1.025547e+00 -3.838779e+00
[58,] 5.693202e+00 1.025547e+00
[59,] 6.985211e+00 5.693202e+00
[60,] 3.330669e-16 6.985211e+00
[61,] 2.400343e+00 3.330669e-16
[62,] -1.342771e+01 2.400343e+00
[63,] 1.028997e+00 -1.342771e+01
[64,] 7.353014e+00 1.028997e+00
[65,] -2.796833e+00 7.353014e+00
[66,] 5.322286e+00 -2.796833e+00
[67,] 1.596231e+01 5.322286e+00
[68,] 1.887379e-15 1.596231e+01
[69,] 3.365943e-01 1.887379e-15
[70,] 8.227062e+00 3.365943e-01
[71,] -1.483486e+01 8.227062e+00
[72,] 1.918428e+01 -1.483486e+01
[73,] -5.460559e-01 1.918428e+01
[74,] 6.800143e-01 -5.460559e-01
[75,] 3.892874e+00 6.800143e-01
[76,] 9.550802e+00 3.892874e+00
[77,] 1.632393e+01 9.550802e+00
[78,] 7.382439e+00 1.632393e+01
[79,] 2.916968e+00 7.382439e+00
[80,] -1.082574e+00 2.916968e+00
[81,] -1.035266e+01 -1.082574e+00
[82,] -3.850401e+00 -1.035266e+01
[83,] -7.259083e+00 -3.850401e+00
[84,] -4.424990e+00 -7.259083e+00
[85,] 1.263995e+01 -4.424990e+00
[86,] 3.213078e+00 1.263995e+01
[87,] 9.346006e+00 3.213078e+00
[88,] -1.320366e+01 9.346006e+00
[89,] -2.109424e-15 -1.320366e+01
[90,] -9.714036e-01 -2.109424e-15
[91,] -1.516149e+01 -9.714036e-01
[92,] -7.843906e+00 -1.516149e+01
[93,] 7.067947e+00 -7.843906e+00
[94,] -1.311305e+01 7.067947e+00
[95,] 4.479398e+00 -1.311305e+01
[96,] -1.393064e+01 4.479398e+00
[97,] 4.089330e+00 -1.393064e+01
[98,] -5.155603e+00 4.089330e+00
[99,] -6.368279e+00 -5.155603e+00
[100,] 4.574800e+00 -6.368279e+00
[101,] -6.294886e+00 4.574800e+00
[102,] 2.063180e+00 -6.294886e+00
[103,] 8.424888e+00 2.063180e+00
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -1.280475e+01 9.870142e+00
2 3.626531e+00 -1.280475e+01
3 6.394140e+00 3.626531e+00
4 4.540842e+00 6.394140e+00
5 2.139140e+00 4.540842e+00
6 -5.192694e+00 2.139140e+00
7 -9.080052e+00 -5.192694e+00
8 7.726093e+00 -9.080052e+00
9 5.492542e+00 7.726093e+00
10 1.101364e+01 5.492542e+00
11 9.617298e+00 1.101364e+01
12 5.053520e+00 9.617298e+00
13 -2.081207e+01 5.053520e+00
14 1.308643e+00 -2.081207e+01
15 -7.279246e+00 1.308643e+00
16 -9.334198e-01 -7.279246e+00
17 4.388351e+00 -9.334198e-01
18 4.519216e-01 4.388351e+00
19 -1.548730e+01 4.519216e-01
20 -8.899563e+00 -1.548730e+01
21 7.138019e+00 -8.899563e+00
22 -1.146759e+01 7.138019e+00
23 8.904982e+00 -1.146759e+01
24 -7.473131e+00 8.904982e+00
25 -1.048005e+00 -7.473131e+00
26 1.147866e+01 -1.048005e+00
27 -2.011256e+00 1.147866e+01
28 1.354025e-01 -2.011256e+00
29 -1.292989e+01 1.354025e-01
30 -5.445321e+00 -1.292989e+01
31 -2.929827e+00 -5.445321e+00
32 -3.806310e+00 -2.929827e+00
33 -9.260716e+00 -3.806310e+00
34 -3.453255e+00 -9.260716e+00
35 1.093597e+01 -3.453255e+00
36 -3.751082e+00 1.093597e+01
37 2.356126e+00 -3.751082e+00
38 5.086930e+00 2.356126e+00
39 -1.471625e+00 5.086930e+00
40 2.968270e-01 -1.471625e+00
41 -1.061879e+01 2.968270e-01
42 -2.421532e+00 -1.061879e+01
43 1.619608e+01 -2.421532e+00
44 1.774504e+01 1.619608e+01
45 -1.447276e+00 1.774504e+01
46 6.950392e+00 -1.447276e+00
47 -1.882892e+01 6.950392e+00
48 -4.528096e+00 -1.882892e+01
49 1.372514e+01 -4.528096e+00
50 -6.810548e+00 1.372514e+01
51 -3.531611e+00 -6.810548e+00
52 -1.231461e+01 -3.531611e+00
53 9.788975e+00 -1.231461e+01
54 -1.188877e+00 9.788975e+00
55 -8.415789e-01 -1.188877e+00
56 -3.838779e+00 -8.415789e-01
57 1.025547e+00 -3.838779e+00
58 5.693202e+00 1.025547e+00
59 6.985211e+00 5.693202e+00
60 3.330669e-16 6.985211e+00
61 2.400343e+00 3.330669e-16
62 -1.342771e+01 2.400343e+00
63 1.028997e+00 -1.342771e+01
64 7.353014e+00 1.028997e+00
65 -2.796833e+00 7.353014e+00
66 5.322286e+00 -2.796833e+00
67 1.596231e+01 5.322286e+00
68 1.887379e-15 1.596231e+01
69 3.365943e-01 1.887379e-15
70 8.227062e+00 3.365943e-01
71 -1.483486e+01 8.227062e+00
72 1.918428e+01 -1.483486e+01
73 -5.460559e-01 1.918428e+01
74 6.800143e-01 -5.460559e-01
75 3.892874e+00 6.800143e-01
76 9.550802e+00 3.892874e+00
77 1.632393e+01 9.550802e+00
78 7.382439e+00 1.632393e+01
79 2.916968e+00 7.382439e+00
80 -1.082574e+00 2.916968e+00
81 -1.035266e+01 -1.082574e+00
82 -3.850401e+00 -1.035266e+01
83 -7.259083e+00 -3.850401e+00
84 -4.424990e+00 -7.259083e+00
85 1.263995e+01 -4.424990e+00
86 3.213078e+00 1.263995e+01
87 9.346006e+00 3.213078e+00
88 -1.320366e+01 9.346006e+00
89 -2.109424e-15 -1.320366e+01
90 -9.714036e-01 -2.109424e-15
91 -1.516149e+01 -9.714036e-01
92 -7.843906e+00 -1.516149e+01
93 7.067947e+00 -7.843906e+00
94 -1.311305e+01 7.067947e+00
95 4.479398e+00 -1.311305e+01
96 -1.393064e+01 4.479398e+00
97 4.089330e+00 -1.393064e+01
98 -5.155603e+00 4.089330e+00
99 -6.368279e+00 -5.155603e+00
100 4.574800e+00 -6.368279e+00
101 -6.294886e+00 4.574800e+00
102 2.063180e+00 -6.294886e+00
103 8.424888e+00 2.063180e+00
> 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/7al6r1258652951.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/8f3v31258652951.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/97yvt1258652951.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')
Warning messages:
1: Not plotting observations with leverage one:
61, 69, 90
2: Not plotting observations with leverage one:
61, 69, 90
> par(opar)
> dev.off()
null device
1
> if (n > n25) {
+ postscript(file="/var/www/html/rcomp/tmp/1017vp1258652951.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/11g91v1258652951.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/129zft1258652951.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/133d9m1258652951.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/14tpur1258652951.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/15e0lh1258652952.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/16rzoq1258652952.tab")
+ }
>
> system("convert tmp/1aqhz1258652951.ps tmp/1aqhz1258652951.png")
> system("convert tmp/2pdl61258652951.ps tmp/2pdl61258652951.png")
> system("convert tmp/3sw111258652951.ps tmp/3sw111258652951.png")
> system("convert tmp/4nop51258652951.ps tmp/4nop51258652951.png")
> system("convert tmp/5tiu51258652951.ps tmp/5tiu51258652951.png")
> system("convert tmp/6m9m71258652951.ps tmp/6m9m71258652951.png")
> system("convert tmp/7al6r1258652951.ps tmp/7al6r1258652951.png")
> system("convert tmp/8f3v31258652951.ps tmp/8f3v31258652951.png")
> system("convert tmp/97yvt1258652951.ps tmp/97yvt1258652951.png")
> system("convert tmp/1017vp1258652951.ps tmp/1017vp1258652951.png")
>
>
> proc.time()
user system elapsed
3.215 1.598 3.594