Send output to:
Browser Blue - Charts White
Browser Black/White
CSV
Data X:
1845 162687 95 595 115 0 48 1917 233285 67 580 79 1 75 192 7215 18 72 1 0 0 2665 164587 99 737 158 0 74 3709 283430 141 1255 127 0 92 7138 546996 275 2021 278 1 137 1888 192501 61 606 95 1 65 1909 213538 64 533 64 0 97 2140 182282 46 687 92 0 62 3168 336547 102 1074 130 1 72 1957 122275 77 637 158 2 50 2370 203938 72 743 120 0 88 1998 119300 110 701 87 0 68 3203 220796 122 1087 264 4 79 1505 174005 67 422 51 4 56 1574 156326 89 474 85 3 54 1965 164063 60 483 100 0 101 1314 90025 63 375 72 5 13 2921 179987 90 929 147 0 80 823 47066 29 262 49 0 19 1289 109572 64 437 40 0 33 2818 241285 103 850 99 0 99 1792 208339 77 652 127 1 38 2474 164166 59 754 166 1 68 1994 159763 89 619 41 1 54 1806 207078 34 657 160 0 63 2177 217028 169 695 92 0 66 1458 201536 96 366 59 0 90 3057 408960 124 1015 89 0 75 2487 250260 48 1029 104 0 68 1914 216527 46 576 81 0 69 1825 212949 51 656 116 2 80 2509 164248 110 812 105 4 59 3634 278911 136 1108 388 0 135 2608 238654 59 852 88 1 75 1 0 1 0 0 0 0 2157 233971 66 1009 63 0 54 1978 149649 55 658 138 3 62 2224 161703 52 547 270 9 46 2215 254893 70 826 64 0 83 2538 269492 73 838 96 2 106 1881 169526 62 704 62 0 51 1113 107893 35 404 35 2 27 2380 229714 83 848 66 1 78 1365 139667 51 419 56 2 71 1294 175983 102 349 46 2 44 756 81407 33 216 49 1 23 2465 251259 110 796 121 0 78 2327 239807 90 752 113 1 60 2787 172743 60 964 190 8 73 658 48188 28 205 37 0 12 2013 169355 71 506 52 0 104 2666 335398 78 841 89 0 95 2086 244729 81 699 73 0 57 2067 208286 62 746 61 1 68 1776 159913 58 547 77 8 44 2045 232137 72 561 63 0 62 1047 101694 26 329 75 1 26 1190 157258 68 427 32 0 67 2932 211586 101 993 59 10 36 1868 181076 66 564 71 6 56 2316 158024 86 858 92 0 55 1392 141491 64 376 87 11 54 1355 130108 40 471 48 3 61 1326 166420 39 432 63 0 27 1587 135509 45 500 41 0 64 2336 195043 72 504 86 8 76 2898 138708 66 887 152 2 93 1118 116552 40 271 49 0 59 340 31970 15 101 40 0 5 3224 291993 121 1203 148 3 62 1552 167825 82 506 86 1 47 1551 135926 69 528 62 2 88 1794 136647 77 501 96 1 57 2728 171518 71 698 95 0 81 1580 108980 46 426 83 2 35 2414 183471 61 709 112 1 102 2640 167426 101 847 77 0 73 1203 112510 49 367 78 0 32 1313 92421 77 413 114 0 34 1207 117169 84 272 55 0 80 2246 304603 65 830 60 0 49 1076 75101 30 334 49 1 30 1638 145043 41 524 132 0 57 1208 95827 48 393 49 0 54 1868 173931 60 574 71 0 38 2829 250424 252 695 102 0 63 1209 115367 116 284 74 0 58 1463 125839 66 462 49 7 49 1610 164078 54 653 74 0 46 1865 158931 42 684 59 5 51 2444 190382 85 714 91 1 90 1253 155226 59 420 68 0 45 1468 146159 61 551 81 0 28 979 62641 44 396 33 0 26 2365 258585 121 741 166 0 54 1890 199841 71 571 97 0 96 223 19349 12 67 15 0 13 2527 247280 109 877 105 3 43 2186 173152 88 885 61 0 46 778 72128 30 306 11 0 30 1194 104253 26 382 45 0 59 1424 151090 57 435 89 0 73 1386 147990 68 348 72 1 40 839 87448 42 227 27 1 36 596 27676 22 194 59 0 2 1684 170326 52 413 127 0 103 1168 132148 38 273 48 1 30 0 0 0 0 0 0 0 1315 133868 36 390 58 0 78 1149 109001 68 376 57 0 25 1485 158833 46 495 60 0 59 1529 150013 66 448 77 1 60 962 89887 63 313 71 0 36 78 3616 5 14 5 0 0 0 0 0 0 0 0 0 1295 216479 48 445 78 0 51 1751 177323 102 637 76 0 79 2142 177948 102 593 124 2 30 1070 140106 41 326 67 0 43 778 43410 19 292 63 0 7 1986 206059 76 573 92 1 92 1084 109873 45 315 58 0 32 2400 157084 61 683 65 10 84 731 60493 40 174 29 3 3 285 19764 12 75 19 1 10 1873 177559 57 572 64 3 47 1269 154169 36 414 79 0 44 1725 164249 54 562 104 0 54 256 11796 9 79 22 0 1 98 10674 9 33 7 0 0 1435 151322 59 487 37 0 46 41 6836 3 11 5 0 0 1931 174712 68 664 48 6 51 42 5118 3 6 1 0 5 528 40248 16 183 34 1 8 0 0 0 0 0 0 0 1122 127628 51 342 53 0 38 1305 88837 38 269 44 0 21 81 7131 4 27 0 1 0 262 9056 15 99 18 0 0 1165 97191 31 322 52 1 26 1405 157478 59 367 60 0 53 1409 125583 23 521 50 1 31
Names of X columns:
a b c d e f g
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