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(13 + ,15 + ,9 + ,42 + ,12 + ,12 + ,18 + ,9 + ,51 + ,15 + ,15 + ,11 + ,9 + ,42 + ,14 + ,12 + ,16 + ,8 + ,46 + ,10 + ,10 + ,12 + ,14 + ,41 + ,10 + ,12 + ,17 + ,14 + ,49 + ,9 + ,15 + ,15 + ,15 + ,47 + ,18 + ,9 + ,19 + ,11 + ,33 + ,11 + ,11 + ,18 + ,8 + ,47 + ,12 + ,11 + ,10 + ,14 + ,42 + ,11 + ,11 + ,14 + ,9 + ,32 + ,15 + ,15 + ,18 + ,6 + ,53 + ,17 + ,7 + ,18 + ,14 + ,41 + ,14 + ,11 + ,14 + ,8 + ,41 + ,24 + ,11 + ,14 + ,11 + ,33 + ,7 + ,10 + ,12 + ,16 + ,37 + ,18 + ,14 + ,16 + ,11 + ,43 + ,11 + ,6 + ,13 + ,13 + ,33 + ,14 + ,11 + ,16 + ,7 + ,49 + ,18 + ,15 + ,14 + ,9 + ,42 + ,12 + ,11 + ,9 + ,15 + ,43 + ,11 + ,12 + ,9 + ,16 + ,37 + ,5 + ,14 + ,17 + ,10 + ,43 + ,12 + ,15 + ,13 + ,14 + ,42 + ,11 + ,9 + ,15 + ,12 + ,43 + ,10 + ,13 + ,17 + ,6 + ,46 + ,11 + ,13 + ,16 + ,4 + ,33 + ,15 + ,16 + ,12 + ,12 + ,42 + ,16 + ,13 + ,11 + ,14 + ,40 + ,14 + ,12 + ,16 + ,13 + ,44 + ,8 + ,14 + ,17 + ,9 + ,42 + ,13 + ,11 + ,17 + ,14 + ,52 + ,18 + ,9 + ,16 + ,14 + ,44 + ,17 + ,16 + ,13 + ,10 + ,45 + ,10 + ,12 + ,12 + ,14 + ,46 + ,13 + ,10 + ,12 + ,8 + ,36 + ,11 + ,13 + ,16 + ,8 + ,45 + ,12 + ,16 + ,14 + ,10 + ,49 + ,12 + ,14 + ,12 + ,9 + ,43 + ,12 + ,15 + ,12 + ,9 + ,43 + ,9 + ,5 + ,14 + ,11 + ,37 + ,18 + ,8 + ,8 + ,15 + ,32 + ,7 + ,11 + ,15 + ,9 + ,45 + ,14 + ,16 + ,14 + ,9 + ,45 + ,16 + ,17 + ,11 + ,10 + ,45 + ,12 + ,9 + ,13 + ,8 + ,45 + ,17 + ,9 + ,14 + ,8 + ,31 + ,12 + ,13 + ,15 + ,14 + ,33 + ,9 + ,10 + ,16 + ,10 + ,44 + ,12 + ,6 + ,10 + ,11 + ,49 + ,9 + ,12 + ,11 + ,9 + ,44 + ,13 + ,8 + ,12 + ,12 + ,41 + ,10 + ,14 + ,14 + ,13 + ,44 + ,10 + ,12 + ,15 + ,14 + ,38 + ,11 + ,11 + ,16 + ,15 + ,33 + ,13 + ,16 + ,9 + ,11 + ,47 + ,13 + ,8 + ,11 + ,9 + ,37 + ,13 + ,15 + ,15 + ,8 + ,48 + ,6 + ,7 + ,15 + ,7 + ,40 + ,7 + ,16 + ,13 + ,10 + ,50 + ,13 + ,14 + ,17 + ,10 + ,54 + ,21 + ,16 + ,17 + ,10 + ,43 + ,11 + ,9 + ,15 + ,9 + ,54 + ,9 + ,14 + ,13 + ,13 + ,44 + ,18 + ,11 + ,15 + ,11 + ,47 + ,9 + ,13 + ,13 + ,8 + ,33 + ,9 + ,15 + ,15 + ,10 + ,45 + ,15 + ,5 + ,10 + ,14 + ,33 + ,9 + ,15 + ,15 + ,11 + ,44 + ,11 + ,13 + ,14 + ,10 + ,47 + ,14 + ,11 + ,15 + ,16 + ,45 + ,14 + ,11 + ,16 + ,11 + ,43 + ,8 + ,12 + ,7 + ,16 + ,43 + ,12 + ,12 + ,13 + ,6 + ,33 + ,8 + ,12 + ,15 + ,11 + ,46 + ,11 + ,14 + ,13 + ,14 + ,47 + ,17 + ,6 + ,16 + ,9 + ,47 + ,16 + ,7 + ,16 + ,9 + ,0 + ,11 + ,14 + ,12 + ,11 + ,43 + ,13 + ,13 + ,15 + ,12 + ,46 + ,11 + ,12 + ,14 + ,20 + ,36 + ,8 + ,9 + ,11 + ,11 + ,42 + ,11 + ,12 + ,14 + ,12 + ,44 + ,13 + ,16 + ,15 + ,9 + ,47 + ,13 + ,10 + ,9 + ,10 + ,41 + ,15 + ,14 + ,15 + ,14 + ,47 + ,15 + ,10 + ,17 + ,8 + ,46 + ,12 + ,16 + ,16 + ,10 + ,47 + ,12 + ,15 + ,14 + ,8 + ,46 + ,15 + ,12 + ,15 + ,7 + ,46 + ,12 + ,10 + ,16 + ,11 + ,36 + ,21 + ,8 + ,10 + ,14 + ,30 + ,24 + ,8 + ,17 + ,8 + ,48 + ,11 + ,11 + ,15 + ,14 + ,45 + ,12 + ,13 + ,15 + ,10 + ,49 + ,15 + ,16 + ,13 + ,9 + ,55 + ,17 + ,14 + ,14 + ,16 + ,11 + ,12 + ,11 + ,16 + ,8 + ,52 + ,16 + ,4 + ,11 + ,12 + ,33 + ,13 + ,14 + ,18 + ,8 + ,47 + ,15 + ,9 + ,14 + ,16 + ,33 + ,11 + ,14 + ,14 + ,13 + ,44 + ,15 + ,8 + ,14 + ,13 + ,42 + ,12 + ,8 + ,14 + ,8 + ,55 + ,14 + ,11 + ,15 + ,9 + ,42 + ,12 + ,12 + ,14 + ,11 + ,46 + ,20 + ,14 + ,15 + ,9 + ,46 + ,17 + ,15 + ,15 + ,8 + ,47 + ,12 + ,16 + ,12 + ,14 + ,33 + ,11 + ,16 + ,19 + ,7 + ,53 + ,11 + ,14 + ,13 + ,11 + ,42 + ,9 + ,12 + ,15 + ,11 + ,44 + ,12 + ,14 + ,17 + ,10 + ,55 + ,11 + ,8 + ,9 + ,14 + ,40 + ,8 + ,16 + ,15 + ,10 + ,46 + ,12 + ,12 + ,16 + ,9 + ,53 + ,15 + ,12 + ,17 + ,8 + ,44 + ,10 + ,11 + ,11 + ,14 + ,35 + ,14 + ,4 + ,15 + ,12 + ,40 + ,16 + ,16 + ,11 + ,12 + ,44 + ,18 + ,15 + ,15 + ,6 + ,46 + ,6 + ,10 + ,17 + ,16 + ,45 + ,16 + ,13 + ,14 + ,8 + ,53 + ,11 + ,15 + ,12 + ,13 + ,45 + ,20 + ,12 + ,14 + ,12 + ,48 + ,10 + ,14 + ,15 + ,11 + ,46 + ,16 + ,7 + ,16 + ,12 + ,55 + ,15 + ,19 + ,16 + ,9 + ,47 + ,14 + ,12 + ,14 + ,11 + ,43 + ,7 + ,12 + ,11 + ,16 + ,38 + ,9 + ,8 + ,14 + ,10 + ,40 + ,12 + ,12 + ,13 + ,13 + ,47 + ,12 + ,10 + ,13 + ,11 + ,47 + ,13 + ,8 + ,14 + ,11 + ,42 + ,17 + ,10 + ,16 + ,9 + ,53 + ,11 + ,14 + ,16 + ,11 + ,43 + ,11 + ,16 + ,12 + ,12 + ,44 + ,14 + ,13 + ,11 + ,10 + ,42 + ,13 + ,16 + ,13 + ,13 + ,51 + ,12 + ,9 + ,15 + ,9 + ,54 + ,11 + ,14 + ,13 + ,14 + ,41 + ,15 + ,14 + ,16 + ,14 + ,51 + ,11 + ,12 + ,13 + ,8 + ,51 + ,13) + ,dim=c(5 + ,143) + ,dimnames=list(c('popularity' + ,'hapiness' + ,'doubsaboutactions' + ,'belonging' + ,'parentalexpectations') + ,1:143)) > y <- array(NA,dim=c(5,143),dimnames=list(c('popularity','hapiness','doubsaboutactions','belonging','parentalexpectations'),1:143)) > 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 = '4' > #'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 belonging popularity hapiness doubsaboutactions parentalexpectations 1 42 13 15 9 12 2 51 12 18 9 15 3 42 15 11 9 14 4 46 12 16 8 10 5 41 10 12 14 10 6 49 12 17 14 9 7 47 15 15 15 18 8 33 9 19 11 11 9 47 11 18 8 12 10 42 11 10 14 11 11 32 11 14 9 15 12 53 15 18 6 17 13 41 7 18 14 14 14 41 11 14 8 24 15 33 11 14 11 7 16 37 10 12 16 18 17 43 14 16 11 11 18 33 6 13 13 14 19 49 11 16 7 18 20 42 15 14 9 12 21 43 11 9 15 11 22 37 12 9 16 5 23 43 14 17 10 12 24 42 15 13 14 11 25 43 9 15 12 10 26 46 13 17 6 11 27 33 13 16 4 15 28 42 16 12 12 16 29 40 13 11 14 14 30 44 12 16 13 8 31 42 14 17 9 13 32 52 11 17 14 18 33 44 9 16 14 17 34 45 16 13 10 10 35 46 12 12 14 13 36 36 10 12 8 11 37 45 13 16 8 12 38 49 16 14 10 12 39 43 14 12 9 12 40 43 15 12 9 9 41 37 5 14 11 18 42 32 8 8 15 7 43 45 11 15 9 14 44 45 16 14 9 16 45 45 17 11 10 12 46 45 9 13 8 17 47 31 9 14 8 12 48 33 13 15 14 9 49 44 10 16 10 12 50 49 6 10 11 9 51 44 12 11 9 13 52 41 8 12 12 10 53 44 14 14 13 10 54 38 12 15 14 11 55 33 11 16 15 13 56 47 16 9 11 13 57 37 8 11 9 13 58 48 15 15 8 6 59 40 7 15 7 7 60 50 16 13 10 13 61 54 14 17 10 21 62 43 16 17 10 11 63 54 9 15 9 9 64 44 14 13 13 18 65 47 11 15 11 9 66 33 13 13 8 9 67 45 15 15 10 15 68 33 5 10 14 9 69 44 15 15 11 11 70 47 13 14 10 14 71 45 11 15 16 14 72 43 11 16 11 8 73 43 12 7 16 12 74 33 12 13 6 8 75 46 12 15 11 11 76 47 14 13 14 17 77 47 6 16 9 16 78 0 7 16 9 11 79 43 14 12 11 13 80 46 13 15 12 11 81 36 12 14 20 8 82 42 9 11 11 11 83 44 12 14 12 13 84 47 16 15 9 13 85 41 10 9 10 15 86 47 14 15 14 15 87 46 10 17 8 12 88 47 16 16 10 12 89 46 15 14 8 15 90 46 12 15 7 12 91 36 10 16 11 21 92 30 8 10 14 24 93 48 8 17 8 11 94 45 11 15 14 12 95 49 13 15 10 15 96 55 16 13 9 17 97 11 14 14 16 12 98 52 11 16 8 16 99 33 4 11 12 13 100 47 14 18 8 15 101 33 9 14 16 11 102 44 14 14 13 15 103 42 8 14 13 12 104 55 8 14 8 14 105 42 11 15 9 12 106 46 12 14 11 20 107 46 14 15 9 17 108 47 15 15 8 12 109 33 16 12 14 11 110 53 16 19 7 11 111 42 14 13 11 9 112 44 12 15 11 12 113 55 14 17 10 11 114 40 8 9 14 8 115 46 16 15 10 12 116 53 12 16 9 15 117 44 12 17 8 10 118 35 11 11 14 14 119 40 4 15 12 16 120 44 16 11 12 18 121 46 15 15 6 6 122 45 10 17 16 16 123 53 13 14 8 11 124 45 15 12 13 20 125 48 12 14 12 10 126 46 14 15 11 16 127 55 7 16 12 15 128 47 19 16 9 14 129 43 12 14 11 7 130 38 12 11 16 9 131 40 8 14 10 12 132 47 12 13 13 12 133 47 10 13 11 13 134 42 8 14 11 17 135 53 10 16 9 11 136 43 14 16 11 11 137 44 16 12 12 14 138 42 13 11 10 13 139 51 16 13 13 12 140 54 9 15 9 11 141 41 14 13 14 15 142 51 14 16 14 11 143 51 12 13 8 13 > k <- length(x[1,]) > df <- as.data.frame(x) > (mylm <- lm(df)) Call: lm(formula = df) Coefficients: (Intercept) popularity hapiness 30.4126 0.6165 0.5109 doubsaboutactions parentalexpectations -0.4303 0.2265 > (mysum <- summary(mylm)) Call: lm(formula = df) Residuals: Min 1Q Median 3Q Max -41.5222 -2.0186 0.3845 3.1917 13.8626 Coefficients: Estimate Std. Error t value Pr(>|t|) (Intercept) 30.4126 5.9311 5.128 9.73e-07 *** popularity 0.6165 0.1929 3.196 0.00173 ** hapiness 0.5109 0.2605 1.961 0.05187 . doubsaboutactions -0.4303 0.2236 -1.924 0.05641 . parentalexpectations 0.2265 0.1680 1.348 0.17975 --- Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 Residual standard error: 6.815 on 138 degrees of freedom Multiple R-squared: 0.1661, Adjusted R-squared: 0.1419 F-statistic: 6.873 on 4 and 138 DF, p-value: 4.486e-05 > 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,] 5.974406e-01 0.8051187586 0.4025593793 [2,] 4.757281e-01 0.9514561509 0.5242719245 [3,] 3.628645e-01 0.7257289727 0.6371355137 [4,] 3.533980e-01 0.7067959793 0.6466020104 [5,] 2.870549e-01 0.5741098910 0.7129450545 [6,] 2.625356e-01 0.5250711725 0.7374644138 [7,] 2.050084e-01 0.4100168684 0.7949915658 [8,] 2.328270e-01 0.4656540167 0.7671729917 [9,] 1.690068e-01 0.3380135878 0.8309932061 [10,] 1.376931e-01 0.2753861453 0.8623069273 [11,] 9.668122e-02 0.1933624301 0.9033187850 [12,] 1.002762e-01 0.2005523329 0.8997238336 [13,] 7.739960e-02 0.1547992080 0.9226003960 [14,] 8.335031e-02 0.1667006185 0.9166496908 [15,] 5.629322e-02 0.1125864300 0.9437067850 [16,] 4.323241e-02 0.0864648283 0.9567675859 [17,] 3.082940e-02 0.0616587902 0.9691706049 [18,] 2.466561e-02 0.0493312286 0.9753343857 [19,] 1.599877e-02 0.0319975377 0.9840012311 [20,] 4.515271e-02 0.0903054186 0.9548472907 [21,] 3.411033e-02 0.0682206579 0.9658896710 [22,] 2.309877e-02 0.0461975399 0.9769012300 [23,] 1.531093e-02 0.0306218664 0.9846890668 [24,] 1.180239e-02 0.0236047844 0.9881976078 [25,] 1.300859e-02 0.0260171767 0.9869914116 [26,] 8.521493e-03 0.0170429851 0.9914785074 [27,] 5.570720e-03 0.0111414406 0.9944292797 [28,] 4.818623e-03 0.0096372451 0.9951813775 [29,] 3.254694e-03 0.0065093870 0.9967453065 [30,] 2.125294e-03 0.0042505882 0.9978747059 [31,] 1.549016e-03 0.0030980327 0.9984509837 [32,] 9.888714e-04 0.0019777428 0.9990111286 [33,] 6.046413e-04 0.0012092826 0.9993953587 [34,] 3.745254e-04 0.0007490508 0.9996254746 [35,] 2.163793e-04 0.0004327585 0.9997836207 [36,] 1.531669e-04 0.0003063337 0.9998468331 [37,] 8.966313e-05 0.0001793263 0.9999103369 [38,] 5.012791e-05 0.0001002558 0.9999498721 [39,] 6.138571e-05 0.0001227714 0.9999386143 [40,] 1.064087e-04 0.0002128173 0.9998935913 [41,] 3.623866e-04 0.0007247733 0.9996376134 [42,] 2.456195e-04 0.0004912390 0.9997543805 [43,] 3.069584e-03 0.0061391676 0.9969304162 [44,] 2.251224e-03 0.0045024487 0.9977487756 [45,] 1.606148e-03 0.0032122956 0.9983938522 [46,] 1.040399e-03 0.0020807977 0.9989596012 [47,] 8.341408e-04 0.0016682817 0.9991658592 [48,] 1.463122e-03 0.0029262447 0.9985368777 [49,] 1.122182e-03 0.0022443642 0.9988778179 [50,] 7.618538e-04 0.0015237076 0.9992381462 [51,] 6.033128e-04 0.0012066256 0.9993966872 [52,] 3.993300e-04 0.0007986601 0.9996006700 [53,] 3.313649e-04 0.0006627297 0.9996686351 [54,] 3.458082e-04 0.0006916164 0.9996541918 [55,] 2.530789e-04 0.0005061579 0.9997469211 [56,] 1.183994e-03 0.0023679889 0.9988160055 [57,] 7.695008e-04 0.0015390016 0.9992304992 [58,] 6.587170e-04 0.0013174341 0.9993412830 [59,] 1.239655e-03 0.0024793101 0.9987603449 [60,] 8.259397e-04 0.0016518793 0.9991740603 [61,] 5.531756e-04 0.0011063512 0.9994468244 [62,] 3.560272e-04 0.0007120545 0.9996439728 [63,] 2.479773e-04 0.0004959547 0.9997520227 [64,] 1.778785e-04 0.0003557571 0.9998221215 [65,] 1.108316e-04 0.0002216632 0.9998891684 [66,] 9.555637e-05 0.0001911127 0.9999044436 [67,] 1.934194e-04 0.0003868387 0.9998065806 [68,] 1.334216e-04 0.0002668431 0.9998665784 [69,] 9.317158e-05 0.0001863432 0.9999068284 [70,] 8.305069e-05 0.0001661014 0.9999169493 [71,] 8.928294e-01 0.2143411221 0.1071705611 [72,] 8.680659e-01 0.2638682303 0.1319341152 [73,] 8.432995e-01 0.3134010548 0.1567005274 [74,] 8.259227e-01 0.3481545940 0.1740772970 [75,] 7.969297e-01 0.4061405816 0.2030702908 [76,] 7.608390e-01 0.4783220580 0.2391610290 [77,] 7.216377e-01 0.5567245737 0.2783622868 [78,] 6.784740e-01 0.6430520366 0.3215260183 [79,] 6.559920e-01 0.6880160569 0.3440080285 [80,] 6.330704e-01 0.7338591751 0.3669295876 [81,] 5.847996e-01 0.8304007042 0.4152003521 [82,] 5.424418e-01 0.9151164900 0.4575582450 [83,] 5.184790e-01 0.9630420731 0.4815210366 [84,] 5.844295e-01 0.8311409927 0.4155704964 [85,] 6.552897e-01 0.6894206464 0.3447103232 [86,] 6.406659e-01 0.7186681520 0.3593340760 [87,] 6.117959e-01 0.7764082071 0.3882041035 [88,] 5.706080e-01 0.8587839928 0.4293919964 [89,] 5.804746e-01 0.8390507759 0.4195253880 [90,] 9.989017e-01 0.0021966944 0.0010983472 [91,] 9.985384e-01 0.0029232140 0.0014616070 [92,] 9.989333e-01 0.0021334335 0.0010667168 [93,] 9.987764e-01 0.0024472210 0.0012236105 [94,] 9.991815e-01 0.0016369473 0.0008184737 [95,] 9.986498e-01 0.0027003712 0.0013501856 [96,] 9.980146e-01 0.0039707794 0.0019853897 [97,] 9.989317e-01 0.0021366610 0.0010683305 [98,] 9.989027e-01 0.0021946494 0.0010973247 [99,] 9.981775e-01 0.0036449494 0.0018224747 [100,] 9.972958e-01 0.0054083452 0.0027041726 [101,] 9.958298e-01 0.0083403909 0.0041701955 [102,] 9.980889e-01 0.0038221316 0.0019110658 [103,] 9.969682e-01 0.0060635688 0.0030317844 [104,] 9.955948e-01 0.0088104806 0.0044052403 [105,] 9.937999e-01 0.0124002759 0.0062001379 [106,] 9.937656e-01 0.0124687700 0.0062343850 [107,] 9.906914e-01 0.0186172225 0.0093086113 [108,] 9.861488e-01 0.0277024451 0.0138512225 [109,] 9.827397e-01 0.0345206261 0.0172603131 [110,] 9.858605e-01 0.0282789972 0.0141394986 [111,] 9.863375e-01 0.0273250776 0.0136625388 [112,] 9.892980e-01 0.0214040629 0.0107020314 [113,] 9.823392e-01 0.0353215235 0.0176607617 [114,] 9.792849e-01 0.0414302825 0.0207151413 [115,] 9.692654e-01 0.0614691612 0.0307345806 [116,] 9.663074e-01 0.0673851161 0.0336925580 [117,] 9.488822e-01 0.1022355571 0.0511177786 [118,] 9.248602e-01 0.1502796075 0.0751398037 [119,] 8.907473e-01 0.2185054907 0.1092527453 [120,] 9.124325e-01 0.1751350729 0.0875675364 [121,] 9.070292e-01 0.1859415470 0.0929707735 [122,] 9.002507e-01 0.1994986444 0.0997493222 [123,] 8.651571e-01 0.2696858149 0.1348429075 [124,] 9.376680e-01 0.1246640562 0.0623320281 [125,] 8.889479e-01 0.2221042984 0.1110521492 [126,] 8.130605e-01 0.3738789924 0.1869394962 [127,] 6.876724e-01 0.6246552133 0.3123276066 [128,] 5.321058e-01 0.9357883183 0.4678941591 > postscript(file="/var/www/html/rcomp/tmp/16cvb1292315507.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/26cvb1292315507.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/3z3uw1292315507.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/4z3uw1292315507.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/5z3uw1292315507.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 = 143 Frequency = 1 1 2 3 4 5 -2.936986354 4.467187133 -2.579480632 1.191416006 2.049925181 6 7 8 9 10 6.488831713 2.052494779 -10.427368686 1.333042862 3.228678042 11 12 13 14 15 -11.872626173 2.873611718 -0.072114061 -5.341785169 -8.199709124 16 17 18 19 20 -2.901799277 -1.977296833 -5.331312241 2.565330698 -3.659140268 21 22 23 24 25 5.169889465 0.342894584 -3.145048350 -0.770196159 2.273122655 26 27 28 29 30 -1.023167253 -15.279010651 -2.869113246 -1.194922704 1.795986934 31 32 33 34 35 -4.801886592 8.066504459 2.037025017 0.118617749 5.137237710 36 37 38 39 40 -5.758403801 -0.878197777 3.154624285 -1.020780124 -0.957693436 41 42 43 44 45 -2.992448594 -2.563436100 0.843000646 -2.181834239 0.070830516 46 47 48 49 50 1.987975954 -11.390236850 -9.105875332 0.831999302 12.473531758 51 52 53 54 55 1.496660245 2.422396074 1.131666106 -3.942421926 -8.859583647 56 57 58 59 60 3.912948713 -3.037205378 2.758888874 -0.965680613 4.438997466 61 62 63 64 65 5.816090802 -4.151575445 12.208768306 -0.169741373 4.836297413 66 67 68 69 70 -10.665837670 -1.419375678 -1.619040203 -1.082917153 2.551144880 71 72 73 74 75 3.855087682 0.551924232 5.778940474 -10.683360277 2.766683630 76 77 78 79 80 3.487096870 4.961675154 -41.522157969 -0.386723923 2.580448184 81 82 83 84 85 -2.170099481 2.659937512 1.254814864 -0.013127231 0.728771943 86 87 88 89 90 2.918350509 1.460489731 0.132797736 -0.769058699 0.818950944 91 92 93 94 95 -8.776563398 -9.866742400 4.920097014 3.447571574 3.813691511 96 97 98 99 100 8.102538941 -31.030519638 6.448709035 -3.280176557 -1.196178204 101 102 103 104 105 -5.721311572 -0.001034365 2.377787484 12.773216556 -1.703919166 106 107 108 109 110 1.238736057 -0.686220420 0.399648309 -9.875816479 3.535703562 111 112 113 114 115 -0.991476821 0.540143536 9.081491744 4.268812383 -0.356288989 116 117 118 119 120 7.489013683 -1.319497269 -4.961855515 0.996550062 -0.811280160 121 122 123 124 125 -0.101707421 2.996714538 8.370168867 0.271558120 5.934435147 126 127 128 129 130 0.400915970 13.862576098 -2.600181383 1.183757282 -0.585092343 131 132 133 134 135 -0.913106960 5.422566381 5.568497180 0.384490717 9.628241248 136 137 138 139 140 -1.977296833 -0.416033057 -0.689575201 6.956432004 11.755688117 141 142 143 -2.059822942 7.313597611 7.044535547 > postscript(file="/var/www/html/rcomp/tmp/6sdtz1292315507.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 = 143 Frequency = 1 lag(myerror, k = 1) myerror 0 -2.936986354 NA 1 4.467187133 -2.936986354 2 -2.579480632 4.467187133 3 1.191416006 -2.579480632 4 2.049925181 1.191416006 5 6.488831713 2.049925181 6 2.052494779 6.488831713 7 -10.427368686 2.052494779 8 1.333042862 -10.427368686 9 3.228678042 1.333042862 10 -11.872626173 3.228678042 11 2.873611718 -11.872626173 12 -0.072114061 2.873611718 13 -5.341785169 -0.072114061 14 -8.199709124 -5.341785169 15 -2.901799277 -8.199709124 16 -1.977296833 -2.901799277 17 -5.331312241 -1.977296833 18 2.565330698 -5.331312241 19 -3.659140268 2.565330698 20 5.169889465 -3.659140268 21 0.342894584 5.169889465 22 -3.145048350 0.342894584 23 -0.770196159 -3.145048350 24 2.273122655 -0.770196159 25 -1.023167253 2.273122655 26 -15.279010651 -1.023167253 27 -2.869113246 -15.279010651 28 -1.194922704 -2.869113246 29 1.795986934 -1.194922704 30 -4.801886592 1.795986934 31 8.066504459 -4.801886592 32 2.037025017 8.066504459 33 0.118617749 2.037025017 34 5.137237710 0.118617749 35 -5.758403801 5.137237710 36 -0.878197777 -5.758403801 37 3.154624285 -0.878197777 38 -1.020780124 3.154624285 39 -0.957693436 -1.020780124 40 -2.992448594 -0.957693436 41 -2.563436100 -2.992448594 42 0.843000646 -2.563436100 43 -2.181834239 0.843000646 44 0.070830516 -2.181834239 45 1.987975954 0.070830516 46 -11.390236850 1.987975954 47 -9.105875332 -11.390236850 48 0.831999302 -9.105875332 49 12.473531758 0.831999302 50 1.496660245 12.473531758 51 2.422396074 1.496660245 52 1.131666106 2.422396074 53 -3.942421926 1.131666106 54 -8.859583647 -3.942421926 55 3.912948713 -8.859583647 56 -3.037205378 3.912948713 57 2.758888874 -3.037205378 58 -0.965680613 2.758888874 59 4.438997466 -0.965680613 60 5.816090802 4.438997466 61 -4.151575445 5.816090802 62 12.208768306 -4.151575445 63 -0.169741373 12.208768306 64 4.836297413 -0.169741373 65 -10.665837670 4.836297413 66 -1.419375678 -10.665837670 67 -1.619040203 -1.419375678 68 -1.082917153 -1.619040203 69 2.551144880 -1.082917153 70 3.855087682 2.551144880 71 0.551924232 3.855087682 72 5.778940474 0.551924232 73 -10.683360277 5.778940474 74 2.766683630 -10.683360277 75 3.487096870 2.766683630 76 4.961675154 3.487096870 77 -41.522157969 4.961675154 78 -0.386723923 -41.522157969 79 2.580448184 -0.386723923 80 -2.170099481 2.580448184 81 2.659937512 -2.170099481 82 1.254814864 2.659937512 83 -0.013127231 1.254814864 84 0.728771943 -0.013127231 85 2.918350509 0.728771943 86 1.460489731 2.918350509 87 0.132797736 1.460489731 88 -0.769058699 0.132797736 89 0.818950944 -0.769058699 90 -8.776563398 0.818950944 91 -9.866742400 -8.776563398 92 4.920097014 -9.866742400 93 3.447571574 4.920097014 94 3.813691511 3.447571574 95 8.102538941 3.813691511 96 -31.030519638 8.102538941 97 6.448709035 -31.030519638 98 -3.280176557 6.448709035 99 -1.196178204 -3.280176557 100 -5.721311572 -1.196178204 101 -0.001034365 -5.721311572 102 2.377787484 -0.001034365 103 12.773216556 2.377787484 104 -1.703919166 12.773216556 105 1.238736057 -1.703919166 106 -0.686220420 1.238736057 107 0.399648309 -0.686220420 108 -9.875816479 0.399648309 109 3.535703562 -9.875816479 110 -0.991476821 3.535703562 111 0.540143536 -0.991476821 112 9.081491744 0.540143536 113 4.268812383 9.081491744 114 -0.356288989 4.268812383 115 7.489013683 -0.356288989 116 -1.319497269 7.489013683 117 -4.961855515 -1.319497269 118 0.996550062 -4.961855515 119 -0.811280160 0.996550062 120 -0.101707421 -0.811280160 121 2.996714538 -0.101707421 122 8.370168867 2.996714538 123 0.271558120 8.370168867 124 5.934435147 0.271558120 125 0.400915970 5.934435147 126 13.862576098 0.400915970 127 -2.600181383 13.862576098 128 1.183757282 -2.600181383 129 -0.585092343 1.183757282 130 -0.913106960 -0.585092343 131 5.422566381 -0.913106960 132 5.568497180 5.422566381 133 0.384490717 5.568497180 134 9.628241248 0.384490717 135 -1.977296833 9.628241248 136 -0.416033057 -1.977296833 137 -0.689575201 -0.416033057 138 6.956432004 -0.689575201 139 11.755688117 6.956432004 140 -2.059822942 11.755688117 141 7.313597611 -2.059822942 142 7.044535547 7.313597611 143 NA 7.044535547 > dum1 <- dum[2:length(myerror),] > dum1 lag(myerror, k = 1) myerror [1,] 4.467187133 -2.936986354 [2,] -2.579480632 4.467187133 [3,] 1.191416006 -2.579480632 [4,] 2.049925181 1.191416006 [5,] 6.488831713 2.049925181 [6,] 2.052494779 6.488831713 [7,] -10.427368686 2.052494779 [8,] 1.333042862 -10.427368686 [9,] 3.228678042 1.333042862 [10,] -11.872626173 3.228678042 [11,] 2.873611718 -11.872626173 [12,] -0.072114061 2.873611718 [13,] -5.341785169 -0.072114061 [14,] -8.199709124 -5.341785169 [15,] -2.901799277 -8.199709124 [16,] -1.977296833 -2.901799277 [17,] -5.331312241 -1.977296833 [18,] 2.565330698 -5.331312241 [19,] -3.659140268 2.565330698 [20,] 5.169889465 -3.659140268 [21,] 0.342894584 5.169889465 [22,] -3.145048350 0.342894584 [23,] -0.770196159 -3.145048350 [24,] 2.273122655 -0.770196159 [25,] -1.023167253 2.273122655 [26,] -15.279010651 -1.023167253 [27,] -2.869113246 -15.279010651 [28,] -1.194922704 -2.869113246 [29,] 1.795986934 -1.194922704 [30,] -4.801886592 1.795986934 [31,] 8.066504459 -4.801886592 [32,] 2.037025017 8.066504459 [33,] 0.118617749 2.037025017 [34,] 5.137237710 0.118617749 [35,] -5.758403801 5.137237710 [36,] -0.878197777 -5.758403801 [37,] 3.154624285 -0.878197777 [38,] -1.020780124 3.154624285 [39,] -0.957693436 -1.020780124 [40,] -2.992448594 -0.957693436 [41,] -2.563436100 -2.992448594 [42,] 0.843000646 -2.563436100 [43,] -2.181834239 0.843000646 [44,] 0.070830516 -2.181834239 [45,] 1.987975954 0.070830516 [46,] -11.390236850 1.987975954 [47,] -9.105875332 -11.390236850 [48,] 0.831999302 -9.105875332 [49,] 12.473531758 0.831999302 [50,] 1.496660245 12.473531758 [51,] 2.422396074 1.496660245 [52,] 1.131666106 2.422396074 [53,] -3.942421926 1.131666106 [54,] -8.859583647 -3.942421926 [55,] 3.912948713 -8.859583647 [56,] -3.037205378 3.912948713 [57,] 2.758888874 -3.037205378 [58,] -0.965680613 2.758888874 [59,] 4.438997466 -0.965680613 [60,] 5.816090802 4.438997466 [61,] -4.151575445 5.816090802 [62,] 12.208768306 -4.151575445 [63,] -0.169741373 12.208768306 [64,] 4.836297413 -0.169741373 [65,] -10.665837670 4.836297413 [66,] -1.419375678 -10.665837670 [67,] -1.619040203 -1.419375678 [68,] -1.082917153 -1.619040203 [69,] 2.551144880 -1.082917153 [70,] 3.855087682 2.551144880 [71,] 0.551924232 3.855087682 [72,] 5.778940474 0.551924232 [73,] -10.683360277 5.778940474 [74,] 2.766683630 -10.683360277 [75,] 3.487096870 2.766683630 [76,] 4.961675154 3.487096870 [77,] -41.522157969 4.961675154 [78,] -0.386723923 -41.522157969 [79,] 2.580448184 -0.386723923 [80,] -2.170099481 2.580448184 [81,] 2.659937512 -2.170099481 [82,] 1.254814864 2.659937512 [83,] -0.013127231 1.254814864 [84,] 0.728771943 -0.013127231 [85,] 2.918350509 0.728771943 [86,] 1.460489731 2.918350509 [87,] 0.132797736 1.460489731 [88,] -0.769058699 0.132797736 [89,] 0.818950944 -0.769058699 [90,] -8.776563398 0.818950944 [91,] -9.866742400 -8.776563398 [92,] 4.920097014 -9.866742400 [93,] 3.447571574 4.920097014 [94,] 3.813691511 3.447571574 [95,] 8.102538941 3.813691511 [96,] -31.030519638 8.102538941 [97,] 6.448709035 -31.030519638 [98,] -3.280176557 6.448709035 [99,] -1.196178204 -3.280176557 [100,] -5.721311572 -1.196178204 [101,] -0.001034365 -5.721311572 [102,] 2.377787484 -0.001034365 [103,] 12.773216556 2.377787484 [104,] -1.703919166 12.773216556 [105,] 1.238736057 -1.703919166 [106,] -0.686220420 1.238736057 [107,] 0.399648309 -0.686220420 [108,] -9.875816479 0.399648309 [109,] 3.535703562 -9.875816479 [110,] -0.991476821 3.535703562 [111,] 0.540143536 -0.991476821 [112,] 9.081491744 0.540143536 [113,] 4.268812383 9.081491744 [114,] -0.356288989 4.268812383 [115,] 7.489013683 -0.356288989 [116,] -1.319497269 7.489013683 [117,] -4.961855515 -1.319497269 [118,] 0.996550062 -4.961855515 [119,] -0.811280160 0.996550062 [120,] -0.101707421 -0.811280160 [121,] 2.996714538 -0.101707421 [122,] 8.370168867 2.996714538 [123,] 0.271558120 8.370168867 [124,] 5.934435147 0.271558120 [125,] 0.400915970 5.934435147 [126,] 13.862576098 0.400915970 [127,] -2.600181383 13.862576098 [128,] 1.183757282 -2.600181383 [129,] -0.585092343 1.183757282 [130,] -0.913106960 -0.585092343 [131,] 5.422566381 -0.913106960 [132,] 5.568497180 5.422566381 [133,] 0.384490717 5.568497180 [134,] 9.628241248 0.384490717 [135,] -1.977296833 9.628241248 [136,] -0.416033057 -1.977296833 [137,] -0.689575201 -0.416033057 [138,] 6.956432004 -0.689575201 [139,] 11.755688117 6.956432004 [140,] -2.059822942 11.755688117 [141,] 7.313597611 -2.059822942 [142,] 7.044535547 7.313597611 > z <- as.data.frame(dum1) > z lag(myerror, k = 1) myerror 1 4.467187133 -2.936986354 2 -2.579480632 4.467187133 3 1.191416006 -2.579480632 4 2.049925181 1.191416006 5 6.488831713 2.049925181 6 2.052494779 6.488831713 7 -10.427368686 2.052494779 8 1.333042862 -10.427368686 9 3.228678042 1.333042862 10 -11.872626173 3.228678042 11 2.873611718 -11.872626173 12 -0.072114061 2.873611718 13 -5.341785169 -0.072114061 14 -8.199709124 -5.341785169 15 -2.901799277 -8.199709124 16 -1.977296833 -2.901799277 17 -5.331312241 -1.977296833 18 2.565330698 -5.331312241 19 -3.659140268 2.565330698 20 5.169889465 -3.659140268 21 0.342894584 5.169889465 22 -3.145048350 0.342894584 23 -0.770196159 -3.145048350 24 2.273122655 -0.770196159 25 -1.023167253 2.273122655 26 -15.279010651 -1.023167253 27 -2.869113246 -15.279010651 28 -1.194922704 -2.869113246 29 1.795986934 -1.194922704 30 -4.801886592 1.795986934 31 8.066504459 -4.801886592 32 2.037025017 8.066504459 33 0.118617749 2.037025017 34 5.137237710 0.118617749 35 -5.758403801 5.137237710 36 -0.878197777 -5.758403801 37 3.154624285 -0.878197777 38 -1.020780124 3.154624285 39 -0.957693436 -1.020780124 40 -2.992448594 -0.957693436 41 -2.563436100 -2.992448594 42 0.843000646 -2.563436100 43 -2.181834239 0.843000646 44 0.070830516 -2.181834239 45 1.987975954 0.070830516 46 -11.390236850 1.987975954 47 -9.105875332 -11.390236850 48 0.831999302 -9.105875332 49 12.473531758 0.831999302 50 1.496660245 12.473531758 51 2.422396074 1.496660245 52 1.131666106 2.422396074 53 -3.942421926 1.131666106 54 -8.859583647 -3.942421926 55 3.912948713 -8.859583647 56 -3.037205378 3.912948713 57 2.758888874 -3.037205378 58 -0.965680613 2.758888874 59 4.438997466 -0.965680613 60 5.816090802 4.438997466 61 -4.151575445 5.816090802 62 12.208768306 -4.151575445 63 -0.169741373 12.208768306 64 4.836297413 -0.169741373 65 -10.665837670 4.836297413 66 -1.419375678 -10.665837670 67 -1.619040203 -1.419375678 68 -1.082917153 -1.619040203 69 2.551144880 -1.082917153 70 3.855087682 2.551144880 71 0.551924232 3.855087682 72 5.778940474 0.551924232 73 -10.683360277 5.778940474 74 2.766683630 -10.683360277 75 3.487096870 2.766683630 76 4.961675154 3.487096870 77 -41.522157969 4.961675154 78 -0.386723923 -41.522157969 79 2.580448184 -0.386723923 80 -2.170099481 2.580448184 81 2.659937512 -2.170099481 82 1.254814864 2.659937512 83 -0.013127231 1.254814864 84 0.728771943 -0.013127231 85 2.918350509 0.728771943 86 1.460489731 2.918350509 87 0.132797736 1.460489731 88 -0.769058699 0.132797736 89 0.818950944 -0.769058699 90 -8.776563398 0.818950944 91 -9.866742400 -8.776563398 92 4.920097014 -9.866742400 93 3.447571574 4.920097014 94 3.813691511 3.447571574 95 8.102538941 3.813691511 96 -31.030519638 8.102538941 97 6.448709035 -31.030519638 98 -3.280176557 6.448709035 99 -1.196178204 -3.280176557 100 -5.721311572 -1.196178204 101 -0.001034365 -5.721311572 102 2.377787484 -0.001034365 103 12.773216556 2.377787484 104 -1.703919166 12.773216556 105 1.238736057 -1.703919166 106 -0.686220420 1.238736057 107 0.399648309 -0.686220420 108 -9.875816479 0.399648309 109 3.535703562 -9.875816479 110 -0.991476821 3.535703562 111 0.540143536 -0.991476821 112 9.081491744 0.540143536 113 4.268812383 9.081491744 114 -0.356288989 4.268812383 115 7.489013683 -0.356288989 116 -1.319497269 7.489013683 117 -4.961855515 -1.319497269 118 0.996550062 -4.961855515 119 -0.811280160 0.996550062 120 -0.101707421 -0.811280160 121 2.996714538 -0.101707421 122 8.370168867 2.996714538 123 0.271558120 8.370168867 124 5.934435147 0.271558120 125 0.400915970 5.934435147 126 13.862576098 0.400915970 127 -2.600181383 13.862576098 128 1.183757282 -2.600181383 129 -0.585092343 1.183757282 130 -0.913106960 -0.585092343 131 5.422566381 -0.913106960 132 5.568497180 5.422566381 133 0.384490717 5.568497180 134 9.628241248 0.384490717 135 -1.977296833 9.628241248 136 -0.416033057 -1.977296833 137 -0.689575201 -0.416033057 138 6.956432004 -0.689575201 139 11.755688117 6.956432004 140 -2.059822942 11.755688117 141 7.313597611 -2.059822942 142 7.044535547 7.313597611 > 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/73mak1292315507.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/83mak1292315507.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/93mak1292315507.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') > par(opar) > dev.off() null device 1 > if (n > n25) { + postscript(file="/var/www/html/rcomp/tmp/10vvs51292315507.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='') + } + } > 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/11ze8b1292315507.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/12kwph1292315507.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/138g721292315508.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/14cg5q1292315508.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/15485b1292315508.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/16ih221292315508.tab") + } > > try(system("convert tmp/16cvb1292315507.ps tmp/16cvb1292315507.png",intern=TRUE)) character(0) > try(system("convert tmp/26cvb1292315507.ps tmp/26cvb1292315507.png",intern=TRUE)) character(0) > try(system("convert tmp/3z3uw1292315507.ps tmp/3z3uw1292315507.png",intern=TRUE)) character(0) > try(system("convert tmp/4z3uw1292315507.ps tmp/4z3uw1292315507.png",intern=TRUE)) character(0) > try(system("convert tmp/5z3uw1292315507.ps tmp/5z3uw1292315507.png",intern=TRUE)) character(0) > try(system("convert tmp/6sdtz1292315507.ps tmp/6sdtz1292315507.png",intern=TRUE)) character(0) > try(system("convert tmp/73mak1292315507.ps tmp/73mak1292315507.png",intern=TRUE)) character(0) > try(system("convert tmp/83mak1292315507.ps tmp/83mak1292315507.png",intern=TRUE)) character(0) > try(system("convert tmp/93mak1292315507.ps tmp/93mak1292315507.png",intern=TRUE)) character(0) > try(system("convert tmp/10vvs51292315507.ps tmp/10vvs51292315507.png",intern=TRUE)) character(0) > > > proc.time() user system elapsed 3.767 1.771 8.186