Send output to:
Browser Blue - Charts White
Browser Black/White
CSV
Data X:
11.3 62 72 11 0 16 12 15 91 9.6 56 61 6 1 13 8 21 137 16.1 57 68 7 1 14 7 30 148 13.4 51 61 10 0 16 12 20 92 12.7 56 64 9 1 17 13 14 131 12.3 30 65 7 1 16 11 18 59 7.9 61 69 4 1 15 12 19 90 12.3 47 63 4 1 13 10 25 83 11.6 56 75 4 1 14 11 23 116 6.7 50 63 8 1 13 7 17 42 12.1 67 73 4 1 19 13 21 155 5.7 41 75 7 0 15 6 21 128 8 45 63 4 0 10 10 8 49 13.3 48 63 4 1 16 12 29 96 9.1 44 62 9 1 12 12 20 66 12.2 37 64 4 0 15 12 19 104 8.8 56 60 10 0 11 8 22 76 14.6 66 56 4 1 9 10 23 99 12.6 38 59 5 1 12 12 24 108 9.9 34 68 4 0 14 9 12 74 10.5 49 66 4 0 14 11 22 96 13.4 55 73 4 0 13 10 12 116 10.9 49 72 4 0 16 12 22 87 4.3 59 71 6 1 13 10 20 97 10.3 40 59 10 0 16 9 10 127 11.8 58 64 7 1 16 11 23 106 11.2 60 66 4 1 16 12 17 80 11.4 63 78 4 0 10 7 22 74 8.6 56 68 7 0 12 11 24 91 13.2 54 73 4 0 12 12 18 133 12.6 52 62 8 1 12 6 21 74 5.6 34 65 11 1 12 9 20 114 9.9 69 68 6 1 19 15 20 140 8.8 32 65 14 0 14 10 22 95 7.7 48 60 5 1 13 11 19 98 9 67 71 4 0 16 12 20 121 7.3 58 65 8 1 15 12 26 126 11.4 57 68 9 1 12 12 23 98 13.6 42 64 4 1 8 11 24 95 7.9 64 74 4 1 10 9 21 110 10.7 58 69 5 1 16 11 21 70 10.3 66 76 4 0 16 12 19 102 8.3 26 68 5 1 10 12 8 86 9.6 61 72 4 1 18 14 17 130 14.2 52 67 4 1 12 8 20 96 8.5 51 63 7 0 16 10 11 102 13.5 55 59 10 0 10 9 8 100 4.9 50 73 4 0 14 10 15 94 6.4 60 66 5 0 12 9 18 52 9.6 56 62 4 0 11 10 18 98 11.6 63 69 4 0 15 12 19 118 11.1 61 66 4 1 7 11 19 99 16.6 52 57 4 0 12 7 30 109 12.6 55 56 17 1 15 12 17 68 18.9 72 71 4 1 16 12 24 131 11.6 33 56 23 1 6 6 20 71 14.6 66 62 4 1 16 11 25 68 13.85 66 59 5 1 16 10 20 89 14.85 64 57 5 0 16 13 27 115 11.75 40 66 4 0 16 12 18 78 18.45 46 63 6 0 16 12 28 118 15.9 58 69 4 1 17 10 21 87 19.9 51 48 9 0 9 8 27 162 10.95 50 66 18 1 15 12 22 49 18.45 52 73 6 0 14 9 28 122 15.1 54 67 5 1 15 12 25 96 15 66 61 4 0 13 9 21 100 11.35 61 68 11 0 16 11 22 82 15.95 80 75 4 1 20 15 28 100 18.1 51 62 10 0 14 8 20 115 14.6 56 69 6 1 12 8 29 141 17.6 53 74 6 1 15 11 20 110 15.35 47 63 4 1 16 12 20 146 13.4 50 58 9 0 11 8 23 90 13.9 39 58 5 0 9 4 18 121 15.25 58 72 4 0 16 10 18 104 12.9 35 62 15 1 14 7 19 147 16.1 58 62 10 0 15 12 25 110 17.35 60 65 9 0 13 11 25 108 13.15 62 69 7 0 13 9 25 113 12.15 63 66 9 0 12 10 24 115 12.6 53 72 6 1 16 8 19 61 10.35 46 62 4 1 14 8 26 60 15.4 67 75 7 1 16 11 10 109 9.6 59 58 4 1 14 12 17 68 18.2 64 66 7 0 15 10 13 111 13.6 38 55 4 0 10 10 17 77 14.85 50 47 15 1 16 12 30 73 14.1 48 62 9 0 16 11 4 89 14.9 47 64 4 0 12 8 16 78 16.25 66 64 4 0 16 10 21 110 13.6 63 50 4 1 15 9 22 65 15.65 44 70 4 0 16 10 20 117 14.6 43 69 4 0 15 12 22 63 12.65 38 48 12 1 13 8 23 52 19.2 45 73 4 0 7 3 0 131 16.6 50 74 6 1 7 8 18 101 11.2 54 66 6 1 17 12 25 42 13.2 55 78 4 0 8 12 18 77 15.85 37 60 7 1 15 10 18 96 11.15 46 69 7 1 16 9 24 57 15.65 51 65 4 0 14 12 29 112 7.65 64 78 12 0 19 14 15 49 15.2 47 63 17 0 11 8 22 56 15.6 62 71 5 1 15 12 23 86 13.1 67 80 4 1 17 13 24 88 11.85 56 73 8 0 9 7 22 48 12.4 65 69 5 1 19 14 15 85 11.4 50 84 4 0 17 13 17 63 14.9 57 64 4 1 16 12 20 102 19.9 47 58 16 0 9 8 27 162 11.2 47 59 7 1 11 13 26 86 14.6 57 78 4 1 14 9 23 114 14.75 50 67 7 1 16 12 23 94 15.15 22 60 19 0 17 10 15 81 16.85 59 66 4 0 15 10 26 110 7.85 56 74 4 1 17 13 22 64 12.6 53 72 9 0 10 9 18 104 7.85 42 55 5 1 16 11 15 105 10.95 52 49 14 1 15 12 22 49 12.35 54 74 4 0 11 8 27 88 9.95 44 53 16 1 16 12 10 95 14.9 62 64 10 1 16 12 20 102 16.65 53 65 5 0 16 12 17 99 13.4 50 57 6 1 14 9 23 63 13.95 36 51 4 0 14 12 19 76 15.7 76 80 4 0 16 12 13 109 16.85 66 67 4 1 16 11 27 117 10.95 62 70 5 1 18 12 23 57 15.35 59 74 4 0 14 6 16 120 12.2 47 75 4 1 20 7 25 73 15.1 55 70 5 0 15 10 2 91 17.75 58 69 4 0 16 12 26 108 15.2 60 65 4 1 16 10 20 105 16.65 57 71 8 0 12 9 22 119 8.1 45 65 15 1 8 3 24 31
Names of X columns:
Totaal Tot_Intr._Motv Tot_Extr._Motv Demotivatie Geslacht_Bin Zelfvertrouwen_statis Zelfvertrouwen_software NUMERACYTOT LFM
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, signif(mysum$coefficients[i,1],6), 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,signif(mysum$coefficients[i,1],6)) a<-table.element(a, signif(mysum$coefficients[i,2],6)) a<-table.element(a, signif(mysum$coefficients[i,3],4)) a<-table.element(a, signif(mysum$coefficients[i,4],6)) a<-table.element(a, signif(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, signif(sqrt(mysum$r.squared),6)) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a, 'R-squared',1,TRUE) a<-table.element(a, signif(mysum$r.squared,6)) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a, 'Adjusted R-squared',1,TRUE) a<-table.element(a, signif(mysum$adj.r.squared,6)) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a, 'F-TEST (value)',1,TRUE) a<-table.element(a, signif(mysum$fstatistic[1],6)) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a, 'F-TEST (DF numerator)',1,TRUE) a<-table.element(a, signif(mysum$fstatistic[2],6)) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a, 'F-TEST (DF denominator)',1,TRUE) a<-table.element(a, signif(mysum$fstatistic[3],6)) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a, 'p-value',1,TRUE) a<-table.element(a, signif(1-pf(mysum$fstatistic[1],mysum$fstatistic[2],mysum$fstatistic[3]),6)) 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, signif(mysum$sigma,6)) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a, 'Sum Squared Residuals',1,TRUE) a<-table.element(a, signif(sum(myerror*myerror),6)) 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,signif(x[i],6)) a<-table.element(a,signif(x[i]-mysum$resid[i],6)) a<-table.element(a,signif(mysum$resid[i],6)) 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,signif(gqarr[mypoint-kp3+1,1],6)) a<-table.element(a,signif(gqarr[mypoint-kp3+1,2],6)) a<-table.element(a,signif(gqarr[mypoint-kp3+1,3],6)) 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,signif(numsignificant1,6)) a<-table.element(a,signif(numsignificant1/numgqtests,6)) 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,signif(numsignificant5,6)) a<-table.element(a,signif(numsignificant5/numgqtests,6)) 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,signif(numsignificant10,6)) a<-table.element(a,signif(numsignificant10/numgqtests,6)) 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