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(7
+ ,5
+ ,1
+ ,6
+ ,5
+ ,7
+ ,5
+ ,2
+ ,1
+ ,6
+ ,2
+ ,3
+ ,5
+ ,6
+ ,3
+ ,6
+ ,6
+ ,3
+ ,5
+ ,6
+ ,2
+ ,4
+ ,4
+ ,6
+ ,8
+ ,6
+ ,3
+ ,2
+ ,6
+ ,2
+ ,6
+ ,5
+ ,2
+ ,7
+ ,3
+ ,3
+ ,6
+ ,5
+ ,2
+ ,6
+ ,5
+ ,1
+ ,4
+ ,6
+ ,2
+ ,5
+ ,3
+ ,2
+ ,5
+ ,6
+ ,4
+ ,6
+ ,5
+ ,5
+ ,5
+ ,5
+ ,4
+ ,7
+ ,4
+ ,1
+ ,5
+ ,5
+ ,1
+ ,7
+ ,1
+ ,6
+ ,6
+ ,5
+ ,2
+ ,4
+ ,6
+ ,1
+ ,7
+ ,6
+ ,1
+ ,1
+ ,6
+ ,1
+ ,7
+ ,5
+ ,3
+ ,6
+ ,6
+ ,2
+ ,6
+ ,5
+ ,2
+ ,4
+ ,4
+ ,1
+ ,7
+ ,6
+ ,5
+ ,5
+ ,6
+ ,3
+ ,7
+ ,6
+ ,2
+ ,5
+ ,5
+ ,2
+ ,5
+ ,4
+ ,5
+ ,6
+ ,3
+ ,2
+ ,8
+ ,5
+ ,4
+ ,4
+ ,5
+ ,2
+ ,7
+ ,5
+ ,2
+ ,6
+ ,4
+ ,2
+ ,5
+ ,5
+ ,2
+ ,3
+ ,5
+ ,2
+ ,7
+ ,6
+ ,5
+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,5
+ ,2)
+ ,dim=c(6
+ ,164)
+ ,dimnames=list(c('Age'
+ ,'Use_hands'
+ ,'Hand_on_hips'
+ ,'Quiet_FirstMeeting'
+ ,'Outgoing_individual'
+ ,'Cry_Sad')
+ ,1:164))
> y <- array(NA,dim=c(6,164),dimnames=list(c('Age','Use_hands','Hand_on_hips','Quiet_FirstMeeting','Outgoing_individual','Cry_Sad'),1:164))
> 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'
> #'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
Cry_Sad Age Use_hands Hand_on_hips Quiet_FirstMeeting Outgoing_individual
1 7 7 5 1 6 5
2 3 5 2 1 6 2
3 3 5 6 3 6 6
4 6 5 6 2 4 4
5 2 8 6 3 2 6
6 3 6 5 2 7 3
7 1 6 5 2 6 5
8 2 4 6 2 5 3
9 5 5 6 4 6 5
10 1 5 5 4 7 4
11 6 5 5 1 7 1
12 1 6 5 2 4 6
13 1 7 6 1 1 6
14 2 7 5 3 6 6
15 1 6 5 2 4 4
16 3 7 6 5 5 6
17 2 7 6 2 5 5
18 2 5 4 5 6 3
19 2 8 5 4 4 5
20 2 7 5 2 6 4
21 2 5 5 2 3 5
22 2 7 6 5 3 6
23 1 5 5 1 5 3
24 3 10 7 4 5 4
25 2 5 6 1 5 5
26 3 4 6 3 5 4
27 4 4 6 2 5 5
28 5 5 6 2 2 6
29 2 5 4 1 6 7
30 5 6 5 3 7 2
31 5 5 6 4 2 4
32 1 5 4 3 3 6
33 6 8 5 5 6 5
34 3 5 5 2 5 5
35 4 5 5 1 7 5
36 6 5 7 2 5 6
37 5 5 7 5 6 6
38 5 5 6 1 5 1
39 3 5 7 3 3 4
40 3 7 6 2 7 2
41 5 7 5 3 5 3
42 2 7 6 2 5 4
43 2 4 4 2 6 5
44 3 5 6 3 2 4
45 5 5 5 3 7 4
46 2 4 5 5 3 3
47 4 5 6 3 6 4
48 5 5 6 2 7 6
49 2 6 5 1 5 4
50 2 5 6 6 4 5
51 5 5 5 6 6 4
52 6 6 5 3 7 5
53 6 6 5 5 2 6
54 5 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7 5 4 4
128 1 6 6 1 3 6
129 2 5 6 3 2 6
130 2 5 5 2 6 4
131 6 5 6 1 6 3
132 2 7 6 2 3 5
133 1 5 5 1 2 7
134 3 4 2 2 6 3
135 4 5 5 2 6 4
136 6 6 3 2 2 2
137 5 7 6 4 5 4
138 6 5 5 5 6 4
139 6 7 5 2 5 3
140 1 7 5 3 3 2
141 6 6 2 2 7 5
142 2 8 5 1 5 5
143 2 5 5 2 4 4
144 7 5 6 2 5 6
145 2 6 6 2 3 5
146 2 4 5 2 2 1
147 6 5 5 2 5 5
148 1 5 3 4 6 6
149 2 5 5 2 5 5
150 3 7 6 4 2 5
151 4 5 6 5 3 5
152 5 6 6 3 2 5
153 5 7 6 4 6 4
154 6 8 6 4 6 7
155 3 10 5 2 2 6
156 1 5 7 3 2 5
157 3 6 6 2 3 6
158 2 4 6 1 4 3
159 3 6 6 2 6 5
160 7 7 7 3 2 6
161 3 5 1 3 7 1
162 4 7 6 2 2 6
163 6 6 5 5 2 4
164 2 6 6 1 4 5
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Age Use_hands
1.558187 0.009709 0.216489
Hand_on_hips Quiet_FirstMeeting Outgoing_individual
0.273494 0.148458 -0.138792
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-3.2672 -1.3455 -0.4475 1.4355 4.0027
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 1.558187 1.156205 1.348 0.17969
Age 0.009709 0.118536 0.082 0.93483
Use_hands 0.216489 0.129833 1.667 0.09741 .
Hand_on_hips 0.273494 0.099789 2.741 0.00684 **
Quiet_FirstMeeting 0.148458 0.086712 1.712 0.08884 .
Outgoing_individual -0.138792 0.103965 -1.335 0.18380
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 1.745 on 158 degrees of freedom
Multiple R-squared: 0.08696, Adjusted R-squared: 0.05807
F-statistic: 3.01 on 5 and 158 DF, p-value: 0.01268
> 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.9749961 0.05000787 0.02500393
[2,] 0.9565357 0.08692856 0.04346428
[3,] 0.9346631 0.13067373 0.06533686
[4,] 0.9251839 0.14963216 0.07481608
[5,] 0.9153859 0.16922818 0.08461409
[6,] 0.8762173 0.24756532 0.12378266
[7,] 0.8587362 0.28252758 0.14126379
[8,] 0.8295524 0.34089529 0.17044765
[9,] 0.8264505 0.34709910 0.17354955
[10,] 0.7801269 0.43974626 0.21987313
[11,] 0.7224752 0.55504951 0.27752476
[12,] 0.7077740 0.58445209 0.29222604
[13,] 0.6426485 0.71470290 0.35735145
[14,] 0.5920876 0.81582475 0.40791237
[15,] 0.6398064 0.72038715 0.36019357
[16,] 0.5938158 0.81236835 0.40618418
[17,] 0.5555015 0.88899702 0.44449851
[18,] 0.4895553 0.97911051 0.51044474
[19,] 0.4467575 0.89351496 0.55324252
[20,] 0.5602980 0.87940399 0.43970200
[21,] 0.4981496 0.99629913 0.50185044
[22,] 0.4769166 0.95383328 0.52308336
[23,] 0.5054169 0.98916616 0.49458308
[24,] 0.4609340 0.92186791 0.53906605
[25,] 0.6069787 0.78604256 0.39302128
[26,] 0.5510211 0.89795779 0.44897890
[27,] 0.5072860 0.98542797 0.49271398
[28,] 0.5477333 0.90453334 0.45226667
[29,] 0.4977464 0.99549280 0.50225360
[30,] 0.4529310 0.90586208 0.54706896
[31,] 0.4131008 0.82620165 0.58689917
[32,] 0.3958978 0.79179564 0.60410218
[33,] 0.3995754 0.79915072 0.60042464
[34,] 0.3894702 0.77894037 0.61052981
[35,] 0.3494414 0.69888288 0.65055856
[36,] 0.3012964 0.60259276 0.69870362
[37,] 0.2808591 0.56171830 0.71914085
[38,] 0.2643572 0.52871450 0.73564275
[39,] 0.2230007 0.44600148 0.77699926
[40,] 0.2007974 0.40159478 0.79920261
[41,] 0.1775758 0.35515150 0.82242425
[42,] 0.1816391 0.36327823 0.81836089
[43,] 0.1708900 0.34177995 0.82911002
[44,] 0.2016125 0.40322503 0.79838749
[45,] 0.3409381 0.68187628 0.65906186
[46,] 0.3458395 0.69167907 0.65416046
[47,] 0.3132787 0.62655748 0.68672126
[48,] 0.2721454 0.54429083 0.72785458
[49,] 0.3209729 0.64194583 0.67902709
[50,] 0.4365371 0.87307428 0.56346286
[51,] 0.4123740 0.82474795 0.58762603
[52,] 0.3702471 0.74049412 0.62975294
[53,] 0.4292622 0.85852435 0.57073783
[54,] 0.4965970 0.99319406 0.50340297
[55,] 0.4551552 0.91031038 0.54484481
[56,] 0.4536535 0.90730694 0.54634653
[57,] 0.4647988 0.92959766 0.53520117
[58,] 0.6379540 0.72409193 0.36204596
[59,] 0.5944566 0.81108680 0.40554340
[60,] 0.6019696 0.79606089 0.39803044
[61,] 0.6253038 0.74939250 0.37469625
[62,] 0.6166775 0.76664492 0.38332246
[63,] 0.5752200 0.84956000 0.42478000
[64,] 0.5359650 0.92806993 0.46403496
[65,] 0.5402191 0.91956173 0.45978086
[66,] 0.7123267 0.57534657 0.28767328
[67,] 0.6782809 0.64343819 0.32171909
[68,] 0.6517041 0.69659172 0.34829586
[69,] 0.6861484 0.62770316 0.31385158
[70,] 0.6475270 0.70494597 0.35247299
[71,] 0.6313411 0.73731777 0.36865888
[72,] 0.6404937 0.71901251 0.35950626
[73,] 0.6247251 0.75054988 0.37527494
[74,] 0.6217204 0.75655913 0.37827956
[75,] 0.6297874 0.74042526 0.37021263
[76,] 0.5896127 0.82077454 0.41038727
[77,] 0.5783325 0.84333505 0.42166752
[78,] 0.5528462 0.89430766 0.44715383
[79,] 0.5846819 0.83063610 0.41531805
[80,] 0.6619898 0.67602042 0.33801021
[81,] 0.6431300 0.71373995 0.35686998
[82,] 0.6765965 0.64680700 0.32340350
[83,] 0.6421490 0.71570208 0.35785104
[84,] 0.6320379 0.73592417 0.36796208
[85,] 0.5889857 0.82202862 0.41101431
[86,] 0.5597639 0.88047220 0.44023610
[87,] 0.6283207 0.74335868 0.37167934
[88,] 0.5892427 0.82151451 0.41075725
[89,] 0.5602300 0.87953995 0.43976998
[90,] 0.5885928 0.82281438 0.41140719
[91,] 0.5644802 0.87103963 0.43551982
[92,] 0.5411151 0.91776979 0.45888489
[93,] 0.5128169 0.97436617 0.48718308
[94,] 0.4666936 0.93338718 0.53330641
[95,] 0.4578511 0.91570222 0.54214889
[96,] 0.4184974 0.83699474 0.58150263
[97,] 0.3913584 0.78271678 0.60864161
[98,] 0.3522498 0.70449956 0.64775022
[99,] 0.3160774 0.63215480 0.68392260
[100,] 0.3329680 0.66593597 0.66703201
[101,] 0.2954233 0.59084654 0.70457673
[102,] 0.2601321 0.52026420 0.73986790
[103,] 0.3018330 0.60366599 0.69816700
[104,] 0.3054517 0.61090336 0.69454832
[105,] 0.3038825 0.60776490 0.69611755
[106,] 0.2623730 0.52474609 0.73762696
[107,] 0.2459790 0.49195795 0.75402102
[108,] 0.3070745 0.61414904 0.69292548
[109,] 0.3618770 0.72375410 0.63812295
[110,] 0.3955807 0.79116144 0.60441928
[111,] 0.3654591 0.73091828 0.63454086
[112,] 0.3173203 0.63464055 0.68267973
[113,] 0.2755958 0.55119167 0.72440417
[114,] 0.3114547 0.62290935 0.68854533
[115,] 0.3286030 0.65720599 0.67139700
[116,] 0.3035809 0.60716181 0.69641910
[117,] 0.2690815 0.53816303 0.73091849
[118,] 0.2557350 0.51147007 0.74426497
[119,] 0.2138222 0.42764448 0.78617776
[120,] 0.2070437 0.41408746 0.79295627
[121,] 0.1814811 0.36296224 0.81851888
[122,] 0.1789741 0.35794820 0.82102590
[123,] 0.2145799 0.42915971 0.78542015
[124,] 0.1974873 0.39497453 0.80251273
[125,] 0.1821290 0.36425796 0.81787102
[126,] 0.1450456 0.29009127 0.85495437
[127,] 0.1143023 0.22860467 0.88569766
[128,] 0.2238821 0.44776418 0.77611791
[129,] 0.1806415 0.36128299 0.81935851
[130,] 0.1545192 0.30903835 0.84548083
[131,] 0.2119827 0.42396549 0.78801726
[132,] 0.2192779 0.43855579 0.78072210
[133,] 0.3261546 0.65230923 0.67384539
[134,] 0.2873880 0.57477607 0.71261196
[135,] 0.2407500 0.48150001 0.75925000
[136,] 0.4840650 0.96812993 0.51593503
[137,] 0.4369926 0.87398522 0.56300739
[138,] 0.3674987 0.73499747 0.63250126
[139,] 0.6584122 0.68317555 0.34158777
[140,] 0.6658021 0.66839571 0.33419785
[141,] 0.5903097 0.81938056 0.40969028
[142,] 0.6035256 0.79294878 0.39647439
[143,] 0.5717044 0.85659111 0.42829555
[144,] 0.4941028 0.98820568 0.50589716
[145,] 0.3749922 0.74998445 0.62500777
[146,] 0.2586099 0.51721979 0.74139011
[147,] 0.5419511 0.91609775 0.45804888
> postscript(file="/var/www/html/freestat/rcomp/tmp/14g3z1290455807.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> plot(x[,1], type='l', main='Actuals and Interpolation', ylab='value of Actuals and Interpolation (dots)', xlab='time or index')
> points(x[,1]-mysum$resid)
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/freestat/rcomp/tmp/24g3z1290455807.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> plot(mysum$resid, type='b', pch=19, main='Residuals', ylab='value of Residuals', xlab='time or index')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/freestat/rcomp/tmp/3fp2k1290455807.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> hist(mysum$resid, main='Residual Histogram', xlab='values of Residuals')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/freestat/rcomp/tmp/4fp2k1290455807.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> densityplot(~mysum$resid,col='black',main='Residual Density Plot', xlab='values of Residuals')
> dev.off()
null device
1
> postscript(file="/var/www/html/freestat/rcomp/tmp/5fp2k1290455807.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> qqnorm(mysum$resid, main='Residual Normal Q-Q Plot')
> qqline(mysum$resid)
> grid()
> dev.off()
null device
1
> (myerror <- as.ts(mysum$resid))
Time Series:
Start = 1
End = 164
Frequency = 1
1 2 3 4 5 6
3.82112403 0.07363233 -0.78414485 2.50868190 -1.21943733 -0.86870429
7 8 9 10 11 12
-2.44266186 -1.76885994 0.80356866 -3.26719251 2.13691445 -2.00695325
13 14 15 16 17 18
-1.51428175 -1.58707269 -2.28453742 -1.20209241 -1.52040129 -2.31453155
19 20 21 22 23 24
-1.71215116 -1.59116246 -0.98757857 -1.90517589 -2.28858486 -1.45179688
25 26 27 28 29 30
-1.22748987 -0.90356225 0.50872424 2.08318260 -0.66538560 0.71900922
31 32 33 34 35 36
1.25860962 -1.90579171 1.71743791 -0.28449509 0.69208279 2.42131863
37 38 39 40 41 42
0.45237716 1.21734179 -0.83284342 -1.23369407 1.14500932 -1.65919337
43 44 45 46 47 48
-1.20675567 -0.46789598 1.00630190 -2.07593744 -0.06172902 1.34089129
49 50 51 52 53 54
-1.15950128 -2.44650362 0.33427695 2.13538547 2.46948006 1.54590230
55 56 57 58 59 60
0.52239552 -0.43299569 2.49922140 3.36022364 1.15067039 -0.71974524
61 62 63 64 65 66
2.63776548 2.40321880 0.16285503 1.79593225 -2.03425947 3.43569128
67 68 69 70 71 72
-0.15945895 -1.98403193 -2.18676516 1.45725309 -0.52485887 0.40429530
73 74 75 76 77 78
1.86801061 4.00271292 -0.78761791 1.09482411 2.47959871 0.53619379
79 80 81 82 83 84
-1.34497427 1.88126575 1.42825456 -1.63977636 1.99296208 -0.46207888
85 86 87 88 89 90
1.51222854 1.06012440 -2.23719838 2.74235865 -1.28449509 -2.29416127
91 92 93 94 95 96
-0.59905165 -1.43299569 -0.22753220 1.21172305 2.78217631 -0.51457687
97 98 99 100 101 102
0.87362935 2.00560142 -1.22976165 1.34663104 -1.08874012 -0.21377626
103 104 105 106 107 108
1.69608789 -0.79451151 -1.20411008 -0.65357463 -0.78211508 2.02567658
109 110 111 112 113 114
-0.73730061 -0.76835914 -2.10399378 -2.06122823 -1.98757857 0.29759968
115 116 117 118 119 120
-1.56426638 -2.61094728 -2.65353230 2.28025476 1.46997487 -0.22976165
121 122 123 124 125 126
-0.50098427 2.21920210 -1.41391745 -1.49127576 -0.25347889 -1.71003673
127 128 129 130 131 132
0.46200101 -1.80148977 -1.19031180 -1.57174544 2.34646770 -1.22348476
133 134 135 136 137 138
-1.28804173 -0.05136148 0.42825456 3.16777329 0.79381782 1.60777135
139 140 141 142 143 144
2.41850372 -2.69686624 3.05834742 -1.04012621 -1.27482892 3.63780781
145 146 147 148 149 150
-1.21377626 -1.38458014 2.71550491 -2.40817171 -1.28449509 -0.62201531
151 152 153 154 155 156
-0.02455096 1.66118760 0.64535956 2.05202731 0.25112924 -2.54559307
157 158 159 160 161 162
-0.07498417 -1.34690727 -0.65915104 3.57378200 -0.54411764 1.06376558
163 164
2.19189589 -1.08874012
> postscript(file="/var/www/html/freestat/rcomp/tmp/6py151290455807.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> dum <- cbind(lag(myerror,k=1),myerror)
> dum
Time Series:
Start = 0
End = 164
Frequency = 1
lag(myerror, k = 1) myerror
0 3.82112403 NA
1 0.07363233 3.82112403
2 -0.78414485 0.07363233
3 2.50868190 -0.78414485
4 -1.21943733 2.50868190
5 -0.86870429 -1.21943733
6 -2.44266186 -0.86870429
7 -1.76885994 -2.44266186
8 0.80356866 -1.76885994
9 -3.26719251 0.80356866
10 2.13691445 -3.26719251
11 -2.00695325 2.13691445
12 -1.51428175 -2.00695325
13 -1.58707269 -1.51428175
14 -2.28453742 -1.58707269
15 -1.20209241 -2.28453742
16 -1.52040129 -1.20209241
17 -2.31453155 -1.52040129
18 -1.71215116 -2.31453155
19 -1.59116246 -1.71215116
20 -0.98757857 -1.59116246
21 -1.90517589 -0.98757857
22 -2.28858486 -1.90517589
23 -1.45179688 -2.28858486
24 -1.22748987 -1.45179688
25 -0.90356225 -1.22748987
26 0.50872424 -0.90356225
27 2.08318260 0.50872424
28 -0.66538560 2.08318260
29 0.71900922 -0.66538560
30 1.25860962 0.71900922
31 -1.90579171 1.25860962
32 1.71743791 -1.90579171
33 -0.28449509 1.71743791
34 0.69208279 -0.28449509
35 2.42131863 0.69208279
36 0.45237716 2.42131863
37 1.21734179 0.45237716
38 -0.83284342 1.21734179
39 -1.23369407 -0.83284342
40 1.14500932 -1.23369407
41 -1.65919337 1.14500932
42 -1.20675567 -1.65919337
43 -0.46789598 -1.20675567
44 1.00630190 -0.46789598
45 -2.07593744 1.00630190
46 -0.06172902 -2.07593744
47 1.34089129 -0.06172902
48 -1.15950128 1.34089129
49 -2.44650362 -1.15950128
50 0.33427695 -2.44650362
51 2.13538547 0.33427695
52 2.46948006 2.13538547
53 1.54590230 2.46948006
54 0.52239552 1.54590230
55 -0.43299569 0.52239552
56 2.49922140 -0.43299569
57 3.36022364 2.49922140
58 1.15067039 3.36022364
59 -0.71974524 1.15067039
60 2.63776548 -0.71974524
61 2.40321880 2.63776548
62 0.16285503 2.40321880
63 1.79593225 0.16285503
64 -2.03425947 1.79593225
65 3.43569128 -2.03425947
66 -0.15945895 3.43569128
67 -1.98403193 -0.15945895
68 -2.18676516 -1.98403193
69 1.45725309 -2.18676516
70 -0.52485887 1.45725309
71 0.40429530 -0.52485887
72 1.86801061 0.40429530
73 4.00271292 1.86801061
74 -0.78761791 4.00271292
75 1.09482411 -0.78761791
76 2.47959871 1.09482411
77 0.53619379 2.47959871
78 -1.34497427 0.53619379
79 1.88126575 -1.34497427
80 1.42825456 1.88126575
81 -1.63977636 1.42825456
82 1.99296208 -1.63977636
83 -0.46207888 1.99296208
84 1.51222854 -0.46207888
85 1.06012440 1.51222854
86 -2.23719838 1.06012440
87 2.74235865 -2.23719838
88 -1.28449509 2.74235865
89 -2.29416127 -1.28449509
90 -0.59905165 -2.29416127
91 -1.43299569 -0.59905165
92 -0.22753220 -1.43299569
93 1.21172305 -0.22753220
94 2.78217631 1.21172305
95 -0.51457687 2.78217631
96 0.87362935 -0.51457687
97 2.00560142 0.87362935
98 -1.22976165 2.00560142
99 1.34663104 -1.22976165
100 -1.08874012 1.34663104
101 -0.21377626 -1.08874012
102 1.69608789 -0.21377626
103 -0.79451151 1.69608789
104 -1.20411008 -0.79451151
105 -0.65357463 -1.20411008
106 -0.78211508 -0.65357463
107 2.02567658 -0.78211508
108 -0.73730061 2.02567658
109 -0.76835914 -0.73730061
110 -2.10399378 -0.76835914
111 -2.06122823 -2.10399378
112 -1.98757857 -2.06122823
113 0.29759968 -1.98757857
114 -1.56426638 0.29759968
115 -2.61094728 -1.56426638
116 -2.65353230 -2.61094728
117 2.28025476 -2.65353230
118 1.46997487 2.28025476
119 -0.22976165 1.46997487
120 -0.50098427 -0.22976165
121 2.21920210 -0.50098427
122 -1.41391745 2.21920210
123 -1.49127576 -1.41391745
124 -0.25347889 -1.49127576
125 -1.71003673 -0.25347889
126 0.46200101 -1.71003673
127 -1.80148977 0.46200101
128 -1.19031180 -1.80148977
129 -1.57174544 -1.19031180
130 2.34646770 -1.57174544
131 -1.22348476 2.34646770
132 -1.28804173 -1.22348476
133 -0.05136148 -1.28804173
134 0.42825456 -0.05136148
135 3.16777329 0.42825456
136 0.79381782 3.16777329
137 1.60777135 0.79381782
138 2.41850372 1.60777135
139 -2.69686624 2.41850372
140 3.05834742 -2.69686624
141 -1.04012621 3.05834742
142 -1.27482892 -1.04012621
143 3.63780781 -1.27482892
144 -1.21377626 3.63780781
145 -1.38458014 -1.21377626
146 2.71550491 -1.38458014
147 -2.40817171 2.71550491
148 -1.28449509 -2.40817171
149 -0.62201531 -1.28449509
150 -0.02455096 -0.62201531
151 1.66118760 -0.02455096
152 0.64535956 1.66118760
153 2.05202731 0.64535956
154 0.25112924 2.05202731
155 -2.54559307 0.25112924
156 -0.07498417 -2.54559307
157 -1.34690727 -0.07498417
158 -0.65915104 -1.34690727
159 3.57378200 -0.65915104
160 -0.54411764 3.57378200
161 1.06376558 -0.54411764
162 2.19189589 1.06376558
163 -1.08874012 2.19189589
164 NA -1.08874012
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 0.07363233 3.82112403
[2,] -0.78414485 0.07363233
[3,] 2.50868190 -0.78414485
[4,] -1.21943733 2.50868190
[5,] -0.86870429 -1.21943733
[6,] -2.44266186 -0.86870429
[7,] -1.76885994 -2.44266186
[8,] 0.80356866 -1.76885994
[9,] -3.26719251 0.80356866
[10,] 2.13691445 -3.26719251
[11,] -2.00695325 2.13691445
[12,] -1.51428175 -2.00695325
[13,] -1.58707269 -1.51428175
[14,] -2.28453742 -1.58707269
[15,] -1.20209241 -2.28453742
[16,] -1.52040129 -1.20209241
[17,] -2.31453155 -1.52040129
[18,] -1.71215116 -2.31453155
[19,] -1.59116246 -1.71215116
[20,] -0.98757857 -1.59116246
[21,] -1.90517589 -0.98757857
[22,] -2.28858486 -1.90517589
[23,] -1.45179688 -2.28858486
[24,] -1.22748987 -1.45179688
[25,] -0.90356225 -1.22748987
[26,] 0.50872424 -0.90356225
[27,] 2.08318260 0.50872424
[28,] -0.66538560 2.08318260
[29,] 0.71900922 -0.66538560
[30,] 1.25860962 0.71900922
[31,] -1.90579171 1.25860962
[32,] 1.71743791 -1.90579171
[33,] -0.28449509 1.71743791
[34,] 0.69208279 -0.28449509
[35,] 2.42131863 0.69208279
[36,] 0.45237716 2.42131863
[37,] 1.21734179 0.45237716
[38,] -0.83284342 1.21734179
[39,] -1.23369407 -0.83284342
[40,] 1.14500932 -1.23369407
[41,] -1.65919337 1.14500932
[42,] -1.20675567 -1.65919337
[43,] -0.46789598 -1.20675567
[44,] 1.00630190 -0.46789598
[45,] -2.07593744 1.00630190
[46,] -0.06172902 -2.07593744
[47,] 1.34089129 -0.06172902
[48,] -1.15950128 1.34089129
[49,] -2.44650362 -1.15950128
[50,] 0.33427695 -2.44650362
[51,] 2.13538547 0.33427695
[52,] 2.46948006 2.13538547
[53,] 1.54590230 2.46948006
[54,] 0.52239552 1.54590230
[55,] -0.43299569 0.52239552
[56,] 2.49922140 -0.43299569
[57,] 3.36022364 2.49922140
[58,] 1.15067039 3.36022364
[59,] -0.71974524 1.15067039
[60,] 2.63776548 -0.71974524
[61,] 2.40321880 2.63776548
[62,] 0.16285503 2.40321880
[63,] 1.79593225 0.16285503
[64,] -2.03425947 1.79593225
[65,] 3.43569128 -2.03425947
[66,] -0.15945895 3.43569128
[67,] -1.98403193 -0.15945895
[68,] -2.18676516 -1.98403193
[69,] 1.45725309 -2.18676516
[70,] -0.52485887 1.45725309
[71,] 0.40429530 -0.52485887
[72,] 1.86801061 0.40429530
[73,] 4.00271292 1.86801061
[74,] -0.78761791 4.00271292
[75,] 1.09482411 -0.78761791
[76,] 2.47959871 1.09482411
[77,] 0.53619379 2.47959871
[78,] -1.34497427 0.53619379
[79,] 1.88126575 -1.34497427
[80,] 1.42825456 1.88126575
[81,] -1.63977636 1.42825456
[82,] 1.99296208 -1.63977636
[83,] -0.46207888 1.99296208
[84,] 1.51222854 -0.46207888
[85,] 1.06012440 1.51222854
[86,] -2.23719838 1.06012440
[87,] 2.74235865 -2.23719838
[88,] -1.28449509 2.74235865
[89,] -2.29416127 -1.28449509
[90,] -0.59905165 -2.29416127
[91,] -1.43299569 -0.59905165
[92,] -0.22753220 -1.43299569
[93,] 1.21172305 -0.22753220
[94,] 2.78217631 1.21172305
[95,] -0.51457687 2.78217631
[96,] 0.87362935 -0.51457687
[97,] 2.00560142 0.87362935
[98,] -1.22976165 2.00560142
[99,] 1.34663104 -1.22976165
[100,] -1.08874012 1.34663104
[101,] -0.21377626 -1.08874012
[102,] 1.69608789 -0.21377626
[103,] -0.79451151 1.69608789
[104,] -1.20411008 -0.79451151
[105,] -0.65357463 -1.20411008
[106,] -0.78211508 -0.65357463
[107,] 2.02567658 -0.78211508
[108,] -0.73730061 2.02567658
[109,] -0.76835914 -0.73730061
[110,] -2.10399378 -0.76835914
[111,] -2.06122823 -2.10399378
[112,] -1.98757857 -2.06122823
[113,] 0.29759968 -1.98757857
[114,] -1.56426638 0.29759968
[115,] -2.61094728 -1.56426638
[116,] -2.65353230 -2.61094728
[117,] 2.28025476 -2.65353230
[118,] 1.46997487 2.28025476
[119,] -0.22976165 1.46997487
[120,] -0.50098427 -0.22976165
[121,] 2.21920210 -0.50098427
[122,] -1.41391745 2.21920210
[123,] -1.49127576 -1.41391745
[124,] -0.25347889 -1.49127576
[125,] -1.71003673 -0.25347889
[126,] 0.46200101 -1.71003673
[127,] -1.80148977 0.46200101
[128,] -1.19031180 -1.80148977
[129,] -1.57174544 -1.19031180
[130,] 2.34646770 -1.57174544
[131,] -1.22348476 2.34646770
[132,] -1.28804173 -1.22348476
[133,] -0.05136148 -1.28804173
[134,] 0.42825456 -0.05136148
[135,] 3.16777329 0.42825456
[136,] 0.79381782 3.16777329
[137,] 1.60777135 0.79381782
[138,] 2.41850372 1.60777135
[139,] -2.69686624 2.41850372
[140,] 3.05834742 -2.69686624
[141,] -1.04012621 3.05834742
[142,] -1.27482892 -1.04012621
[143,] 3.63780781 -1.27482892
[144,] -1.21377626 3.63780781
[145,] -1.38458014 -1.21377626
[146,] 2.71550491 -1.38458014
[147,] -2.40817171 2.71550491
[148,] -1.28449509 -2.40817171
[149,] -0.62201531 -1.28449509
[150,] -0.02455096 -0.62201531
[151,] 1.66118760 -0.02455096
[152,] 0.64535956 1.66118760
[153,] 2.05202731 0.64535956
[154,] 0.25112924 2.05202731
[155,] -2.54559307 0.25112924
[156,] -0.07498417 -2.54559307
[157,] -1.34690727 -0.07498417
[158,] -0.65915104 -1.34690727
[159,] 3.57378200 -0.65915104
[160,] -0.54411764 3.57378200
[161,] 1.06376558 -0.54411764
[162,] 2.19189589 1.06376558
[163,] -1.08874012 2.19189589
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 0.07363233 3.82112403
2 -0.78414485 0.07363233
3 2.50868190 -0.78414485
4 -1.21943733 2.50868190
5 -0.86870429 -1.21943733
6 -2.44266186 -0.86870429
7 -1.76885994 -2.44266186
8 0.80356866 -1.76885994
9 -3.26719251 0.80356866
10 2.13691445 -3.26719251
11 -2.00695325 2.13691445
12 -1.51428175 -2.00695325
13 -1.58707269 -1.51428175
14 -2.28453742 -1.58707269
15 -1.20209241 -2.28453742
16 -1.52040129 -1.20209241
17 -2.31453155 -1.52040129
18 -1.71215116 -2.31453155
19 -1.59116246 -1.71215116
20 -0.98757857 -1.59116246
21 -1.90517589 -0.98757857
22 -2.28858486 -1.90517589
23 -1.45179688 -2.28858486
24 -1.22748987 -1.45179688
25 -0.90356225 -1.22748987
26 0.50872424 -0.90356225
27 2.08318260 0.50872424
28 -0.66538560 2.08318260
29 0.71900922 -0.66538560
30 1.25860962 0.71900922
31 -1.90579171 1.25860962
32 1.71743791 -1.90579171
33 -0.28449509 1.71743791
34 0.69208279 -0.28449509
35 2.42131863 0.69208279
36 0.45237716 2.42131863
37 1.21734179 0.45237716
38 -0.83284342 1.21734179
39 -1.23369407 -0.83284342
40 1.14500932 -1.23369407
41 -1.65919337 1.14500932
42 -1.20675567 -1.65919337
43 -0.46789598 -1.20675567
44 1.00630190 -0.46789598
45 -2.07593744 1.00630190
46 -0.06172902 -2.07593744
47 1.34089129 -0.06172902
48 -1.15950128 1.34089129
49 -2.44650362 -1.15950128
50 0.33427695 -2.44650362
51 2.13538547 0.33427695
52 2.46948006 2.13538547
53 1.54590230 2.46948006
54 0.52239552 1.54590230
55 -0.43299569 0.52239552
56 2.49922140 -0.43299569
57 3.36022364 2.49922140
58 1.15067039 3.36022364
59 -0.71974524 1.15067039
60 2.63776548 -0.71974524
61 2.40321880 2.63776548
62 0.16285503 2.40321880
63 1.79593225 0.16285503
64 -2.03425947 1.79593225
65 3.43569128 -2.03425947
66 -0.15945895 3.43569128
67 -1.98403193 -0.15945895
68 -2.18676516 -1.98403193
69 1.45725309 -2.18676516
70 -0.52485887 1.45725309
71 0.40429530 -0.52485887
72 1.86801061 0.40429530
73 4.00271292 1.86801061
74 -0.78761791 4.00271292
75 1.09482411 -0.78761791
76 2.47959871 1.09482411
77 0.53619379 2.47959871
78 -1.34497427 0.53619379
79 1.88126575 -1.34497427
80 1.42825456 1.88126575
81 -1.63977636 1.42825456
82 1.99296208 -1.63977636
83 -0.46207888 1.99296208
84 1.51222854 -0.46207888
85 1.06012440 1.51222854
86 -2.23719838 1.06012440
87 2.74235865 -2.23719838
88 -1.28449509 2.74235865
89 -2.29416127 -1.28449509
90 -0.59905165 -2.29416127
91 -1.43299569 -0.59905165
92 -0.22753220 -1.43299569
93 1.21172305 -0.22753220
94 2.78217631 1.21172305
95 -0.51457687 2.78217631
96 0.87362935 -0.51457687
97 2.00560142 0.87362935
98 -1.22976165 2.00560142
99 1.34663104 -1.22976165
100 -1.08874012 1.34663104
101 -0.21377626 -1.08874012
102 1.69608789 -0.21377626
103 -0.79451151 1.69608789
104 -1.20411008 -0.79451151
105 -0.65357463 -1.20411008
106 -0.78211508 -0.65357463
107 2.02567658 -0.78211508
108 -0.73730061 2.02567658
109 -0.76835914 -0.73730061
110 -2.10399378 -0.76835914
111 -2.06122823 -2.10399378
112 -1.98757857 -2.06122823
113 0.29759968 -1.98757857
114 -1.56426638 0.29759968
115 -2.61094728 -1.56426638
116 -2.65353230 -2.61094728
117 2.28025476 -2.65353230
118 1.46997487 2.28025476
119 -0.22976165 1.46997487
120 -0.50098427 -0.22976165
121 2.21920210 -0.50098427
122 -1.41391745 2.21920210
123 -1.49127576 -1.41391745
124 -0.25347889 -1.49127576
125 -1.71003673 -0.25347889
126 0.46200101 -1.71003673
127 -1.80148977 0.46200101
128 -1.19031180 -1.80148977
129 -1.57174544 -1.19031180
130 2.34646770 -1.57174544
131 -1.22348476 2.34646770
132 -1.28804173 -1.22348476
133 -0.05136148 -1.28804173
134 0.42825456 -0.05136148
135 3.16777329 0.42825456
136 0.79381782 3.16777329
137 1.60777135 0.79381782
138 2.41850372 1.60777135
139 -2.69686624 2.41850372
140 3.05834742 -2.69686624
141 -1.04012621 3.05834742
142 -1.27482892 -1.04012621
143 3.63780781 -1.27482892
144 -1.21377626 3.63780781
145 -1.38458014 -1.21377626
146 2.71550491 -1.38458014
147 -2.40817171 2.71550491
148 -1.28449509 -2.40817171
149 -0.62201531 -1.28449509
150 -0.02455096 -0.62201531
151 1.66118760 -0.02455096
152 0.64535956 1.66118760
153 2.05202731 0.64535956
154 0.25112924 2.05202731
155 -2.54559307 0.25112924
156 -0.07498417 -2.54559307
157 -1.34690727 -0.07498417
158 -0.65915104 -1.34690727
159 3.57378200 -0.65915104
160 -0.54411764 3.57378200
161 1.06376558 -0.54411764
162 2.19189589 1.06376558
163 -1.08874012 2.19189589
> 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/70qi81290455807.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> acf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Autocorrelation Function')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/freestat/rcomp/tmp/80qi81290455807.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> pacf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Partial Autocorrelation Function')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/freestat/rcomp/tmp/90qi81290455807.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> opar <- par(mfrow = c(2,2), oma = c(0, 0, 1.1, 0))
> plot(mylm, las = 1, sub='Residual Diagnostics')
> par(opar)
> dev.off()
null device
1
> if (n > n25) {
+ postscript(file="/var/www/html/freestat/rcomp/tmp/10tz0t1290455807.ps",horizontal=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
+ plot(kp3:nmkm3,gqarr[,2], main='Goldfeld-Quandt test',ylab='2-sided p-value',xlab='breakpoint')
+ grid()
+ dev.off()
+ }
null device
1
>
> #Note: the /var/www/html/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/11wzyy1290455807.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/120ixn1290455807.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/13escd1290455807.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/14zstj1290455807.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/152t9p1290455807.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/166tqd1290455807.tab")
+ }
> try(system("convert tmp/14g3z1290455807.ps tmp/14g3z1290455807.png",intern=TRUE))
character(0)
> try(system("convert tmp/24g3z1290455807.ps tmp/24g3z1290455807.png",intern=TRUE))
character(0)
> try(system("convert tmp/3fp2k1290455807.ps tmp/3fp2k1290455807.png",intern=TRUE))
character(0)
> try(system("convert tmp/4fp2k1290455807.ps tmp/4fp2k1290455807.png",intern=TRUE))
character(0)
> try(system("convert tmp/5fp2k1290455807.ps tmp/5fp2k1290455807.png",intern=TRUE))
character(0)
> try(system("convert tmp/6py151290455807.ps tmp/6py151290455807.png",intern=TRUE))
character(0)
> try(system("convert tmp/70qi81290455807.ps tmp/70qi81290455807.png",intern=TRUE))
character(0)
> try(system("convert tmp/80qi81290455807.ps tmp/80qi81290455807.png",intern=TRUE))
character(0)
> try(system("convert tmp/90qi81290455807.ps tmp/90qi81290455807.png",intern=TRUE))
character(0)
> try(system("convert tmp/10tz0t1290455807.ps tmp/10tz0t1290455807.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
5.904 2.715 10.712