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(1000.00 + ,6600.00 + ,6.3 + ,2.0 + ,8.3 + ,4.5 + ,42.0 + ,3.00 + ,1.00 + ,3.00 + ,2547000.00 + ,4603000.00 + ,2.1 + ,1.8 + ,3.9 + ,69.0 + ,624.0 + ,3.00 + ,5.00 + ,4.00 + ,10550.00 + ,179500.00 + ,9.1 + ,0.7 + ,9.8 + ,27.0 + ,180.0 + ,4.00 + ,4.00 + ,4.00 + ,0.023 + ,0.300 + ,15.8 + ,3.9 + ,19.7 + ,19.0 + ,35.0 + ,1.00 + ,1.00 + ,1.00 + ,160000.00 + ,169000.00 + ,5.2 + ,1.0 + ,6.2 + ,30.4 + ,392.0 + ,4.00 + ,5.00 + ,4.00 + ,3300.00 + ,25600.00 + ,10.9 + ,3.6 + ,14.5 + ,28.0 + ,63.0 + ,1.00 + ,2.00 + ,1.00 + ,52160.00 + ,440000.00 + ,8.3 + ,1.4 + ,9.7 + ,50.0 + ,230.0 + ,1.00 + ,1.00 + ,1.00 + ,0.425 + ,6400.00 + ,11.0 + ,1.5 + ,12.5 + ,7.0 + ,112.0 + ,5.00 + ,4.00 + ,4.00 + ,465000.00 + ,423000.00 + ,3.2 + ,0.7 + ,3.9 + ,30.0 + ,281.0 + ,5.00 + ,5.00 + ,5.00 + ,0.075 + ,1200.00 + ,6.3 + ,2.1 + ,8.4 + ,3.5 + ,42.0 + ,1.00 + ,1.00 + ,1.00 + ,0.785 + ,3500.00 + ,6.6 + ,4.1 + ,10.7 + ,6.0 + ,42.0 + ,2.00 + ,2.00 + ,2.00 + ,0.200 + ,5000.00 + ,9.5 + ,1.2 + ,10.7 + ,10.4 + ,120.0 + ,2.00 + ,2.00 + ,2.00 + ,27660.00 + ,115000.00 + ,3.3 + ,0.5 + ,3.8 + ,20.0 + ,148.0 + ,5.00 + ,5.00 + ,5.00 + ,0.120 + ,1000.00 + ,11.0 + ,3.4 + ,14.4 + ,3.9 + ,16.0 + ,3.00 + ,1.00 + ,2.00 + ,85000.00 + ,325000.00 + ,4.7 + ,1.5 + ,6.2 + ,41.0 + ,310.0 + ,1.00 + ,3.00 + ,1.00 + ,0.101 + ,4000.00 + ,10.4 + ,3.4 + ,13.8 + ,9.0 + ,28.0 + ,5.00 + ,1.00 + ,3.00 + ,1040.00 + ,5500.00 + ,7.4 + ,0.8 + ,8.2 + ,7.6 + ,68.0 + ,5.00 + ,3.00 + ,4.00 + ,521000.00 + ,655000.00 + ,2.1 + ,0.8 + ,2.9 + ,46.0 + ,336.0 + ,5.00 + ,5.00 + ,5.00 + ,0.010 + ,0.250 + ,17.9 + ,2.0 + ,19.9 + ,24.0 + ,50.0 + ,1.00 + ,1.00 + ,1.00 + ,62000.00 + ,1320000.00 + ,6.1 + ,1.9 + ,8.0 + ,100.0 + ,267.0 + ,1.00 + ,1.00 + ,1.00 + ,.023 + ,0.400 + ,11.9 + ,1.3 + ,13.2 + ,3.2 + ,19.0 + ,4.00 + ,1.00 + ,3.00 + ,1700.00 + ,6300.00 + ,13.8 + ,5.6 + ,19.4 + ,5.0 + ,12.0 + ,2.00 + ,1.00 + ,1.00 + ,3500.00 + ,10800.00 + ,14.3 + ,3.1 + ,17.4 + ,6.5 + ,120.0 + ,2.00 + ,1.00 + ,1.00 + ,0.480 + ,15500.00 + ,15.2 + ,1.8 + ,17.0 + ,12.0 + ,140.0 + ,2.00 + ,2.00 + ,2.00 + ,10000.00 + ,115000.00 + ,10.0 + ,0.9 + ,10.9 + ,20.2 + ,170.0 + ,4.00 + ,4.00 + ,4.00 + ,1620.00 + ,11400.00 + ,11.9 + ,1.8 + ,13.7 + ,13.0 + ,17.0 + ,2.00 + ,1.00 + ,2.00 + ,192000.00 + ,180000.00 + ,6.5 + ,1.9 + ,8.4 + ,27.0 + ,115.0 + ,4.00 + ,4.00 + ,4.00 + ,2500.00 + ,12100.00 + ,7.5 + ,0.9 + ,8.4 + ,18.0 + ,31.0 + ,5.00 + ,5.00 + ,5.00 + ,0.280 + ,1900.00 + ,10.6 + ,2.6 + ,13.2 + ,4.7 + ,21.0 + ,3.00 + ,1.00 + ,3.00 + ,4235.00 + ,50400.00 + ,7.4 + ,2.4 + ,9.8 + ,9.8 + ,52.0 + ,1.00 + ,1.00 + ,1.00 + ,6800.00 + ,179000.00 + ,8.4 + ,1.2 + ,9.6 + ,29.0 + ,164.0 + ,2.00 + ,3.00 + ,2.00 + ,0.750 + ,12300.00 + ,5.7 + ,0.9 + ,6.6 + ,7.0 + ,225.0 + ,2.00 + ,2.00 + ,2.00 + ,3600.00 + ,21000.00 + ,4.9 + ,0.5 + ,5.4 + ,6.0 + ,225.0 + ,3.00 + ,2.00 + ,3.00 + ,55500.00 + ,175000.00 + ,3.2 + ,0.6 + ,3.8 + ,20.0 + ,151.0 + ,5.00 + ,5.00 + ,5.00 + ,0.900 + ,2600.00 + ,11.0 + ,2.3 + ,13.3 + ,4.5 + ,60.0 + ,2.00 + ,1.00 + ,2.00 + ,2000.00 + ,12300.00 + ,4.9 + ,0.5 + ,5.4 + ,7.5 + ,200.0 + ,3.00 + ,1.00 + ,3.00 + ,0.104 + ,2500.00 + ,13.2 + ,2.6 + ,15.8 + ,2.3 + ,46.0 + ,3.00 + ,2.00 + ,2.00 + ,4190.00 + ,58000.00 + ,9.7 + ,0.6 + ,10.3 + ,24.0 + ,210.0 + ,4.00 + ,3.00 + ,4.00 + ,3500.00 + ,3900.00 + ,12.8 + ,6.6 + ,19.4 + ,3.0 + ,14.0 + ,2.00 + ,1.00 + ,1.00) + ,dim=c(10 + ,39) + ,dimnames=list(c('Bodyweightkg' + ,'brainweightkg' + ,'slowwavesleep' + ,'paradoxicalsleep' + ,'totalsleep' + ,'maxlifespan' + ,'gestationtime' + ,'predationindex' + ,'sleepexposureindex' + ,'overalldangerindex') + ,1:39)) > y <- array(NA,dim=c(10,39),dimnames=list(c('Bodyweightkg','brainweightkg','slowwavesleep','paradoxicalsleep','totalsleep','maxlifespan','gestationtime','predationindex','sleepexposureindex','overalldangerindex'),1:39)) > 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 Bodyweightkg brainweightkg slowwavesleep paradoxicalsleep totalsleep 1 1.000e+03 6.600e+03 6.3 2.0 8.3 2 2.547e+06 4.603e+06 2.1 1.8 3.9 3 1.055e+04 1.795e+05 9.1 0.7 9.8 4 2.300e-02 3.000e-01 15.8 3.9 19.7 5 1.600e+05 1.690e+05 5.2 1.0 6.2 6 3.300e+03 2.560e+04 10.9 3.6 14.5 7 5.216e+04 4.400e+05 8.3 1.4 9.7 8 4.250e-01 6.400e+03 11.0 1.5 12.5 9 4.650e+05 4.230e+05 3.2 0.7 3.9 10 7.500e-02 1.200e+03 6.3 2.1 8.4 11 7.850e-01 3.500e+03 6.6 4.1 10.7 12 2.000e-01 5.000e+03 9.5 1.2 10.7 13 2.766e+04 1.150e+05 3.3 0.5 3.8 14 1.200e-01 1.000e+03 11.0 3.4 14.4 15 8.500e+04 3.250e+05 4.7 1.5 6.2 16 1.010e-01 4.000e+03 10.4 3.4 13.8 17 1.040e+03 5.500e+03 7.4 0.8 8.2 18 5.210e+05 6.550e+05 2.1 0.8 2.9 19 1.000e-02 2.500e-01 17.9 2.0 19.9 20 6.200e+04 1.320e+06 6.1 1.9 8.0 21 2.300e-02 4.000e-01 11.9 1.3 13.2 22 1.700e+03 6.300e+03 13.8 5.6 19.4 23 3.500e+03 1.080e+04 14.3 3.1 17.4 24 4.800e-01 1.550e+04 15.2 1.8 17.0 25 1.000e+04 1.150e+05 10.0 0.9 10.9 26 1.620e+03 1.140e+04 11.9 1.8 13.7 27 1.920e+05 1.800e+05 6.5 1.9 8.4 28 2.500e+03 1.210e+04 7.5 0.9 8.4 29 2.800e-01 1.900e+03 10.6 2.6 13.2 30 4.235e+03 5.040e+04 7.4 2.4 9.8 31 6.800e+03 1.790e+05 8.4 1.2 9.6 32 7.500e-01 1.230e+04 5.7 0.9 6.6 33 3.600e+03 2.100e+04 4.9 0.5 5.4 34 5.550e+04 1.750e+05 3.2 0.6 3.8 35 9.000e-01 2.600e+03 11.0 2.3 13.3 36 2.000e+03 1.230e+04 4.9 0.5 5.4 37 1.040e-01 2.500e+03 13.2 2.6 15.8 38 4.190e+03 5.800e+04 9.7 0.6 10.3 39 3.500e+03 3.900e+03 12.8 6.6 19.4 maxlifespan gestationtime predationindex sleepexposureindex 1 4.5 42 3 1 2 69.0 624 3 5 3 27.0 180 4 4 4 19.0 35 1 1 5 30.4 392 4 5 6 28.0 63 1 2 7 50.0 230 1 1 8 7.0 112 5 4 9 30.0 281 5 5 10 3.5 42 1 1 11 6.0 42 2 2 12 10.4 120 2 2 13 20.0 148 5 5 14 3.9 16 3 1 15 41.0 310 1 3 16 9.0 28 5 1 17 7.6 68 5 3 18 46.0 336 5 5 19 24.0 50 1 1 20 100.0 267 1 1 21 3.2 19 4 1 22 5.0 12 2 1 23 6.5 120 2 1 24 12.0 140 2 2 25 20.2 170 4 4 26 13.0 17 2 1 27 27.0 115 4 4 28 18.0 31 5 5 29 4.7 21 3 1 30 9.8 52 1 1 31 29.0 164 2 3 32 7.0 225 2 2 33 6.0 225 3 2 34 20.0 151 5 5 35 4.5 60 2 1 36 7.5 200 3 1 37 2.3 46 3 2 38 24.0 210 4 3 39 3.0 14 2 1 overalldangerindex 1 3 2 4 3 4 4 1 5 4 6 1 7 1 8 4 9 5 10 1 11 2 12 2 13 5 14 2 15 1 16 3 17 4 18 5 19 1 20 1 21 3 22 1 23 1 24 2 25 4 26 2 27 4 28 5 29 3 30 1 31 2 32 2 33 3 34 5 35 2 36 3 37 2 38 4 39 1 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) brainweightkg slowwavesleep paradoxicalsleep -1.753e+05 5.442e-01 4.180e+03 2.984e+04 totalsleep maxlifespan gestationtime predationindex NA -5.887e+03 4.924e+02 -4.462e+04 sleepexposureindex overalldangerindex 2.075e+04 7.012e+04 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -152142 -42612 -9448 40337 182919 Coefficients: (1 not defined because of singularities) Estimate Std. Error t value Pr(>|t|) (Intercept) -1.753e+05 9.346e+04 -1.876 0.0704 . brainweightkg 5.442e-01 3.184e-02 17.089 < 2e-16 *** slowwavesleep 4.180e+03 4.801e+03 0.871 0.3908 paradoxicalsleep 2.984e+04 1.561e+04 1.911 0.0656 . totalsleep NA NA NA NA maxlifespan -5.887e+03 9.967e+02 -5.907 1.81e-06 *** gestationtime 4.924e+02 2.277e+02 2.162 0.0387 * predationindex -4.462e+04 3.264e+04 -1.367 0.1817 sleepexposureindex 2.075e+04 1.868e+04 1.111 0.2754 overalldangerindex 7.012e+04 4.562e+04 1.537 0.1348 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 79550 on 30 degrees of freedom Multiple R-squared: 0.9712, Adjusted R-squared: 0.9635 F-statistic: 126.6 on 8 and 30 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.8989226 0.20215487 0.101077434 [2,] 0.8063784 0.38724310 0.193621551 [3,] 0.6970974 0.60580530 0.302902649 [4,] 0.5702797 0.85944066 0.429720332 [5,] 0.4339225 0.86784498 0.566077511 [6,] 0.9784769 0.04304625 0.021523123 [7,] 0.9723967 0.05520655 0.027603273 [8,] 0.9946214 0.01075711 0.005378554 [9,] 0.9855577 0.02888464 0.014442320 [10,] 0.9672761 0.06544778 0.032723889 [11,] 0.9321672 0.13566555 0.067832773 [12,] 0.8922517 0.21549652 0.107748262 [13,] 0.8156662 0.36866760 0.184333800 [14,] 0.6678762 0.66424752 0.332123758 > postscript(file="/var/www/html/rcomp/tmp/1cy631291900312.ps",horizontal=F,onefile=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/2cy631291900312.ps",horizontal=F,onefile=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/3n8561291900312.ps",horizontal=F,onefile=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/4n8561291900312.ps",horizontal=F,onefile=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/5n8561291900312.ps",horizontal=F,onefile=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 = 39 Frequency = 1 1 2 3 4 5 6 -4689.647 3603.876 -85371.363 41306.054 -27973.185 78559.213 7 8 9 10 11 12 46466.714 -73179.218 182918.967 39368.694 -54337.519 6750.358 13 14 15 16 17 18 -74651.258 15327.250 20074.583 59447.990 10231.913 181401.393 19 20 21 22 23 24 111270.086 -152142.079 43673.213 -29261.912 -1753.613 -41119.848 25 26 27 28 29 30 -95662.047 63725.474 102874.877 -27472.700 -27491.037 35447.786 31 32 33 34 35 36 -9447.656 -44103.210 -61342.319 -83505.154 -15477.076 -16317.002 37 38 39 -15757.137 -36820.862 -64572.600 > postscript(file="/var/www/html/rcomp/tmp/6gzm91291900312.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) > dum <- cbind(lag(myerror,k=1),myerror) > dum Time Series: Start = 0 End = 39 Frequency = 1 lag(myerror, k = 1) myerror 0 -4689.647 NA 1 3603.876 -4689.647 2 -85371.363 3603.876 3 41306.054 -85371.363 4 -27973.185 41306.054 5 78559.213 -27973.185 6 46466.714 78559.213 7 -73179.218 46466.714 8 182918.967 -73179.218 9 39368.694 182918.967 10 -54337.519 39368.694 11 6750.358 -54337.519 12 -74651.258 6750.358 13 15327.250 -74651.258 14 20074.583 15327.250 15 59447.990 20074.583 16 10231.913 59447.990 17 181401.393 10231.913 18 111270.086 181401.393 19 -152142.079 111270.086 20 43673.213 -152142.079 21 -29261.912 43673.213 22 -1753.613 -29261.912 23 -41119.848 -1753.613 24 -95662.047 -41119.848 25 63725.474 -95662.047 26 102874.877 63725.474 27 -27472.700 102874.877 28 -27491.037 -27472.700 29 35447.786 -27491.037 30 -9447.656 35447.786 31 -44103.210 -9447.656 32 -61342.319 -44103.210 33 -83505.154 -61342.319 34 -15477.076 -83505.154 35 -16317.002 -15477.076 36 -15757.137 -16317.002 37 -36820.862 -15757.137 38 -64572.600 -36820.862 39 NA -64572.600 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 3603.876 -4689.647 [2,] -85371.363 3603.876 [3,] 41306.054 -85371.363 [4,] -27973.185 41306.054 [5,] 78559.213 -27973.185 [6,] 46466.714 78559.213 [7,] -73179.218 46466.714 [8,] 182918.967 -73179.218 [9,] 39368.694 182918.967 [10,] -54337.519 39368.694 [11,] 6750.358 -54337.519 [12,] -74651.258 6750.358 [13,] 15327.250 -74651.258 [14,] 20074.583 15327.250 [15,] 59447.990 20074.583 [16,] 10231.913 59447.990 [17,] 181401.393 10231.913 [18,] 111270.086 181401.393 [19,] -152142.079 111270.086 [20,] 43673.213 -152142.079 [21,] -29261.912 43673.213 [22,] -1753.613 -29261.912 [23,] -41119.848 -1753.613 [24,] -95662.047 -41119.848 [25,] 63725.474 -95662.047 [26,] 102874.877 63725.474 [27,] -27472.700 102874.877 [28,] -27491.037 -27472.700 [29,] 35447.786 -27491.037 [30,] -9447.656 35447.786 [31,] -44103.210 -9447.656 [32,] -61342.319 -44103.210 [33,] -83505.154 -61342.319 [34,] -15477.076 -83505.154 [35,] -16317.002 -15477.076 [36,] -15757.137 -16317.002 [37,] -36820.862 -15757.137 [38,] -64572.600 -36820.862 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 3603.876 -4689.647 2 -85371.363 3603.876 3 41306.054 -85371.363 4 -27973.185 41306.054 5 78559.213 -27973.185 6 46466.714 78559.213 7 -73179.218 46466.714 8 182918.967 -73179.218 9 39368.694 182918.967 10 -54337.519 39368.694 11 6750.358 -54337.519 12 -74651.258 6750.358 13 15327.250 -74651.258 14 20074.583 15327.250 15 59447.990 20074.583 16 10231.913 59447.990 17 181401.393 10231.913 18 111270.086 181401.393 19 -152142.079 111270.086 20 43673.213 -152142.079 21 -29261.912 43673.213 22 -1753.613 -29261.912 23 -41119.848 -1753.613 24 -95662.047 -41119.848 25 63725.474 -95662.047 26 102874.877 63725.474 27 -27472.700 102874.877 28 -27491.037 -27472.700 29 35447.786 -27491.037 30 -9447.656 35447.786 31 -44103.210 -9447.656 32 -61342.319 -44103.210 33 -83505.154 -61342.319 34 -15477.076 -83505.154 35 -16317.002 -15477.076 36 -15757.137 -16317.002 37 -36820.862 -15757.137 38 -64572.600 -36820.862 > 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/7r83t1291900312.ps",horizontal=F,onefile=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/8r83t1291900312.ps",horizontal=F,onefile=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/9r83t1291900312.ps",horizontal=F,onefile=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') Warning messages: 1: In sqrt(crit * p * (1 - hh)/hh) : NaNs produced 2: In sqrt(crit * p * (1 - hh)/hh) : NaNs produced > par(opar) > dev.off() null device 1 > if (n > n25) { + postscript(file="/var/www/html/rcomp/tmp/101z3e1291900312.ps",horizontal=F,onefile=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='') + } + } Error: subscript out of bounds Execution halted