Send output to:
Browser Blue - Charts White
Browser Black/White
CSV
Data X:
1418 56 396 81 30 115 94 24188 146283 144 145 2 2172 89 967 125 30 116 103 32287 96933 135 132 4 1583 44 656 66 26 100 93 27101 95757 84 84 0 1764 84 655 74 38 140 123 19716 143983 130 127 0 1495 88 465 49 44 166 148 17753 75851 82 78 -4 1373 55 525 52 30 99 90 9028 59238 60 60 4 2187 60 885 88 40 139 124 18653 93163 131 131 4 4041 154 1436 108 47 181 168 29498 151511 140 133 0 1706 53 612 43 30 116 115 27563 136368 151 150 -1 2152 119 865 75 31 116 71 18293 112642 91 91 0 2242 75 963 86 30 108 108 16116 127766 119 118 1 2515 92 966 135 34 129 120 26569 85646 123 119 0 2147 100 801 63 31 118 114 24785 98579 90 89 3 1638 73 513 52 33 125 120 23825 131741 113 108 -1 2452 77 992 59 33 127 124 34461 171975 175 162 4 2662 99 937 64 36 136 126 24919 159676 96 92 3 865 30 260 32 14 46 37 12558 58391 41 41 1 1793 76 503 129 17 54 38 7784 31580 47 47 0 2527 146 927 37 32 124 120 28522 136815 126 120 -2 2747 67 1269 31 30 115 93 22265 120642 105 105 -3 1324 56 537 65 35 128 95 14459 69107 80 79 -4 1383 58 532 74 28 97 90 22240 108016 73 70 2 4308 119 1635 715 34 125 110 11912 79336 68 67 2 1831 66 557 66 39 149 138 18220 93176 127 127 -4 3373 89 1178 106 39 149 133 19199 161632 154 152 3 2352 41 866 112 29 108 96 25239 102996 112 109 2 2144 68 574 66 44 166 164 29801 160604 137 133 2 4691 168 1276 190 21 80 78 18450 158051 135 123 0 2694 132 825 165 28 107 102 34861 162647 230 230 5 1769 71 663 61 28 107 99 16688 60622 71 68 -2 3148 112 1069 53 38 146 129 24683 179566 147 147 0 1954 70 711 38 32 123 114 21436 96144 105 101 -2 1226 57 503 50 29 111 99 30546 129847 107 108 -3 1496 103 464 42 27 105 104 15977 71180 116 114 2 1943 52 657 53 40 155 138 14251 86767 89 88 2 1762 62 577 50 40 155 151 16851 93487 84 83 2 1403 45 619 77 28 104 72 21113 82981 113 113 0 1425 46 479 57 34 132 120 17401 73815 120 118 4 1857 63 817 73 33 127 115 23958 94552 110 110 4 1420 53 537 63 33 122 98 14587 67808 78 76 2 1644 78 465 47 35 87 71 20537 106175 145 141 2 1054 46 299 57 29 109 107 30495 76669 91 91 -4 937 41 248 36 20 78 73 7117 57283 48 48 3 2547 91 905 63 37 141 129 33473 72413 150 144 3 1626 63 512 63 33 124 118 21115 96971 181 168 2 1964 63 786 110 29 112 104 32902 120336 121 117 -1 1381 32 489 56 28 108 107 25131 93913 99 100 -3 1290 34 351 71 21 78 36 6943 32036 40 37 0 1982 93 669 56 41 158 139 31808 102255 87 87 1 1590 55 506 79 20 78 56 17014 63506 66 64 -3 1281 72 407 67 30 119 93 6440 68370 58 58 3 1272 42 316 76 22 88 87 18647 50517 77 76 0 1944 71 603 65 42 155 110 20556 103950 130 129 0 1605 65 577 45 32 123 83 22392 84396 101 101 0 1386 41 411 97 36 136 98 8388 55515 120 89 3 2395 86 975 53 31 117 82 22120 209056 195 193 -3 2699 95 964 144 33 124 115 20923 142775 106 101 0 1606 49 537 60 40 151 140 20237 68847 83 82 -4 1204 64 369 89 38 145 120 3769 20112 37 36 2 1138 38 417 42 24 87 66 12252 61023 77 75 -1 1111 52 389 52 43 165 139 21721 112494 144 131 3 2186 247 719 128 31 120 119 17939 78876 95 90 2 3604 139 1277 142 40 150 141 23436 170745 169 166 5 3261 110 1402 128 37 136 133 34538 122037 134 133 2 1641 67 564 50 31 116 98 25515 112283 197 196 -2 2312 83 747 50 39 150 117 29402 120691 140 136 0 2201 70 861 46 32 118 105 28732 122422 125 123 3 961 32 319 57 18 71 55 5250 25899 21 21 -2 1900 83 612 52 39 144 132 28608 139296 167 163 0 1645 70 564 48 30 110 73 14817 89455 96 96 6 2429 103 824 91 37 147 86 16714 147866 151 151 -3 872 34 239 70 32 111 48 1669 14336 23 23 3 1018 40 459 37 17 68 48 7768 30059 21 14 0 1403 46 454 72 12 48 43 7936 41907 90 87 -2 616 18 225 24 13 51 46 7294 35885 60 56 1 1232 60 389 90 17 68 65 13275 55764 26 25 0 1255 39 339 45 17 64 52 5401 35619 41 41 2 995 31 333 26 20 76 68 8702 40557 35 33 2 2048 54 636 132 17 66 47 8030 44197 68 68 -3 301 14 93 35 17 68 41 1278 4103 6 6 -2 628 23 170 48 17 66 47 1574 4694 0 0 1 1597 77 530 124 22 83 71 9653 62991 41 39 -4 717 19 201 35 15 55 30 7067 24261 38 37 0 652 49 227 49 12 41 24 1514 21425 47 47 1 733 20 261 45 17 66 63 5432 27184 34 34 0
Names of X columns:
pageviews logins comp_views comp_views_pr comp_reviewed Feedback_p1 feedback_p120 revisions seconds hyperlinks blogs testscores
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
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