Send output to:
Browser Blue - Charts White
Browser Black/White
CSV
Data X:
18 264528 749 70 30 106 59635 15 257677 592 67 31 111 84607 13 256402 801 111 35 124 162365 12 255100 823 93 22 56 58233 11 254825 1174 91 27 98 104911 10 254150 1155 126 35 122 70817 19 249232 1151 68 21 57 73586 18 247024 916 106 22 77 120087 13 245107 824 96 31 101 109104 15 244272 1024 104 31 109 72631 12 243625 835 89 27 100 85224 11 226191 939 44 24 88 67271 13 224205 1084 78 25 75 55071 14 223590 1033 81 34 113 117986 12 212060 689 116 26 90 81493 17 209795 772 87 24 91 63717 18 206879 824 94 21 57 114425 13 204030 521 88 30 107 64664 15 201748 569 121 33 104 86281 12 201744 713 95 40 150 83038 11 199232 571 122 24 69 123328 10 198797 627 76 20 75 79194 14 198432 767 74 22 45 73795 17 197266 753 87 24 87 101653 13 197197 566 94 30 91 63958 12 194652 613 78 33 118 65196 16 193518 622 56 24 91 70111 15 193024 690 76 36 108 62932 12 190926 603 98 25 85 72369 10 189461 768 86 24 82 57637 19 189401 595 87 30 113 96750 16 188150 573 95 30 100 54628 17 187714 655 108 24 80 74482 13 187483 580 49 24 85 76168 12 185366 537 114 29 100 111436 11 185288 582 97 27 55 38885 16 182581 603 108 26 81 103646 13 181110 486 85 24 91 105965 14 180042 478 87 36 136 101773 16 176625 397 51 23 87 90257 18 174150 596 56 19 40 85903 10 173587 654 70 20 70 71170 11 173535 592 51 26 92 70027 12 173260 716 41 21 78 37238 15 172071 549 49 30 59 43460 16 170588 333 65 26 84 95556 12 169613 735 79 24 88 48204 10 168059 391 84 26 85 60029 18 167255 669 71 25 69 37048 14 166822 465 79 27 82 82204 16 164604 528 64 30 102 52295 17 162716 391 93 27 98 56316 13 161756 695 75 21 59 65911 12 159940 485 100 30 112 74349 14 158835 477 84 30 106 61704 11 158054 432 73 31 103 91939 16 152510 873 99 25 85 79774 14 152366 446 93 24 74 83042 13 152193 450 110 25 91 76013 15 150999 567 98 24 80 68608 10 149006 616 82 22 61 71181 11 146342 850 103 28 99 55027 14 145908 527 61 24 65 65724 16 145696 710 51 31 61 36311 13 145285 636 66 28 88 57231 15 145142 704 70 24 86 56699 17 142339 397 75 20 67 125410 11 142064 390 38 24 80 73713 13 141933 427 90 27 75 51370 14 141582 470 54 22 76 55901 10 141574 393 62 29 59 38439 17 139409 678 70 24 79 99518 14 139144 344 57 21 76 56530 12 138191 451 57 21 72 54506 15 137885 450 42 20 48 42564 13 137544 388 40 31 110 94137 10 135261 311 31 33 102 73087 11 135251 339 85 25 38 64102 13 133561 454 42 24 40 28340 15 132798 570 27 22 83 38417 11 131108 646 79 30 101 56733 14 130539 420 60 20 47 48821 9 130533 387 64 20 76 85168 7 129762 511 55 26 74 38650 15 129484 394 44 33 92 53009 5 128734 342 72 18 65 55064 13 128274 358 71 37 123 63262 3 127930 441 75 21 35 66477 6 127493 507 69 15 22 34497 9 126630 449 51 25 91 58425 15 125927 474 87 24 61 51360 3 122024 368 50 20 51 42051 7 120362 438 48 25 75 49319 17 118807 468 56 25 81 55827 8 118522 388 58 25 41 63016 9 117926 320 65 15 35 40671 11 117815 729 108 27 92 99501 5 116502 580 37 19 68 77411 9 115971 445 48 25 63 40001 12 113853 338 78 19 53 82043 6 113461 414 64 19 72 89041 8 112004 403 28 21 63 37361 11 109237 641 24 21 62 15430 7 108278 307 81 30 120 70780 9 106888 406 42 21 71 26982 12 106351 341 30 20 37 29467 4 106193 271 57 23 70 202316 5 105477 341 39 16 29 49288 10 104367 443 38 23 69 50466 7 103239 506 41 24 63 43448 11 98791 447 48 18 55 36252 5 98724 251 46 23 86 72571 9 98393 335 94 23 79 56979 8 98066 434 30 14 41 31701 10 95297 275 42 15 51 37137 3 94006 355 83 24 76 46765 11 93125 836 30 21 29 50838 5 91838 400 100 18 62 59155 13 91290 290 57 27 66 21067 6 90961 298 42 22 78 63785 8 89318 292 75 22 78 44970 11 86621 223 54 20 72 54565 5 86206 186 41 15 30 31258 9 81106 300 31 21 59 35838 11 80964 216 30 8 18 26998 7 80953 437 49 8 27 56622 4 78800 330 20 26 66 33032 9 78256 242 3 12 19 47261 13 77166 248 16 24 71 62147 6 76470 312 28 20 57 35606 9 74567 353 18 20 50 62832 12 74112 215 28 19 54 174949 5 73567 187 37 23 31 23238 7 69471 364 22 20 63 22618 15 68538 172 29 20 75 36990 3 68388 376 105 32 112 78956 7 65029 255 21 18 61 32551 4 61857 192 23 11 30 25162 7 50999 225 2 20 66 63989 11 46660 259 12 5 13 6179 9 43287 214 13 19 64 43750 6 38214 276 16 8 21 8773 10 37257 111 0 16 53 52491 7 32750 102 1 18 22 22807 9 31414 200 18 8 9 14116
Names of X columns:
Score Time CCViews Blogs Reviews LFM Totalcharacters
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