Send output to:
Browser Blue - Charts White
Browser Black/White
CSV
Data X:
321.61 26.75 109.3 345.85 22.33 109.6 338.60 16.38 109.3 345.64 12.77 108.8 340.71 11.89 108.60 342.49 13.49 108.9 342.65 11.95 109.5 348.68 9.88 109.5 377.36 13.42 109.7 418.05 14.03 110.2 423.13 14.01 110.3 397.69 14.47 110.4 390.80 15.44 110.5 408.29 18.1 111.2 401.02 17.28 111.6 409.24 17.74 112.1 439.28 18.05 112.70 459.95 18.41 113.1 449.66 18.71 113.5 451.14 19.62 113.8 460.66 18.88 114.4 460.23 18.32 115 465.69 18.63 115.3 468.01 17.87 115.4 486.74 16.77 115.4 475.89 16.5 115.7 441.52 15.9 116 443.63 14.86 116.5 451.62 16.42 117.10 451.14 16.36 117.5 450.88 15.49 118 437.56 14.47 118.5 431.18 14.57 119 412.02 13.22 119.8 407.14 12.23 120.2 420.48 12.53 120.3 418.92 14.68 120.5 403.57 16.45 121.1 387.55 16.52 121.6 390.02 18.1 122.3 384.37 19.39 123.10 370.62 18.22 123.8 367.90 17.8 124.1 374.91 17.67 124.4 365.15 16.87 124.6 361.91 17.69 125 367.03 18.41 125.6 395.19 18.38 125.9 409.25 19.37 126.1 410.49 20.59 127.4 416.58 19.68 128 392.21 18.12 128.7 374.29 16.32 128.90 369.05 16.21 129.2 352.19 14.93 129.9 362.85 16.81 130.4 395.47 26.54 131.6 388.82 33.62 132.7 380.39 34.85 133.5 381.73 31.54 133.8 377.69 26.61 133.8 383.04 22.81 134.6 363.89 18.53 134.8 363.23 18.21 135 358.37 18.49 135.20 356.97 18.72 135.6 366.87 17.78 136 367.57 19.02 136.2 355.88 19.3 136.6 348.88 19.95 137.2 358.77 21.56 137.4 360.42 20.41 137.8 361.08 17.63 137.9 354.57 17.52 138.1 353.73 17.65 138.6 344.20 17.35 139.3 338.34 18.65 139.50 337.21 19.52 139.7 340.96 20.88 140.2 353.29 20.18 140.5 342.67 19.62 140.9 345.71 20.19 141.3 344.17 20.04 141.8 334.92 18.9 142 334.81 17.93 141.9 329.05 17.24 142.6 329.31 18.23 143.1 330.25 18.5 143.6 341.89 18.44 144.00 367.74 18.17 144.2 371.93 17.37 144.4 392.79 16.37 144.4 377.97 16.43 144.8 354.93 15.8 145.1 364.40 16.44 145.7 374.05 15.09 145.8 383.63 13.36 145.8 386.56 14.17 146.2 381.90 13.75 146.7 384.08 13.69 147.2 377.29 15.15 147.40 381.54 16.43 147.5 385.60 17.23 148 385.47 18.04 148.4 380.40 16.98 149 391.74 16.13 149.4 389.57 16.48 149.5 384.29 17.2 149.7 379.26 16.13 149.7 378.44 16.88 150.3 376.63 17.44 150.9 382.48 17.35 151.4 390.89 18.77 151.90 385.04 18.43 152.2 387.58 17.33 152.5 386.19 16.06 152.5 383.78 16.49 152.9 383.10 16.77 153.2 383.25 16.18 153.7 385.19 16.82 153.6 387.35 17.93 153.5 400.49 17.79 154.4 404.53 17.69 154.9 396.15 19.46 155.7 392.79 20.78 156.30 391.96 19.12 156.6 385.04 18.56 156.7 383.58 19.56 157 387.46 20.19 157.3 382.90 22.14 157.8 381.04 23.43 158.3 377.69 22.25 158.6 368.95 23.51 158.6 353.87 23.29 159.1 347.03 20.54 159.6 351.49 19.42 160 344.23 17.98 160.20 344.09 19.47 160.1 340.51 18.02 160.3 323.90 18.45 160.5 324.02 18.79 160.8 323.11 18.73 161.2 324.36 20.12 161.6 305.55 19.16 161.5 288.59 17.24 161.3 289.15 15.07 161.6 297.49 14.18 161.9 295.94 13.24 162.2 308.29 13.39 162.50 299.10 13.97 162.8 292.32 12.48 163 292.87 12.72 163.2 284.11 12.49 163.4 288.98 13.8 163.6 295.93 13.26 164 294.17 11.88 164 291.68 10.41 163.9 287.07 11.32 164.3 287.33 10.75 164.5 285.96 12.86 165 282.62 15.73 166.20 276.44 16.12 166.2 261.31 16.24 166.2 256.08 18.75 166.7 256.69 20.21 167.1 264.74 22.37 167.9 310.72 22.19 168.2 293.18 24.22 168.3 283.07 25.01 168.3 284.32 25.21 168.8 299.86 27.15 169.8 286.39 27.49 171.2 279.69 23.45 171.30 275.19 27.23 171.5 285.73 29.62 172.4 281.59 28.16 172.8 274.47 29.41 172.8 273.68 32.08 173.7 270.00 31.4 174 266.01 32.33 174.1 271.45 25.28 174 265.49 25.95 175.1 261.87 27.24 175.8 263.03 25.02 176.2 260.48 25.66 176.90 272.36 27.55 177.7 269.82 26.97 178 267.53 24.8 177.5 272.39 25.81 177.5 283.42 25.03 178.3 283.06 20.73 177.7 276.16 18.69 177.4 275.85 18.52 176.7 281.51 19.15 177.1 295.50 19.98 177.8 294.06 23.64 178.8 302.68 25.43 179.80 314.58 25.69 179.8 321.18 24.49 179.9 313.29 25.75 180.1 310.25 26.78 180.7 319.14 28.28 181 316.56 27.53 181.3 319.07 24.79 181.3 331.92 27.89 180.9 356.86 30.77 181.7 358.97 32.88 183.1 340.55 30.36 184.2 328.18 25.49 183.80 355.68 26.06 183.5 356.35 27.91 183.7 350.99 28.59 183.9 359.77 29.68 184.6 378.95 26.88 185.2 378.92 29.01 185 389.91 29.12 184.5 406.11 29.95 184.3 413.79 31.4 185.2 404.95 31.32 186.2 406.67 33.67 187.4 403.26 33.71 188.00 383.78 37.63 189.1 392.48 35.54 189.7 398.09 37.93 189.4 400.51 42.08 189.5 405.28 41.65 189.9 420.46 46.87 190.9 439.38 42.23 191 442.08 39.09 190.3 424.03 42.89 190.7 423.35 44.56 191.8 434.32 50.93 193.3 429.23 50.64 194.60 421.87 47.81 194.4 430.66 53.89 194.5 424.48 56.37 195.4 437.93 61.87 196.4 456.05 61.65 198.8 469.90 58.19 199.2 476.67 54.98 197.6 510.10 56.47 196.8 549.86 62.36 198.3 555.00 59.71 198.7 557.09 60.93 199.8 610.65 68 201.50 675.39 68.61 202.5 596.15 68.29 202.9 633.71 72.51 203.5 632.33 71.81 203.9 598.06 61.97 202.9 585.78 57.95 201.8 627.83 58.13 201.5 629.42 61 201.8 631.17 53.4 202.416 664.75 57.58 203.499 654.90 60.6 205.352 679.37 65.1 206.69 666.92 65.1 207.949 655.49 68.19 208.352 665.30 73.67 208.299 665.41 70.13 207.917 712.65 76.91 208.49 754.60 82.15 208.936 806.25 91.27 210.177 803.20 89.43 210.036 889.60 90.82 211.08 922.30 93.75 211.693 968.43 101.84 213.528 909.70 109.05 214.82 890.51 122.77 216.632 889.49 131.52 218.815 939.77 132.55 219.964 838.31 114.57 219.086 829.93 99.29 218.783 806.62 72.69 216.573 760.86 54.04 212.425 822.00 41.53 210.228 859.19 43.91 211.143 943.16 41.76 212.193 924.27 46.95 212.709 889.50 50.28 213.24 930.20 58.1 213.856 945.67 69.13 215.693 934.23 64.65 215.351 949.67 71.63 215.834 996.59 68.38 215.969 1043.16 74.08 216.177 1127.04 77.56 216.33 1126.22 74.88 215.949 1116.51 77.09 216.687 1095.41 74.7 216.741 1113.34 79.3 217.631 1148.69 84.19 218.01 1205.43 75.56 218.178 1232.92 74.73 217.965 1192.97 74.49 218.011 1215.81 75.93 218.312 1270.98 76.14 218.439 1342.02 81.72 218.711
Names of X columns:
Gold Oil CPI
Sample Range:
(leave blank to include all observations)
From:
To:
Column Number of Endogenous Series
(?)
Fixed Seasonal Effects
Do not include Seasonal Dummies
Do not include Seasonal Dummies
Include Seasonal Dummies
Type of Equation
No Linear Trend
No Linear Trend
Linear Trend
First Differences
Seasonal Differences (s)
First and Seasonal Differences (s)
Degree of Predetermination (lagged endogenous variables)
Degree of Seasonal Predetermination
Seasonality
12
1
2
3
4
5
6
7
8
9
10
11
12
Chart options
R Code
library(lattice) library(lmtest) 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 k <- length(x[1,]) df <- as.data.frame(x) (mylm <- lm(df)) (mysum <- summary(mylm)) 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 } bitmap(file='test0.png') 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() bitmap(file='test1.png') plot(mysum$resid, type='b', pch=19, main='Residuals', ylab='value of Residuals', xlab='time or index') grid() dev.off() bitmap(file='test2.png') hist(mysum$resid, main='Residual Histogram', xlab='values of Residuals') grid() dev.off() bitmap(file='test3.png') densityplot(~mysum$resid,col='black',main='Residual Density Plot', xlab='values of Residuals') dev.off() bitmap(file='test4.png') qqnorm(mysum$resid, main='Residual Normal Q-Q Plot') qqline(mysum$resid) grid() dev.off() (myerror <- as.ts(mysum$resid)) bitmap(file='test5.png') dum <- cbind(lag(myerror,k=1),myerror) dum dum1 <- dum[2:length(myerror),] dum1 z <- as.data.frame(dum1) z 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() bitmap(file='test6.png') acf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Autocorrelation Function') grid() dev.off() bitmap(file='test7.png') pacf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Partial Autocorrelation Function') grid() dev.off() bitmap(file='test8.png') opar <- par(mfrow = c(2,2), oma = c(0, 0, 1.1, 0)) plot(mylm, las = 1, sub='Residual Diagnostics') par(opar) dev.off() if (n > n25) { bitmap(file='test9.png') plot(kp3:nmkm3,gqarr[,2], main='Goldfeld-Quandt test',ylab='2-sided p-value',xlab='breakpoint') grid() dev.off() } load(file='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='mytable1.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<br />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='mytable2.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='mytable3.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<br />Forecast', 1, TRUE) a<-table.element(a, 'Residuals<br />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='mytable4.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='mytable5.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='mytable6.tab') }
Compute
Summary of computational transaction
Raw Input
view raw input (R code)
Raw Output
view raw output of R engine
Computing time
0 seconds
R Server
Big Analytics Cloud Computing Center
Click here to blog (archive) this computation