R version 3.6.3 (2020-02-29) -- "Holding the Windsock"
Copyright (C) 2020 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-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.
> source('/home/pw/wessanet/cretab')
>
>
> RC.capture <- function (expression, collapse = NULL) {
+ resultConn <- textConnection('RC.resultText', open = 'w', local=TRUE)
+ sink(resultConn)
+ on.exit(function() {
+ sink()
+ close(resultConn)
+ })
+ expression
+ on.exit(NULL)
+ sink()
+ close(resultConn)
+ return(paste(c(RC.resultText, ''), collapse = collapse, sep = ''))
+ }
> RC.texteval <- function (sourceText, collapse = NULL, echo = TRUE) {
+ sourceConn <- textConnection(sourceText, open = 'r')
+ on.exit(close(sourceConn))
+ result <- RC.capture(source(file = sourceConn, local = FALSE, echo = echo, print.eval = TRUE), collapse = collapse)
+ on.exit(NULL)
+ close(sourceConn)
+ res <- ''
+ for(i in 1:length(result)) {
+ if (result[i]!='') res <- paste(res,result[i],'
+ ',sep='')
+ }
+ return(res)
+ }
>
>
> myrfcuid = ''
>
> x <- array(list(6.0,-.10,0.57,1.01,1.68,1.1,0.0,-.5,0.5,7.5,-.99,-.10,0.57,1.01,2.2,1.1,0.0,-.5,7.0,.11,-.99,-.10,0.57,1.7,2.2,1.1,0.0,1.4,-.26,.11,-.99,-.10,2.1,1.7,2.2,1.1,-5.4,-.66,-.26,.11,-.99,0.1,2.1,1.7,2.2,-3.5,.05,-.66,-.26,.11,0.9,0.1,2.1,1.7,1.9,-.27,.05,-.66,-.26,0.0,0.9,0.1,2.1,4.4,.00,-.27,.05,-.66,-.2,0.0,0.9,0.1,4.4,.99,.00,-.27,.05,-1.9,-.2,0.0,0.9,9.5,1.61,.99,.00,-.27,-1.2,-1.9,-.2,0.0,17.7,1.26,1.61,.99,.00,0.6,-1.2,-1.9,-.2,11.5,1.04,1.26,1.61,.99,2.9,0.6,-1.2,-1.9,14.1,1.23,1.04,1.26,1.61,7.8,2.9,0.6,-1.2,7.9,0.94,1.23,1.04,1.26,6.4,7.8,2.9,0.6,6.7,1.45,0.94,1.23,1.04,4.2,6.4,7.8,2.9,4.2,2.39,1.45,0.94,1.23,4.9,4.2,6.4,7.8,2.7,1.63,2.39,1.45,0.94,1.1,4.9,4.2,6.4,7.2,0.91,1.63,2.39,1.45,3.9,1.1,4.9,4.2,9.7,1.24,0.91,1.63,2.39,2.1,3.9,1.1,4.9,9.2,1.39,1.24,0.91,1.63,0.3,2.1,3.9,1.1,6.1,0.50,1.39,1.24,0.91,2.6,0.3,2.1,3.9,3.3,0.75,0.50,1.39,1.24,0.9,2.6,0.3,2.1,-1.0,0.23,0.75,0.50,1.39,-.9,0.9,2.6,0.3,-5.3,0.19,0.23,0.75,0.50,0.4,-.9,0.9,2.6,-.6,0.40,0.19,0.23,0.75,-4.8,0.4,-.9,0.9,-.2,0.15,0.40,0.19,0.23,-4.8,-4.8,0.4,-.9,4.4,1.25,0.15,0.40,0.19,-1.8,-4.8,-4.8,0.4,8.9,1.42,1.25,0.15,0.40,-1.4,-1.8,-4.8,-4.8,12.6,1.51,1.42,1.25,0.15,-.3,-1.4,-1.8,-4.8,8.00,0.72,1.51,1.42,1.25,-.8,-.3,-1.4,-1.8,8.6,0.59,0.72,1.51,1.42,1.0,-.8,-.3,-1.4,6.2,0.32,0.59,0.72,1.51,0.2,1.0,-.8,-.3,1.8,0.54,0.32,0.59,0.72,0.0,0.2,1.0,-.8,5.6,0.22,0.54,0.32,0.59,1.3,0.0,0.2,1.0,5.1,0.06,0.22,0.54,0.32,-.4,1.3,0.0,0.2,8.6,0.61,0.06,0.22,0.54,0.9,-.4,1.3,0.0,8.1,0.31,0.61,0.06,0.22,3.6,0.9,-.4,1.3,2.1,0.03,0.31,0.61,0.06,-.4,3.6,0.9,-.4,7.1,-.01,0.03,0.31,0.61,0.2,-.4,3.6,0.9,-5.4,-.63,-.01,0.03,0.31,-.5,0.2,-.4,3.6,-7.2,-.20,-.63,-.01,0.03,2.0,-.5,0.2,-.4,3.9,1.47,-.20,-.63,-.01,2.0,2.0,-.5,0.2,13.2,1.46,1.47,-.20,-.63,0.8,2.0,2.0,-.5,13.1,1.78,1.46,1.47,-.20,1.5,0.8,2.0,2.0,10.0,1.86,1.78,1.46,1.47,-1.6,1.5,0.8,2.0,10.0,1.20,1.86,1.78,1.46,0.0,-1.6,1.5,0.8,5.0,1.00,1.20,1.86,1.78,-.6,0.0,-1.6,1.5,5.0,-1.26,1.00,1.20,1.86,-.4,-.6,0.0,-1.6,5.0,-.37,-1.26,1.00,1.20,-1.0,-.4,-.6,0.0,4.3,-.30,-.37,-1.26,1.00,0.8,-1.0,-.4,-.6,1.7,1.33,-.30,-.37,-1.26,1.5,0.8,-1.0,-.4,-3.2,-0.10,1.33,-.30,-.37,0.2,1.5,0.8,-1.0,3.4,0.70,-.10,1.33,-.30,0.5,0.2,1.5,0.8,11.0,1.03,0.70,-.10,1.33,1.6,0.5,0.2,1.5,9.0,0.84,1.03,0.70,-.10,0.8,1.6,0.5,0.2,14.4,1.30,0.84,1.03,0.70,1.9,0.8,1.6,0.5,11.6,0.93,1.30,0.84,1.03,3.4,1.9,0.8,1.6,8.5,0.97,0.93,1.30,0.84,0.0,3.4,1.9,0.8,6.2,-.13,0.97,0.93,1.30,1.1,0.0,3.4,1.9,5.4,0.80,-.13,0.97,0.93,0.7,1.1,0.0,3.4,7.7,1.53,0.80,-.13,0.97,0.1,0.7,1.1,0.0,8.7,1.37,1.53,0.80,-.13,-1.6,0.1,0.7,1.1,11.1,1.53,1.37,1.53,0.80,1.2,-1.6,0.1,0.7,10.6,1.47,1.53,1.37,1.53,1.4,1.2,-1.6,0.1,12.9,1.00,1.47,1.53,1.37,0.0,1.4,1.2,-1.6,8.7,1.06,1.00,1.47,1.53,-.1,0.0,1.4,1.2,8.8,2.54,1.06,1.00,1.47,-1.1,-.1,0.0,1.4,6.0,2.66,2.54,1.06,1.00,-.2,-1.1,-.1,0.0,20.0,1.20,2.66,2.54,1.06,-.6,-.2,-1.1,-.1,12.9,0.94,1.20,2.66,2.54,1.9,-.6,-.2,-1.1,14.7,1.86,0.94,1.20,2.66,1.8,1.9,-.6,-.2,20.8,3.00,1.86,0.94,1.20,4.2,1.8,1.9,-.6,21.3,2.90,3.00,1.86,0.94,1.8,4.2,1.8,1.9,11.5,1.84,2.90,3.00,1.86,3.2,1.8,4.2,1.8,10.6,-.54,1.84,2.90,3.00,4.7,3.2,1.8,4.2,14.3,0.50,-.54,1.84,2.90,2.0,4.7,3.2,1.8,5.8,1.70,0.50,-.54,1.84,5.1,2.0,4.7,3.2,7.9,2.40,1.70,0.50,-.54,0.8,5.1,2.0,4.7,17.1,3.87,2.40,1.70,.50,2.7,0.8,5.1,2.0,17.6,2.93,3.87,2.40,1.70,1.6,2.7,0.8,5.1,17.9,2.40,2.93,3.87,2.40,2.3,1.6,2.7,0.8,26.0,3.17,2.40,2.93,3.87,2.8,2.3,1.6,2.7,17.7,3.67,3.17,2.40,2.93,-.2,2.8,2.3,1.6,15.4,4.13,3.67,3.17,2.40,0.0,-.2,2.8,2.3,20.9,3.53,4.13,3.67,3.17,-1.6,0.0,-.2,2.8,16.2,1.60,3.53,4.13,3.67,0.2,-1.6,0.0,-.2,17.9,0.90,1.60,3.53,4.13,1.1,0.2,-1.6,0.0,6.7,1.64,0.90,1.60,3.53,-.5,1.1,0.2,-1.6,10.0,2.16,1.64,0.90,1.60,0.2,-.5,1.1,0.2,14.3,1.54,2.16,1.64,0.90,-2.2,0.2,-.5,1.1,17.3,2.73,1.54,2.16,1.64,-1.6,-2.2,0.2,-.5,22.9,3.77,2.73,1.54,2.16,0.8,-1.6,-2.2,0.2,22.8,3.56,3.77,2.73,1.54,0.8,0.8,-1.6,-2.2,19.6,4.60,3.56,3.77,2.73,-.8,0.8,0.8,-1.6,17.7,3.84,4.60,3.56,3.77,1.6,-.8,0.8,0.8,19.2,2.10,3.84,4.60,3.56,0.8,1.6,-.8,0.8),dim=c(9,96),dimnames=list(c('^QP','^M','^M-1','^M-2','^M-3','^Gf','^Gf-1','^Gf-2','^Gf-3'),1:96))
> y <- array(NA,dim=c(9,96),dimnames=list(c('^QP','^M','^M-1','^M-2','^M-3','^Gf','^Gf-1','^Gf-2','^Gf-3'),1:96))
> for (i in 1:dim(x)[1])
+ {
+ for (j in 1:dim(x)[2])
+ {
+ y[i,j] <- as.numeric(x[i,j])
+ }
+ }
> par6 = '12'
> par5 = ''
> par4 = ''
> par3 = 'No Linear Trend'
> par2 = 'Do not include Seasonal Dummies'
> par1 = '1'
> par6 <- '12'
> par5 <- ''
> par4 <- ''
> par3 <- 'No Linear Trend'
> par2 <- 'Do not include Seasonal Dummies'
> par1 <- '1'
> #'GNU S' R Code compiled by R2WASP v. 1.2.327 (Fri, 21 Jul 2017 20:18:06 +0200)
> #Author: root
> #To cite this work: Wessa P., (2017), Multiple Regression (v1.0.48) in Free Statistics Software (v$_version), Office for Research Development and Education, URL https://www.wessa.net/rwasp_multipleregression.wasp/
> #Source of accompanying publication: Office for Research, Development, and Education
> #
> library(lattice)
> library(lmtest)
Loading required package: zoo
Attaching package: 'zoo'
The following objects are masked from 'package:base':
as.Date, as.Date.numeric
> library(car)
Loading required package: carData
> library(MASS)
> n25 <- 25 #minimum number of obs. for Goldfeld-Quandt test
> mywarning <- ''
> par6 <- as.numeric(par6)
> if(is.na(par6)) {
+ par6 <- 12
+ mywarning = 'Warning: you did not specify the seasonality. The seasonal period was set to s = 12.'
+ }
> par1 <- as.numeric(par1)
> if(is.na(par1)) {
+ par1 <- 1
+ mywarning = 'Warning: you did not specify the column number of the endogenous series! The first column was selected by default.'
+ }
> if (par4=='') par4 <- 0
> par4 <- as.numeric(par4)
> if (!is.numeric(par4)) par4 <- 0
> if (par5=='') par5 <- 0
> par5 <- as.numeric(par5)
> if (!is.numeric(par5)) par5 <- 0
> x <- na.omit(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'){
+ (n <- n -1)
+ x2 <- array(0, dim=c(n,k), dimnames=list(1:n, paste('(1-B)',colnames(x),sep='')))
+ for (i in 1:n) {
+ for (j in 1:k) {
+ x2[i,j] <- x[i+1,j] - x[i,j]
+ }
+ }
+ x <- x2
+ }
> if (par3 == 'Seasonal Differences (s)'){
+ (n <- n - par6)
+ x2 <- array(0, dim=c(n,k), dimnames=list(1:n, paste('(1-Bs)',colnames(x),sep='')))
+ for (i in 1:n) {
+ for (j in 1:k) {
+ x2[i,j] <- x[i+par6,j] - x[i,j]
+ }
+ }
+ x <- x2
+ }
> if (par3 == 'First and Seasonal Differences (s)'){
+ (n <- n -1)
+ x2 <- array(0, dim=c(n,k), dimnames=list(1:n, paste('(1-B)',colnames(x),sep='')))
+ for (i in 1:n) {
+ for (j in 1:k) {
+ x2[i,j] <- x[i+1,j] - x[i,j]
+ }
+ }
+ x <- x2
+ (n <- n - par6)
+ x2 <- array(0, dim=c(n,k), dimnames=list(1:n, paste('(1-Bs)',colnames(x),sep='')))
+ for (i in 1:n) {
+ for (j in 1:k) {
+ x2[i,j] <- x[i+par6,j] - x[i,j]
+ }
+ }
+ x <- x2
+ }
> if(par4 > 0) {
+ x2 <- array(0, dim=c(n-par4,par4), dimnames=list(1:(n-par4), paste(colnames(x)[par1],'(t-',1:par4,')',sep='')))
+ for (i in 1:(n-par4)) {
+ for (j in 1:par4) {
+ x2[i,j] <- x[i+par4-j,par1]
+ }
+ }
+ x <- cbind(x[(par4+1):n,], x2)
+ n <- n - par4
+ }
> if(par5 > 0) {
+ x2 <- array(0, dim=c(n-par5*par6,par5), dimnames=list(1:(n-par5*par6), paste(colnames(x)[par1],'(t-',1:par5,'s)',sep='')))
+ for (i in 1:(n-par5*par6)) {
+ for (j in 1:par5) {
+ x2[i,j] <- x[i+par5*par6-j*par6,par1]
+ }
+ }
+ x <- cbind(x[(par5*par6+1):n,], x2)
+ n <- n - par5*par6
+ }
> if (par2 == 'Include Seasonal Dummies'){
+ x2 <- array(0, dim=c(n,par6-1), dimnames=list(1:n, paste('M', seq(1:(par6-1)), sep ='')))
+ for (i in 1:(par6-1)){
+ x2[seq(i,n,par6),i] <- 1
+ }
+ x <- cbind(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[n,]))
[1] 9
> if (par3 == 'Linear Trend'){
+ x <- cbind(x, c(1:n))
+ colnames(x)[k+1] <- 't'
+ }
> print(x)
^QP ^M ^M-1 ^M-2 ^M-3 ^Gf ^Gf-1 ^Gf-2 ^Gf-3
1 6.0 -0.10 0.57 1.01 1.68 1.1 0.0 -0.5 0.5
2 7.5 -0.99 -0.10 0.57 1.01 2.2 1.1 0.0 -0.5
3 7.0 0.11 -0.99 -0.10 0.57 1.7 2.2 1.1 0.0
4 1.4 -0.26 0.11 -0.99 -0.10 2.1 1.7 2.2 1.1
5 -5.4 -0.66 -0.26 0.11 -0.99 0.1 2.1 1.7 2.2
6 -3.5 0.05 -0.66 -0.26 0.11 0.9 0.1 2.1 1.7
7 1.9 -0.27 0.05 -0.66 -0.26 0.0 0.9 0.1 2.1
8 4.4 0.00 -0.27 0.05 -0.66 -0.2 0.0 0.9 0.1
9 4.4 0.99 0.00 -0.27 0.05 -1.9 -0.2 0.0 0.9
10 9.5 1.61 0.99 0.00 -0.27 -1.2 -1.9 -0.2 0.0
11 17.7 1.26 1.61 0.99 0.00 0.6 -1.2 -1.9 -0.2
12 11.5 1.04 1.26 1.61 0.99 2.9 0.6 -1.2 -1.9
13 14.1 1.23 1.04 1.26 1.61 7.8 2.9 0.6 -1.2
14 7.9 0.94 1.23 1.04 1.26 6.4 7.8 2.9 0.6
15 6.7 1.45 0.94 1.23 1.04 4.2 6.4 7.8 2.9
16 4.2 2.39 1.45 0.94 1.23 4.9 4.2 6.4 7.8
17 2.7 1.63 2.39 1.45 0.94 1.1 4.9 4.2 6.4
18 7.2 0.91 1.63 2.39 1.45 3.9 1.1 4.9 4.2
19 9.7 1.24 0.91 1.63 2.39 2.1 3.9 1.1 4.9
20 9.2 1.39 1.24 0.91 1.63 0.3 2.1 3.9 1.1
21 6.1 0.50 1.39 1.24 0.91 2.6 0.3 2.1 3.9
22 3.3 0.75 0.50 1.39 1.24 0.9 2.6 0.3 2.1
23 -1.0 0.23 0.75 0.50 1.39 -0.9 0.9 2.6 0.3
24 -5.3 0.19 0.23 0.75 0.50 0.4 -0.9 0.9 2.6
25 -0.6 0.40 0.19 0.23 0.75 -4.8 0.4 -0.9 0.9
26 -0.2 0.15 0.40 0.19 0.23 -4.8 -4.8 0.4 -0.9
27 4.4 1.25 0.15 0.40 0.19 -1.8 -4.8 -4.8 0.4
28 8.9 1.42 1.25 0.15 0.40 -1.4 -1.8 -4.8 -4.8
29 12.6 1.51 1.42 1.25 0.15 -0.3 -1.4 -1.8 -4.8
30 8.0 0.72 1.51 1.42 1.25 -0.8 -0.3 -1.4 -1.8
31 8.6 0.59 0.72 1.51 1.42 1.0 -0.8 -0.3 -1.4
32 6.2 0.32 0.59 0.72 1.51 0.2 1.0 -0.8 -0.3
33 1.8 0.54 0.32 0.59 0.72 0.0 0.2 1.0 -0.8
34 5.6 0.22 0.54 0.32 0.59 1.3 0.0 0.2 1.0
35 5.1 0.06 0.22 0.54 0.32 -0.4 1.3 0.0 0.2
36 8.6 0.61 0.06 0.22 0.54 0.9 -0.4 1.3 0.0
37 8.1 0.31 0.61 0.06 0.22 3.6 0.9 -0.4 1.3
38 2.1 0.03 0.31 0.61 0.06 -0.4 3.6 0.9 -0.4
39 7.1 -0.01 0.03 0.31 0.61 0.2 -0.4 3.6 0.9
40 -5.4 -0.63 -0.01 0.03 0.31 -0.5 0.2 -0.4 3.6
41 -7.2 -0.20 -0.63 -0.01 0.03 2.0 -0.5 0.2 -0.4
42 3.9 1.47 -0.20 -0.63 -0.01 2.0 2.0 -0.5 0.2
43 13.2 1.46 1.47 -0.20 -0.63 0.8 2.0 2.0 -0.5
44 13.1 1.78 1.46 1.47 -0.20 1.5 0.8 2.0 2.0
45 10.0 1.86 1.78 1.46 1.47 -1.6 1.5 0.8 2.0
46 10.0 1.20 1.86 1.78 1.46 0.0 -1.6 1.5 0.8
47 5.0 1.00 1.20 1.86 1.78 -0.6 0.0 -1.6 1.5
48 5.0 -1.26 1.00 1.20 1.86 -0.4 -0.6 0.0 -1.6
49 5.0 -0.37 -1.26 1.00 1.20 -1.0 -0.4 -0.6 0.0
50 4.3 -0.30 -0.37 -1.26 1.00 0.8 -1.0 -0.4 -0.6
51 1.7 1.33 -0.30 -0.37 -1.26 1.5 0.8 -1.0 -0.4
52 -3.2 -0.10 1.33 -0.30 -0.37 0.2 1.5 0.8 -1.0
53 3.4 0.70 -0.10 1.33 -0.30 0.5 0.2 1.5 0.8
54 11.0 1.03 0.70 -0.10 1.33 1.6 0.5 0.2 1.5
55 9.0 0.84 1.03 0.70 -0.10 0.8 1.6 0.5 0.2
56 14.4 1.30 0.84 1.03 0.70 1.9 0.8 1.6 0.5
57 11.6 0.93 1.30 0.84 1.03 3.4 1.9 0.8 1.6
58 8.5 0.97 0.93 1.30 0.84 0.0 3.4 1.9 0.8
59 6.2 -0.13 0.97 0.93 1.30 1.1 0.0 3.4 1.9
60 5.4 0.80 -0.13 0.97 0.93 0.7 1.1 0.0 3.4
61 7.7 1.53 0.80 -0.13 0.97 0.1 0.7 1.1 0.0
62 8.7 1.37 1.53 0.80 -0.13 -1.6 0.1 0.7 1.1
63 11.1 1.53 1.37 1.53 0.80 1.2 -1.6 0.1 0.7
64 10.6 1.47 1.53 1.37 1.53 1.4 1.2 -1.6 0.1
65 12.9 1.00 1.47 1.53 1.37 0.0 1.4 1.2 -1.6
66 8.7 1.06 1.00 1.47 1.53 -0.1 0.0 1.4 1.2
67 8.8 2.54 1.06 1.00 1.47 -1.1 -0.1 0.0 1.4
68 6.0 2.66 2.54 1.06 1.00 -0.2 -1.1 -0.1 0.0
69 20.0 1.20 2.66 2.54 1.06 -0.6 -0.2 -1.1 -0.1
70 12.9 0.94 1.20 2.66 2.54 1.9 -0.6 -0.2 -1.1
71 14.7 1.86 0.94 1.20 2.66 1.8 1.9 -0.6 -0.2
72 20.8 3.00 1.86 0.94 1.20 4.2 1.8 1.9 -0.6
73 21.3 2.90 3.00 1.86 0.94 1.8 4.2 1.8 1.9
74 11.5 1.84 2.90 3.00 1.86 3.2 1.8 4.2 1.8
75 10.6 -0.54 1.84 2.90 3.00 4.7 3.2 1.8 4.2
76 14.3 0.50 -0.54 1.84 2.90 2.0 4.7 3.2 1.8
77 5.8 1.70 0.50 -0.54 1.84 5.1 2.0 4.7 3.2
78 7.9 2.40 1.70 0.50 -0.54 0.8 5.1 2.0 4.7
79 17.1 3.87 2.40 1.70 0.50 2.7 0.8 5.1 2.0
80 17.6 2.93 3.87 2.40 1.70 1.6 2.7 0.8 5.1
81 17.9 2.40 2.93 3.87 2.40 2.3 1.6 2.7 0.8
82 26.0 3.17 2.40 2.93 3.87 2.8 2.3 1.6 2.7
83 17.7 3.67 3.17 2.40 2.93 -0.2 2.8 2.3 1.6
84 15.4 4.13 3.67 3.17 2.40 0.0 -0.2 2.8 2.3
85 20.9 3.53 4.13 3.67 3.17 -1.6 0.0 -0.2 2.8
86 16.2 1.60 3.53 4.13 3.67 0.2 -1.6 0.0 -0.2
87 17.9 0.90 1.60 3.53 4.13 1.1 0.2 -1.6 0.0
88 6.7 1.64 0.90 1.60 3.53 -0.5 1.1 0.2 -1.6
89 10.0 2.16 1.64 0.90 1.60 0.2 -0.5 1.1 0.2
90 14.3 1.54 2.16 1.64 0.90 -2.2 0.2 -0.5 1.1
91 17.3 2.73 1.54 2.16 1.64 -1.6 -2.2 0.2 -0.5
92 22.9 3.77 2.73 1.54 2.16 0.8 -1.6 -2.2 0.2
93 22.8 3.56 3.77 2.73 1.54 0.8 0.8 -1.6 -2.2
94 19.6 4.60 3.56 3.77 2.73 -0.8 0.8 0.8 -1.6
95 17.7 3.84 4.60 3.56 3.77 1.6 -0.8 0.8 0.8
96 19.2 2.10 3.84 4.60 3.56 0.8 1.6 -0.8 0.8
> (k <- length(x[n,]))
[1] 9
> head(x)
^QP ^M ^M-1 ^M-2 ^M-3 ^Gf ^Gf-1 ^Gf-2 ^Gf-3
1 6.0 -0.10 0.57 1.01 1.68 1.1 0.0 -0.5 0.5
2 7.5 -0.99 -0.10 0.57 1.01 2.2 1.1 0.0 -0.5
3 7.0 0.11 -0.99 -0.10 0.57 1.7 2.2 1.1 0.0
4 1.4 -0.26 0.11 -0.99 -0.10 2.1 1.7 2.2 1.1
5 -5.4 -0.66 -0.26 0.11 -0.99 0.1 2.1 1.7 2.2
6 -3.5 0.05 -0.66 -0.26 0.11 0.9 0.1 2.1 1.7
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) `^M` `^M-1` `^M-2` `^M-3` `^Gf`
2.7026 2.4876 0.8568 1.4689 0.6003 0.7002
`^Gf-1` `^Gf-2` `^Gf-3`
0.1605 -0.4723 -0.6502
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-10.3544 -1.9159 0.3168 2.3542 7.7744
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 2.7026 0.6306 4.286 4.69e-05 ***
`^M` 2.4876 0.5122 4.856 5.23e-06 ***
`^M-1` 0.8568 0.6882 1.245 0.21648
`^M-2` 1.4689 0.6918 2.123 0.03657 *
`^M-3` 0.6003 0.5432 1.105 0.27216
`^Gf` 0.7002 0.2448 2.860 0.00530 **
`^Gf-1` 0.1605 0.2663 0.603 0.54827
`^Gf-2` -0.4723 0.2685 -1.759 0.08201 .
`^Gf-3` -0.6502 0.2441 -2.663 0.00922 **
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 3.792 on 87 degrees of freedom
Multiple R-squared: 0.7232, Adjusted R-squared: 0.6977
F-statistic: 28.41 on 8 and 87 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.4648682 0.92973648 0.535131762
[2,] 0.3122693 0.62453853 0.687730737
[3,] 0.3677232 0.73544644 0.632276780
[4,] 0.6500615 0.69987706 0.349938531
[5,] 0.5775428 0.84491439 0.422457197
[6,] 0.5052121 0.98957587 0.494787935
[7,] 0.4088422 0.81768446 0.591157772
[8,] 0.3584870 0.71697406 0.641512972
[9,] 0.2706409 0.54128179 0.729359105
[10,] 0.1996567 0.39931346 0.800343269
[11,] 0.2107025 0.42140500 0.789297498
[12,] 0.3205327 0.64106547 0.679467263
[13,] 0.6232713 0.75345739 0.376728694
[14,] 0.5686015 0.86279704 0.431398522
[15,] 0.5020965 0.99580701 0.497903507
[16,] 0.4991793 0.99835862 0.500820689
[17,] 0.5457906 0.90841871 0.454209355
[18,] 0.4764459 0.95289178 0.523554109
[19,] 0.4079927 0.81598540 0.592007298
[20,] 0.3387296 0.67745915 0.661270426
[21,] 0.2756484 0.55129685 0.724351574
[22,] 0.2653930 0.53078598 0.734607012
[23,] 0.2134386 0.42687718 0.786561410
[24,] 0.1775251 0.35505012 0.822474938
[25,] 0.1784451 0.35689027 0.821554867
[26,] 0.1415534 0.28310672 0.858446639
[27,] 0.1148568 0.22971356 0.885143220
[28,] 0.1563351 0.31267020 0.843664899
[29,] 0.1694409 0.33888182 0.830559090
[30,] 0.5722776 0.85544490 0.427722449
[31,] 0.5624857 0.87502850 0.437514251
[32,] 0.6128949 0.77421014 0.387105071
[33,] 0.6064053 0.78718948 0.393594741
[34,] 0.5485799 0.90284022 0.451420111
[35,] 0.4865551 0.97311029 0.513444853
[36,] 0.5111250 0.97775001 0.488875003
[37,] 0.4530271 0.90605423 0.546972887
[38,] 0.4681538 0.93630760 0.531846199
[39,] 0.4358989 0.87179772 0.564101142
[40,] 0.5290259 0.94194828 0.470974140
[41,] 0.6963764 0.60724726 0.303623629
[42,] 0.7105381 0.57892377 0.289461887
[43,] 0.7070474 0.58590512 0.292952558
[44,] 0.6669715 0.66605691 0.333028457
[45,] 0.6877531 0.62449389 0.312246947
[46,] 0.6398684 0.72026316 0.360131578
[47,] 0.5933287 0.81334255 0.406671275
[48,] 0.5697232 0.86055360 0.430276801
[49,] 0.5875501 0.82489977 0.412449887
[50,] 0.5246206 0.95075880 0.475379399
[51,] 0.4690993 0.93819866 0.530900670
[52,] 0.4091046 0.81820916 0.590895418
[53,] 0.4324209 0.86484177 0.567579113
[54,] 0.4262710 0.85254196 0.573729020
[55,] 0.3577795 0.71555899 0.642220503
[56,] 0.3767446 0.75348922 0.623255388
[57,] 0.5945955 0.81080891 0.405404454
[58,] 0.7487683 0.50246344 0.251231719
[59,] 0.7209676 0.55806473 0.279032363
[60,] 0.6729215 0.65415701 0.327078507
[61,] 0.6634362 0.67312764 0.336563820
[62,] 0.8048623 0.39027535 0.195137674
[63,] 0.7518546 0.49629071 0.248145355
[64,] 0.6881371 0.62372588 0.311862941
[65,] 0.7220985 0.55580298 0.277901490
[66,] 0.6418900 0.71621993 0.358109966
[67,] 0.7992039 0.40159227 0.200796134
[68,] 0.7133560 0.57328795 0.286643974
[69,] 0.8101792 0.37964166 0.189820832
[70,] 0.7253008 0.54939839 0.274699193
[71,] 0.8204909 0.35901829 0.179509147
[72,] 0.9969128 0.00617449 0.003087245
[73,] 0.9841875 0.03162506 0.015812530
> postscript(file="/home/pw/wessanet/rcomp/tmp/1fwco1586637023.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="/home/pw/wessanet/rcomp/tmp/2ot9n1586637023.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="/home/pw/wessanet/rcomp/tmp/353bm1586637023.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> sresid <- studres(mylm)
> hist(sresid, freq=FALSE, main='Distribution of Studentized Residuals')
> xfit<-seq(min(sresid),max(sresid),length=40)
> yfit<-dnorm(xfit)
> lines(xfit, yfit)
> grid()
> dev.off()
null device
1
> postscript(file="/home/pw/wessanet/rcomp/tmp/4wbtq1586637023.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="/home/pw/wessanet/rcomp/tmp/5oj751586637023.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> qqPlot(mylm, main='QQ Plot')
[1] 24 41
> grid()
> dev.off()
null device
1
> (myerror <- as.ts(mysum$resid))
Time Series:
Start = 1
End = 96
Frequency = 1
1 2 3 4 5 6
-0.11557268 3.86019274 3.65280770 0.77528652 -3.97891501 -3.99461400
7 8 9 10 11 12
2.21995264 2.88163283 1.54881486 3.15686080 7.77437895 -1.75750760
13 14 15 16 17 18
-1.79443095 -4.45197247 -1.24417225 -3.81989331 -4.21078340 -1.40585822
19 20 21 22 23 24
0.91329130 1.67224576 0.25407677 -4.02318393 -4.57736138 -8.09412101
25 26 27 28 29 30
-1.79180660 -0.30062141 -2.21874641 -2.98557035 -0.53814946 -1.84698434
31 32 33 34 35 36
-0.88141519 -0.64169663 -3.89889651 0.89765838 1.27580195 3.72927069
37 38 39 40 41 42
1.87461362 -2.00757805 5.78479226 -4.28721589 -10.35438090 -3.18420393
43 44 45 46 47 48
6.01639670 3.74575852 0.67613611 0.71305897 -4.37937548 1.03185151
49 50 51 52 53 54
2.58904388 2.93242115 -4.66537275 -6.78368982 -1.88530761 4.35307598
55 56 57 58 59 60
1.90638643 5.43271691 2.35054652 1.04569833 2.91441126 0.37956582
61 62 63 64 65 66
0.45173051 2.33151258 0.60885962 -1.86471893 2.68227518 0.93753678
67 68 69 70 71 72
-1.78420151 -7.38389141 7.53356652 -0.64485558 1.22679922 4.21743446
73 74 75 76 77 78
5.66772585 -3.16294899 1.38022767 6.89972833 -1.46263238 -0.01775827
79 80 81 82 83 84
1.60722105 1.88738254 -0.48027832 6.90996328 -0.31506025 -3.96783808
85 86 87 88 89 90
1.43021609 -1.79008967 2.36521307 -6.09507315 -1.17367538 4.95392212
91 92 93 94 95 96
3.57217662 3.70880543 0.20213642 -5.00305682 -6.08248746 -1.58521545
> postscript(file="/home/pw/wessanet/rcomp/tmp/6pdgz1586637023.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 = 96
Frequency = 1
lag(myerror, k = 1) myerror
0 -0.11557268 NA
1 3.86019274 -0.11557268
2 3.65280770 3.86019274
3 0.77528652 3.65280770
4 -3.97891501 0.77528652
5 -3.99461400 -3.97891501
6 2.21995264 -3.99461400
7 2.88163283 2.21995264
8 1.54881486 2.88163283
9 3.15686080 1.54881486
10 7.77437895 3.15686080
11 -1.75750760 7.77437895
12 -1.79443095 -1.75750760
13 -4.45197247 -1.79443095
14 -1.24417225 -4.45197247
15 -3.81989331 -1.24417225
16 -4.21078340 -3.81989331
17 -1.40585822 -4.21078340
18 0.91329130 -1.40585822
19 1.67224576 0.91329130
20 0.25407677 1.67224576
21 -4.02318393 0.25407677
22 -4.57736138 -4.02318393
23 -8.09412101 -4.57736138
24 -1.79180660 -8.09412101
25 -0.30062141 -1.79180660
26 -2.21874641 -0.30062141
27 -2.98557035 -2.21874641
28 -0.53814946 -2.98557035
29 -1.84698434 -0.53814946
30 -0.88141519 -1.84698434
31 -0.64169663 -0.88141519
32 -3.89889651 -0.64169663
33 0.89765838 -3.89889651
34 1.27580195 0.89765838
35 3.72927069 1.27580195
36 1.87461362 3.72927069
37 -2.00757805 1.87461362
38 5.78479226 -2.00757805
39 -4.28721589 5.78479226
40 -10.35438090 -4.28721589
41 -3.18420393 -10.35438090
42 6.01639670 -3.18420393
43 3.74575852 6.01639670
44 0.67613611 3.74575852
45 0.71305897 0.67613611
46 -4.37937548 0.71305897
47 1.03185151 -4.37937548
48 2.58904388 1.03185151
49 2.93242115 2.58904388
50 -4.66537275 2.93242115
51 -6.78368982 -4.66537275
52 -1.88530761 -6.78368982
53 4.35307598 -1.88530761
54 1.90638643 4.35307598
55 5.43271691 1.90638643
56 2.35054652 5.43271691
57 1.04569833 2.35054652
58 2.91441126 1.04569833
59 0.37956582 2.91441126
60 0.45173051 0.37956582
61 2.33151258 0.45173051
62 0.60885962 2.33151258
63 -1.86471893 0.60885962
64 2.68227518 -1.86471893
65 0.93753678 2.68227518
66 -1.78420151 0.93753678
67 -7.38389141 -1.78420151
68 7.53356652 -7.38389141
69 -0.64485558 7.53356652
70 1.22679922 -0.64485558
71 4.21743446 1.22679922
72 5.66772585 4.21743446
73 -3.16294899 5.66772585
74 1.38022767 -3.16294899
75 6.89972833 1.38022767
76 -1.46263238 6.89972833
77 -0.01775827 -1.46263238
78 1.60722105 -0.01775827
79 1.88738254 1.60722105
80 -0.48027832 1.88738254
81 6.90996328 -0.48027832
82 -0.31506025 6.90996328
83 -3.96783808 -0.31506025
84 1.43021609 -3.96783808
85 -1.79008967 1.43021609
86 2.36521307 -1.79008967
87 -6.09507315 2.36521307
88 -1.17367538 -6.09507315
89 4.95392212 -1.17367538
90 3.57217662 4.95392212
91 3.70880543 3.57217662
92 0.20213642 3.70880543
93 -5.00305682 0.20213642
94 -6.08248746 -5.00305682
95 -1.58521545 -6.08248746
96 NA -1.58521545
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 3.86019274 -0.11557268
[2,] 3.65280770 3.86019274
[3,] 0.77528652 3.65280770
[4,] -3.97891501 0.77528652
[5,] -3.99461400 -3.97891501
[6,] 2.21995264 -3.99461400
[7,] 2.88163283 2.21995264
[8,] 1.54881486 2.88163283
[9,] 3.15686080 1.54881486
[10,] 7.77437895 3.15686080
[11,] -1.75750760 7.77437895
[12,] -1.79443095 -1.75750760
[13,] -4.45197247 -1.79443095
[14,] -1.24417225 -4.45197247
[15,] -3.81989331 -1.24417225
[16,] -4.21078340 -3.81989331
[17,] -1.40585822 -4.21078340
[18,] 0.91329130 -1.40585822
[19,] 1.67224576 0.91329130
[20,] 0.25407677 1.67224576
[21,] -4.02318393 0.25407677
[22,] -4.57736138 -4.02318393
[23,] -8.09412101 -4.57736138
[24,] -1.79180660 -8.09412101
[25,] -0.30062141 -1.79180660
[26,] -2.21874641 -0.30062141
[27,] -2.98557035 -2.21874641
[28,] -0.53814946 -2.98557035
[29,] -1.84698434 -0.53814946
[30,] -0.88141519 -1.84698434
[31,] -0.64169663 -0.88141519
[32,] -3.89889651 -0.64169663
[33,] 0.89765838 -3.89889651
[34,] 1.27580195 0.89765838
[35,] 3.72927069 1.27580195
[36,] 1.87461362 3.72927069
[37,] -2.00757805 1.87461362
[38,] 5.78479226 -2.00757805
[39,] -4.28721589 5.78479226
[40,] -10.35438090 -4.28721589
[41,] -3.18420393 -10.35438090
[42,] 6.01639670 -3.18420393
[43,] 3.74575852 6.01639670
[44,] 0.67613611 3.74575852
[45,] 0.71305897 0.67613611
[46,] -4.37937548 0.71305897
[47,] 1.03185151 -4.37937548
[48,] 2.58904388 1.03185151
[49,] 2.93242115 2.58904388
[50,] -4.66537275 2.93242115
[51,] -6.78368982 -4.66537275
[52,] -1.88530761 -6.78368982
[53,] 4.35307598 -1.88530761
[54,] 1.90638643 4.35307598
[55,] 5.43271691 1.90638643
[56,] 2.35054652 5.43271691
[57,] 1.04569833 2.35054652
[58,] 2.91441126 1.04569833
[59,] 0.37956582 2.91441126
[60,] 0.45173051 0.37956582
[61,] 2.33151258 0.45173051
[62,] 0.60885962 2.33151258
[63,] -1.86471893 0.60885962
[64,] 2.68227518 -1.86471893
[65,] 0.93753678 2.68227518
[66,] -1.78420151 0.93753678
[67,] -7.38389141 -1.78420151
[68,] 7.53356652 -7.38389141
[69,] -0.64485558 7.53356652
[70,] 1.22679922 -0.64485558
[71,] 4.21743446 1.22679922
[72,] 5.66772585 4.21743446
[73,] -3.16294899 5.66772585
[74,] 1.38022767 -3.16294899
[75,] 6.89972833 1.38022767
[76,] -1.46263238 6.89972833
[77,] -0.01775827 -1.46263238
[78,] 1.60722105 -0.01775827
[79,] 1.88738254 1.60722105
[80,] -0.48027832 1.88738254
[81,] 6.90996328 -0.48027832
[82,] -0.31506025 6.90996328
[83,] -3.96783808 -0.31506025
[84,] 1.43021609 -3.96783808
[85,] -1.79008967 1.43021609
[86,] 2.36521307 -1.79008967
[87,] -6.09507315 2.36521307
[88,] -1.17367538 -6.09507315
[89,] 4.95392212 -1.17367538
[90,] 3.57217662 4.95392212
[91,] 3.70880543 3.57217662
[92,] 0.20213642 3.70880543
[93,] -5.00305682 0.20213642
[94,] -6.08248746 -5.00305682
[95,] -1.58521545 -6.08248746
> z <- as.data.frame(dum1)
> print(z)
lag(myerror, k = 1) myerror
1 3.86019274 -0.11557268
2 3.65280770 3.86019274
3 0.77528652 3.65280770
4 -3.97891501 0.77528652
5 -3.99461400 -3.97891501
6 2.21995264 -3.99461400
7 2.88163283 2.21995264
8 1.54881486 2.88163283
9 3.15686080 1.54881486
10 7.77437895 3.15686080
11 -1.75750760 7.77437895
12 -1.79443095 -1.75750760
13 -4.45197247 -1.79443095
14 -1.24417225 -4.45197247
15 -3.81989331 -1.24417225
16 -4.21078340 -3.81989331
17 -1.40585822 -4.21078340
18 0.91329130 -1.40585822
19 1.67224576 0.91329130
20 0.25407677 1.67224576
21 -4.02318393 0.25407677
22 -4.57736138 -4.02318393
23 -8.09412101 -4.57736138
24 -1.79180660 -8.09412101
25 -0.30062141 -1.79180660
26 -2.21874641 -0.30062141
27 -2.98557035 -2.21874641
28 -0.53814946 -2.98557035
29 -1.84698434 -0.53814946
30 -0.88141519 -1.84698434
31 -0.64169663 -0.88141519
32 -3.89889651 -0.64169663
33 0.89765838 -3.89889651
34 1.27580195 0.89765838
35 3.72927069 1.27580195
36 1.87461362 3.72927069
37 -2.00757805 1.87461362
38 5.78479226 -2.00757805
39 -4.28721589 5.78479226
40 -10.35438090 -4.28721589
41 -3.18420393 -10.35438090
42 6.01639670 -3.18420393
43 3.74575852 6.01639670
44 0.67613611 3.74575852
45 0.71305897 0.67613611
46 -4.37937548 0.71305897
47 1.03185151 -4.37937548
48 2.58904388 1.03185151
49 2.93242115 2.58904388
50 -4.66537275 2.93242115
51 -6.78368982 -4.66537275
52 -1.88530761 -6.78368982
53 4.35307598 -1.88530761
54 1.90638643 4.35307598
55 5.43271691 1.90638643
56 2.35054652 5.43271691
57 1.04569833 2.35054652
58 2.91441126 1.04569833
59 0.37956582 2.91441126
60 0.45173051 0.37956582
61 2.33151258 0.45173051
62 0.60885962 2.33151258
63 -1.86471893 0.60885962
64 2.68227518 -1.86471893
65 0.93753678 2.68227518
66 -1.78420151 0.93753678
67 -7.38389141 -1.78420151
68 7.53356652 -7.38389141
69 -0.64485558 7.53356652
70 1.22679922 -0.64485558
71 4.21743446 1.22679922
72 5.66772585 4.21743446
73 -3.16294899 5.66772585
74 1.38022767 -3.16294899
75 6.89972833 1.38022767
76 -1.46263238 6.89972833
77 -0.01775827 -1.46263238
78 1.60722105 -0.01775827
79 1.88738254 1.60722105
80 -0.48027832 1.88738254
81 6.90996328 -0.48027832
82 -0.31506025 6.90996328
83 -3.96783808 -0.31506025
84 1.43021609 -3.96783808
85 -1.79008967 1.43021609
86 2.36521307 -1.79008967
87 -6.09507315 2.36521307
88 -1.17367538 -6.09507315
89 4.95392212 -1.17367538
90 3.57217662 4.95392212
91 3.70880543 3.57217662
92 0.20213642 3.70880543
93 -5.00305682 0.20213642
94 -6.08248746 -5.00305682
95 -1.58521545 -6.08248746
> 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="/home/pw/wessanet/rcomp/tmp/7ecqj1586637023.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="/home/pw/wessanet/rcomp/tmp/84sql1586637023.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="/home/pw/wessanet/rcomp/tmp/9or8w1586637023.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="/home/pw/wessanet/rcomp/tmp/10z29e1586637023.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
>
> 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, signif(mysum$coefficients[i,1],6), 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.row.start(a)
> a<-table.element(a, mywarning)
> a<-table.row.end(a)
> a<-table.end(a)
> table.save(a,file="/home/pw/wessanet/rcomp/tmp/11t6dw1586637023.tab")
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a,'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,formatC(signif(mysum$coefficients[i,1],5),format='g',flag='+'))
+ a<-table.element(a,formatC(signif(mysum$coefficients[i,2],5),format='g',flag=' '))
+ a<-table.element(a,formatC(signif(mysum$coefficients[i,3],4),format='e',flag='+'))
+ a<-table.element(a,formatC(signif(mysum$coefficients[i,4],4),format='g',flag=' '))
+ a<-table.element(a,formatC(signif(mysum$coefficients[i,4]/2,4),format='g',flag=' '))
+ a<-table.row.end(a)
+ }
> a<-table.end(a)
> table.save(a,file="/home/pw/wessanet/rcomp/tmp/12zo0q1586637023.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,formatC(signif(sqrt(mysum$r.squared),6),format='g',flag=' '))
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'R-squared',1,TRUE)
> a<-table.element(a,formatC(signif(mysum$r.squared,6),format='g',flag=' '))
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Adjusted R-squared',1,TRUE)
> a<-table.element(a,formatC(signif(mysum$adj.r.squared,6),format='g',flag=' '))
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (value)',1,TRUE)
> a<-table.element(a,formatC(signif(mysum$fstatistic[1],6),format='g',flag=' '))
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (DF numerator)',1,TRUE)
> a<-table.element(a, signif(mysum$fstatistic[2],6))
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (DF denominator)',1,TRUE)
> a<-table.element(a, signif(mysum$fstatistic[3],6))
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'p-value',1,TRUE)
> a<-table.element(a,formatC(signif(1-pf(mysum$fstatistic[1],mysum$fstatistic[2],mysum$fstatistic[3]),6),format='g',flag=' '))
> 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,formatC(signif(mysum$sigma,6),format='g',flag=' '))
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Sum Squared Residuals',1,TRUE)
> a<-table.element(a,formatC(signif(sum(myerror*myerror),6),format='g',flag=' '))
> a<-table.row.end(a)
> a<-table.end(a)
> table.save(a,file="/home/pw/wessanet/rcomp/tmp/13zayg1586637023.tab")
> myr <- as.numeric(mysum$resid)
> myr
[1] -0.11557268 3.86019274 3.65280770 0.77528652 -3.97891501
[6] -3.99461400 2.21995264 2.88163283 1.54881486 3.15686080
[11] 7.77437895 -1.75750760 -1.79443095 -4.45197247 -1.24417225
[16] -3.81989331 -4.21078340 -1.40585822 0.91329130 1.67224576
[21] 0.25407677 -4.02318393 -4.57736138 -8.09412101 -1.79180660
[26] -0.30062141 -2.21874641 -2.98557035 -0.53814946 -1.84698434
[31] -0.88141519 -0.64169663 -3.89889651 0.89765838 1.27580195
[36] 3.72927069 1.87461362 -2.00757805 5.78479226 -4.28721589
[41] -10.35438090 -3.18420393 6.01639670 3.74575852 0.67613611
[46] 0.71305897 -4.37937548 1.03185151 2.58904388 2.93242115
[51] -4.66537275 -6.78368982 -1.88530761 4.35307598 1.90638643
[56] 5.43271691 2.35054652 1.04569833 2.91441126 0.37956582
[61] 0.45173051 2.33151258 0.60885962 -1.86471893 2.68227518
[66] 0.93753678 -1.78420151 -7.38389141 7.53356652 -0.64485558
[71] 1.22679922 4.21743446 5.66772585 -3.16294899 1.38022767
[76] 6.89972833 -1.46263238 -0.01775827 1.60722105 1.88738254
[81] -0.48027832 6.90996328 -0.31506025 -3.96783808 1.43021609
[86] -1.79008967 2.36521307 -6.09507315 -1.17367538 4.95392212
[91] 3.57217662 3.70880543 0.20213642 -5.00305682 -6.08248746
[96] -1.58521545
> a <-table.start()
> a <- table.row.start(a)
> a <- table.element(a,'Menu of Residual Diagnostics',2,TRUE)
> a <- table.row.end(a)
> a <- table.row.start(a)
> a <- table.element(a,'Description',1,TRUE)
> a <- table.element(a,'Link',1,TRUE)
> a <- table.row.end(a)
> a <- table.row.start(a)
> a <-table.element(a,'Histogram',1,header=TRUE)
> a <- table.element(a,hyperlink( paste('https://supernova.wessa.net/rwasp_histogram.wasp?convertgetintopost=1&data=',paste(as.character(mysum$resid),sep='',collapse=' '),sep='') ,'Compute','Click here to examine the Residuals.'),1)
> a <- table.row.end(a)
> a <- table.row.start(a)
> a <-table.element(a,'Central Tendency',1,header=TRUE)
> a <- table.element(a,hyperlink( paste('https://supernova.wessa.net/rwasp_centraltendency.wasp?convertgetintopost=1&data=',paste(as.character(mysum$resid),sep='',collapse=' '),sep='') ,'Compute','Click here to examine the Residuals.'),1)
> a <- table.row.end(a)
> a <- table.row.start(a)
> a <-table.element(a,'QQ Plot',1,header=TRUE)
> a <- table.element(a,hyperlink( paste('https://supernova.wessa.net/rwasp_fitdistrnorm.wasp?convertgetintopost=1&data=',paste(as.character(mysum$resid),sep='',collapse=' '),sep='') ,'Compute','Click here to examine the Residuals.'),1)
> a <- table.row.end(a)
> a <- table.row.start(a)
> a <-table.element(a,'Kernel Density Plot',1,header=TRUE)
> a <- table.element(a,hyperlink( paste('https://supernova.wessa.net/rwasp_density.wasp?convertgetintopost=1&data=',paste(as.character(mysum$resid),sep='',collapse=' '),sep='') ,'Compute','Click here to examine the Residuals.'),1)
> a <- table.row.end(a)
> a <- table.row.start(a)
> a <-table.element(a,'Skewness/Kurtosis Test',1,header=TRUE)
> a <- table.element(a,hyperlink( paste('https://supernova.wessa.net/rwasp_skewness_kurtosis.wasp?convertgetintopost=1&data=',paste(as.character(mysum$resid),sep='',collapse=' '),sep='') ,'Compute','Click here to examine the Residuals.'),1)
> a <- table.row.end(a)
> a <- table.row.start(a)
> a <-table.element(a,'Skewness-Kurtosis Plot',1,header=TRUE)
> a <- table.element(a,hyperlink( paste('https://supernova.wessa.net/rwasp_skewness_kurtosis_plot.wasp?convertgetintopost=1&data=',paste(as.character(mysum$resid),sep='',collapse=' '),sep='') ,'Compute','Click here to examine the Residuals.'),1)
> a <- table.row.end(a)
> a <- table.row.start(a)
> a <-table.element(a,'Harrell-Davis Plot',1,header=TRUE)
> a <- table.element(a,hyperlink( paste('https://supernova.wessa.net/rwasp_harrell_davis.wasp?convertgetintopost=1&data=',paste(as.character(mysum$resid),sep='',collapse=' '),sep='') ,'Compute','Click here to examine the Residuals.'),1)
> a <- table.row.end(a)
> a <- table.row.start(a)
> a <-table.element(a,'Bootstrap Plot -- Central Tendency',1,header=TRUE)
> a <- table.element(a,hyperlink( paste('https://supernova.wessa.net/rwasp_bootstrapplot1.wasp?convertgetintopost=1&data=',paste(as.character(mysum$resid),sep='',collapse=' '),sep='') ,'Compute','Click here to examine the Residuals.'),1)
> a <- table.row.end(a)
> a <- table.row.start(a)
> a <-table.element(a,'Blocked Bootstrap Plot -- Central Tendency',1,header=TRUE)
> a <- table.element(a,hyperlink( paste('https://supernova.wessa.net/rwasp_bootstrapplot.wasp?convertgetintopost=1&data=',paste(as.character(mysum$resid),sep='',collapse=' '),sep='') ,'Compute','Click here to examine the Residuals.'),1)
> a <- table.row.end(a)
> a <- table.row.start(a)
> a <-table.element(a,'(Partial) Autocorrelation Plot',1,header=TRUE)
> a <- table.element(a,hyperlink( paste('https://supernova.wessa.net/rwasp_autocorrelation.wasp?convertgetintopost=1&data=',paste(as.character(mysum$resid),sep='',collapse=' '),sep='') ,'Compute','Click here to examine the Residuals.'),1)
> a <- table.row.end(a)
> a <- table.row.start(a)
> a <-table.element(a,'Spectral Analysis',1,header=TRUE)
> a <- table.element(a,hyperlink( paste('https://supernova.wessa.net/rwasp_spectrum.wasp?convertgetintopost=1&data=',paste(as.character(mysum$resid),sep='',collapse=' '),sep='') ,'Compute','Click here to examine the Residuals.'),1)
> a <- table.row.end(a)
> a <- table.row.start(a)
> a <-table.element(a,'Tukey lambda PPCC Plot',1,header=TRUE)
> a <- table.element(a,hyperlink( paste('https://supernova.wessa.net/rwasp_tukeylambda.wasp?convertgetintopost=1&data=',paste(as.character(mysum$resid),sep='',collapse=' '),sep='') ,'Compute','Click here to examine the Residuals.'),1)
> a <- table.row.end(a)
> a <- table.row.start(a)
> a <-table.element(a,'Box-Cox Normality Plot',1,header=TRUE)
> a <- table.element(a,hyperlink( paste('https://supernova.wessa.net/rwasp_boxcoxnorm.wasp?convertgetintopost=1&data=',paste(as.character(mysum$resid),sep='',collapse=' '),sep='') ,'Compute','Click here to examine the Residuals.'),1)
> a <- table.row.end(a)
> a <- table.row.start(a)
> a <- table.element(a,'Summary Statistics',1,header=TRUE)
> a <- table.element(a,hyperlink( paste('https://supernova.wessa.net/rwasp_summary1.wasp?convertgetintopost=1&data=',paste(as.character(mysum$resid),sep='',collapse=' '),sep='') ,'Compute','Click here to examine the Residuals.'),1)
> a <- table.row.end(a)
> a<-table.end(a)
> table.save(a,file="/home/pw/wessanet/rcomp/tmp/14ssdi1586637023.tab")
> if(n < 200) {
+ 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,formatC(signif(x[i],6),format='g',flag=' '))
+ a<-table.element(a,formatC(signif(x[i]-mysum$resid[i],6),format='g',flag=' '))
+ a<-table.element(a,formatC(signif(mysum$resid[i],6),format='g',flag=' '))
+ a<-table.row.end(a)
+ }
+ a<-table.end(a)
+ table.save(a,file="/home/pw/wessanet/rcomp/tmp/15nt0w1586637023.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,formatC(signif(gqarr[mypoint-kp3+1,1],6),format='g',flag=' '))
+ a<-table.element(a,formatC(signif(gqarr[mypoint-kp3+1,2],6),format='g',flag=' '))
+ a<-table.element(a,formatC(signif(gqarr[mypoint-kp3+1,3],6),format='g',flag=' '))
+ a<-table.row.end(a)
+ }
+ a<-table.end(a)
+ table.save(a,file="/home/pw/wessanet/rcomp/tmp/16ujk61586637023.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,signif(numsignificant1,6))
+ a<-table.element(a,formatC(signif(numsignificant1/numgqtests,6),format='g',flag=' '))
+ 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,signif(numsignificant5,6))
+ a<-table.element(a,signif(numsignificant5/numgqtests,6))
+ 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,signif(numsignificant10,6))
+ a<-table.element(a,signif(numsignificant10/numgqtests,6))
+ 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="/home/pw/wessanet/rcomp/tmp/17696z1586637023.tab")
+ }
+ }
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a,'Ramsey RESET F-Test for powers (2 and 3) of fitted values',1,TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> reset_test_fitted <- resettest(mylm,power=2:3,type='fitted')
> a<-table.element(a,paste('
',RC.texteval('reset_test_fitted'),'',sep='')) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Ramsey RESET F-Test for powers (2 and 3) of regressors',1,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > reset_test_regressors <- resettest(mylm,power=2:3,type='regressor') > a<-table.element(a,paste('
',RC.texteval('reset_test_regressors'),'',sep='')) > a<-table.row.end(a) > a<-table.row.start(a) > a<-table.element(a,'Ramsey RESET F-Test for powers (2 and 3) of principal components',1,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > reset_test_principal_components <- resettest(mylm,power=2:3,type='princomp') > a<-table.element(a,paste('
',RC.texteval('reset_test_principal_components'),'',sep='')) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/home/pw/wessanet/rcomp/tmp/18kf9v1586637023.tab") > a<-table.start() > a<-table.row.start(a) > a<-table.element(a,'Variance Inflation Factors (Multicollinearity)',1,TRUE) > a<-table.row.end(a) > a<-table.row.start(a) > vif <- vif(mylm) > a<-table.element(a,paste('
',RC.texteval('vif'),'',sep='')) > a<-table.row.end(a) > a<-table.end(a) > table.save(a,file="/home/pw/wessanet/rcomp/tmp/19717t1586637023.tab") > > try(system("convert /home/pw/wessanet/rcomp/tmp/1fwco1586637023.ps /home/pw/wessanet/rcomp/tmp/1fwco1586637023.png",intern=TRUE)) convert-im6.q16: profile 'icc': 'RGB ': RGB color space not permitted on grayscale PNG `/home/pw/wessanet/rcomp/tmp/1fwco1586637023.png' @ warning/png.c/MagickPNGWarningHandler/1654. character(0) > try(system("convert /home/pw/wessanet/rcomp/tmp/2ot9n1586637023.ps /home/pw/wessanet/rcomp/tmp/2ot9n1586637023.png",intern=TRUE)) convert-im6.q16: profile 'icc': 'RGB ': RGB color space not permitted on grayscale PNG `/home/pw/wessanet/rcomp/tmp/2ot9n1586637023.png' @ warning/png.c/MagickPNGWarningHandler/1654. character(0) > try(system("convert /home/pw/wessanet/rcomp/tmp/353bm1586637023.ps /home/pw/wessanet/rcomp/tmp/353bm1586637023.png",intern=TRUE)) convert-im6.q16: profile 'icc': 'RGB ': RGB color space not permitted on grayscale PNG `/home/pw/wessanet/rcomp/tmp/353bm1586637023.png' @ warning/png.c/MagickPNGWarningHandler/1654. character(0) > try(system("convert /home/pw/wessanet/rcomp/tmp/4wbtq1586637023.ps /home/pw/wessanet/rcomp/tmp/4wbtq1586637023.png",intern=TRUE)) convert-im6.q16: profile 'icc': 'RGB ': RGB color space not permitted on grayscale PNG `/home/pw/wessanet/rcomp/tmp/4wbtq1586637023.png' @ warning/png.c/MagickPNGWarningHandler/1654. character(0) > try(system("convert /home/pw/wessanet/rcomp/tmp/5oj751586637023.ps /home/pw/wessanet/rcomp/tmp/5oj751586637023.png",intern=TRUE)) character(0) > try(system("convert /home/pw/wessanet/rcomp/tmp/6pdgz1586637023.ps /home/pw/wessanet/rcomp/tmp/6pdgz1586637023.png",intern=TRUE)) convert-im6.q16: profile 'icc': 'RGB ': RGB color space not permitted on grayscale PNG `/home/pw/wessanet/rcomp/tmp/6pdgz1586637023.png' @ warning/png.c/MagickPNGWarningHandler/1654. character(0) > try(system("convert /home/pw/wessanet/rcomp/tmp/7ecqj1586637023.ps /home/pw/wessanet/rcomp/tmp/7ecqj1586637023.png",intern=TRUE)) character(0) > try(system("convert /home/pw/wessanet/rcomp/tmp/84sql1586637023.ps /home/pw/wessanet/rcomp/tmp/84sql1586637023.png",intern=TRUE)) character(0) > try(system("convert /home/pw/wessanet/rcomp/tmp/9or8w1586637023.ps /home/pw/wessanet/rcomp/tmp/9or8w1586637023.png",intern=TRUE)) character(0) > try(system("convert /home/pw/wessanet/rcomp/tmp/10z29e1586637023.ps /home/pw/wessanet/rcomp/tmp/10z29e1586637023.png",intern=TRUE)) convert-im6.q16: profile 'icc': 'RGB ': RGB color space not permitted on grayscale PNG `/home/pw/wessanet/rcomp/tmp/10z29e1586637023.png' @ warning/png.c/MagickPNGWarningHandler/1654. character(0) > > proc.time() user system elapsed 2.306 0.294 2.608