R version 2.9.0 (2009-04-17)
Copyright (C) 2009 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> x <- array(list(1
+ ,15
+ ,15
+ ,13
+ ,6
+ ,2
+ ,9
+ ,12
+ ,11
+ ,4
+ ,2
+ ,12
+ ,15
+ ,14
+ ,6
+ ,2
+ ,15
+ ,12
+ ,12
+ ,5
+ ,2
+ ,17
+ ,14
+ ,12
+ ,5
+ ,2
+ ,14
+ ,8
+ ,6
+ ,4
+ ,1
+ ,9
+ ,11
+ ,10
+ ,5
+ ,1
+ ,12
+ ,15
+ ,11
+ ,3
+ ,2
+ ,11
+ ,4
+ ,10
+ ,2
+ ,2
+ ,13
+ ,13
+ ,12
+ ,5
+ ,1
+ ,16
+ ,19
+ ,15
+ ,6
+ ,1
+ ,16
+ ,10
+ ,13
+ ,6
+ ,1
+ ,15
+ ,15
+ ,18
+ ,8
+ ,2
+ ,10
+ ,6
+ ,11
+ ,6
+ ,1
+ ,16
+ ,7
+ ,12
+ ,3
+ ,2
+ ,12
+ ,14
+ ,13
+ ,6
+ ,2
+ ,15
+ ,16
+ ,14
+ ,6
+ ,1
+ ,13
+ ,16
+ ,16
+ ,7
+ ,1
+ ,18
+ ,14
+ ,16
+ ,8
+ ,2
+ ,13
+ ,15
+ ,16
+ ,6
+ ,1
+ ,17
+ ,14
+ ,15
+ ,7
+ ,1
+ ,14
+ ,12
+ ,13
+ ,4
+ ,2
+ ,13
+ ,9
+ ,8
+ ,4
+ ,1
+ ,13
+ ,12
+ ,14
+ ,2
+ ,1
+ ,15
+ ,14
+ ,15
+ ,6
+ ,1
+ ,13
+ ,12
+ ,13
+ ,6
+ ,1
+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(c('Gender','Happiness','Popularity','Liked','Celebrity'),1:159))
> 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 = '3'
> #'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
Popularity Gender Happiness Liked Celebrity
1 15 1 15 13 6
2 12 2 9 11 4
3 15 2 12 14 6
4 12 2 15 12 5
5 14 2 17 12 5
6 8 2 14 6 4
7 11 1 9 10 5
8 15 1 12 11 3
9 4 2 11 10 2
10 13 2 13 12 5
11 19 1 16 15 6
12 10 1 16 13 6
13 15 1 15 18 8
14 6 2 10 11 6
15 7 1 16 12 3
16 14 2 12 13 6
17 16 2 15 14 6
18 16 1 13 16 7
19 14 1 18 16 8
20 15 2 13 16 6
21 14 1 17 15 7
22 12 1 14 13 4
23 9 2 13 8 4
24 12 1 13 14 2
25 14 1 15 15 6
26 12 1 13 13 6
27 14 1 15 16 6
28 10 1 13 13 6
29 14 1 14 12 6
30 16 1 13 15 7
31 10 1 16 11 4
32 8 1 14 14 3
33 8 2 12 14 3
34 12 1 18 13 5
35 11 1 15 13 6
36 8 2 9 12 4
37 13 2 16 14 6
38 11 1 16 13 3
39 12 2 17 12 3
40 16 2 13 14 6
41 16 1 17 15 6
42 13 1 15 16 6
43 14 1 14 15 8
44 5 2 10 5 2
45 14 2 13 15 6
46 13 1 11 8 4
47 16 1 11 16 7
48 15 2 16 14 6
49 15 2 16 14 6
50 15 1 11 16 6
51 11 1 15 14 5
52 15 1 15 13 6
53 16 1 12 14 6
54 13 1 17 14 5
55 11 2 15 12 6
56 12 2 16 13 7
57 12 1 14 15 5
58 10 1 17 15 6
59 8 1 10 13 6
60 9 2 11 10 4
61 12 1 15 13 5
62 14 2 15 14 6
63 12 1 7 13 6
64 11 2 17 13 4
65 14 2 14 18 6
66 7 2 18 12 4
67 16 2 14 14 7
68 16 1 12 16 8
69 11 2 14 13 6
70 16 1 9 16 6
71 13 1 14 15 6
72 11 1 11 14 5
73 11 1 15 14 5
74 13 1 16 13 6
75 14 1 17 12 6
76 15 1 16 16 4
77 10 2 12 9 5
78 15 1 15 15 8
79 11 2 15 16 6
80 6 1 16 11 2
81 11 1 16 13 2
82 12 2 11 13 4
83 13 2 15 14 6
84 12 1 12 15 6
85 8 2 14 14 5
86 9 1 15 12 4
87 10 1 17 16 4
88 16 1 19 14 6
89 15 1 15 13 5
90 14 2 16 12 6
91 12 1 14 13 7
92 12 1 16 12 6
93 10 1 15 9 4
94 12 1 15 13 4
95 8 2 17 10 3
96 16 1 12 15 8
97 11 1 18 9 4
98 12 1 13 13 4
99 9 1 14 13 5
100 14 2 14 13 5
101 15 2 14 15 7
102 8 2 12 13 4
103 12 1 14 14 5
104 10 2 12 11 5
105 16 1 15 15 8
106 17 1 11 14 5
107 8 2 11 15 2
108 9 1 15 12 5
109 8 1 14 15 4
110 11 2 15 14 5
111 16 1 16 16 7
112 13 2 12 14 6
113 5 1 14 12 3
114 5 1 14 12 3
115 15 1 18 11 5
116 15 1 14 13 6
117 12 1 13 12 5
118 12 2 14 12 6
119 16 1 14 16 7
120 12 1 17 13 6
121 10 1 12 12 6
122 12 1 16 14 5
123 4 1 15 4 4
124 11 2 10 14 6
125 16 2 13 15 6
126 7 2 15 12 3
127 9 1 16 11 4
128 14 2 15 12 4
129 11 1 14 11 4
130 10 1 11 12 5
131 6 2 13 11 4
132 14 1 17 13 6
133 11 1 14 12 6
134 11 1 16 12 4
135 9 2 15 15 7
136 16 1 12 14 4
137 7 2 16 12 4
138 8 2 8 12 4
139 10 2 9 12 4
140 14 1 13 13 5
141 9 1 19 11 4
142 13 1 11 13 7
143 13 2 15 12 3
144 12 2 11 14 5
145 11 2 15 15 5
146 10 2 16 15 6
147 12 1 15 13 5
148 14 1 12 16 6
149 11 2 16 17 6
150 13 2 15 13 3
151 14 2 13 14 6
152 13 1 14 13 5
153 16 1 11 16 8
154 13 1 15 13 6
155 13 1 12 13 6
156 12 1 16 14 4
157 9 1 14 13 3
158 14 1 13 14 4
159 15 1 15 16 7
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Gender Happiness Liked Celebrity
1.70905 -0.52081 0.03768 0.42649 0.93555
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-5.34890 -1.40203 0.08892 1.42283 5.86157
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 1.70905 1.69941 1.006 0.316
Gender -0.52081 0.37039 -1.406 0.162
Happiness 0.03768 0.07788 0.484 0.629
Liked 0.42649 0.09769 4.366 2.31e-05 ***
Celebrity 0.93555 0.14850 6.300 2.97e-09 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 2.222 on 154 degrees of freedom
Multiple R-squared: 0.4601, Adjusted R-squared: 0.4461
F-statistic: 32.81 on 4 and 154 DF, p-value: < 2.2e-16
> if (n > n25) {
+ kp3 <- k + 3
+ nmkm3 <- n - k - 3
+ gqarr <- array(NA, dim=c(nmkm3-kp3+1,3))
+ numgqtests <- 0
+ numsignificant1 <- 0
+ numsignificant5 <- 0
+ numsignificant10 <- 0
+ for (mypoint in kp3:nmkm3) {
+ j <- 0
+ numgqtests <- numgqtests + 1
+ for (myalt in c('greater', 'two.sided', 'less')) {
+ j <- j + 1
+ gqarr[mypoint-kp3+1,j] <- gqtest(mylm, point=mypoint, alternative=myalt)$p.value
+ }
+ if (gqarr[mypoint-kp3+1,2] < 0.01) numsignificant1 <- numsignificant1 + 1
+ if (gqarr[mypoint-kp3+1,2] < 0.05) numsignificant5 <- numsignificant5 + 1
+ if (gqarr[mypoint-kp3+1,2] < 0.10) numsignificant10 <- numsignificant10 + 1
+ }
+ gqarr
+ }
[,1] [,2] [,3]
[1,] 0.1170230 0.234045916 0.8829770421
[2,] 0.8753666 0.249266833 0.1246334164
[3,] 0.8025516 0.394896829 0.1974484147
[4,] 0.7349496 0.530100844 0.2650504222
[5,] 0.9685786 0.062842774 0.0314213870
[6,] 0.9840310 0.031937935 0.0159689673
[7,] 0.9941703 0.011659444 0.0058297220
[8,] 0.9990624 0.001875147 0.0009375737
[9,] 0.9985307 0.002938631 0.0014693153
[10,] 0.9983397 0.003320540 0.0016602698
[11,] 0.9970749 0.005850108 0.0029250538
[12,] 0.9971046 0.005790880 0.0028954401
[13,] 0.9952844 0.009431190 0.0047155951
[14,] 0.9928157 0.014368582 0.0071842908
[15,] 0.9888310 0.022338081 0.0111690407
[16,] 0.9832057 0.033588599 0.0167942997
[17,] 0.9774248 0.045150301 0.0225751505
[18,] 0.9674681 0.065063763 0.0325318814
[19,] 0.9557632 0.088473664 0.0442368322
[20,] 0.9413206 0.117358852 0.0586794260
[21,] 0.9452494 0.109501258 0.0547506292
[22,] 0.9390465 0.121906927 0.0609534637
[23,] 0.9269841 0.146031830 0.0730159149
[24,] 0.9057293 0.188541436 0.0942707182
[25,] 0.9302954 0.139409254 0.0697046270
[26,] 0.9378054 0.124389204 0.0621946021
[27,] 0.9186917 0.162616699 0.0813083493
[28,] 0.9114887 0.177022657 0.0885113287
[29,] 0.9077390 0.184522014 0.0922610071
[30,] 0.8834699 0.233060153 0.1165300765
[31,] 0.8563752 0.287249518 0.1436247590
[32,] 0.8513352 0.297329657 0.1486648284
[33,] 0.8686702 0.262659573 0.1313297865
[34,] 0.8587892 0.282421578 0.1412107888
[35,] 0.8390560 0.321887915 0.1609439577
[36,] 0.8183896 0.363220864 0.1816104321
[37,] 0.7823179 0.435364184 0.2176820919
[38,] 0.7448089 0.510382170 0.2551910849
[39,] 0.8447642 0.310471688 0.1552358440
[40,] 0.8207765 0.358446962 0.1792234812
[41,] 0.8073647 0.385270561 0.1926352803
[42,] 0.7933197 0.413360550 0.2066802749
[43,] 0.7626883 0.474623486 0.2373117431
[44,] 0.7436560 0.512688081 0.2563440406
[45,] 0.7336826 0.532634720 0.2663173599
[46,] 0.7517402 0.496519655 0.2482598274
[47,] 0.7123825 0.575234908 0.2876174539
[48,] 0.6866514 0.626697140 0.3133485699
[49,] 0.6662338 0.667532497 0.3337662486
[50,] 0.6310564 0.737887255 0.3689436274
[51,] 0.7246154 0.550769154 0.2753845768
[52,] 0.8386556 0.322688817 0.1613444086
[53,] 0.8100086 0.379982798 0.1899913992
[54,] 0.7760034 0.447993203 0.2239966015
[55,] 0.7476179 0.504764106 0.2523820530
[56,] 0.7097166 0.580566850 0.2902834249
[57,] 0.6731632 0.653673525 0.3268367627
[58,] 0.6350247 0.729950691 0.3649753454
[59,] 0.6952399 0.609520122 0.3047600608
[60,] 0.6963111 0.607377841 0.3036889207
[61,] 0.6541132 0.691773597 0.3458867986
[62,] 0.6283255 0.743348983 0.3716744915
[63,] 0.6180489 0.763902240 0.3819511200
[64,] 0.5781371 0.843725720 0.4218628598
[65,] 0.5475771 0.904845785 0.4524228926
[66,] 0.5204914 0.959017182 0.4795085909
[67,] 0.4739278 0.947855581 0.5260722096
[68,] 0.4474157 0.894831386 0.5525843069
[69,] 0.4584417 0.916883384 0.5415583078
[70,] 0.4160149 0.832029832 0.5839850841
[71,] 0.3742924 0.748584762 0.6257076191
[72,] 0.3967070 0.793413908 0.6032930458
[73,] 0.4050142 0.810028411 0.5949857946
[74,] 0.3860098 0.772019699 0.6139901506
[75,] 0.3677763 0.735552615 0.6322236925
[76,] 0.3259721 0.651944260 0.6740278701
[77,] 0.3077050 0.615410049 0.6922949753
[78,] 0.3895379 0.779075730 0.6104621348
[79,] 0.3679846 0.735969154 0.6320154230
[80,] 0.3811453 0.762290544 0.6188547282
[81,] 0.3868249 0.773649873 0.6131750636
[82,] 0.4214462 0.842892353 0.5785538235
[83,] 0.4200742 0.840148366 0.5799258169
[84,] 0.4025633 0.805126533 0.5974367334
[85,] 0.3598717 0.719743394 0.6401283030
[86,] 0.3232805 0.646560949 0.6767195256
[87,] 0.2889149 0.577829860 0.7110850699
[88,] 0.2536567 0.507313415 0.7463432927
[89,] 0.2185106 0.437021249 0.7814893753
[90,] 0.2088442 0.417688366 0.7911558169
[91,] 0.1827655 0.365530913 0.8172345437
[92,] 0.2043465 0.408693008 0.7956534962
[93,] 0.2255667 0.451133420 0.7744332898
[94,] 0.1991679 0.398335812 0.8008320940
[95,] 0.1980204 0.396040802 0.8019795989
[96,] 0.1671379 0.334275794 0.8328621031
[97,] 0.1403711 0.280742162 0.8596289189
[98,] 0.1155822 0.231164411 0.8844177946
[99,] 0.2095913 0.419182564 0.7904087181
[100,] 0.1878150 0.375629906 0.8121850469
[101,] 0.1912635 0.382526952 0.8087365242
[102,] 0.2840319 0.568063737 0.7159681316
[103,] 0.2464703 0.492940686 0.7535296571
[104,] 0.2118898 0.423779639 0.7881101803
[105,] 0.1807805 0.361561038 0.8192194812
[106,] 0.3427909 0.685581860 0.6572090702
[107,] 0.6092792 0.781441602 0.3907208011
[108,] 0.7517793 0.496441435 0.2482207177
[109,] 0.7665884 0.466823299 0.2334116496
[110,] 0.7252098 0.549580483 0.2747902416
[111,] 0.7279597 0.544080579 0.2720402893
[112,] 0.6918560 0.616288097 0.3081440483
[113,] 0.6451336 0.709732812 0.3548664058
[114,] 0.6309361 0.738127858 0.3690639292
[115,] 0.5836141 0.832771892 0.4163859459
[116,] 0.5569223 0.886155417 0.4430777086
[117,] 0.5127236 0.974552850 0.4872764251
[118,] 0.6248907 0.750218640 0.3751093198
[119,] 0.6317865 0.736427049 0.3682135245
[120,] 0.6045084 0.790983158 0.3954915789
[121,] 0.8080492 0.383901565 0.1919507824
[122,] 0.7635765 0.472846918 0.2364234590
[123,] 0.7614433 0.477113492 0.2385567458
[124,] 0.8051538 0.389692381 0.1948461907
[125,] 0.8081655 0.383669093 0.1918345465
[126,] 0.7647375 0.470525046 0.2352625228
[127,] 0.7099967 0.580006522 0.2900032612
[128,] 0.7599562 0.480087679 0.2400438396
[129,] 0.8193431 0.361313767 0.1806568833
[130,] 0.8621675 0.275665078 0.1378325391
[131,] 0.9282830 0.143433986 0.0717169929
[132,] 0.9537276 0.092544855 0.0462724275
[133,] 0.9383013 0.123397399 0.0616986996
[134,] 0.9215511 0.156897784 0.0784488918
[135,] 0.9092460 0.181507901 0.0907539507
[136,] 0.9275348 0.144930333 0.0724651665
[137,] 0.9036145 0.192770935 0.0963854674
[138,] 0.8603480 0.279303985 0.1396519926
[139,] 0.8908267 0.218346507 0.1091732533
[140,] 0.8271371 0.345725793 0.1728628967
[141,] 0.7322006 0.535598790 0.2677993948
[142,] 0.8839626 0.232074869 0.1160374347
[143,] 0.8384490 0.323101953 0.1615509765
[144,] 0.6973981 0.605203719 0.3026018597
> postscript(file="/var/www/html/rcomp/tmp/1slvx1292234768.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> plot(x[,1], type='l', main='Actuals and Interpolation', ylab='value of Actuals and Interpolation (dots)', xlab='time or index')
> points(x[,1]-mysum$resid)
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/22uci1292234768.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> plot(mysum$resid, type='b', pch=19, main='Residuals', ylab='value of Residuals', xlab='time or index')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/32uci1292234768.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> hist(mysum$resid, main='Residual Histogram', xlab='values of Residuals')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/42uci1292234768.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> densityplot(~mysum$resid,col='black',main='Residual Density Plot', xlab='values of Residuals')
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/5dlt31292234768.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 = 159
Frequency = 1
1 2 3 4 5 6
2.08891848 2.55986902 2.29626766 0.97176658 2.89641179 0.50394729
7 8 9 10 11 12
0.53000702 5.86157181 -3.21790270 2.04712137 5.19825498 -2.94875892
13 14 15 16 17 18
-1.91463680 -5.34889840 -2.71563083 1.72276071 3.18323547 0.94924911
19 20 21 22 23 24
-2.17468289 1.40560416 -0.77496743 0.99768590 0.68863858 2.47996027
25 26 27 28 29 30
0.23593238 -0.83572673 -0.19056067 -2.83572673 1.55308892 1.37574216
31 32 33 34 35 36
-0.22468279 -2.49326214 -1.89709730 -0.08856870 -1.91108152 -1.86662403
37 38 39 40 41 42
0.14555807 0.85787612 2.76750181 3.25859026 2.16057758 -1.19056067
43 44 45 46 47 48
-1.59748025 -0.04776005 0.83209721 4.24318334 1.02460390 2.14555807
49 50 51 52 53 54
2.14555807 0.96014892 -1.40202956 2.08891848 2.77545762 0.52261565
55 56 57 58 59 60
-0.96377843 -1.36349389 -0.79084521 -3.83942242 -4.72269454 -0.08899272
61 62 63 64 65 66
0.02446349 1.18323547 -0.60966235 0.40546375 -0.48505933 -3.20572060
67 68 69 70 71 72
2.28536785 0.05138149 -1.35259409 2.03550371 -0.72639023 -1.25131997
73 74 75 76 77 78
-1.40202956 0.05124108 1.44005673 2.64285196 0.36427792 -0.63515765
79 80 81 82 83 84
-2.66975063 -2.35359277 1.79342113 1.63152813 0.18323547 -1.65103543
85 86 87 88 89 90
-3.84354212 -1.61349845 -2.39482544 2.51171584 3.02446349 1.99854417
91 92 93 94 95 96
-1.80894914 -0.52226587 0.66598070 0.96000850 -0.37951209 0.47787454
97 98 99 100 101 102
1.55294851 1.03536330 -2.93785911 2.58295093 0.85887480 -2.40614927
103 104 105 106 107 108
-0.36435216 -0.48870818 0.36484235 4.74868003 -1.35036794 -2.54904346
109 110 111 112 113 114
-3.85530020 -0.88121952 0.83621692 0.29626766 -4.64027604 -4.64027604
115 116 117 118 119 120
3.76441740 2.12659587 0.52631133 0.07389896 0.91157171 -0.98643632
121 122 123 124 125 126
-2.37155628 -0.43970696 -3.20155405 -1.62837755 2.83209721 -2.15714339
127 128 129 130 131 132
-1.22468279 3.90731159 0.85067200 -1.39833387 -3.59084056 1.01356368
133 134 135 136 137 138
-1.44691108 0.34882416 -5.17880260 4.64654764 -3.13036580 -1.82894663
139 140 141 142 143 144
0.13337597 2.09981828 -1.33771498 -0.69591695 3.84285661 0.26949007
145 146 147 148 149 150
-1.30771257 -3.28093498 0.02446349 -0.07752848 -3.13392108 3.41636356
151 152 153 154 155 156
1.25859026 1.06214089 0.08905889 0.08891848 0.20195067 0.49583806
157 158 159
-1.06676909 2.60887025 -0.12610568
> postscript(file="/var/www/html/rcomp/tmp/6dlt31292234768.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 = 159
Frequency = 1
lag(myerror, k = 1) myerror
0 2.08891848 NA
1 2.55986902 2.08891848
2 2.29626766 2.55986902
3 0.97176658 2.29626766
4 2.89641179 0.97176658
5 0.50394729 2.89641179
6 0.53000702 0.50394729
7 5.86157181 0.53000702
8 -3.21790270 5.86157181
9 2.04712137 -3.21790270
10 5.19825498 2.04712137
11 -2.94875892 5.19825498
12 -1.91463680 -2.94875892
13 -5.34889840 -1.91463680
14 -2.71563083 -5.34889840
15 1.72276071 -2.71563083
16 3.18323547 1.72276071
17 0.94924911 3.18323547
18 -2.17468289 0.94924911
19 1.40560416 -2.17468289
20 -0.77496743 1.40560416
21 0.99768590 -0.77496743
22 0.68863858 0.99768590
23 2.47996027 0.68863858
24 0.23593238 2.47996027
25 -0.83572673 0.23593238
26 -0.19056067 -0.83572673
27 -2.83572673 -0.19056067
28 1.55308892 -2.83572673
29 1.37574216 1.55308892
30 -0.22468279 1.37574216
31 -2.49326214 -0.22468279
32 -1.89709730 -2.49326214
33 -0.08856870 -1.89709730
34 -1.91108152 -0.08856870
35 -1.86662403 -1.91108152
36 0.14555807 -1.86662403
37 0.85787612 0.14555807
38 2.76750181 0.85787612
39 3.25859026 2.76750181
40 2.16057758 3.25859026
41 -1.19056067 2.16057758
42 -1.59748025 -1.19056067
43 -0.04776005 -1.59748025
44 0.83209721 -0.04776005
45 4.24318334 0.83209721
46 1.02460390 4.24318334
47 2.14555807 1.02460390
48 2.14555807 2.14555807
49 0.96014892 2.14555807
50 -1.40202956 0.96014892
51 2.08891848 -1.40202956
52 2.77545762 2.08891848
53 0.52261565 2.77545762
54 -0.96377843 0.52261565
55 -1.36349389 -0.96377843
56 -0.79084521 -1.36349389
57 -3.83942242 -0.79084521
58 -4.72269454 -3.83942242
59 -0.08899272 -4.72269454
60 0.02446349 -0.08899272
61 1.18323547 0.02446349
62 -0.60966235 1.18323547
63 0.40546375 -0.60966235
64 -0.48505933 0.40546375
65 -3.20572060 -0.48505933
66 2.28536785 -3.20572060
67 0.05138149 2.28536785
68 -1.35259409 0.05138149
69 2.03550371 -1.35259409
70 -0.72639023 2.03550371
71 -1.25131997 -0.72639023
72 -1.40202956 -1.25131997
73 0.05124108 -1.40202956
74 1.44005673 0.05124108
75 2.64285196 1.44005673
76 0.36427792 2.64285196
77 -0.63515765 0.36427792
78 -2.66975063 -0.63515765
79 -2.35359277 -2.66975063
80 1.79342113 -2.35359277
81 1.63152813 1.79342113
82 0.18323547 1.63152813
83 -1.65103543 0.18323547
84 -3.84354212 -1.65103543
85 -1.61349845 -3.84354212
86 -2.39482544 -1.61349845
87 2.51171584 -2.39482544
88 3.02446349 2.51171584
89 1.99854417 3.02446349
90 -1.80894914 1.99854417
91 -0.52226587 -1.80894914
92 0.66598070 -0.52226587
93 0.96000850 0.66598070
94 -0.37951209 0.96000850
95 0.47787454 -0.37951209
96 1.55294851 0.47787454
97 1.03536330 1.55294851
98 -2.93785911 1.03536330
99 2.58295093 -2.93785911
100 0.85887480 2.58295093
101 -2.40614927 0.85887480
102 -0.36435216 -2.40614927
103 -0.48870818 -0.36435216
104 0.36484235 -0.48870818
105 4.74868003 0.36484235
106 -1.35036794 4.74868003
107 -2.54904346 -1.35036794
108 -3.85530020 -2.54904346
109 -0.88121952 -3.85530020
110 0.83621692 -0.88121952
111 0.29626766 0.83621692
112 -4.64027604 0.29626766
113 -4.64027604 -4.64027604
114 3.76441740 -4.64027604
115 2.12659587 3.76441740
116 0.52631133 2.12659587
117 0.07389896 0.52631133
118 0.91157171 0.07389896
119 -0.98643632 0.91157171
120 -2.37155628 -0.98643632
121 -0.43970696 -2.37155628
122 -3.20155405 -0.43970696
123 -1.62837755 -3.20155405
124 2.83209721 -1.62837755
125 -2.15714339 2.83209721
126 -1.22468279 -2.15714339
127 3.90731159 -1.22468279
128 0.85067200 3.90731159
129 -1.39833387 0.85067200
130 -3.59084056 -1.39833387
131 1.01356368 -3.59084056
132 -1.44691108 1.01356368
133 0.34882416 -1.44691108
134 -5.17880260 0.34882416
135 4.64654764 -5.17880260
136 -3.13036580 4.64654764
137 -1.82894663 -3.13036580
138 0.13337597 -1.82894663
139 2.09981828 0.13337597
140 -1.33771498 2.09981828
141 -0.69591695 -1.33771498
142 3.84285661 -0.69591695
143 0.26949007 3.84285661
144 -1.30771257 0.26949007
145 -3.28093498 -1.30771257
146 0.02446349 -3.28093498
147 -0.07752848 0.02446349
148 -3.13392108 -0.07752848
149 3.41636356 -3.13392108
150 1.25859026 3.41636356
151 1.06214089 1.25859026
152 0.08905889 1.06214089
153 0.08891848 0.08905889
154 0.20195067 0.08891848
155 0.49583806 0.20195067
156 -1.06676909 0.49583806
157 2.60887025 -1.06676909
158 -0.12610568 2.60887025
159 NA -0.12610568
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 2.55986902 2.08891848
[2,] 2.29626766 2.55986902
[3,] 0.97176658 2.29626766
[4,] 2.89641179 0.97176658
[5,] 0.50394729 2.89641179
[6,] 0.53000702 0.50394729
[7,] 5.86157181 0.53000702
[8,] -3.21790270 5.86157181
[9,] 2.04712137 -3.21790270
[10,] 5.19825498 2.04712137
[11,] -2.94875892 5.19825498
[12,] -1.91463680 -2.94875892
[13,] -5.34889840 -1.91463680
[14,] -2.71563083 -5.34889840
[15,] 1.72276071 -2.71563083
[16,] 3.18323547 1.72276071
[17,] 0.94924911 3.18323547
[18,] -2.17468289 0.94924911
[19,] 1.40560416 -2.17468289
[20,] -0.77496743 1.40560416
[21,] 0.99768590 -0.77496743
[22,] 0.68863858 0.99768590
[23,] 2.47996027 0.68863858
[24,] 0.23593238 2.47996027
[25,] -0.83572673 0.23593238
[26,] -0.19056067 -0.83572673
[27,] -2.83572673 -0.19056067
[28,] 1.55308892 -2.83572673
[29,] 1.37574216 1.55308892
[30,] -0.22468279 1.37574216
[31,] -2.49326214 -0.22468279
[32,] -1.89709730 -2.49326214
[33,] -0.08856870 -1.89709730
[34,] -1.91108152 -0.08856870
[35,] -1.86662403 -1.91108152
[36,] 0.14555807 -1.86662403
[37,] 0.85787612 0.14555807
[38,] 2.76750181 0.85787612
[39,] 3.25859026 2.76750181
[40,] 2.16057758 3.25859026
[41,] -1.19056067 2.16057758
[42,] -1.59748025 -1.19056067
[43,] -0.04776005 -1.59748025
[44,] 0.83209721 -0.04776005
[45,] 4.24318334 0.83209721
[46,] 1.02460390 4.24318334
[47,] 2.14555807 1.02460390
[48,] 2.14555807 2.14555807
[49,] 0.96014892 2.14555807
[50,] -1.40202956 0.96014892
[51,] 2.08891848 -1.40202956
[52,] 2.77545762 2.08891848
[53,] 0.52261565 2.77545762
[54,] -0.96377843 0.52261565
[55,] -1.36349389 -0.96377843
[56,] -0.79084521 -1.36349389
[57,] -3.83942242 -0.79084521
[58,] -4.72269454 -3.83942242
[59,] -0.08899272 -4.72269454
[60,] 0.02446349 -0.08899272
[61,] 1.18323547 0.02446349
[62,] -0.60966235 1.18323547
[63,] 0.40546375 -0.60966235
[64,] -0.48505933 0.40546375
[65,] -3.20572060 -0.48505933
[66,] 2.28536785 -3.20572060
[67,] 0.05138149 2.28536785
[68,] -1.35259409 0.05138149
[69,] 2.03550371 -1.35259409
[70,] -0.72639023 2.03550371
[71,] -1.25131997 -0.72639023
[72,] -1.40202956 -1.25131997
[73,] 0.05124108 -1.40202956
[74,] 1.44005673 0.05124108
[75,] 2.64285196 1.44005673
[76,] 0.36427792 2.64285196
[77,] -0.63515765 0.36427792
[78,] -2.66975063 -0.63515765
[79,] -2.35359277 -2.66975063
[80,] 1.79342113 -2.35359277
[81,] 1.63152813 1.79342113
[82,] 0.18323547 1.63152813
[83,] -1.65103543 0.18323547
[84,] -3.84354212 -1.65103543
[85,] -1.61349845 -3.84354212
[86,] -2.39482544 -1.61349845
[87,] 2.51171584 -2.39482544
[88,] 3.02446349 2.51171584
[89,] 1.99854417 3.02446349
[90,] -1.80894914 1.99854417
[91,] -0.52226587 -1.80894914
[92,] 0.66598070 -0.52226587
[93,] 0.96000850 0.66598070
[94,] -0.37951209 0.96000850
[95,] 0.47787454 -0.37951209
[96,] 1.55294851 0.47787454
[97,] 1.03536330 1.55294851
[98,] -2.93785911 1.03536330
[99,] 2.58295093 -2.93785911
[100,] 0.85887480 2.58295093
[101,] -2.40614927 0.85887480
[102,] -0.36435216 -2.40614927
[103,] -0.48870818 -0.36435216
[104,] 0.36484235 -0.48870818
[105,] 4.74868003 0.36484235
[106,] -1.35036794 4.74868003
[107,] -2.54904346 -1.35036794
[108,] -3.85530020 -2.54904346
[109,] -0.88121952 -3.85530020
[110,] 0.83621692 -0.88121952
[111,] 0.29626766 0.83621692
[112,] -4.64027604 0.29626766
[113,] -4.64027604 -4.64027604
[114,] 3.76441740 -4.64027604
[115,] 2.12659587 3.76441740
[116,] 0.52631133 2.12659587
[117,] 0.07389896 0.52631133
[118,] 0.91157171 0.07389896
[119,] -0.98643632 0.91157171
[120,] -2.37155628 -0.98643632
[121,] -0.43970696 -2.37155628
[122,] -3.20155405 -0.43970696
[123,] -1.62837755 -3.20155405
[124,] 2.83209721 -1.62837755
[125,] -2.15714339 2.83209721
[126,] -1.22468279 -2.15714339
[127,] 3.90731159 -1.22468279
[128,] 0.85067200 3.90731159
[129,] -1.39833387 0.85067200
[130,] -3.59084056 -1.39833387
[131,] 1.01356368 -3.59084056
[132,] -1.44691108 1.01356368
[133,] 0.34882416 -1.44691108
[134,] -5.17880260 0.34882416
[135,] 4.64654764 -5.17880260
[136,] -3.13036580 4.64654764
[137,] -1.82894663 -3.13036580
[138,] 0.13337597 -1.82894663
[139,] 2.09981828 0.13337597
[140,] -1.33771498 2.09981828
[141,] -0.69591695 -1.33771498
[142,] 3.84285661 -0.69591695
[143,] 0.26949007 3.84285661
[144,] -1.30771257 0.26949007
[145,] -3.28093498 -1.30771257
[146,] 0.02446349 -3.28093498
[147,] -0.07752848 0.02446349
[148,] -3.13392108 -0.07752848
[149,] 3.41636356 -3.13392108
[150,] 1.25859026 3.41636356
[151,] 1.06214089 1.25859026
[152,] 0.08905889 1.06214089
[153,] 0.08891848 0.08905889
[154,] 0.20195067 0.08891848
[155,] 0.49583806 0.20195067
[156,] -1.06676909 0.49583806
[157,] 2.60887025 -1.06676909
[158,] -0.12610568 2.60887025
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 2.55986902 2.08891848
2 2.29626766 2.55986902
3 0.97176658 2.29626766
4 2.89641179 0.97176658
5 0.50394729 2.89641179
6 0.53000702 0.50394729
7 5.86157181 0.53000702
8 -3.21790270 5.86157181
9 2.04712137 -3.21790270
10 5.19825498 2.04712137
11 -2.94875892 5.19825498
12 -1.91463680 -2.94875892
13 -5.34889840 -1.91463680
14 -2.71563083 -5.34889840
15 1.72276071 -2.71563083
16 3.18323547 1.72276071
17 0.94924911 3.18323547
18 -2.17468289 0.94924911
19 1.40560416 -2.17468289
20 -0.77496743 1.40560416
21 0.99768590 -0.77496743
22 0.68863858 0.99768590
23 2.47996027 0.68863858
24 0.23593238 2.47996027
25 -0.83572673 0.23593238
26 -0.19056067 -0.83572673
27 -2.83572673 -0.19056067
28 1.55308892 -2.83572673
29 1.37574216 1.55308892
30 -0.22468279 1.37574216
31 -2.49326214 -0.22468279
32 -1.89709730 -2.49326214
33 -0.08856870 -1.89709730
34 -1.91108152 -0.08856870
35 -1.86662403 -1.91108152
36 0.14555807 -1.86662403
37 0.85787612 0.14555807
38 2.76750181 0.85787612
39 3.25859026 2.76750181
40 2.16057758 3.25859026
41 -1.19056067 2.16057758
42 -1.59748025 -1.19056067
43 -0.04776005 -1.59748025
44 0.83209721 -0.04776005
45 4.24318334 0.83209721
46 1.02460390 4.24318334
47 2.14555807 1.02460390
48 2.14555807 2.14555807
49 0.96014892 2.14555807
50 -1.40202956 0.96014892
51 2.08891848 -1.40202956
52 2.77545762 2.08891848
53 0.52261565 2.77545762
54 -0.96377843 0.52261565
55 -1.36349389 -0.96377843
56 -0.79084521 -1.36349389
57 -3.83942242 -0.79084521
58 -4.72269454 -3.83942242
59 -0.08899272 -4.72269454
60 0.02446349 -0.08899272
61 1.18323547 0.02446349
62 -0.60966235 1.18323547
63 0.40546375 -0.60966235
64 -0.48505933 0.40546375
65 -3.20572060 -0.48505933
66 2.28536785 -3.20572060
67 0.05138149 2.28536785
68 -1.35259409 0.05138149
69 2.03550371 -1.35259409
70 -0.72639023 2.03550371
71 -1.25131997 -0.72639023
72 -1.40202956 -1.25131997
73 0.05124108 -1.40202956
74 1.44005673 0.05124108
75 2.64285196 1.44005673
76 0.36427792 2.64285196
77 -0.63515765 0.36427792
78 -2.66975063 -0.63515765
79 -2.35359277 -2.66975063
80 1.79342113 -2.35359277
81 1.63152813 1.79342113
82 0.18323547 1.63152813
83 -1.65103543 0.18323547
84 -3.84354212 -1.65103543
85 -1.61349845 -3.84354212
86 -2.39482544 -1.61349845
87 2.51171584 -2.39482544
88 3.02446349 2.51171584
89 1.99854417 3.02446349
90 -1.80894914 1.99854417
91 -0.52226587 -1.80894914
92 0.66598070 -0.52226587
93 0.96000850 0.66598070
94 -0.37951209 0.96000850
95 0.47787454 -0.37951209
96 1.55294851 0.47787454
97 1.03536330 1.55294851
98 -2.93785911 1.03536330
99 2.58295093 -2.93785911
100 0.85887480 2.58295093
101 -2.40614927 0.85887480
102 -0.36435216 -2.40614927
103 -0.48870818 -0.36435216
104 0.36484235 -0.48870818
105 4.74868003 0.36484235
106 -1.35036794 4.74868003
107 -2.54904346 -1.35036794
108 -3.85530020 -2.54904346
109 -0.88121952 -3.85530020
110 0.83621692 -0.88121952
111 0.29626766 0.83621692
112 -4.64027604 0.29626766
113 -4.64027604 -4.64027604
114 3.76441740 -4.64027604
115 2.12659587 3.76441740
116 0.52631133 2.12659587
117 0.07389896 0.52631133
118 0.91157171 0.07389896
119 -0.98643632 0.91157171
120 -2.37155628 -0.98643632
121 -0.43970696 -2.37155628
122 -3.20155405 -0.43970696
123 -1.62837755 -3.20155405
124 2.83209721 -1.62837755
125 -2.15714339 2.83209721
126 -1.22468279 -2.15714339
127 3.90731159 -1.22468279
128 0.85067200 3.90731159
129 -1.39833387 0.85067200
130 -3.59084056 -1.39833387
131 1.01356368 -3.59084056
132 -1.44691108 1.01356368
133 0.34882416 -1.44691108
134 -5.17880260 0.34882416
135 4.64654764 -5.17880260
136 -3.13036580 4.64654764
137 -1.82894663 -3.13036580
138 0.13337597 -1.82894663
139 2.09981828 0.13337597
140 -1.33771498 2.09981828
141 -0.69591695 -1.33771498
142 3.84285661 -0.69591695
143 0.26949007 3.84285661
144 -1.30771257 0.26949007
145 -3.28093498 -1.30771257
146 0.02446349 -3.28093498
147 -0.07752848 0.02446349
148 -3.13392108 -0.07752848
149 3.41636356 -3.13392108
150 1.25859026 3.41636356
151 1.06214089 1.25859026
152 0.08905889 1.06214089
153 0.08891848 0.08905889
154 0.20195067 0.08891848
155 0.49583806 0.20195067
156 -1.06676909 0.49583806
157 2.60887025 -1.06676909
158 -0.12610568 2.60887025
> plot(z,main=paste('Residual Lag plot, lowess, and regression line'), ylab='values of Residuals', xlab='lagged values of Residuals')
> lines(lowess(z))
> abline(lm(z))
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/7ova61292234768.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> acf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Autocorrelation Function')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/8ova61292234768.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> pacf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Partial Autocorrelation Function')
> grid()
> dev.off()
null device
1
> postscript(file="/var/www/html/rcomp/tmp/9h4991292234768.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> opar <- par(mfrow = c(2,2), oma = c(0, 0, 1.1, 0))
> plot(mylm, las = 1, sub='Residual Diagnostics')
> par(opar)
> dev.off()
null device
1
> if (n > n25) {
+ postscript(file="/var/www/html/rcomp/tmp/10h4991292234768.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
+ plot(kp3:nmkm3,gqarr[,2], main='Goldfeld-Quandt test',ylab='2-sided p-value',xlab='breakpoint')
+ grid()
+ dev.off()
+ }
null device
1
>
> #Note: the /var/www/html/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/www/html/rcomp/createtable")
>
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Estimated Regression Equation', 1, TRUE)
> a<-table.row.end(a)
> myeq <- colnames(x)[1]
> myeq <- paste(myeq, '[t] = ', sep='')
> for (i in 1:k){
+ if (mysum$coefficients[i,1] > 0) myeq <- paste(myeq, '+', '')
+ myeq <- paste(myeq, mysum$coefficients[i,1], sep=' ')
+ if (rownames(mysum$coefficients)[i] != '(Intercept)') {
+ myeq <- paste(myeq, rownames(mysum$coefficients)[i], sep='')
+ if (rownames(mysum$coefficients)[i] != 't') myeq <- paste(myeq, '[t]', sep='')
+ }
+ }
> myeq <- paste(myeq, ' + e[t]')
> a<-table.row.start(a)
> a<-table.element(a, myeq)
> a<-table.row.end(a)
> a<-table.end(a)
> table.save(a,file="/var/www/html/rcomp/tmp/11km8f1292234768.tab")
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a,hyperlink('http://www.xycoon.com/ols1.htm','Multiple Linear Regression - Ordinary Least Squares',''), 6, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a,'Variable',header=TRUE)
> a<-table.element(a,'Parameter',header=TRUE)
> a<-table.element(a,'S.D.',header=TRUE)
> a<-table.element(a,'T-STAT
H0: parameter = 0',header=TRUE)
> a<-table.element(a,'2-tail p-value',header=TRUE)
> a<-table.element(a,'1-tail p-value',header=TRUE)
> a<-table.row.end(a)
> for (i in 1:k){
+ a<-table.row.start(a)
+ a<-table.element(a,rownames(mysum$coefficients)[i],header=TRUE)
+ a<-table.element(a,mysum$coefficients[i,1])
+ a<-table.element(a, round(mysum$coefficients[i,2],6))
+ a<-table.element(a, round(mysum$coefficients[i,3],4))
+ a<-table.element(a, round(mysum$coefficients[i,4],6))
+ a<-table.element(a, round(mysum$coefficients[i,4]/2,6))
+ a<-table.row.end(a)
+ }
> a<-table.end(a)
> table.save(a,file="/var/www/html/rcomp/tmp/125no21292234768.tab")
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Regression Statistics', 2, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple R',1,TRUE)
> a<-table.element(a, sqrt(mysum$r.squared))
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'R-squared',1,TRUE)
> a<-table.element(a, mysum$r.squared)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Adjusted R-squared',1,TRUE)
> a<-table.element(a, mysum$adj.r.squared)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (value)',1,TRUE)
> a<-table.element(a, mysum$fstatistic[1])
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (DF numerator)',1,TRUE)
> a<-table.element(a, mysum$fstatistic[2])
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (DF denominator)',1,TRUE)
> a<-table.element(a, mysum$fstatistic[3])
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'p-value',1,TRUE)
> a<-table.element(a, 1-pf(mysum$fstatistic[1],mysum$fstatistic[2],mysum$fstatistic[3]))
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Residual Statistics', 2, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Residual Standard Deviation',1,TRUE)
> a<-table.element(a, mysum$sigma)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Sum Squared Residuals',1,TRUE)
> a<-table.element(a, sum(myerror*myerror))
> a<-table.row.end(a)
> a<-table.end(a)
> table.save(a,file="/var/www/html/rcomp/tmp/13c63w1292234768.tab")
> a<-table.start()
> a<-table.row.start(a)
> a<-table.element(a, 'Multiple Linear Regression - Actuals, Interpolation, and Residuals', 4, TRUE)
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Time or Index', 1, TRUE)
> a<-table.element(a, 'Actuals', 1, TRUE)
> a<-table.element(a, 'Interpolation
Forecast', 1, TRUE)
> a<-table.element(a, 'Residuals
Prediction Error', 1, TRUE)
> a<-table.row.end(a)
> for (i in 1:n) {
+ a<-table.row.start(a)
+ a<-table.element(a,i, 1, TRUE)
+ a<-table.element(a,x[i])
+ a<-table.element(a,x[i]-mysum$resid[i])
+ a<-table.element(a,mysum$resid[i])
+ a<-table.row.end(a)
+ }
> a<-table.end(a)
> table.save(a,file="/var/www/html/rcomp/tmp/14nf3z1292234768.tab")
> if (n > n25) {
+ a<-table.start()
+ a<-table.row.start(a)
+ a<-table.element(a,'Goldfeld-Quandt test for Heteroskedasticity',4,TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'p-values',header=TRUE)
+ a<-table.element(a,'Alternative Hypothesis',3,header=TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'breakpoint index',header=TRUE)
+ a<-table.element(a,'greater',header=TRUE)
+ a<-table.element(a,'2-sided',header=TRUE)
+ a<-table.element(a,'less',header=TRUE)
+ a<-table.row.end(a)
+ for (mypoint in kp3:nmkm3) {
+ a<-table.row.start(a)
+ a<-table.element(a,mypoint,header=TRUE)
+ a<-table.element(a,gqarr[mypoint-kp3+1,1])
+ a<-table.element(a,gqarr[mypoint-kp3+1,2])
+ a<-table.element(a,gqarr[mypoint-kp3+1,3])
+ a<-table.row.end(a)
+ }
+ a<-table.end(a)
+ table.save(a,file="/var/www/html/rcomp/tmp/15qy1n1292234768.tab")
+ a<-table.start()
+ a<-table.row.start(a)
+ a<-table.element(a,'Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity',4,TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'Description',header=TRUE)
+ a<-table.element(a,'# significant tests',header=TRUE)
+ a<-table.element(a,'% significant tests',header=TRUE)
+ a<-table.element(a,'OK/NOK',header=TRUE)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'1% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant1)
+ a<-table.element(a,numsignificant1/numgqtests)
+ if (numsignificant1/numgqtests < 0.01) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'5% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant5)
+ a<-table.element(a,numsignificant5/numgqtests)
+ if (numsignificant5/numgqtests < 0.05) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.row.start(a)
+ a<-table.element(a,'10% type I error level',header=TRUE)
+ a<-table.element(a,numsignificant10)
+ a<-table.element(a,numsignificant10/numgqtests)
+ if (numsignificant10/numgqtests < 0.1) dum <- 'OK' else dum <- 'NOK'
+ a<-table.element(a,dum)
+ a<-table.row.end(a)
+ a<-table.end(a)
+ table.save(a,file="/var/www/html/rcomp/tmp/164qzw1292234768.tab")
+ }
>
> try(system("convert tmp/1slvx1292234768.ps tmp/1slvx1292234768.png",intern=TRUE))
character(0)
> try(system("convert tmp/22uci1292234768.ps tmp/22uci1292234768.png",intern=TRUE))
character(0)
> try(system("convert tmp/32uci1292234768.ps tmp/32uci1292234768.png",intern=TRUE))
character(0)
> try(system("convert tmp/42uci1292234768.ps tmp/42uci1292234768.png",intern=TRUE))
character(0)
> try(system("convert tmp/5dlt31292234768.ps tmp/5dlt31292234768.png",intern=TRUE))
character(0)
> try(system("convert tmp/6dlt31292234768.ps tmp/6dlt31292234768.png",intern=TRUE))
character(0)
> try(system("convert tmp/7ova61292234768.ps tmp/7ova61292234768.png",intern=TRUE))
character(0)
> try(system("convert tmp/8ova61292234768.ps tmp/8ova61292234768.png",intern=TRUE))
character(0)
> try(system("convert tmp/9h4991292234768.ps tmp/9h4991292234768.png",intern=TRUE))
character(0)
> try(system("convert tmp/10h4991292234768.ps tmp/10h4991292234768.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
4.004 1.784 23.666