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(3.9,4.2,3.6,4.5,3.3,4.6,3.2,4.9,3.4,4.9,3.4,4.5,3.5,4.6,3.2,4.7,3.3,4.7,3.3,4.3,3.4,4.2,3.7,4.4,3.9,4,4,3.8,3.7,3.6,3.9,3.6,4.2,3.3,4.4,3.4,4.3,3.4,4.2,3.3,4.3,3.3,4.3,3.2,4.3,3.1,4.5,3.1,5,2.4,5.2,2.4,5.2,2.4,5.4,2.1,5.5,2,5.4,2,5.5,2.1,5.4,2.1,5.7,2,5.7,2,6.1,2,6.5,1.7,6.9,1.3,6.8,1.2,6.7,1.1,6.6,1.4,6.5,1.5,6.4,1.4,6.1,1.1,6.2,1.1,6.3,1,6.4,1.4,6.5,1.3,6.7,1.2,7,1.5,7,1.6,6.8,1.8,6.7,1.5,6.7,1.3,6.5,1.6,6.4,1.6,6.1,1.8,6.2,1.8,6,1.6,6.1,1.8,6.1,2,6.2,1.3),dim=c(2,61),dimnames=list(c('Werkl','Infl'),1:61)) > y <- array(NA,dim=c(2,61),dimnames=list(c('Werkl','Infl'),1:61)) > 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 Werkl Infl 1 3.9 4.2 2 3.6 4.5 3 3.3 4.6 4 3.2 4.9 5 3.4 4.9 6 3.4 4.5 7 3.5 4.6 8 3.2 4.7 9 3.3 4.7 10 3.3 4.3 11 3.4 4.2 12 3.7 4.4 13 3.9 4.0 14 4.0 3.8 15 3.7 3.6 16 3.9 3.6 17 4.2 3.3 18 4.4 3.4 19 4.3 3.4 20 4.2 3.3 21 4.3 3.3 22 4.3 3.2 23 4.3 3.1 24 4.5 3.1 25 5.0 2.4 26 5.2 2.4 27 5.2 2.4 28 5.4 2.1 29 5.5 2.0 30 5.4 2.0 31 5.5 2.1 32 5.4 2.1 33 5.7 2.0 34 5.7 2.0 35 6.1 2.0 36 6.5 1.7 37 6.9 1.3 38 6.8 1.2 39 6.7 1.1 40 6.6 1.4 41 6.5 1.5 42 6.4 1.4 43 6.1 1.1 44 6.2 1.1 45 6.3 1.0 46 6.4 1.4 47 6.5 1.3 48 6.7 1.2 49 7.0 1.5 50 7.0 1.6 51 6.8 1.8 52 6.7 1.5 53 6.7 1.3 54 6.5 1.6 55 6.4 1.6 56 6.1 1.8 57 6.2 1.8 58 6.0 1.6 59 6.1 1.8 60 6.1 2.0 61 6.2 1.3 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) Infl 7.79 -0.99 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -0.600146 -0.231865 -0.002128 0.198863 0.794898 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 7.78924 0.09594 81.19 <2e-16 *** Infl -0.99009 0.03360 -29.46 <2e-16 *** --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 0.3244 on 59 degrees of freedom Multiple R-squared: 0.9364, Adjusted R-squared: 0.9353 F-statistic: 868.1 on 1 and 59 DF, p-value: < 2.2e-16 > 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,] 0.1201445429 0.2402890859 0.87985546 [2,] 0.0778132196 0.1556264392 0.92218678 [3,] 0.0332432429 0.0664864858 0.96675676 [4,] 0.0262419436 0.0524838873 0.97375806 [5,] 0.0122498267 0.0244996534 0.98775017 [6,] 0.0331607112 0.0663214225 0.96683929 [7,] 0.0266538592 0.0533077184 0.97334614 [8,] 0.0269350141 0.0538700281 0.97306499 [9,] 0.0201344943 0.0402689886 0.97986551 [10,] 0.0118065059 0.0236130119 0.98819349 [11,] 0.0161120723 0.0322241445 0.98388793 [12,] 0.0084253286 0.0168506573 0.99157467 [13,] 0.0048166520 0.0096333039 0.99518335 [14,] 0.0067836125 0.0135672250 0.99321639 [15,] 0.0044967849 0.0089935698 0.99550322 [16,] 0.0022788983 0.0045577967 0.99772110 [17,] 0.0011717844 0.0023435687 0.99882822 [18,] 0.0005554054 0.0011108108 0.99944459 [19,] 0.0002899289 0.0005798577 0.99971007 [20,] 0.0001679274 0.0003358548 0.99983207 [21,] 0.0001352232 0.0002704464 0.99986478 [22,] 0.0002064791 0.0004129582 0.99979352 [23,] 0.0002206685 0.0004413371 0.99977933 [24,] 0.0002139452 0.0004278904 0.99978605 [25,] 0.0002162531 0.0004325063 0.99978375 [26,] 0.0002471514 0.0004943028 0.99975285 [27,] 0.0003475920 0.0006951840 0.99965241 [28,] 0.0006633226 0.0013266451 0.99933668 [29,] 0.0016370108 0.0032740217 0.99836299 [30,] 0.0046248198 0.0092496395 0.99537518 [31,] 0.0287141210 0.0574282419 0.97128588 [32,] 0.0974660882 0.1949321765 0.90253391 [33,] 0.2341368695 0.4682737391 0.76586313 [34,] 0.2705412217 0.5410824435 0.72945878 [35,] 0.2403165053 0.4806330105 0.75968349 [36,] 0.2260579730 0.4521159460 0.77394203 [37,] 0.1965121679 0.3930243358 0.80348783 [38,] 0.1477077678 0.2954155355 0.85229223 [39,] 0.1973944970 0.3947889940 0.80260550 [40,] 0.2179394042 0.4358788084 0.78206060 [41,] 0.2516479704 0.5032959408 0.74835203 [42,] 0.2057387280 0.4114774560 0.79426127 [43,] 0.1613189186 0.3226378371 0.83868108 [44,] 0.1211474594 0.2422949188 0.87885254 [45,] 0.2864904032 0.5729808064 0.71350960 [46,] 0.6289711605 0.7420576789 0.37102884 [47,] 0.8967294098 0.2065411805 0.10327059 [48,] 0.9286231475 0.1427537049 0.07137685 [49,] 0.9516760344 0.0966479313 0.04832397 [50,] 0.9770487623 0.0459024754 0.02295124 [51,] 0.9932219597 0.0135560805 0.00677804 [52,] 0.9703483912 0.0593032175 0.02965161 > postscript(file="/var/www/html/rcomp/tmp/1e5lh1260099803.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/2i7kp1260099803.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/3fvh41260099803.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/4mpte1260099803.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/5bwlk1260099803.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 = 61 Frequency = 1 1 2 3 4 5 0.2691262628 0.2661525794 0.0651613516 0.2621876682 0.4621876682 6 7 8 9 10 0.0661525794 0.2651613516 0.0641701238 0.1641701238 -0.2318649650 11 12 13 14 15 -0.2308737372 0.2671438072 0.0711087184 -0.0269088260 -0.5249263705 16 17 18 19 20 -0.3249263705 -0.3219526871 -0.0229439149 -0.1229439149 -0.3219526871 21 22 23 24 25 -0.2219526871 -0.3209614593 -0.4199702315 -0.2199702315 -0.4130316370 26 27 28 29 30 -0.2130316370 -0.2130316370 -0.3100579536 -0.3090667258 -0.4090667258 31 32 33 34 35 -0.2100579536 -0.3100579536 -0.1090667258 -0.1090667258 0.2909332742 36 37 38 39 40 0.3939069576 0.3978718688 0.1988630966 -0.0001456756 0.1968806410 41 42 43 44 45 0.1958894132 -0.0031193590 -0.6001456756 -0.5001456756 -0.4991544479 46 47 48 49 50 -0.0031193590 -0.0021281312 0.0988630966 0.6958894132 0.7948981854 51 52 53 54 55 0.7929157298 0.3958894132 0.1978718688 0.2948981854 0.1948981854 56 57 58 59 60 0.0929157298 0.1929157298 -0.2051018146 0.0929157298 0.2909332742 61 -0.3021281312 > postscript(file="/var/www/html/rcomp/tmp/6pcsi1260099803.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 = 61 Frequency = 1 lag(myerror, k = 1) myerror 0 0.2691262628 NA 1 0.2661525794 0.2691262628 2 0.0651613516 0.2661525794 3 0.2621876682 0.0651613516 4 0.4621876682 0.2621876682 5 0.0661525794 0.4621876682 6 0.2651613516 0.0661525794 7 0.0641701238 0.2651613516 8 0.1641701238 0.0641701238 9 -0.2318649650 0.1641701238 10 -0.2308737372 -0.2318649650 11 0.2671438072 -0.2308737372 12 0.0711087184 0.2671438072 13 -0.0269088260 0.0711087184 14 -0.5249263705 -0.0269088260 15 -0.3249263705 -0.5249263705 16 -0.3219526871 -0.3249263705 17 -0.0229439149 -0.3219526871 18 -0.1229439149 -0.0229439149 19 -0.3219526871 -0.1229439149 20 -0.2219526871 -0.3219526871 21 -0.3209614593 -0.2219526871 22 -0.4199702315 -0.3209614593 23 -0.2199702315 -0.4199702315 24 -0.4130316370 -0.2199702315 25 -0.2130316370 -0.4130316370 26 -0.2130316370 -0.2130316370 27 -0.3100579536 -0.2130316370 28 -0.3090667258 -0.3100579536 29 -0.4090667258 -0.3090667258 30 -0.2100579536 -0.4090667258 31 -0.3100579536 -0.2100579536 32 -0.1090667258 -0.3100579536 33 -0.1090667258 -0.1090667258 34 0.2909332742 -0.1090667258 35 0.3939069576 0.2909332742 36 0.3978718688 0.3939069576 37 0.1988630966 0.3978718688 38 -0.0001456756 0.1988630966 39 0.1968806410 -0.0001456756 40 0.1958894132 0.1968806410 41 -0.0031193590 0.1958894132 42 -0.6001456756 -0.0031193590 43 -0.5001456756 -0.6001456756 44 -0.4991544479 -0.5001456756 45 -0.0031193590 -0.4991544479 46 -0.0021281312 -0.0031193590 47 0.0988630966 -0.0021281312 48 0.6958894132 0.0988630966 49 0.7948981854 0.6958894132 50 0.7929157298 0.7948981854 51 0.3958894132 0.7929157298 52 0.1978718688 0.3958894132 53 0.2948981854 0.1978718688 54 0.1948981854 0.2948981854 55 0.0929157298 0.1948981854 56 0.1929157298 0.0929157298 57 -0.2051018146 0.1929157298 58 0.0929157298 -0.2051018146 59 0.2909332742 0.0929157298 60 -0.3021281312 0.2909332742 61 NA -0.3021281312 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 0.2661525794 0.2691262628 [2,] 0.0651613516 0.2661525794 [3,] 0.2621876682 0.0651613516 [4,] 0.4621876682 0.2621876682 [5,] 0.0661525794 0.4621876682 [6,] 0.2651613516 0.0661525794 [7,] 0.0641701238 0.2651613516 [8,] 0.1641701238 0.0641701238 [9,] -0.2318649650 0.1641701238 [10,] -0.2308737372 -0.2318649650 [11,] 0.2671438072 -0.2308737372 [12,] 0.0711087184 0.2671438072 [13,] -0.0269088260 0.0711087184 [14,] -0.5249263705 -0.0269088260 [15,] -0.3249263705 -0.5249263705 [16,] -0.3219526871 -0.3249263705 [17,] -0.0229439149 -0.3219526871 [18,] -0.1229439149 -0.0229439149 [19,] -0.3219526871 -0.1229439149 [20,] -0.2219526871 -0.3219526871 [21,] -0.3209614593 -0.2219526871 [22,] -0.4199702315 -0.3209614593 [23,] -0.2199702315 -0.4199702315 [24,] -0.4130316370 -0.2199702315 [25,] -0.2130316370 -0.4130316370 [26,] -0.2130316370 -0.2130316370 [27,] -0.3100579536 -0.2130316370 [28,] -0.3090667258 -0.3100579536 [29,] -0.4090667258 -0.3090667258 [30,] -0.2100579536 -0.4090667258 [31,] -0.3100579536 -0.2100579536 [32,] -0.1090667258 -0.3100579536 [33,] -0.1090667258 -0.1090667258 [34,] 0.2909332742 -0.1090667258 [35,] 0.3939069576 0.2909332742 [36,] 0.3978718688 0.3939069576 [37,] 0.1988630966 0.3978718688 [38,] -0.0001456756 0.1988630966 [39,] 0.1968806410 -0.0001456756 [40,] 0.1958894132 0.1968806410 [41,] -0.0031193590 0.1958894132 [42,] -0.6001456756 -0.0031193590 [43,] -0.5001456756 -0.6001456756 [44,] -0.4991544479 -0.5001456756 [45,] -0.0031193590 -0.4991544479 [46,] -0.0021281312 -0.0031193590 [47,] 0.0988630966 -0.0021281312 [48,] 0.6958894132 0.0988630966 [49,] 0.7948981854 0.6958894132 [50,] 0.7929157298 0.7948981854 [51,] 0.3958894132 0.7929157298 [52,] 0.1978718688 0.3958894132 [53,] 0.2948981854 0.1978718688 [54,] 0.1948981854 0.2948981854 [55,] 0.0929157298 0.1948981854 [56,] 0.1929157298 0.0929157298 [57,] -0.2051018146 0.1929157298 [58,] 0.0929157298 -0.2051018146 [59,] 0.2909332742 0.0929157298 [60,] -0.3021281312 0.2909332742 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 0.2661525794 0.2691262628 2 0.0651613516 0.2661525794 3 0.2621876682 0.0651613516 4 0.4621876682 0.2621876682 5 0.0661525794 0.4621876682 6 0.2651613516 0.0661525794 7 0.0641701238 0.2651613516 8 0.1641701238 0.0641701238 9 -0.2318649650 0.1641701238 10 -0.2308737372 -0.2318649650 11 0.2671438072 -0.2308737372 12 0.0711087184 0.2671438072 13 -0.0269088260 0.0711087184 14 -0.5249263705 -0.0269088260 15 -0.3249263705 -0.5249263705 16 -0.3219526871 -0.3249263705 17 -0.0229439149 -0.3219526871 18 -0.1229439149 -0.0229439149 19 -0.3219526871 -0.1229439149 20 -0.2219526871 -0.3219526871 21 -0.3209614593 -0.2219526871 22 -0.4199702315 -0.3209614593 23 -0.2199702315 -0.4199702315 24 -0.4130316370 -0.2199702315 25 -0.2130316370 -0.4130316370 26 -0.2130316370 -0.2130316370 27 -0.3100579536 -0.2130316370 28 -0.3090667258 -0.3100579536 29 -0.4090667258 -0.3090667258 30 -0.2100579536 -0.4090667258 31 -0.3100579536 -0.2100579536 32 -0.1090667258 -0.3100579536 33 -0.1090667258 -0.1090667258 34 0.2909332742 -0.1090667258 35 0.3939069576 0.2909332742 36 0.3978718688 0.3939069576 37 0.1988630966 0.3978718688 38 -0.0001456756 0.1988630966 39 0.1968806410 -0.0001456756 40 0.1958894132 0.1968806410 41 -0.0031193590 0.1958894132 42 -0.6001456756 -0.0031193590 43 -0.5001456756 -0.6001456756 44 -0.4991544479 -0.5001456756 45 -0.0031193590 -0.4991544479 46 -0.0021281312 -0.0031193590 47 0.0988630966 -0.0021281312 48 0.6958894132 0.0988630966 49 0.7948981854 0.6958894132 50 0.7929157298 0.7948981854 51 0.3958894132 0.7929157298 52 0.1978718688 0.3958894132 53 0.2948981854 0.1978718688 54 0.1948981854 0.2948981854 55 0.0929157298 0.1948981854 56 0.1929157298 0.0929157298 57 -0.2051018146 0.1929157298 58 0.0929157298 -0.2051018146 59 0.2909332742 0.0929157298 60 -0.3021281312 0.2909332742 > 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/7nfe71260099803.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/8gecy1260099803.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/9al3w1260099803.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/107eqa1260099803.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/11ojdv1260099803.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/12t1ad1260099803.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/13wax41260099803.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/14rztq1260099803.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/153g001260099803.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/16lwbx1260099803.tab") + } > > system("convert tmp/1e5lh1260099803.ps tmp/1e5lh1260099803.png") > system("convert tmp/2i7kp1260099803.ps tmp/2i7kp1260099803.png") > system("convert tmp/3fvh41260099803.ps tmp/3fvh41260099803.png") > system("convert tmp/4mpte1260099803.ps tmp/4mpte1260099803.png") > system("convert tmp/5bwlk1260099803.ps tmp/5bwlk1260099803.png") > system("convert tmp/6pcsi1260099803.ps tmp/6pcsi1260099803.png") > system("convert tmp/7nfe71260099803.ps tmp/7nfe71260099803.png") > system("convert tmp/8gecy1260099803.ps tmp/8gecy1260099803.png") > system("convert tmp/9al3w1260099803.ps tmp/9al3w1260099803.png") > system("convert tmp/107eqa1260099803.ps tmp/107eqa1260099803.png") > > > proc.time() user system elapsed 2.445 1.546 3.491