R version 2.15.2 (2012-10-26) -- "Trick or Treat"
Copyright (C) 2012 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: i686-pc-linux-gnu (32-bit)
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(4
+ ,1
+ ,1
+ ,0
+ ,0
+ ,1
+ ,0
+ ,4
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,4
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,4
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,4
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,4
+ ,1
+ ,0
+ ,0
+ ,1
+ ,1
+ ,0
+ ,4
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,4
+ ,0
+ ,1
+ ,0
+ ,0
+ ,0
+ ,0
+ ,4
+ ,0
+ ,0
+ ,0
+ ,0
+ ,1
+ ,0
+ ,4
+ ,1
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,4
+ ,1
+ ,1
+ ,0
+ ,0
+ ,0
+ ,0
+ ,4
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,4
+ ,0
+ ,0
+ ,1
+ ,1
+ ,0
+ ,0
+ ,4
+ ,1
+ ,1
+ ,0
+ ,0
+ ,0
+ ,0
+ ,4
+ ,0
+ ,0
+ ,1
+ ,1
+ ,1
+ ,0
+ ,4
+ ,0
+ ,1
+ ,1
+ ,1
+ ,1
+ ,0
+ ,4
+ ,1
+ ,1
+ ,1
+ ,1
+ ,0
+ ,1
+ ,4
+ ,1
+ ,1
+ ,0
+ ,0
+ ,0
+ ,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+ ,0
+ ,2
+ ,0
+ ,0
+ ,1
+ ,0
+ ,1
+ ,1
+ ,2
+ ,0
+ ,1
+ ,1
+ ,0
+ ,1
+ ,0
+ ,2
+ ,1
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,2
+ ,0
+ ,0
+ ,0
+ ,1
+ ,1
+ ,0
+ ,2
+ ,0
+ ,0
+ ,0
+ ,1
+ ,0
+ ,0
+ ,2
+ ,0
+ ,1
+ ,0
+ ,0
+ ,1
+ ,0
+ ,2
+ ,0
+ ,1
+ ,1
+ ,0
+ ,0
+ ,0
+ ,2
+ ,0
+ ,1
+ ,0
+ ,0
+ ,0
+ ,0
+ ,2
+ ,1
+ ,0
+ ,0
+ ,0
+ ,0
+ ,0
+ ,2
+ ,0
+ ,0
+ ,0
+ ,1
+ ,1
+ ,0
+ ,2
+ ,0
+ ,0
+ ,0
+ ,0
+ ,1
+ ,0
+ ,2
+ ,1
+ ,0
+ ,1
+ ,0
+ ,0
+ ,1
+ ,2
+ ,1
+ ,0
+ ,1
+ ,1
+ ,0
+ ,1
+ ,2
+ ,1
+ ,0
+ ,1
+ ,0
+ ,0
+ ,0)
+ ,dim=c(7
+ ,154)
+ ,dimnames=list(c('Weeks'
+ ,'UseLimit'
+ ,'T40enT20'
+ ,'Used'
+ ,'CorrectAnalysis'
+ ,'Useful'
+ ,'Outcome')
+ ,1:154))
> y <- array(NA,dim=c(7,154),dimnames=list(c('Weeks','UseLimit','T40enT20','Used','CorrectAnalysis','Useful','Outcome'),1:154))
> 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 = '6'
> par3 <- 'No Linear Trend'
> par2 <- 'Do not include Seasonal Dummies'
> par1 <- '6'
> #'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, 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
Useful Weeks UseLimit T40enT20 Used CorrectAnalysis Outcome
1 1 4 1 1 0 0 0
2 0 4 0 0 0 0 0
3 0 4 0 0 0 0 0
4 0 4 0 0 0 0 0
5 0 4 0 0 0 0 0
6 1 4 1 0 0 1 0
7 0 4 0 0 0 0 0
8 0 4 0 1 0 0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 0
137 1 2 1 0 1 1 0
138 1 2 1 1 1 1 0
139 0 2 0 1 0 0 0
140 0 2 0 0 0 0 0
141 1 2 0 0 1 0 1
142 1 2 0 1 1 0 0
143 0 2 1 0 0 0 0
144 1 2 0 0 0 1 0
145 0 2 0 0 0 1 0
146 1 2 0 1 0 0 0
147 0 2 0 1 1 0 0
148 0 2 0 1 0 0 0
149 0 2 1 0 0 0 0
150 1 2 0 0 0 1 0
151 1 2 0 0 0 0 0
152 0 2 1 0 1 0 1
153 0 2 1 0 1 1 1
154 0 2 1 0 1 0 0
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Weeks UseLimit T40enT20
0.18371 0.05955 -0.07624 -0.03930
Used CorrectAnalysis Outcome
0.09806 0.15766 -0.11409
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-0.6776 -0.4179 -0.2744 0.5193 0.7734
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.18371 0.13676 1.343 0.181
Weeks 0.05955 0.04076 1.461 0.146
UseLimit -0.07624 0.08606 -0.886 0.377
T40enT20 -0.03930 0.09426 -0.417 0.677
Used 0.09806 0.10102 0.971 0.333
CorrectAnalysis 0.15766 0.09411 1.675 0.096 .
Outcome -0.11409 0.16522 -0.690 0.491
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 0.4858 on 147 degrees of freedom
Multiple R-squared: 0.05824, Adjusted R-squared: 0.0198
F-statistic: 1.515 on 6 and 147 DF, p-value: 0.177
> 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.8463342 0.3073315 0.1536658
[2,] 0.8166965 0.3666070 0.1833035
[3,] 0.7213202 0.5573596 0.2786798
[4,] 0.6165084 0.7669831 0.3834916
[5,] 0.5478265 0.9043470 0.4521735
[6,] 0.6406809 0.7186381 0.3593191
[7,] 0.5759023 0.8481954 0.4240977
[8,] 0.4835595 0.9671191 0.5164405
[9,] 0.4197121 0.8394242 0.5802879
[10,] 0.5807713 0.8384575 0.4192287
[11,] 0.5976415 0.8047169 0.4023585
[12,] 0.6633101 0.6733799 0.3366899
[13,] 0.6589660 0.6820679 0.3410340
[14,] 0.6130291 0.7739419 0.3869709
[15,] 0.5780586 0.8438827 0.4219414
[16,] 0.6044528 0.7910944 0.3955472
[17,] 0.6858721 0.6282557 0.3141279
[18,] 0.7619782 0.4760436 0.2380218
[19,] 0.7339594 0.5320811 0.2660406
[20,] 0.7723618 0.4552764 0.2276382
[21,] 0.7920177 0.4159647 0.2079823
[22,] 0.7639916 0.4720167 0.2360084
[23,] 0.7312842 0.5374317 0.2687158
[24,] 0.7316728 0.5366544 0.2683272
[25,] 0.7434107 0.5131786 0.2565893
[26,] 0.7149358 0.5701284 0.2850642
[27,] 0.6847397 0.6305206 0.3152603
[28,] 0.7173483 0.5653035 0.2826517
[29,] 0.7337730 0.5324540 0.2662270
[30,] 0.7249313 0.5501375 0.2750687
[31,] 0.7380471 0.5239058 0.2619529
[32,] 0.7199658 0.5600685 0.2800342
[33,] 0.7125591 0.5748817 0.2874409
[34,] 0.7202194 0.5595612 0.2797806
[35,] 0.6888550 0.6222901 0.3111450
[36,] 0.6941583 0.6116834 0.3058417
[37,] 0.6895481 0.6209037 0.3104519
[38,] 0.6717776 0.6564448 0.3282224
[39,] 0.6928170 0.6143660 0.3071830
[40,] 0.6817786 0.6364429 0.3182214
[41,] 0.6663348 0.6673303 0.3336652
[42,] 0.6593521 0.6812958 0.3406479
[43,] 0.6581883 0.6836233 0.3418117
[44,] 0.6740090 0.6519821 0.3259910
[45,] 0.6581063 0.6837874 0.3418937
[46,] 0.6449068 0.7101865 0.3550932
[47,] 0.6505072 0.6989857 0.3494928
[48,] 0.6188981 0.7622039 0.3811019
[49,] 0.6359285 0.7281429 0.3640715
[50,] 0.6508025 0.6983951 0.3491975
[51,] 0.6627191 0.6745618 0.3372809
[52,] 0.7048071 0.5903858 0.2951929
[53,] 0.7386641 0.5226718 0.2613359
[54,] 0.7270808 0.5458383 0.2729192
[55,] 0.7630947 0.4738106 0.2369053
[56,] 0.7512643 0.4974714 0.2487357
[57,] 0.7401402 0.5197196 0.2598598
[58,] 0.7439892 0.5120217 0.2560108
[59,] 0.7255847 0.5488306 0.2744153
[60,] 0.7374056 0.5251887 0.2625944
[61,] 0.7466715 0.5066569 0.2533285
[62,] 0.7415387 0.5169226 0.2584613
[63,] 0.7495957 0.5008085 0.2504043
[64,] 0.7420670 0.5158660 0.2579330
[65,] 0.7412580 0.5174840 0.2587420
[66,] 0.7481216 0.5037568 0.2518784
[67,] 0.7395958 0.5208084 0.2604042
[68,] 0.7539038 0.4921923 0.2460962
[69,] 0.7315704 0.5368592 0.2684296
[70,] 0.7758366 0.4483269 0.2241634
[71,] 0.7717196 0.4565607 0.2282804
[72,] 0.7567426 0.4865148 0.2432574
[73,] 0.7736347 0.4527306 0.2263653
[74,] 0.7542891 0.4914218 0.2457109
[75,] 0.7366070 0.5267860 0.2633930
[76,] 0.7361282 0.5277437 0.2638718
[77,] 0.7028354 0.5943291 0.2971646
[78,] 0.7251065 0.5497871 0.2748935
[79,] 0.7547172 0.4905656 0.2452828
[80,] 0.7667902 0.4664195 0.2332098
[81,] 0.7803842 0.4392316 0.2196158
[82,] 0.8038346 0.3923307 0.1961654
[83,] 0.7816507 0.4366987 0.2183493
[84,] 0.7776508 0.4446984 0.2223492
[85,] 0.7581825 0.4836351 0.2418175
[86,] 0.7289280 0.5421440 0.2710720
[87,] 0.7645929 0.4708142 0.2354071
[88,] 0.7305788 0.5388424 0.2694212
[89,] 0.7061705 0.5876589 0.2938295
[90,] 0.6701805 0.6596391 0.3298195
[91,] 0.7127006 0.5745988 0.2872994
[92,] 0.7801010 0.4397981 0.2198990
[93,] 0.7577913 0.4844173 0.2422087
[94,] 0.7339632 0.5320737 0.2660368
[95,] 0.7090084 0.5819832 0.2909916
[96,] 0.6863456 0.6273089 0.3136544
[97,] 0.6593511 0.6812978 0.3406489
[98,] 0.6324410 0.7351180 0.3675590
[99,] 0.5907660 0.8184680 0.4092340
[100,] 0.5628714 0.8742571 0.4371286
[101,] 0.5156256 0.9687488 0.4843744
[102,] 0.5026594 0.9946812 0.4973406
[103,] 0.4639399 0.9278797 0.5360601
[104,] 0.4573753 0.9147505 0.5426247
[105,] 0.4156022 0.8312043 0.5843978
[106,] 0.3672312 0.7344624 0.6327688
[107,] 0.3413733 0.6827466 0.6586267
[108,] 0.4500025 0.9000050 0.5499975
[109,] 0.3958068 0.7916136 0.6041932
[110,] 0.3711202 0.7422403 0.6288798
[111,] 0.4082202 0.8164404 0.5917798
[112,] 0.3535625 0.7071250 0.6464375
[113,] 0.3275567 0.6551135 0.6724433
[114,] 0.2872473 0.5744947 0.7127527
[115,] 0.2500932 0.5001864 0.7499068
[116,] 0.2824432 0.5648865 0.7175568
[117,] 0.2519318 0.5038635 0.7480682
[118,] 0.2780279 0.5560559 0.7219721
[119,] 0.3190290 0.6380580 0.6809710
[120,] 0.2831460 0.5662919 0.7168540
[121,] 0.3343460 0.6686921 0.6656540
[122,] 0.2741008 0.5482017 0.7258992
[123,] 0.4671962 0.9343924 0.5328038
[124,] 0.4041403 0.8082806 0.5958597
[125,] 0.3482949 0.6965898 0.6517051
[126,] 0.2995366 0.5990732 0.7004634
[127,] 0.2613292 0.5226584 0.7386708
[128,] 0.2352990 0.4705980 0.7647010
[129,] 0.3365706 0.6731413 0.6634294
[130,] 0.2993721 0.5987442 0.7006279
[131,] 0.4088932 0.8177864 0.5911068
[132,] 0.3104978 0.6209957 0.6895022
[133,] 0.3747591 0.7495181 0.6252409
[134,] 0.2569762 0.5139524 0.7430238
[135,] 0.1909270 0.3818541 0.8090730
> postscript(file="/var/wessaorg/rcomp/tmp/140jg1356101751.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/wessaorg/rcomp/tmp/2x7781356101751.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/wessaorg/rcomp/tmp/3ajk11356101751.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/wessaorg/rcomp/tmp/4hi1f1356101751.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/wessaorg/rcomp/tmp/5xa101356101751.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 = 154
Frequency = 1
1 2 3 4 5 6 7
0.6936215 -0.4219182 -0.4219182 -0.4219182 -0.4219182 0.4966602 -0.4219182
8 9 10 11 12 13 14
-0.3826196 0.5780818 -0.3456771 -0.3063785 -0.4219182 -0.6776372 -0.3063785
15 16 17 18 19 20 21
0.3223628 0.3616614 -0.4480122 -0.3063785 0.5780818 0.4757466 -0.5033398
22 23 24 25 26 27 28
0.3986040 0.4204191 0.4966602 0.5193241 -0.6776372 0.6543229 -0.5199745
29 30 31 32 33 34 35
0.5780818 -0.5795809 -0.4219182 -0.3456771 -0.5033398 0.6173804 -0.4219182
36 37 38 39 40 41 42
-0.4219182 -0.5620975 0.4800255 0.4204191 -0.5402823 0.4364481 0.4800255
43 44 45 46 47 48 49
0.4966602 -0.3063785 -0.5795809 0.4204191 -0.4219182 0.5780818 0.4204191
50 51 52 53 54 55 56
-0.4219182 -0.4806759 -0.4480122 0.5780818 -0.4058892 -0.4219182 0.5193241
57 58 59 60 61 62 63
0.3223628 0.5780818 0.5780818 0.5519878 0.6936215 -0.6776372 -0.4219182
64 65 66 67 68 69 70
0.6936215 -0.4219182 -0.4219182 -0.5242534 -0.3456771 0.5780818 -0.5199745
71 72 73 74 75 76 77
-0.4219182 0.5780818 0.4800255 -0.4437333 0.5780818 0.4597177 0.5780818
78 79 80 81 82 83 84
0.3223628 0.6334093 -0.5402823 -0.4219182 0.5562667 -0.4219182 -0.4058892
85 86 87 88 89 90 91
0.4204191 -0.3456771 0.7734271 0.7146694 -0.3028140 0.6971860 -0.4604767
92 93 94 95 96 97 98
-0.1872744 -0.3842356 -0.3028140 -0.2635155 0.6971860 -0.1872744 -0.3028140
99 100 101 102 103 104 105
-0.2265729 0.6971860 0.7734271 -0.3028140 -0.3028140 -0.3028140 -0.3615718
106 107 108 109 110 111 112
-0.3028140 -0.3028140 -0.2853306 -0.3028140 -0.2265729 -0.4429933 -0.2635155
113 114 115 116 117 118 119
-0.4008703 -0.2853306 -0.2265729 -0.3028140 0.7734271 -0.2265729 -0.3028140
120 121 122 123 124 125 126
0.6971860 -0.2265729 -0.3028140 -0.2853306 0.4414670 0.6971860 -0.2635155
127 128 129 130 131 132 133
-0.4604767 0.6971860 -0.3028140 0.6971860 -0.2265729 0.7734271 -0.3246292
134 135 136 137 138 139 140
-0.3028140 -0.3028140 -0.3028140 0.5177081 0.5570067 -0.2635155 -0.3028140
141 142 143 144 145 146 147
0.7132150 0.6384282 -0.2265729 0.5395233 -0.4604767 0.7364845 -0.3615718
148 149 150 151 152 153 154
-0.2635155 -0.2265729 0.5395233 0.6971860 -0.2105439 -0.3682066 -0.3246292
> postscript(file="/var/wessaorg/rcomp/tmp/699tl1356101751.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 = 154
Frequency = 1
lag(myerror, k = 1) myerror
0 0.6936215 NA
1 -0.4219182 0.6936215
2 -0.4219182 -0.4219182
3 -0.4219182 -0.4219182
4 -0.4219182 -0.4219182
5 0.4966602 -0.4219182
6 -0.4219182 0.4966602
7 -0.3826196 -0.4219182
8 0.5780818 -0.3826196
9 -0.3456771 0.5780818
10 -0.3063785 -0.3456771
11 -0.4219182 -0.3063785
12 -0.6776372 -0.4219182
13 -0.3063785 -0.6776372
14 0.3223628 -0.3063785
15 0.3616614 0.3223628
16 -0.4480122 0.3616614
17 -0.3063785 -0.4480122
18 0.5780818 -0.3063785
19 0.4757466 0.5780818
20 -0.5033398 0.4757466
21 0.3986040 -0.5033398
22 0.4204191 0.3986040
23 0.4966602 0.4204191
24 0.5193241 0.4966602
25 -0.6776372 0.5193241
26 0.6543229 -0.6776372
27 -0.5199745 0.6543229
28 0.5780818 -0.5199745
29 -0.5795809 0.5780818
30 -0.4219182 -0.5795809
31 -0.3456771 -0.4219182
32 -0.5033398 -0.3456771
33 0.6173804 -0.5033398
34 -0.4219182 0.6173804
35 -0.4219182 -0.4219182
36 -0.5620975 -0.4219182
37 0.4800255 -0.5620975
38 0.4204191 0.4800255
39 -0.5402823 0.4204191
40 0.4364481 -0.5402823
41 0.4800255 0.4364481
42 0.4966602 0.4800255
43 -0.3063785 0.4966602
44 -0.5795809 -0.3063785
45 0.4204191 -0.5795809
46 -0.4219182 0.4204191
47 0.5780818 -0.4219182
48 0.4204191 0.5780818
49 -0.4219182 0.4204191
50 -0.4806759 -0.4219182
51 -0.4480122 -0.4806759
52 0.5780818 -0.4480122
53 -0.4058892 0.5780818
54 -0.4219182 -0.4058892
55 0.5193241 -0.4219182
56 0.3223628 0.5193241
57 0.5780818 0.3223628
58 0.5780818 0.5780818
59 0.5519878 0.5780818
60 0.6936215 0.5519878
61 -0.6776372 0.6936215
62 -0.4219182 -0.6776372
63 0.6936215 -0.4219182
64 -0.4219182 0.6936215
65 -0.4219182 -0.4219182
66 -0.5242534 -0.4219182
67 -0.3456771 -0.5242534
68 0.5780818 -0.3456771
69 -0.5199745 0.5780818
70 -0.4219182 -0.5199745
71 0.5780818 -0.4219182
72 0.4800255 0.5780818
73 -0.4437333 0.4800255
74 0.5780818 -0.4437333
75 0.4597177 0.5780818
76 0.5780818 0.4597177
77 0.3223628 0.5780818
78 0.6334093 0.3223628
79 -0.5402823 0.6334093
80 -0.4219182 -0.5402823
81 0.5562667 -0.4219182
82 -0.4219182 0.5562667
83 -0.4058892 -0.4219182
84 0.4204191 -0.4058892
85 -0.3456771 0.4204191
86 0.7734271 -0.3456771
87 0.7146694 0.7734271
88 -0.3028140 0.7146694
89 0.6971860 -0.3028140
90 -0.4604767 0.6971860
91 -0.1872744 -0.4604767
92 -0.3842356 -0.1872744
93 -0.3028140 -0.3842356
94 -0.2635155 -0.3028140
95 0.6971860 -0.2635155
96 -0.1872744 0.6971860
97 -0.3028140 -0.1872744
98 -0.2265729 -0.3028140
99 0.6971860 -0.2265729
100 0.7734271 0.6971860
101 -0.3028140 0.7734271
102 -0.3028140 -0.3028140
103 -0.3028140 -0.3028140
104 -0.3615718 -0.3028140
105 -0.3028140 -0.3615718
106 -0.3028140 -0.3028140
107 -0.2853306 -0.3028140
108 -0.3028140 -0.2853306
109 -0.2265729 -0.3028140
110 -0.4429933 -0.2265729
111 -0.2635155 -0.4429933
112 -0.4008703 -0.2635155
113 -0.2853306 -0.4008703
114 -0.2265729 -0.2853306
115 -0.3028140 -0.2265729
116 0.7734271 -0.3028140
117 -0.2265729 0.7734271
118 -0.3028140 -0.2265729
119 0.6971860 -0.3028140
120 -0.2265729 0.6971860
121 -0.3028140 -0.2265729
122 -0.2853306 -0.3028140
123 0.4414670 -0.2853306
124 0.6971860 0.4414670
125 -0.2635155 0.6971860
126 -0.4604767 -0.2635155
127 0.6971860 -0.4604767
128 -0.3028140 0.6971860
129 0.6971860 -0.3028140
130 -0.2265729 0.6971860
131 0.7734271 -0.2265729
132 -0.3246292 0.7734271
133 -0.3028140 -0.3246292
134 -0.3028140 -0.3028140
135 -0.3028140 -0.3028140
136 0.5177081 -0.3028140
137 0.5570067 0.5177081
138 -0.2635155 0.5570067
139 -0.3028140 -0.2635155
140 0.7132150 -0.3028140
141 0.6384282 0.7132150
142 -0.2265729 0.6384282
143 0.5395233 -0.2265729
144 -0.4604767 0.5395233
145 0.7364845 -0.4604767
146 -0.3615718 0.7364845
147 -0.2635155 -0.3615718
148 -0.2265729 -0.2635155
149 0.5395233 -0.2265729
150 0.6971860 0.5395233
151 -0.2105439 0.6971860
152 -0.3682066 -0.2105439
153 -0.3246292 -0.3682066
154 NA -0.3246292
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -0.4219182 0.6936215
[2,] -0.4219182 -0.4219182
[3,] -0.4219182 -0.4219182
[4,] -0.4219182 -0.4219182
[5,] 0.4966602 -0.4219182
[6,] -0.4219182 0.4966602
[7,] -0.3826196 -0.4219182
[8,] 0.5780818 -0.3826196
[9,] -0.3456771 0.5780818
[10,] -0.3063785 -0.3456771
[11,] -0.4219182 -0.3063785
[12,] -0.6776372 -0.4219182
[13,] -0.3063785 -0.6776372
[14,] 0.3223628 -0.3063785
[15,] 0.3616614 0.3223628
[16,] -0.4480122 0.3616614
[17,] -0.3063785 -0.4480122
[18,] 0.5780818 -0.3063785
[19,] 0.4757466 0.5780818
[20,] -0.5033398 0.4757466
[21,] 0.3986040 -0.5033398
[22,] 0.4204191 0.3986040
[23,] 0.4966602 0.4204191
[24,] 0.5193241 0.4966602
[25,] -0.6776372 0.5193241
[26,] 0.6543229 -0.6776372
[27,] -0.5199745 0.6543229
[28,] 0.5780818 -0.5199745
[29,] -0.5795809 0.5780818
[30,] -0.4219182 -0.5795809
[31,] -0.3456771 -0.4219182
[32,] -0.5033398 -0.3456771
[33,] 0.6173804 -0.5033398
[34,] -0.4219182 0.6173804
[35,] -0.4219182 -0.4219182
[36,] -0.5620975 -0.4219182
[37,] 0.4800255 -0.5620975
[38,] 0.4204191 0.4800255
[39,] -0.5402823 0.4204191
[40,] 0.4364481 -0.5402823
[41,] 0.4800255 0.4364481
[42,] 0.4966602 0.4800255
[43,] -0.3063785 0.4966602
[44,] -0.5795809 -0.3063785
[45,] 0.4204191 -0.5795809
[46,] -0.4219182 0.4204191
[47,] 0.5780818 -0.4219182
[48,] 0.4204191 0.5780818
[49,] -0.4219182 0.4204191
[50,] -0.4806759 -0.4219182
[51,] -0.4480122 -0.4806759
[52,] 0.5780818 -0.4480122
[53,] -0.4058892 0.5780818
[54,] -0.4219182 -0.4058892
[55,] 0.5193241 -0.4219182
[56,] 0.3223628 0.5193241
[57,] 0.5780818 0.3223628
[58,] 0.5780818 0.5780818
[59,] 0.5519878 0.5780818
[60,] 0.6936215 0.5519878
[61,] -0.6776372 0.6936215
[62,] -0.4219182 -0.6776372
[63,] 0.6936215 -0.4219182
[64,] -0.4219182 0.6936215
[65,] -0.4219182 -0.4219182
[66,] -0.5242534 -0.4219182
[67,] -0.3456771 -0.5242534
[68,] 0.5780818 -0.3456771
[69,] -0.5199745 0.5780818
[70,] -0.4219182 -0.5199745
[71,] 0.5780818 -0.4219182
[72,] 0.4800255 0.5780818
[73,] -0.4437333 0.4800255
[74,] 0.5780818 -0.4437333
[75,] 0.4597177 0.5780818
[76,] 0.5780818 0.4597177
[77,] 0.3223628 0.5780818
[78,] 0.6334093 0.3223628
[79,] -0.5402823 0.6334093
[80,] -0.4219182 -0.5402823
[81,] 0.5562667 -0.4219182
[82,] -0.4219182 0.5562667
[83,] -0.4058892 -0.4219182
[84,] 0.4204191 -0.4058892
[85,] -0.3456771 0.4204191
[86,] 0.7734271 -0.3456771
[87,] 0.7146694 0.7734271
[88,] -0.3028140 0.7146694
[89,] 0.6971860 -0.3028140
[90,] -0.4604767 0.6971860
[91,] -0.1872744 -0.4604767
[92,] -0.3842356 -0.1872744
[93,] -0.3028140 -0.3842356
[94,] -0.2635155 -0.3028140
[95,] 0.6971860 -0.2635155
[96,] -0.1872744 0.6971860
[97,] -0.3028140 -0.1872744
[98,] -0.2265729 -0.3028140
[99,] 0.6971860 -0.2265729
[100,] 0.7734271 0.6971860
[101,] -0.3028140 0.7734271
[102,] -0.3028140 -0.3028140
[103,] -0.3028140 -0.3028140
[104,] -0.3615718 -0.3028140
[105,] -0.3028140 -0.3615718
[106,] -0.3028140 -0.3028140
[107,] -0.2853306 -0.3028140
[108,] -0.3028140 -0.2853306
[109,] -0.2265729 -0.3028140
[110,] -0.4429933 -0.2265729
[111,] -0.2635155 -0.4429933
[112,] -0.4008703 -0.2635155
[113,] -0.2853306 -0.4008703
[114,] -0.2265729 -0.2853306
[115,] -0.3028140 -0.2265729
[116,] 0.7734271 -0.3028140
[117,] -0.2265729 0.7734271
[118,] -0.3028140 -0.2265729
[119,] 0.6971860 -0.3028140
[120,] -0.2265729 0.6971860
[121,] -0.3028140 -0.2265729
[122,] -0.2853306 -0.3028140
[123,] 0.4414670 -0.2853306
[124,] 0.6971860 0.4414670
[125,] -0.2635155 0.6971860
[126,] -0.4604767 -0.2635155
[127,] 0.6971860 -0.4604767
[128,] -0.3028140 0.6971860
[129,] 0.6971860 -0.3028140
[130,] -0.2265729 0.6971860
[131,] 0.7734271 -0.2265729
[132,] -0.3246292 0.7734271
[133,] -0.3028140 -0.3246292
[134,] -0.3028140 -0.3028140
[135,] -0.3028140 -0.3028140
[136,] 0.5177081 -0.3028140
[137,] 0.5570067 0.5177081
[138,] -0.2635155 0.5570067
[139,] -0.3028140 -0.2635155
[140,] 0.7132150 -0.3028140
[141,] 0.6384282 0.7132150
[142,] -0.2265729 0.6384282
[143,] 0.5395233 -0.2265729
[144,] -0.4604767 0.5395233
[145,] 0.7364845 -0.4604767
[146,] -0.3615718 0.7364845
[147,] -0.2635155 -0.3615718
[148,] -0.2265729 -0.2635155
[149,] 0.5395233 -0.2265729
[150,] 0.6971860 0.5395233
[151,] -0.2105439 0.6971860
[152,] -0.3682066 -0.2105439
[153,] -0.3246292 -0.3682066
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -0.4219182 0.6936215
2 -0.4219182 -0.4219182
3 -0.4219182 -0.4219182
4 -0.4219182 -0.4219182
5 0.4966602 -0.4219182
6 -0.4219182 0.4966602
7 -0.3826196 -0.4219182
8 0.5780818 -0.3826196
9 -0.3456771 0.5780818
10 -0.3063785 -0.3456771
11 -0.4219182 -0.3063785
12 -0.6776372 -0.4219182
13 -0.3063785 -0.6776372
14 0.3223628 -0.3063785
15 0.3616614 0.3223628
16 -0.4480122 0.3616614
17 -0.3063785 -0.4480122
18 0.5780818 -0.3063785
19 0.4757466 0.5780818
20 -0.5033398 0.4757466
21 0.3986040 -0.5033398
22 0.4204191 0.3986040
23 0.4966602 0.4204191
24 0.5193241 0.4966602
25 -0.6776372 0.5193241
26 0.6543229 -0.6776372
27 -0.5199745 0.6543229
28 0.5780818 -0.5199745
29 -0.5795809 0.5780818
30 -0.4219182 -0.5795809
31 -0.3456771 -0.4219182
32 -0.5033398 -0.3456771
33 0.6173804 -0.5033398
34 -0.4219182 0.6173804
35 -0.4219182 -0.4219182
36 -0.5620975 -0.4219182
37 0.4800255 -0.5620975
38 0.4204191 0.4800255
39 -0.5402823 0.4204191
40 0.4364481 -0.5402823
41 0.4800255 0.4364481
42 0.4966602 0.4800255
43 -0.3063785 0.4966602
44 -0.5795809 -0.3063785
45 0.4204191 -0.5795809
46 -0.4219182 0.4204191
47 0.5780818 -0.4219182
48 0.4204191 0.5780818
49 -0.4219182 0.4204191
50 -0.4806759 -0.4219182
51 -0.4480122 -0.4806759
52 0.5780818 -0.4480122
53 -0.4058892 0.5780818
54 -0.4219182 -0.4058892
55 0.5193241 -0.4219182
56 0.3223628 0.5193241
57 0.5780818 0.3223628
58 0.5780818 0.5780818
59 0.5519878 0.5780818
60 0.6936215 0.5519878
61 -0.6776372 0.6936215
62 -0.4219182 -0.6776372
63 0.6936215 -0.4219182
64 -0.4219182 0.6936215
65 -0.4219182 -0.4219182
66 -0.5242534 -0.4219182
67 -0.3456771 -0.5242534
68 0.5780818 -0.3456771
69 -0.5199745 0.5780818
70 -0.4219182 -0.5199745
71 0.5780818 -0.4219182
72 0.4800255 0.5780818
73 -0.4437333 0.4800255
74 0.5780818 -0.4437333
75 0.4597177 0.5780818
76 0.5780818 0.4597177
77 0.3223628 0.5780818
78 0.6334093 0.3223628
79 -0.5402823 0.6334093
80 -0.4219182 -0.5402823
81 0.5562667 -0.4219182
82 -0.4219182 0.5562667
83 -0.4058892 -0.4219182
84 0.4204191 -0.4058892
85 -0.3456771 0.4204191
86 0.7734271 -0.3456771
87 0.7146694 0.7734271
88 -0.3028140 0.7146694
89 0.6971860 -0.3028140
90 -0.4604767 0.6971860
91 -0.1872744 -0.4604767
92 -0.3842356 -0.1872744
93 -0.3028140 -0.3842356
94 -0.2635155 -0.3028140
95 0.6971860 -0.2635155
96 -0.1872744 0.6971860
97 -0.3028140 -0.1872744
98 -0.2265729 -0.3028140
99 0.6971860 -0.2265729
100 0.7734271 0.6971860
101 -0.3028140 0.7734271
102 -0.3028140 -0.3028140
103 -0.3028140 -0.3028140
104 -0.3615718 -0.3028140
105 -0.3028140 -0.3615718
106 -0.3028140 -0.3028140
107 -0.2853306 -0.3028140
108 -0.3028140 -0.2853306
109 -0.2265729 -0.3028140
110 -0.4429933 -0.2265729
111 -0.2635155 -0.4429933
112 -0.4008703 -0.2635155
113 -0.2853306 -0.4008703
114 -0.2265729 -0.2853306
115 -0.3028140 -0.2265729
116 0.7734271 -0.3028140
117 -0.2265729 0.7734271
118 -0.3028140 -0.2265729
119 0.6971860 -0.3028140
120 -0.2265729 0.6971860
121 -0.3028140 -0.2265729
122 -0.2853306 -0.3028140
123 0.4414670 -0.2853306
124 0.6971860 0.4414670
125 -0.2635155 0.6971860
126 -0.4604767 -0.2635155
127 0.6971860 -0.4604767
128 -0.3028140 0.6971860
129 0.6971860 -0.3028140
130 -0.2265729 0.6971860
131 0.7734271 -0.2265729
132 -0.3246292 0.7734271
133 -0.3028140 -0.3246292
134 -0.3028140 -0.3028140
135 -0.3028140 -0.3028140
136 0.5177081 -0.3028140
137 0.5570067 0.5177081
138 -0.2635155 0.5570067
139 -0.3028140 -0.2635155
140 0.7132150 -0.3028140
141 0.6384282 0.7132150
142 -0.2265729 0.6384282
143 0.5395233 -0.2265729
144 -0.4604767 0.5395233
145 0.7364845 -0.4604767
146 -0.3615718 0.7364845
147 -0.2635155 -0.3615718
148 -0.2265729 -0.2635155
149 0.5395233 -0.2265729
150 0.6971860 0.5395233
151 -0.2105439 0.6971860
152 -0.3682066 -0.2105439
153 -0.3246292 -0.3682066
> 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/wessaorg/rcomp/tmp/7xmuq1356101751.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/wessaorg/rcomp/tmp/88rcc1356101751.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/wessaorg/rcomp/tmp/9ezae1356101751.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/wessaorg/rcomp/tmp/10fj0g1356101751.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/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/wessaorg/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/wessaorg/rcomp/tmp/11th6n1356101751.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/wessaorg/rcomp/tmp/12lbw21356101751.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/wessaorg/rcomp/tmp/1349mv1356101751.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/wessaorg/rcomp/tmp/14qgr41356101751.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/wessaorg/rcomp/tmp/157xz81356101751.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/wessaorg/rcomp/tmp/162j1y1356101751.tab")
+ }
>
> try(system("convert tmp/140jg1356101751.ps tmp/140jg1356101751.png",intern=TRUE))
character(0)
> try(system("convert tmp/2x7781356101751.ps tmp/2x7781356101751.png",intern=TRUE))
character(0)
> try(system("convert tmp/3ajk11356101751.ps tmp/3ajk11356101751.png",intern=TRUE))
character(0)
> try(system("convert tmp/4hi1f1356101751.ps tmp/4hi1f1356101751.png",intern=TRUE))
character(0)
> try(system("convert tmp/5xa101356101751.ps tmp/5xa101356101751.png",intern=TRUE))
character(0)
> try(system("convert tmp/699tl1356101751.ps tmp/699tl1356101751.png",intern=TRUE))
character(0)
> try(system("convert tmp/7xmuq1356101751.ps tmp/7xmuq1356101751.png",intern=TRUE))
character(0)
> try(system("convert tmp/88rcc1356101751.ps tmp/88rcc1356101751.png",intern=TRUE))
character(0)
> try(system("convert tmp/9ezae1356101751.ps tmp/9ezae1356101751.png",intern=TRUE))
character(0)
> try(system("convert tmp/10fj0g1356101751.ps tmp/10fj0g1356101751.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
8.900 1.327 10.291