R version 2.9.0 (2009-04-17) Copyright (C) 2009 The R Foundation for Statistical Computing ISBN 3-900051-07-0 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > x <- array(list(184,74,11,31,20,213,72,11,43,18,347,70,18,16,16,565,71,11,25,19,327,72,9,29,24,260,68,8,32,15,325,68,12,24,14,102,62,13,28,11,38,69,7,25,12,226,66,9,58,15,137,60,13,21,9,369,81,4,77,36,109,66,9,37,12,809,67,11,37,16,29,65,12,35,11,245,64,10,42,14,118,64,12,21,10,148,62,7,81,27,387,59,15,31,16,98,56,15,50,15,608,46,22,24,8,218,54,14,27,13,254,54,20,22,11,697,45,26,18,8,827,57,12,23,11,693,57,9,60,18,448,61,19,14,12,942,52,17,31,10,1017,44,21,24,9,216,43,18,23,8,673,48,19,22,10,989,57,14,25,12,630,47,19,25,9,404,50,19,21,9,692,48,16,32,11,1517,49,13,31,14,879,72,13,13,22,631,59,14,21,13,1375,49,9,46,13,1139,54,13,27,12,3545,62,22,18,15,706,47,17,39,11,451,45,34,15,10,433,48,26,23,12,601,69,23,7,12,1024,42,23,23,11,457,49,18,30,12,1441,57,15,35,13,1022,72,22,15,16,1244,67,26,18,16),dim=c(5,50),dimnames=list(c('Crimerate','25+HSgraduate','Dropouts16-19','CollegeStudents18-24','25+CollegeGrads'),1:50)) > y <- array(NA,dim=c(5,50),dimnames=list(c('Crimerate','25+HSgraduate','Dropouts16-19','CollegeStudents18-24','25+CollegeGrads'),1:50)) > for (i in 1:dim(x)[1]) + { + for (j in 1:dim(x)[2]) + { + y[i,j] <- as.numeric(x[i,j]) + } + } > par3 = 'No Linear Trend' > par2 = 'Do not include Seasonal Dummies' > par1 = '1' > #'GNU S' R Code compiled by R2WASP v. 1.0.44 () > #Author: Prof. Dr. P. Wessa > #To cite this work: AUTHOR(S), (YEAR), YOUR SOFTWARE TITLE (vNUMBER) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_YOURPAGE.wasp/ > #Source of accompanying publication: Office for Research, Development, and Education > #Technical description: Write here your technical program description (don't use hard returns!) > library(lattice) > library(lmtest) Loading required package: zoo Attaching package: 'zoo' The following object(s) are masked from package:base : as.Date.numeric > 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 Crimerate 25+HSgraduate Dropouts16-19 CollegeStudents18-24 25+CollegeGrads 1 184 74 11 31 20 2 213 72 11 43 18 3 347 70 18 16 16 4 565 71 11 25 19 5 327 72 9 29 24 6 260 68 8 32 15 7 325 68 12 24 14 8 102 62 13 28 11 9 38 69 7 25 12 10 226 66 9 58 15 11 137 60 13 21 9 12 369 81 4 77 36 13 109 66 9 37 12 14 809 67 11 37 16 15 29 65 12 35 11 16 245 64 10 42 14 17 118 64 12 21 10 18 148 62 7 81 27 19 387 59 15 31 16 20 98 56 15 50 15 21 608 46 22 24 8 22 218 54 14 27 13 23 254 54 20 22 11 24 697 45 26 18 8 25 827 57 12 23 11 26 693 57 9 60 18 27 448 61 19 14 12 28 942 52 17 31 10 29 1017 44 21 24 9 30 216 43 18 23 8 31 673 48 19 22 10 32 989 57 14 25 12 33 630 47 19 25 9 34 404 50 19 21 9 35 692 48 16 32 11 36 1517 49 13 31 14 37 879 72 13 13 22 38 631 59 14 21 13 39 1375 49 9 46 13 40 1139 54 13 27 12 41 3545 62 22 18 15 42 706 47 17 39 11 43 451 45 34 15 10 44 433 48 26 23 12 45 601 69 23 7 12 46 1024 42 23 23 11 47 457 49 18 30 12 48 1441 57 15 35 13 49 1022 72 22 15 16 50 1244 67 26 18 16 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) `25+HSgraduate` `Dropouts16-19` 1395.26 -22.02 11.36 `CollegeStudents18-24` `25+CollegeGrads` -13.00 52.81 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -672.3 -303.4 -108.7 177.8 2707.3 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 1395.259 1026.946 1.359 0.1810 `25+HSgraduate` -22.024 14.248 -1.546 0.1292 `Dropouts16-19` 11.356 21.103 0.538 0.5931 `CollegeStudents18-24` -13.002 9.405 -1.382 0.1737 `25+CollegeGrads` 52.807 28.752 1.837 0.0729 . --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 551.8 on 45 degrees of freedom Multiple R-squared: 0.1504, Adjusted R-squared: 0.07488 F-statistic: 1.991 on 4 and 45 DF, p-value: 0.112 > 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 + } [,1] [,2] [,3] [1,] 2.359928e-02 4.719856e-02 0.9764007 [2,] 1.083536e-02 2.167072e-02 0.9891646 [3,] 3.084017e-03 6.168034e-03 0.9969160 [4,] 7.305535e-04 1.461107e-03 0.9992694 [5,] 1.852467e-04 3.704934e-04 0.9998148 [6,] 3.703480e-05 7.406960e-05 0.9999630 [7,] 1.068663e-03 2.137326e-03 0.9989313 [8,] 4.573276e-04 9.146551e-04 0.9995427 [9,] 1.421066e-04 2.842133e-04 0.9998579 [10,] 5.292826e-05 1.058565e-04 0.9999471 [11,] 3.126310e-05 6.252619e-05 0.9999687 [12,] 1.151853e-05 2.303707e-05 0.9999885 [13,] 6.654351e-06 1.330870e-05 0.9999933 [14,] 4.242537e-06 8.485075e-06 0.9999958 [15,] 1.974236e-06 3.948471e-06 0.9999980 [16,] 9.317249e-07 1.863450e-06 0.9999991 [17,] 4.018616e-07 8.037232e-07 0.9999996 [18,] 2.289661e-06 4.579322e-06 0.9999977 [19,] 6.910890e-06 1.382178e-05 0.9999931 [20,] 2.516794e-06 5.033588e-06 0.9999975 [21,] 5.513793e-06 1.102759e-05 0.9999945 [22,] 4.685687e-06 9.371373e-06 0.9999953 [23,] 5.432444e-06 1.086489e-05 0.9999946 [24,] 1.871385e-06 3.742770e-06 0.9999981 [25,] 2.961056e-06 5.922112e-06 0.9999970 [26,] 9.497985e-07 1.899597e-06 0.9999991 [27,] 3.343557e-07 6.687114e-07 0.9999997 [28,] 1.096604e-07 2.193208e-07 0.9999999 [29,] 6.653109e-07 1.330622e-06 0.9999993 [30,] 5.254951e-06 1.050990e-05 0.9999947 [31,] 5.563857e-06 1.112771e-05 0.9999944 [32,] 5.663933e-06 1.132787e-05 0.9999943 [33,] 3.035258e-06 6.070516e-06 0.9999970 [34,] 7.556589e-01 4.886823e-01 0.2443411 [35,] 6.135467e-01 7.729067e-01 0.3864533 > postscript(file="/var/www/html/rcomp/tmp/14sk91290525561.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > 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() null device 1 > postscript(file="/var/www/html/rcomp/tmp/2xjjc1290525561.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > plot(mysum$resid, type='b', pch=19, main='Residuals', ylab='value of Residuals', xlab='time or index') > grid() > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/3xjjc1290525561.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > hist(mysum$resid, main='Residual Histogram', xlab='values of Residuals') > grid() > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/4xjjc1290525561.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > densityplot(~mysum$resid,col='black',main='Residual Density Plot', xlab='values of Residuals') > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/58bif1290525561.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > qqnorm(mysum$resid, main='Residual Normal Q-Q Plot') > qqline(mysum$resid) > grid() > dev.off() null device 1 > (myerror <- as.ts(mysum$resid)) Time Series: Start = 1 End = 50 Frequency = 1 1 2 3 4 5 6 -359.494357 -112.905056 -347.884831 -69.770331 -475.061876 -104.530761 7 8 9 10 11 12 -136.164503 -292.235333 -225.742125 144.114301 -286.682094 -187.659516 13 14 15 16 17 18 -87.503995 400.578308 -196.793838 -47.513165 -259.037147 -333.911114 19 20 21 22 23 24 -321.050220 -376.278745 -134.412082 -482.399436 -473.933171 -190.873141 25 26 27 28 29 30 268.991992 280.481217 -271.231635 373.912558 189.089318 -560.060007 31 32 33 34 35 36 -122.913094 381.475728 -96.124138 -308.059956 7.368008 717.037783 37 38 39 40 41 42 -70.903615 -37.291202 868.299185 502.764187 2707.309011 79.000933 43 44 45 46 47 48 -672.344700 -535.020626 -78.479272 10.712325 -307.131923 899.331084 49 50 312.735373 418.195699 > postscript(file="/var/www/html/rcomp/tmp/68bif1290525561.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > dum <- cbind(lag(myerror,k=1),myerror) > dum Time Series: Start = 0 End = 50 Frequency = 1 lag(myerror, k = 1) myerror 0 -359.494357 NA 1 -112.905056 -359.494357 2 -347.884831 -112.905056 3 -69.770331 -347.884831 4 -475.061876 -69.770331 5 -104.530761 -475.061876 6 -136.164503 -104.530761 7 -292.235333 -136.164503 8 -225.742125 -292.235333 9 144.114301 -225.742125 10 -286.682094 144.114301 11 -187.659516 -286.682094 12 -87.503995 -187.659516 13 400.578308 -87.503995 14 -196.793838 400.578308 15 -47.513165 -196.793838 16 -259.037147 -47.513165 17 -333.911114 -259.037147 18 -321.050220 -333.911114 19 -376.278745 -321.050220 20 -134.412082 -376.278745 21 -482.399436 -134.412082 22 -473.933171 -482.399436 23 -190.873141 -473.933171 24 268.991992 -190.873141 25 280.481217 268.991992 26 -271.231635 280.481217 27 373.912558 -271.231635 28 189.089318 373.912558 29 -560.060007 189.089318 30 -122.913094 -560.060007 31 381.475728 -122.913094 32 -96.124138 381.475728 33 -308.059956 -96.124138 34 7.368008 -308.059956 35 717.037783 7.368008 36 -70.903615 717.037783 37 -37.291202 -70.903615 38 868.299185 -37.291202 39 502.764187 868.299185 40 2707.309011 502.764187 41 79.000933 2707.309011 42 -672.344700 79.000933 43 -535.020626 -672.344700 44 -78.479272 -535.020626 45 10.712325 -78.479272 46 -307.131923 10.712325 47 899.331084 -307.131923 48 312.735373 899.331084 49 418.195699 312.735373 50 NA 418.195699 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] -112.905056 -359.494357 [2,] -347.884831 -112.905056 [3,] -69.770331 -347.884831 [4,] -475.061876 -69.770331 [5,] -104.530761 -475.061876 [6,] -136.164503 -104.530761 [7,] -292.235333 -136.164503 [8,] -225.742125 -292.235333 [9,] 144.114301 -225.742125 [10,] -286.682094 144.114301 [11,] -187.659516 -286.682094 [12,] -87.503995 -187.659516 [13,] 400.578308 -87.503995 [14,] -196.793838 400.578308 [15,] -47.513165 -196.793838 [16,] -259.037147 -47.513165 [17,] -333.911114 -259.037147 [18,] -321.050220 -333.911114 [19,] -376.278745 -321.050220 [20,] -134.412082 -376.278745 [21,] -482.399436 -134.412082 [22,] -473.933171 -482.399436 [23,] -190.873141 -473.933171 [24,] 268.991992 -190.873141 [25,] 280.481217 268.991992 [26,] -271.231635 280.481217 [27,] 373.912558 -271.231635 [28,] 189.089318 373.912558 [29,] -560.060007 189.089318 [30,] -122.913094 -560.060007 [31,] 381.475728 -122.913094 [32,] -96.124138 381.475728 [33,] -308.059956 -96.124138 [34,] 7.368008 -308.059956 [35,] 717.037783 7.368008 [36,] -70.903615 717.037783 [37,] -37.291202 -70.903615 [38,] 868.299185 -37.291202 [39,] 502.764187 868.299185 [40,] 2707.309011 502.764187 [41,] 79.000933 2707.309011 [42,] -672.344700 79.000933 [43,] -535.020626 -672.344700 [44,] -78.479272 -535.020626 [45,] 10.712325 -78.479272 [46,] -307.131923 10.712325 [47,] 899.331084 -307.131923 [48,] 312.735373 899.331084 [49,] 418.195699 312.735373 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 -112.905056 -359.494357 2 -347.884831 -112.905056 3 -69.770331 -347.884831 4 -475.061876 -69.770331 5 -104.530761 -475.061876 6 -136.164503 -104.530761 7 -292.235333 -136.164503 8 -225.742125 -292.235333 9 144.114301 -225.742125 10 -286.682094 144.114301 11 -187.659516 -286.682094 12 -87.503995 -187.659516 13 400.578308 -87.503995 14 -196.793838 400.578308 15 -47.513165 -196.793838 16 -259.037147 -47.513165 17 -333.911114 -259.037147 18 -321.050220 -333.911114 19 -376.278745 -321.050220 20 -134.412082 -376.278745 21 -482.399436 -134.412082 22 -473.933171 -482.399436 23 -190.873141 -473.933171 24 268.991992 -190.873141 25 280.481217 268.991992 26 -271.231635 280.481217 27 373.912558 -271.231635 28 189.089318 373.912558 29 -560.060007 189.089318 30 -122.913094 -560.060007 31 381.475728 -122.913094 32 -96.124138 381.475728 33 -308.059956 -96.124138 34 7.368008 -308.059956 35 717.037783 7.368008 36 -70.903615 717.037783 37 -37.291202 -70.903615 38 868.299185 -37.291202 39 502.764187 868.299185 40 2707.309011 502.764187 41 79.000933 2707.309011 42 -672.344700 79.000933 43 -535.020626 -672.344700 44 -78.479272 -535.020626 45 10.712325 -78.479272 46 -307.131923 10.712325 47 899.331084 -307.131923 48 312.735373 899.331084 49 418.195699 312.735373 > 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() null device 1 > postscript(file="/var/www/html/rcomp/tmp/7i2hi1290525561.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > acf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Autocorrelation Function') > grid() > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/8i2hi1290525561.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > pacf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Partial Autocorrelation Function') > grid() > dev.off() null device 1 > postscript(file="/var/www/html/rcomp/tmp/9btgl1290525561.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > opar <- par(mfrow = c(2,2), oma = c(0, 0, 1.1, 0)) > plot(mylm, las = 1, sub='Residual Diagnostics') > par(opar) > dev.off() null device 1 > if (n > n25) { + postscript(file="/var/www/html/rcomp/tmp/10btgl1290525561.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) + plot(kp3:nmkm3,gqarr[,2], main='Goldfeld-Quandt test',ylab='2-sided p-value',xlab='breakpoint') + grid() + dev.off() + } null device 1 > > #Note: the /var/www/html/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab > load(file="/var/www/html/rcomp/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="/var/www/html/rcomp/tmp/11plwb1290525561.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
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="/var/www/html/rcomp/tmp/12smvh1290525561.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="/var/www/html/rcomp/tmp/13z5at1290525561.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
Forecast', 1, TRUE) > a<-table.element(a, 'Residuals
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="/var/www/html/rcomp/tmp/14aw9e1290525561.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="/var/www/html/rcomp/tmp/15depk1290525561.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="/var/www/html/rcomp/tmp/16rons1290525561.tab") + } > > try(system("convert tmp/14sk91290525561.ps tmp/14sk91290525561.png",intern=TRUE)) character(0) > try(system("convert tmp/2xjjc1290525561.ps tmp/2xjjc1290525561.png",intern=TRUE)) character(0) > try(system("convert tmp/3xjjc1290525561.ps tmp/3xjjc1290525561.png",intern=TRUE)) character(0) > try(system("convert tmp/4xjjc1290525561.ps tmp/4xjjc1290525561.png",intern=TRUE)) character(0) > try(system("convert tmp/58bif1290525561.ps tmp/58bif1290525561.png",intern=TRUE)) character(0) > try(system("convert tmp/68bif1290525561.ps tmp/68bif1290525561.png",intern=TRUE)) character(0) > try(system("convert tmp/7i2hi1290525561.ps tmp/7i2hi1290525561.png",intern=TRUE)) character(0) > try(system("convert tmp/8i2hi1290525561.ps tmp/8i2hi1290525561.png",intern=TRUE)) character(0) > try(system("convert tmp/9btgl1290525561.ps tmp/9btgl1290525561.png",intern=TRUE)) character(0) > try(system("convert tmp/10btgl1290525561.ps tmp/10btgl1290525561.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 2.396 1.580 5.403