R version 2.8.0 (2008-10-20)
Copyright (C) 2008 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.
Natural language support but running in an English locale
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> x <- array(list(3
+ ,3
+ ,4
+ ,4
+ ,4
+ ,4
+ ,3
+ ,4
+ ,3
+ ,4
+ ,4
+ ,4
+ ,3
+ ,4
+ ,3
+ ,3
+ ,3
+ ,4
+ ,3
+ ,2
+ ,2
+ ,2
+ ,3
+ ,3
+ ,3
+ ,2
+ ,3
+ ,4
+ ,4
+ ,4
+ ,5
+ ,4
+ ,4
+ ,4
+ ,5
+ ,3
+ ,2
+ ,4
+ ,3
+ ,4
+ ,2
+ ,3
+ ,4
+ ,4
+ ,4
+ ,2
+ ,4
+ ,2
+ ,3
+ ,2
+ ,4
+ ,3
+ ,2
+ ,4
+ ,2
+ ,3
+ ,3
+ ,4
+ ,3
+ ,4
+ ,3
+ ,4
+ ,4
+ ,4
+ ,4
+ ,4
+ ,2
+ ,4
+ ,3
+ ,5
+ ,4
+ ,2
+ ,4
+ ,3
+ ,5
+ ,2
+ ,3
+ ,3
+ ,4
+ ,4
+ ,3
+ ,2
+ ,4
+ ,3
+ ,3
+ ,4
+ ,4
+ ,4
+ ,4
+ ,4
+ ,2
+ ,2
+ ,3
+ ,3
+ ,4
+ ,2
+ ,1
+ ,2
+ ,3
+ ,2
+ ,3
+ ,3
+ ,2
+ ,4
+ ,4
+ ,4
+ ,4
+ ,4
+ ,4
+ ,4
+ ,2
+ ,2
+ ,3
+ ,3
+ ,4
+ ,2
+ ,3
+ ,4
+ ,3
+ ,4
+ ,3
+ ,3
+ ,4
+ ,4
+ ,4
+ ,4
+ ,4
+ ,3
+ ,4
+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#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
SocialVisible ManyFriends MakeNewFriends QuiteAccepted IntendMakeNewFriends
1 3 3 4 4 4
2 4 3 4 3 4
3 4 4 3 4 3
4 3 3 4 3 2
5 2 2 3 3 3
6 2 3 4 4 4
7 5 4 4 4 5
8 3 2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 4
94 4 2 4 3 4
95 5 1 3 2 2
96 3 2 4 2 4
97 4 2 2 4 4
98 4 3 4 3 4
99 4 4 4 4 4
100 4 4 4 4 4
101 5 3 4 5 5
102 4 3 4 3 4
103 3 1 3 1 4
104 4 3 4 4 4
105 4 3 3 3 3
106 4 4 4 4 4
107 4 2 3 4 4
108 4 3 3 4 4
109 3 3 2 4 3
110 4 3 4 3 4
111 4 4 4 4 4
112 4 4 4 4 4
113 4 4 1 3 5
114 4 4 4 3 4
115 4 2 4 4 4
116 4 3 4 4 4
117 3 4 3 3 4
118 4 3 4 3 4
119 3 4 4 3 4
120 3 2 3 4 4
121 4 4 4 4 4
122 4 4 4 3 4
123 4 3 4 3 4
124 4 4 4 4 4
125 3 3 4 4 4
126 3 3 3 4 3
127 1 1 3 1 1
128 4 4 4 4 4
129 3 4 4 4 4
130 4 2 4 4 4
131 4 3 4 4 4
132 3 4 4 4 4
133 4 3 4 4 4
134 4 4 4 4 4
135 2 2 4 4 4
136 4 5 4 4 4
137 3 3 3 4 3
138 3 4 3 4 4
139 4 3 4 4 4
140 4 4 4 4 4
141 3 3 4 4 4
142 3 3 4 4 4
143 3 2 4 4 4
144 4 4 4 4 4
145 4 4 4 4 4
146 3 3 4 4 4
147 4 4 4 5 4
148 3 2 4 3 3
149 4 4 4 4 3
150 4 4 4 3 4
151 4 3 4 3 3
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) ManyFriends MakeNewFriends
1.12352 0.20501 0.08583
QuiteAccepted IntendMakeNewFriends
0.25852 0.10774
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-1.5469 -0.5469 0.1831 0.5066 2.6815
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 1.12352 0.46038 2.440 0.01587 *
ManyFriends 0.20501 0.07435 2.757 0.00658 **
MakeNewFriends 0.08583 0.09535 0.900 0.36950
QuiteAccepted 0.25852 0.09539 2.710 0.00753 **
IntendMakeNewFriends 0.10774 0.09353 1.152 0.25124
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 0.7132 on 146 degrees of freedom
Multiple R-squared: 0.1924, Adjusted R-squared: 0.1703
F-statistic: 8.696 on 4 and 146 DF, p-value: 2.528e-06
> 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.3480496 0.696099200 0.651950400
[2,] 0.3060334 0.612066728 0.693966636
[3,] 0.8321745 0.335650907 0.167825454
[4,] 0.9899611 0.020077851 0.010038925
[5,] 0.9813365 0.037327013 0.018663507
[6,] 0.9765606 0.046878867 0.023439434
[7,] 0.9744364 0.051127178 0.025563589
[8,] 0.9659725 0.068055069 0.034027534
[9,] 0.9850168 0.029966412 0.014983206
[10,] 0.9777360 0.044527933 0.022263967
[11,] 0.9702803 0.059439439 0.029719720
[12,] 0.9745103 0.050979469 0.025489734
[13,] 0.9650809 0.069838160 0.034919080
[14,] 0.9498845 0.100230918 0.050115459
[15,] 0.9343554 0.131289192 0.065644596
[16,] 0.9387001 0.122599857 0.061299928
[17,] 0.9659009 0.068198150 0.034099075
[18,] 0.9544861 0.091027827 0.045513913
[19,] 0.9440711 0.111857787 0.055928893
[20,] 0.9443985 0.111203054 0.055601527
[21,] 0.9263480 0.147304084 0.073652042
[22,] 0.9102584 0.179483266 0.089741633
[23,] 0.8885852 0.222829594 0.111414797
[24,] 0.8989986 0.202002858 0.101001429
[25,] 0.8772705 0.245459076 0.122729538
[26,] 0.8510853 0.297829421 0.148914710
[27,] 0.8634188 0.273162479 0.136581239
[28,] 0.8394697 0.321060569 0.160530285
[29,] 0.8240389 0.351922243 0.175961121
[30,] 0.8113753 0.377249415 0.188624708
[31,] 0.8024941 0.395011817 0.197505909
[32,] 0.7676607 0.464678585 0.232339292
[33,] 0.7566690 0.486662016 0.243331008
[34,] 0.7335033 0.532993338 0.266496669
[35,] 0.7442942 0.511411572 0.255705786
[36,] 0.7091056 0.581788823 0.290894412
[37,] 0.6660780 0.667843909 0.333921954
[38,] 0.6365980 0.726803929 0.363401964
[39,] 0.6783443 0.643311392 0.321655696
[40,] 0.7028727 0.594254555 0.297127278
[41,] 0.7428847 0.514230550 0.257115275
[42,] 0.7225722 0.554855581 0.277427791
[43,] 0.7715800 0.456839967 0.228419984
[44,] 0.7769778 0.446044320 0.223022160
[45,] 0.7594721 0.481055779 0.240527890
[46,] 0.7200719 0.559856278 0.279928139
[47,] 0.7436103 0.512779392 0.256389696
[48,] 0.7199435 0.560112912 0.280056456
[49,] 0.8135396 0.372920804 0.186460402
[50,] 0.7871570 0.425686096 0.212843048
[51,] 0.8212413 0.357517457 0.178758729
[52,] 0.7949190 0.410162044 0.205081022
[53,] 0.7594650 0.481070093 0.240535047
[54,] 0.7562191 0.487561893 0.243780947
[55,] 0.7348865 0.530226961 0.265113481
[56,] 0.7134585 0.573082916 0.286541458
[57,] 0.6835481 0.632903732 0.316451866
[58,] 0.6887494 0.622501221 0.311250611
[59,] 0.6458180 0.708364025 0.354182013
[60,] 0.6213173 0.757365339 0.378682669
[61,] 0.6108570 0.778286092 0.389143046
[62,] 0.7484099 0.503180139 0.251590070
[63,] 0.7223540 0.555291912 0.277645956
[64,] 0.6863187 0.627362617 0.313681308
[65,] 0.6613459 0.677308173 0.338654087
[66,] 0.8767309 0.246538231 0.123269115
[67,] 0.8659036 0.268192785 0.134096393
[68,] 0.8588129 0.282374186 0.141187093
[69,] 0.8504911 0.299017812 0.149508906
[70,] 0.8861459 0.227708228 0.113854114
[71,] 0.8766247 0.246750602 0.123375301
[72,] 0.8551354 0.289729236 0.144864618
[73,] 0.8494207 0.301158626 0.150579313
[74,] 0.8358197 0.328360627 0.164180314
[75,] 0.9094512 0.181097652 0.090548826
[76,] 0.9170463 0.165907457 0.082953728
[77,] 0.9159142 0.168171637 0.084085818
[78,] 0.9310704 0.137859262 0.068929631
[79,] 0.9433080 0.113384048 0.056692024
[80,] 0.9298073 0.140385438 0.070192719
[81,] 0.9243835 0.151232955 0.075616477
[82,] 0.9138310 0.172338037 0.086169019
[83,] 0.9032053 0.193589394 0.096794697
[84,] 0.8829098 0.234180414 0.117090207
[85,] 0.8843439 0.231312187 0.115656093
[86,] 0.8725370 0.254926001 0.127463001
[87,] 0.8768394 0.246321222 0.123160611
[88,] 0.9989173 0.002165448 0.001082724
[89,] 0.9985468 0.002906308 0.001453154
[90,] 0.9987837 0.002432691 0.001216346
[91,] 0.9985296 0.002940748 0.001470374
[92,] 0.9978257 0.004348691 0.002174346
[93,] 0.9968198 0.006360453 0.003180227
[94,] 0.9978507 0.004298575 0.002149288
[95,] 0.9974208 0.005158416 0.002579208
[96,] 0.9965291 0.006941742 0.003470871
[97,] 0.9954770 0.009045978 0.004522989
[98,] 0.9974215 0.005157051 0.002578526
[99,] 0.9961834 0.007633209 0.003816605
[100,] 0.9969321 0.006135833 0.003067917
[101,] 0.9968198 0.006360411 0.003180206
[102,] 0.9956528 0.008694362 0.004347181
[103,] 0.9947915 0.010417081 0.005208540
[104,] 0.9923589 0.015282285 0.007641143
[105,] 0.9889551 0.022089817 0.011044909
[106,] 0.9934985 0.013003046 0.006501523
[107,] 0.9910586 0.017882764 0.008941382
[108,] 0.9919578 0.016084342 0.008042171
[109,] 0.9902340 0.019531926 0.009765963
[110,] 0.9857718 0.028456482 0.014228241
[111,] 0.9856365 0.028727010 0.014363505
[112,] 0.9876843 0.024631481 0.012315740
[113,] 0.9858195 0.028361084 0.014180542
[114,] 0.9788716 0.042256732 0.021128366
[115,] 0.9704468 0.059106402 0.029553201
[116,] 0.9736754 0.052649228 0.026324614
[117,] 0.9619255 0.076148903 0.038074452
[118,] 0.9543229 0.091354194 0.045677097
[119,] 0.9387402 0.122519667 0.061259834
[120,] 0.9539656 0.092068743 0.046034371
[121,] 0.9350753 0.129849358 0.064924679
[122,] 0.9492967 0.101406591 0.050703296
[123,] 0.9791763 0.041647414 0.020823707
[124,] 0.9830825 0.033834977 0.016917488
[125,] 0.9923796 0.015240823 0.007620411
[126,] 0.9956637 0.008672572 0.004336286
[127,] 0.9916483 0.016703472 0.008351736
[128,] 0.9972084 0.005583107 0.002791553
[129,] 0.9963169 0.007366123 0.003683061
[130,] 0.9925685 0.014863012 0.007431506
[131,] 0.9832995 0.033400988 0.016700494
[132,] 0.9936348 0.012730354 0.006365177
[133,] 0.9836183 0.032763395 0.016381697
[134,] 0.9710883 0.057823470 0.028911735
[135,] 0.9567076 0.086584811 0.043292405
[136,] 0.9167595 0.166481045 0.083240522
> postscript(file="/var/www/html/freestat/rcomp/tmp/138521291302421.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/freestat/rcomp/tmp/2e0n51291302421.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/freestat/rcomp/tmp/3e0n51291302421.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/freestat/rcomp/tmp/4e0n51291302421.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/freestat/rcomp/tmp/56rmq1291302421.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 = 151
Frequency = 1
1 2 3 4 5 6
-0.546912916 0.711611392 0.441651049 -0.072914811 -0.889812344 -1.546912916
7 8 9 10 11 12
1.140344037 -0.083382458 -1.546912916 -1.106254528 0.840227313 -0.288388608
13 14 15 16 17 18
-0.751919065 0.808880644 0.808880644 -1.461079700 0.024354440 0.248080935
19 20 21 22 23 24
-0.997549242 -0.491236080 -0.375246483 0.248080935 -0.997549242 -1.288388608
25 26 27 28 29 30
-0.546912916 0.333914151 0.538920300 -0.267509585 -0.558348951 0.248080935
31 32 33 34 35 36
-1.041300334 -0.461079700 0.248080935 -1.083382458 0.333914151 0.453087084
37 38 39 40 41 42
-0.803979127 -0.666085849 0.248080935 0.506605243 -0.558348951 0.723047427
43 44 45 46 47 48
0.002450758 -0.202555391 -0.493394757 -0.956925215 -1.018428264 0.797444609
49 50 51 52 53 54
0.453087084 0.916617542 -0.803979127 -0.546912916 -0.083382458 -0.859655963
55 56 57 58 59 60
-0.461079700 -1.353342801 0.183126741 1.034765816 0.248080935 -0.083382458
61 62 63 64 65 66
0.506605243 -0.299824643 0.355817833 0.110187656 -0.751919065 -0.083382458
67 68 69 70 71 72
-0.493394757 0.506605243 -1.469064590 0.355817833 0.248080935 -0.439176018
73 74 75 76 77 78
1.840227313 -0.461079700 -0.546912916 -0.396125506 1.012918405 0.506605243
79 80 81 82 83 84
0.121623691 -0.546912916 0.538920300 -1.353342801 0.850962767 -0.396125506
85 86 87 88 89 90
-0.867908662 0.840227313 0.248080935 -0.461079700 0.355817833 0.538920300
91 92 93 94 95 96
0.248080935 -0.666085849 -0.202555391 0.916617542 2.681455012 0.175141850
97 98 99 100 101 102
0.829759666 0.711611392 0.248080935 0.248080935 1.086825878 0.711611392
103 104 105 106 107 108
0.724505524 0.453087084 0.905181507 0.248080935 0.743926450 0.538920300
109 110 111 112 113 114
-0.267509585 0.711611392 0.248080935 0.248080935 0.656367994 0.506605243
115 116 117 118 119 120
0.658093234 0.453087084 -0.407561541 0.711611392 -0.493394757 -0.256073550
121 122 123 124 125 126
0.248080935 0.506605243 0.711611392 0.248080935 -0.546912916 -0.353342801
127 128 129 130 131 132
-0.952283781 0.248080935 -0.751919065 0.658093234 0.453087084 -0.751919065
133 134 135 136 137 138
0.453087084 0.248080935 -1.341906766 0.043074785 -0.353342801 -0.666085849
139 140 141 142 143 144
0.453087084 0.248080935 -0.546912916 -0.546912916 -0.341906766 0.248080935
145 146 147 148 149 150
0.248080935 -0.546912916 -0.010443373 0.024354440 0.355817833 0.506605243
151
0.819348291
> postscript(file="/var/www/html/freestat/rcomp/tmp/66rmq1291302421.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 = 151
Frequency = 1
lag(myerror, k = 1) myerror
0 -0.546912916 NA
1 0.711611392 -0.546912916
2 0.441651049 0.711611392
3 -0.072914811 0.441651049
4 -0.889812344 -0.072914811
5 -1.546912916 -0.889812344
6 1.140344037 -1.546912916
7 -0.083382458 1.140344037
8 -1.546912916 -0.083382458
9 -1.106254528 -1.546912916
10 0.840227313 -1.106254528
11 -0.288388608 0.840227313
12 -0.751919065 -0.288388608
13 0.808880644 -0.751919065
14 0.808880644 0.808880644
15 -1.461079700 0.808880644
16 0.024354440 -1.461079700
17 0.248080935 0.024354440
18 -0.997549242 0.248080935
19 -0.491236080 -0.997549242
20 -0.375246483 -0.491236080
21 0.248080935 -0.375246483
22 -0.997549242 0.248080935
23 -1.288388608 -0.997549242
24 -0.546912916 -1.288388608
25 0.333914151 -0.546912916
26 0.538920300 0.333914151
27 -0.267509585 0.538920300
28 -0.558348951 -0.267509585
29 0.248080935 -0.558348951
30 -1.041300334 0.248080935
31 -0.461079700 -1.041300334
32 0.248080935 -0.461079700
33 -1.083382458 0.248080935
34 0.333914151 -1.083382458
35 0.453087084 0.333914151
36 -0.803979127 0.453087084
37 -0.666085849 -0.803979127
38 0.248080935 -0.666085849
39 0.506605243 0.248080935
40 -0.558348951 0.506605243
41 0.723047427 -0.558348951
42 0.002450758 0.723047427
43 -0.202555391 0.002450758
44 -0.493394757 -0.202555391
45 -0.956925215 -0.493394757
46 -1.018428264 -0.956925215
47 0.797444609 -1.018428264
48 0.453087084 0.797444609
49 0.916617542 0.453087084
50 -0.803979127 0.916617542
51 -0.546912916 -0.803979127
52 -0.083382458 -0.546912916
53 -0.859655963 -0.083382458
54 -0.461079700 -0.859655963
55 -1.353342801 -0.461079700
56 0.183126741 -1.353342801
57 1.034765816 0.183126741
58 0.248080935 1.034765816
59 -0.083382458 0.248080935
60 0.506605243 -0.083382458
61 -0.299824643 0.506605243
62 0.355817833 -0.299824643
63 0.110187656 0.355817833
64 -0.751919065 0.110187656
65 -0.083382458 -0.751919065
66 -0.493394757 -0.083382458
67 0.506605243 -0.493394757
68 -1.469064590 0.506605243
69 0.355817833 -1.469064590
70 0.248080935 0.355817833
71 -0.439176018 0.248080935
72 1.840227313 -0.439176018
73 -0.461079700 1.840227313
74 -0.546912916 -0.461079700
75 -0.396125506 -0.546912916
76 1.012918405 -0.396125506
77 0.506605243 1.012918405
78 0.121623691 0.506605243
79 -0.546912916 0.121623691
80 0.538920300 -0.546912916
81 -1.353342801 0.538920300
82 0.850962767 -1.353342801
83 -0.396125506 0.850962767
84 -0.867908662 -0.396125506
85 0.840227313 -0.867908662
86 0.248080935 0.840227313
87 -0.461079700 0.248080935
88 0.355817833 -0.461079700
89 0.538920300 0.355817833
90 0.248080935 0.538920300
91 -0.666085849 0.248080935
92 -0.202555391 -0.666085849
93 0.916617542 -0.202555391
94 2.681455012 0.916617542
95 0.175141850 2.681455012
96 0.829759666 0.175141850
97 0.711611392 0.829759666
98 0.248080935 0.711611392
99 0.248080935 0.248080935
100 1.086825878 0.248080935
101 0.711611392 1.086825878
102 0.724505524 0.711611392
103 0.453087084 0.724505524
104 0.905181507 0.453087084
105 0.248080935 0.905181507
106 0.743926450 0.248080935
107 0.538920300 0.743926450
108 -0.267509585 0.538920300
109 0.711611392 -0.267509585
110 0.248080935 0.711611392
111 0.248080935 0.248080935
112 0.656367994 0.248080935
113 0.506605243 0.656367994
114 0.658093234 0.506605243
115 0.453087084 0.658093234
116 -0.407561541 0.453087084
117 0.711611392 -0.407561541
118 -0.493394757 0.711611392
119 -0.256073550 -0.493394757
120 0.248080935 -0.256073550
121 0.506605243 0.248080935
122 0.711611392 0.506605243
123 0.248080935 0.711611392
124 -0.546912916 0.248080935
125 -0.353342801 -0.546912916
126 -0.952283781 -0.353342801
127 0.248080935 -0.952283781
128 -0.751919065 0.248080935
129 0.658093234 -0.751919065
130 0.453087084 0.658093234
131 -0.751919065 0.453087084
132 0.453087084 -0.751919065
133 0.248080935 0.453087084
134 -1.341906766 0.248080935
135 0.043074785 -1.341906766
136 -0.353342801 0.043074785
137 -0.666085849 -0.353342801
138 0.453087084 -0.666085849
139 0.248080935 0.453087084
140 -0.546912916 0.248080935
141 -0.546912916 -0.546912916
142 -0.341906766 -0.546912916
143 0.248080935 -0.341906766
144 0.248080935 0.248080935
145 -0.546912916 0.248080935
146 -0.010443373 -0.546912916
147 0.024354440 -0.010443373
148 0.355817833 0.024354440
149 0.506605243 0.355817833
150 0.819348291 0.506605243
151 NA 0.819348291
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 0.711611392 -0.546912916
[2,] 0.441651049 0.711611392
[3,] -0.072914811 0.441651049
[4,] -0.889812344 -0.072914811
[5,] -1.546912916 -0.889812344
[6,] 1.140344037 -1.546912916
[7,] -0.083382458 1.140344037
[8,] -1.546912916 -0.083382458
[9,] -1.106254528 -1.546912916
[10,] 0.840227313 -1.106254528
[11,] -0.288388608 0.840227313
[12,] -0.751919065 -0.288388608
[13,] 0.808880644 -0.751919065
[14,] 0.808880644 0.808880644
[15,] -1.461079700 0.808880644
[16,] 0.024354440 -1.461079700
[17,] 0.248080935 0.024354440
[18,] -0.997549242 0.248080935
[19,] -0.491236080 -0.997549242
[20,] -0.375246483 -0.491236080
[21,] 0.248080935 -0.375246483
[22,] -0.997549242 0.248080935
[23,] -1.288388608 -0.997549242
[24,] -0.546912916 -1.288388608
[25,] 0.333914151 -0.546912916
[26,] 0.538920300 0.333914151
[27,] -0.267509585 0.538920300
[28,] -0.558348951 -0.267509585
[29,] 0.248080935 -0.558348951
[30,] -1.041300334 0.248080935
[31,] -0.461079700 -1.041300334
[32,] 0.248080935 -0.461079700
[33,] -1.083382458 0.248080935
[34,] 0.333914151 -1.083382458
[35,] 0.453087084 0.333914151
[36,] -0.803979127 0.453087084
[37,] -0.666085849 -0.803979127
[38,] 0.248080935 -0.666085849
[39,] 0.506605243 0.248080935
[40,] -0.558348951 0.506605243
[41,] 0.723047427 -0.558348951
[42,] 0.002450758 0.723047427
[43,] -0.202555391 0.002450758
[44,] -0.493394757 -0.202555391
[45,] -0.956925215 -0.493394757
[46,] -1.018428264 -0.956925215
[47,] 0.797444609 -1.018428264
[48,] 0.453087084 0.797444609
[49,] 0.916617542 0.453087084
[50,] -0.803979127 0.916617542
[51,] -0.546912916 -0.803979127
[52,] -0.083382458 -0.546912916
[53,] -0.859655963 -0.083382458
[54,] -0.461079700 -0.859655963
[55,] -1.353342801 -0.461079700
[56,] 0.183126741 -1.353342801
[57,] 1.034765816 0.183126741
[58,] 0.248080935 1.034765816
[59,] -0.083382458 0.248080935
[60,] 0.506605243 -0.083382458
[61,] -0.299824643 0.506605243
[62,] 0.355817833 -0.299824643
[63,] 0.110187656 0.355817833
[64,] -0.751919065 0.110187656
[65,] -0.083382458 -0.751919065
[66,] -0.493394757 -0.083382458
[67,] 0.506605243 -0.493394757
[68,] -1.469064590 0.506605243
[69,] 0.355817833 -1.469064590
[70,] 0.248080935 0.355817833
[71,] -0.439176018 0.248080935
[72,] 1.840227313 -0.439176018
[73,] -0.461079700 1.840227313
[74,] -0.546912916 -0.461079700
[75,] -0.396125506 -0.546912916
[76,] 1.012918405 -0.396125506
[77,] 0.506605243 1.012918405
[78,] 0.121623691 0.506605243
[79,] -0.546912916 0.121623691
[80,] 0.538920300 -0.546912916
[81,] -1.353342801 0.538920300
[82,] 0.850962767 -1.353342801
[83,] -0.396125506 0.850962767
[84,] -0.867908662 -0.396125506
[85,] 0.840227313 -0.867908662
[86,] 0.248080935 0.840227313
[87,] -0.461079700 0.248080935
[88,] 0.355817833 -0.461079700
[89,] 0.538920300 0.355817833
[90,] 0.248080935 0.538920300
[91,] -0.666085849 0.248080935
[92,] -0.202555391 -0.666085849
[93,] 0.916617542 -0.202555391
[94,] 2.681455012 0.916617542
[95,] 0.175141850 2.681455012
[96,] 0.829759666 0.175141850
[97,] 0.711611392 0.829759666
[98,] 0.248080935 0.711611392
[99,] 0.248080935 0.248080935
[100,] 1.086825878 0.248080935
[101,] 0.711611392 1.086825878
[102,] 0.724505524 0.711611392
[103,] 0.453087084 0.724505524
[104,] 0.905181507 0.453087084
[105,] 0.248080935 0.905181507
[106,] 0.743926450 0.248080935
[107,] 0.538920300 0.743926450
[108,] -0.267509585 0.538920300
[109,] 0.711611392 -0.267509585
[110,] 0.248080935 0.711611392
[111,] 0.248080935 0.248080935
[112,] 0.656367994 0.248080935
[113,] 0.506605243 0.656367994
[114,] 0.658093234 0.506605243
[115,] 0.453087084 0.658093234
[116,] -0.407561541 0.453087084
[117,] 0.711611392 -0.407561541
[118,] -0.493394757 0.711611392
[119,] -0.256073550 -0.493394757
[120,] 0.248080935 -0.256073550
[121,] 0.506605243 0.248080935
[122,] 0.711611392 0.506605243
[123,] 0.248080935 0.711611392
[124,] -0.546912916 0.248080935
[125,] -0.353342801 -0.546912916
[126,] -0.952283781 -0.353342801
[127,] 0.248080935 -0.952283781
[128,] -0.751919065 0.248080935
[129,] 0.658093234 -0.751919065
[130,] 0.453087084 0.658093234
[131,] -0.751919065 0.453087084
[132,] 0.453087084 -0.751919065
[133,] 0.248080935 0.453087084
[134,] -1.341906766 0.248080935
[135,] 0.043074785 -1.341906766
[136,] -0.353342801 0.043074785
[137,] -0.666085849 -0.353342801
[138,] 0.453087084 -0.666085849
[139,] 0.248080935 0.453087084
[140,] -0.546912916 0.248080935
[141,] -0.546912916 -0.546912916
[142,] -0.341906766 -0.546912916
[143,] 0.248080935 -0.341906766
[144,] 0.248080935 0.248080935
[145,] -0.546912916 0.248080935
[146,] -0.010443373 -0.546912916
[147,] 0.024354440 -0.010443373
[148,] 0.355817833 0.024354440
[149,] 0.506605243 0.355817833
[150,] 0.819348291 0.506605243
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 0.711611392 -0.546912916
2 0.441651049 0.711611392
3 -0.072914811 0.441651049
4 -0.889812344 -0.072914811
5 -1.546912916 -0.889812344
6 1.140344037 -1.546912916
7 -0.083382458 1.140344037
8 -1.546912916 -0.083382458
9 -1.106254528 -1.546912916
10 0.840227313 -1.106254528
11 -0.288388608 0.840227313
12 -0.751919065 -0.288388608
13 0.808880644 -0.751919065
14 0.808880644 0.808880644
15 -1.461079700 0.808880644
16 0.024354440 -1.461079700
17 0.248080935 0.024354440
18 -0.997549242 0.248080935
19 -0.491236080 -0.997549242
20 -0.375246483 -0.491236080
21 0.248080935 -0.375246483
22 -0.997549242 0.248080935
23 -1.288388608 -0.997549242
24 -0.546912916 -1.288388608
25 0.333914151 -0.546912916
26 0.538920300 0.333914151
27 -0.267509585 0.538920300
28 -0.558348951 -0.267509585
29 0.248080935 -0.558348951
30 -1.041300334 0.248080935
31 -0.461079700 -1.041300334
32 0.248080935 -0.461079700
33 -1.083382458 0.248080935
34 0.333914151 -1.083382458
35 0.453087084 0.333914151
36 -0.803979127 0.453087084
37 -0.666085849 -0.803979127
38 0.248080935 -0.666085849
39 0.506605243 0.248080935
40 -0.558348951 0.506605243
41 0.723047427 -0.558348951
42 0.002450758 0.723047427
43 -0.202555391 0.002450758
44 -0.493394757 -0.202555391
45 -0.956925215 -0.493394757
46 -1.018428264 -0.956925215
47 0.797444609 -1.018428264
48 0.453087084 0.797444609
49 0.916617542 0.453087084
50 -0.803979127 0.916617542
51 -0.546912916 -0.803979127
52 -0.083382458 -0.546912916
53 -0.859655963 -0.083382458
54 -0.461079700 -0.859655963
55 -1.353342801 -0.461079700
56 0.183126741 -1.353342801
57 1.034765816 0.183126741
58 0.248080935 1.034765816
59 -0.083382458 0.248080935
60 0.506605243 -0.083382458
61 -0.299824643 0.506605243
62 0.355817833 -0.299824643
63 0.110187656 0.355817833
64 -0.751919065 0.110187656
65 -0.083382458 -0.751919065
66 -0.493394757 -0.083382458
67 0.506605243 -0.493394757
68 -1.469064590 0.506605243
69 0.355817833 -1.469064590
70 0.248080935 0.355817833
71 -0.439176018 0.248080935
72 1.840227313 -0.439176018
73 -0.461079700 1.840227313
74 -0.546912916 -0.461079700
75 -0.396125506 -0.546912916
76 1.012918405 -0.396125506
77 0.506605243 1.012918405
78 0.121623691 0.506605243
79 -0.546912916 0.121623691
80 0.538920300 -0.546912916
81 -1.353342801 0.538920300
82 0.850962767 -1.353342801
83 -0.396125506 0.850962767
84 -0.867908662 -0.396125506
85 0.840227313 -0.867908662
86 0.248080935 0.840227313
87 -0.461079700 0.248080935
88 0.355817833 -0.461079700
89 0.538920300 0.355817833
90 0.248080935 0.538920300
91 -0.666085849 0.248080935
92 -0.202555391 -0.666085849
93 0.916617542 -0.202555391
94 2.681455012 0.916617542
95 0.175141850 2.681455012
96 0.829759666 0.175141850
97 0.711611392 0.829759666
98 0.248080935 0.711611392
99 0.248080935 0.248080935
100 1.086825878 0.248080935
101 0.711611392 1.086825878
102 0.724505524 0.711611392
103 0.453087084 0.724505524
104 0.905181507 0.453087084
105 0.248080935 0.905181507
106 0.743926450 0.248080935
107 0.538920300 0.743926450
108 -0.267509585 0.538920300
109 0.711611392 -0.267509585
110 0.248080935 0.711611392
111 0.248080935 0.248080935
112 0.656367994 0.248080935
113 0.506605243 0.656367994
114 0.658093234 0.506605243
115 0.453087084 0.658093234
116 -0.407561541 0.453087084
117 0.711611392 -0.407561541
118 -0.493394757 0.711611392
119 -0.256073550 -0.493394757
120 0.248080935 -0.256073550
121 0.506605243 0.248080935
122 0.711611392 0.506605243
123 0.248080935 0.711611392
124 -0.546912916 0.248080935
125 -0.353342801 -0.546912916
126 -0.952283781 -0.353342801
127 0.248080935 -0.952283781
128 -0.751919065 0.248080935
129 0.658093234 -0.751919065
130 0.453087084 0.658093234
131 -0.751919065 0.453087084
132 0.453087084 -0.751919065
133 0.248080935 0.453087084
134 -1.341906766 0.248080935
135 0.043074785 -1.341906766
136 -0.353342801 0.043074785
137 -0.666085849 -0.353342801
138 0.453087084 -0.666085849
139 0.248080935 0.453087084
140 -0.546912916 0.248080935
141 -0.546912916 -0.546912916
142 -0.341906766 -0.546912916
143 0.248080935 -0.341906766
144 0.248080935 0.248080935
145 -0.546912916 0.248080935
146 -0.010443373 -0.546912916
147 0.024354440 -0.010443373
148 0.355817833 0.024354440
149 0.506605243 0.355817833
150 0.819348291 0.506605243
> 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/freestat/rcomp/tmp/7zi3t1291302421.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/freestat/rcomp/tmp/8zi3t1291302421.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/freestat/rcomp/tmp/9zi3t1291302421.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/freestat/rcomp/tmp/10a92e1291302421.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/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/www/html/freestat/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/freestat/rcomp/tmp/11ds1k1291302421.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/freestat/rcomp/tmp/12zsz81291302421.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/freestat/rcomp/tmp/135bw11291302421.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/freestat/rcomp/tmp/14ylwm1291302421.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/freestat/rcomp/tmp/1513ca1291302421.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/freestat/rcomp/tmp/16gvs11291302421.tab")
+ }
>
> try(system("convert tmp/138521291302421.ps tmp/138521291302421.png",intern=TRUE))
character(0)
> try(system("convert tmp/2e0n51291302421.ps tmp/2e0n51291302421.png",intern=TRUE))
character(0)
> try(system("convert tmp/3e0n51291302421.ps tmp/3e0n51291302421.png",intern=TRUE))
character(0)
> try(system("convert tmp/4e0n51291302421.ps tmp/4e0n51291302421.png",intern=TRUE))
character(0)
> try(system("convert tmp/56rmq1291302421.ps tmp/56rmq1291302421.png",intern=TRUE))
character(0)
> try(system("convert tmp/66rmq1291302421.ps tmp/66rmq1291302421.png",intern=TRUE))
character(0)
> try(system("convert tmp/7zi3t1291302421.ps tmp/7zi3t1291302421.png",intern=TRUE))
character(0)
> try(system("convert tmp/8zi3t1291302421.ps tmp/8zi3t1291302421.png",intern=TRUE))
character(0)
> try(system("convert tmp/9zi3t1291302421.ps tmp/9zi3t1291302421.png",intern=TRUE))
character(0)
> try(system("convert tmp/10a92e1291302421.ps tmp/10a92e1291302421.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
5.324 2.582 5.871