Send output to:
Browser Blue - Charts White
Browser Black/White
CSV
Data X:
56 30 112285 58.58527778 56 28 84786 33.60611111 54 38 83123 49.03 89 30 101193 49.81138889 40 22 38361 34.21805556 25 26 68504 14.65166667 92 25 119182 107.0927778 18 18 22807 9.213888889 63 11 17140 28.23472222 44 26 116174 41.40583333 33 25 57635 45.95722222 84 38 66198 65.8925 88 44 71701 48.14611111 55 30 57793 36.98083333 60 40 80444 71.90916667 66 34 53855 50.02305556 154 47 97668 90.22194444 53 30 133824 64.15666667 119 31 101481 65.77361111 41 23 99645 37.63138889 61 36 114789 56.36805556 58 36 99052 59.76305556 75 30 67654 95.63805556 33 25 65553 42.75972222 40 39 97500 36.92861111 92 34 69112 48.53444444 100 31 82753 48.44861111 112 31 85323 62.65222222 73 33 72654 62.12 40 25 30727 34.67138889 45 33 77873 61.58277778 60 35 117478 58.54638889 62 42 74007 47.29611111 75 43 90183 72.37805556 31 30 61542 23.57027778 77 33 101494 81.78444444 34 13 27570 28.05861111 46 32 55813 59.90027778 99 36 79215 90.3075 17 0 1423 1.993333333 66 28 55461 46.53944444 30 14 31081 29.55777778 76 17 22996 26.82222222 146 32 83122 73.82472222 67 30 70106 74.90305556 56 35 60578 41.42 107 20 39992 48.84 58 28 79892 42.46416667 34 28 49810 31.01805556 61 39 71570 32.33555556 119 34 100708 100.6391667 42 26 33032 21.88888889 66 39 82875 50.87972222 89 39 139077 77.2125 44 33 71595 41.84138889 66 28 72260 46.89138889 24 4 5950 6.718888889 259 39 115762 91.46305556 17 18 32551 18.06361111 64 14 31701 28.0825 41 29 80670 60.81833333 68 44 143558 67.79222222 168 21 117105 94.88055556 43 16 23789 28.77694444 132 28 120733 64.81333333 105 35 105195 71.23944444 71 28 73107 57.26694444 112 38 132068 86.52027778 94 23 149193 65.5 82 36 46821 49.4275 70 32 87011 57.54888889 57 29 95260 54.59805556 53 25 55183 48.38444444 103 27 106671 39.79055556 121 36 73511 52.09972222 62 28 92945 52.13361111 52 23 78664 33.06 52 40 70054 50.60888889 32 23 22618 20.435 62 40 74011 54.16083333 45 28 83737 46.52444444 46 34 69094 39.93222222 63 33 93133 76.53916667 75 28 95536 67.55527778 88 34 225920 50.83305556 46 30 62133 37.68027778 53 33 61370 42.30527778 37 22 43836 33.39472222 90 38 106117 96.24583333 63 26 38692 40.49722222 78 35 84651 53.70527778 25 8 56622 22.48694444 45 24 15986 34.10388889 46 29 95364 36.27361111 41 20 26706 31.28083333 144 29 89691 79.57444444 82 45 67267 66.96277778 91 37 126846 41.235 71 33 41140 56.86472222 63 33 102860 50.5775 53 25 51715 38.98444444 62 32 55801 61.25444444 63 29 111813 67.51666667 32 28 120293 45.2125 39 28 138599 50.72583333 62 31 161647 64.48277778 117 52 115929 73.69944444 34 21 24266 23.77055556 92 24 162901 86.34416667 93 41 109825 62.51666667 54 33 129838 64.5325 144 32 37510 40.26833333 14 19 43750 12.02416667 61 20 40652 43.265 109 31 87771 45.7525 38 31 85872 56.09444444 73 32 89275 65.40388889 75 18 44418 61.33361111 50 23 192565 27.62944444 61 17 35232 25.73916667 55 20 40909 37.03555556 77 12 13294 17.04472222 75 17 32387 34.98055556 72 30 140867 27.98611111 50 31 120662 62.37472222 32 10 21233 22.86555556 53 13 44332 28.33611111 42 22 61056 28.20083333 71 42 101338 67.64194444 10 1 1168 6.371666667 35 9 13497 11.54611111 65 32 65567 42.35388889 25 11 25162 17.1825 66 25 32334 27.75638889 41 36 40735 36.80194444 86 31 91413 88.165 16 0 855 5.848333333 42 24 97068 58.23361111 19 13 44339 6.291111111 19 8 14116 8.726111111 45 13 10288 12.97166667 65 19 65622 36.58277778 35 18 16563 25.48194444 95 33 76643 67.98583333 49 40 110681 51.25277778 37 22 29011 22.18416667 64 38 92696 35.67305556 38 24 94785 27.1775 34 8 8773 10.615 32 35 83209 41.9725 65 43 93815 75.68277778 52 43 86687 47.915 62 14 34553 30.01194444 65 41 105547 91.14083333 83 38 103487 69.60527778 95 45 213688 97.51861111 29 31 71220 43.89305556 18 13 23517 27.46277778 33 28 56926 23.73305556 247 31 91721 63.67833333 139 40 115168 97.67194444 29 30 111194 23.39083333 118 16 51009 33.45694444 110 37 135777 90.16611111 67 30 51513 36.40805556 42 35 74163 56.74194444 65 32 51633 45.98416667 94 27 75345 39.36722222 64 20 33416 32.23555556 81 18 83305 69.4575 95 31 98952 83.27083333 67 31 102372 54.39944444 63 21 37238 48.12777778 83 39 103772 70.69111111 45 41 123969 28.99694444 30 13 27142 37.80111111 70 32 135400 55.41 32 18 21399 25.69416667 83 39 130115 62.31388889 31 14 24874 37.71694444 67 7 34988 20.66888889 66 17 45549 22.56666667 10 0 6023 4.08 70 30 64466 50.45361111 103 37 54990 75.51555556 5 0 1644 1.999722222 20 5 6179 12.96111111 5 1 3926 4.874166667 36 16 32755 37.04666667 34 32 34777 26.45194444 48 24 73224 42.38916667 40 17 27114 27.26277778 43 11 20760 22.11638889 31 24 37636 16.44277778 42 22 65461 38.87277778 46 12 30080 32.94777778 33 19 24094 20.24444444 18 13 69008 18.1875 55 17 54968 27.67861111 35 15 46090 19.99027778 59 16 27507 21.46444444 19 24 10672 13.69138889 66 15 34029 37.53638889 60 17 46300 30.12388889 36 18 24760 24.92944444 25 20 18779 12.30444444 47 16 21280 21.56888889 54 16 40662 50.42444444 53 18 28987 37.2275 40 22 22827 34.46222222 40 8 18513 25.73055556 39 17 30594 33.84666667 14 18 24006 14.69861111 45 16 27913 22.74222222 36 23 42744 16.38361111 28 22 12934 14.86527778 44 13 22574 16.89222222 30 13 41385 15.65972222 22 16 18653 18.19166667 17 16 18472 22.48583333 31 20 30976 21.195 55 22 63339 28.89194444 54 17 25568 27.25111111 21 18 33747 18.88583333 14 17 4154 8.608055556 81 12 19474 37.62722222 35 7 35130 20.41777778 43 17 39067 17.53416667 46 14 13310 17.015 30 23 65892 20.80944444 23 17 4143 8.826111111 38 14 28579 22.62138889 54 15 51776 24.21833333 20 17 21152 13.91388889 53 21 38084 18.2625 45 18 27717 15.73694444 39 18 32928 43.99972222 20 17 11342 12.90416667 24 17 19499 20.45111111 31 16 16380 10.66527778 35 15 36874 25.5275 151 21 48259 38.75722222 52 16 16734 14.49 30 14 28207 14.32416667 31 15 30143 19.5975 29 17 41369 23.57111111 57 15 45833 28.48277778 40 15 29156 24.07722222 44 10 35944 23.80805556 25 6 36278 9.628333333 77 22 45588 41.82777778 35 21 45097 27.66972222 11 1 3895 5.374722222 63 18 28394 27.60361111 44 17 18632 23.95277778 19 4 2325 8.565833333 13 10 25139 8.807222222 42 16 27975 24.94611111 38 16 14483 17.24666667 29 9 13127 11.15305556 20 16 5839 7.676111111 27 17 24069 21.38611111 20 7 3738 10.40555556 19 15 18625 15.04361111 37 14 36341 13.85055556 26 14 24548 23.42694444 42 18 21792 17.82638889 49 12 26263 16.495 30 16 23686 33.14111111 49 21 49303 21.30611111 67 19 25659 28.72916667 28 16 28904 19.54 19 1 2781 12.05833333 49 16 29236 29.12166667 27 10 19546 17.28194444 30 19 22818 19.25111111 22 12 32689 14.75472222 12 2 5752 5.49 31 14 22197 24.07777778 20 17 20055 23.3625 20 19 25272 21.65138889 39 14 82206 24.75361111 29 11 32073 25.27916667 16 4 5444 11.18 27 16 20154 17.82972222 21 20 36944 14.12694444 19 12 8019 15.72583333 35 15 30884 17.44222222 14 16 19540 20.14861111
Names of X columns:
X_1 X_2 X_3 Y_1
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
1 seconds
R Server
Big Analytics Cloud Computing Center
Click here to blog (archive) this computation