R version 2.12.0 (2010-10-15)
Copyright (C) 2010 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: i486-pc-linux-gnu (32-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> x <- array(list(14
+ ,11
+ ,23
+ ,8
+ ,1
+ ,6
+ ,7
+ ,22
+ ,24
+ ,4
+ ,2
+ ,5
+ ,22
+ ,23
+ ,24
+ ,7
+ ,2
+ ,20
+ ,12
+ ,21
+ ,21
+ ,4
+ ,2
+ ,12
+ ,15
+ ,19
+ ,21
+ ,4
+ ,2
+ ,11
+ ,9
+ ,12
+ ,19
+ ,5
+ ,2
+ ,12
+ ,20
+ ,24
+ ,12
+ ,15
+ ,1
+ ,11
+ ,10
+ ,21
+ ,21
+ ,5
+ ,1
+ ,9
+ ,12
+ ,21
+ ,25
+ ,7
+ ,2
+ ,13
+ ,23
+ ,26
+ ,27
+ ,4
+ ,2
+ ,9
+ ,10
+ ,18
+ ,21
+ ,4
+ ,1
+ ,14
+ ,11
+ ,21
+ ,27
+ ,7
+ ,1
+ ,12
+ ,20
+ ,22
+ ,20
+ ,8
+ ,1
+ ,18
+ ,11
+ ,26
+ ,16
+ ,4
+ ,2
+ ,9
+ ,22
+ ,20
+ ,26
+ ,8
+ ,1
+ ,15
+ ,19
+ ,20
+ ,24
+ ,4
+ ,2
+ ,12
+ ,20
+ ,26
+ ,25
+ ,5
+ ,2
+ ,12
+ ,16
+ ,27
+ ,25
+ ,16
+ ,1
+ ,12
+ ,12
+ ,27
+ ,27
+ ,7
+ ,1
+ ,15
+ ,14
+ ,16
+ ,23
+ ,4
+ ,2
+ ,11
+ ,14
+ ,26
+ ,22
+ ,6
+ ,1
+ ,13
+ ,9
+ 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 ,12
+ ,25
+ ,25
+ ,4
+ ,2
+ ,11
+ ,18
+ ,24
+ ,25
+ ,4
+ ,1
+ ,11
+ ,13
+ ,24
+ ,24
+ ,7
+ ,1
+ ,13
+ ,21
+ ,28
+ ,24
+ ,4
+ ,2
+ ,8
+ ,24
+ ,24
+ ,24
+ ,6
+ ,2
+ ,12
+ ,17
+ ,22
+ ,22
+ ,4
+ ,2
+ ,9
+ ,12
+ ,22
+ ,22
+ ,4
+ ,1
+ ,14
+ ,12
+ ,20
+ ,21
+ ,6
+ ,1
+ ,18
+ ,10
+ ,25
+ ,23
+ ,5
+ ,1
+ ,15
+ ,14
+ ,13
+ ,21
+ ,4
+ ,1
+ ,9
+ ,14
+ ,21
+ ,24
+ ,8
+ ,1
+ ,11
+ ,13
+ ,23
+ ,22
+ ,6
+ ,1
+ ,17
+ ,17
+ ,18
+ ,25
+ ,5
+ ,2
+ ,12)
+ ,dim=c(6
+ ,148)
+ ,dimnames=list(c('I/Exp.Stimulation'
+ ,'E/Introjected'
+ ,'E/Ext.Regulation'
+ ,'Amotivation'
+ ,'gender'
+ ,'PE')
+ ,1:148))
> y <- array(NA,dim=c(6,148),dimnames=list(c('I/Exp.Stimulation','E/Introjected','E/Ext.Regulation','Amotivation','gender','PE'),1:148))
> 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 = '2'
> #'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
> 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
E/Introjected I/Exp.Stimulation E/Ext.Regulation Amotivation gender PE
1 11 14 23 8 1 6
2 22 7 24 4 2 5
3 23 22 24 7 2 20
4 21 12 21 4 2 12
5 19 15 21 4 2 11
6 12 9 19 5 2 12
7 24 20 12 15 1 11
8 21 10 21 5 1 9
9 21 12 25 7 2 13
10 26 23 27 4 2 9
11 18 10 21 4 1 14
12 21 11 27 7 1 12
13 22 20 20 8 1 18
14 26 11 16 4 2 9
15 20 22 26 8 1 15
16 20 19 24 4 2 12
17 26 20 25 5 2 12
18 27 16 25 16 1 12
19 27 12 27 7 1 15
20 16 14 23 4 2 11
21 26 14 22 6 1 13
22 20 9 10 4 1 10
23 25 19 25 5 2 17
24 16 17 18 4 1 13
25 20 14 21 4 1 17
26 20 19 20 6 1 15
27 24 20 18 4 1 13
28 24 20 25 4 1 17
29 22 9 28 4 1 21
30 18 10 27 8 1 12
31 21 6 20 5 2 12
32 17 15 20 4 1 15
33 15 9 20 10 2 8
34 28 24 27 4 2 15
35 23 11 23 4 1 16
36 19 4 23 4 2 9
37 15 12 22 5 2 13
38 26 22 26 5 1 11
39 20 16 21 4 1 9
40 11 14 17 6 1 15
41 17 13 27 4 2 9
42 16 13 16 4 2 15
43 21 10 26 4 1 14
44 18 12 17 4 1 8
45 17 13 24 4 2 11
46 21 16 23 4 2 14
47 18 18 20 6 1 14
48 16 10 10 4 1 12
49 13 12 21 5 1 15
50 28 9 25 4 1 11
51 25 7 28 4 1 11
52 24 16 25 5 2 9
53 15 12 20 10 2 8
54 21 15 20 10 1 13
55 11 15 27 4 1 12
56 27 8 26 4 1 24
57 23 14 19 4 2 11
58 21 13 26 8 1 11
59 16 18 20 4 2 16
60 20 11 22 14 1 12
61 21 12 19 4 2 18
62 10 12 23 5 2 12
63 18 24 28 4 2 14
64 20 11 22 8 2 16
65 21 5 27 4 2 24
66 24 17 14 4 1 13
67 26 9 25 5 1 11
68 23 20 22 8 1 14
69 22 17 24 7 1 16
70 13 14 23 4 1 12
71 27 23 25 4 1 21
72 24 10 28 9 2 11
73 19 19 28 4 1 6
74 17 5 16 4 2 9
75 16 16 25 5 1 14
76 20 19 21 4 1 16
77 8 5 27 4 1 18
78 16 15 21 6 2 9
79 17 18 22 6 1 13
80 23 20 26 4 2 17
81 18 17 21 6 1 11
82 24 19 24 4 1 16
83 17 11 24 6 1 11
84 20 12 23 4 1 11
85 22 13 26 8 2 11
86 22 7 21 5 1 20
87 20 8 24 8 1 10
88 18 15 23 7 1 12
89 21 13 21 4 2 11
90 23 18 20 6 1 14
91 28 19 22 4 1 12
92 19 12 26 5 1 12
93 22 12 23 6 1 12
94 17 17 23 4 2 10
95 25 17 22 4 2 12
96 22 11 25 4 2 10
97 21 11 21 8 2 10
98 15 17 21 9 1 13
99 20 5 25 4 1 12
100 25 8 26 12 2 13
101 21 17 21 4 1 9
102 24 18 24 8 1 14
103 23 17 21 8 2 14
104 22 17 23 4 1 12
105 14 10 24 4 1 18
106 11 8 24 4 1 17
107 22 9 24 15 1 12
108 22 13 25 3 1 15
109 6 14 28 8 1 8
110 15 5 18 4 2 8
111 26 16 28 5 1 12
112 26 22 22 4 1 10
113 20 15 28 3 1 18
114 26 14 22 11 1 15
115 15 8 24 6 1 16
116 25 10 27 4 2 11
117 22 18 21 5 2 10
118 20 18 26 4 2 7
119 18 9 24 16 1 17
120 23 15 25 8 1 7
121 22 9 20 4 2 14
122 23 15 21 4 1 12
123 17 21 23 4 1 15
124 20 9 23 5 1 13
125 21 16 19 8 2 10
126 23 15 22 4 1 16
127 25 10 15 4 2 11
128 25 4 24 4 2 7
129 21 12 18 8 2 15
130 22 14 18 8 1 18
131 18 14 23 4 1 11
132 18 18 17 18 1 13
133 18 19 19 4 2 11
134 21 16 21 5 2 13
135 21 7 12 4 2 12
136 25 12 25 4 2 11
137 24 18 25 4 1 11
138 24 13 24 7 1 13
139 28 21 24 4 2 8
140 24 24 24 6 2 12
141 22 17 22 4 2 9
142 22 12 22 4 1 14
143 20 12 21 6 1 18
144 25 10 23 5 1 15
145 13 14 21 4 1 9
146 21 14 24 8 1 11
147 23 13 22 6 1 17
148 18 17 25 5 2 12
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) `I/Exp.Stimulation` `E/Ext.Regulation`
11.80397 0.19558 0.13726
Amotivation gender PE
0.06084 0.77443 0.11210
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-14.5432 -2.5385 0.6733 2.7950 8.7535
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 11.80397 3.17009 3.724 0.000283 ***
`I/Exp.Stimulation` 0.19558 0.07521 2.600 0.010299 *
`E/Ext.Regulation` 0.13726 0.09797 1.401 0.163381
Amotivation 0.06084 0.12928 0.471 0.638656
gender 0.77443 0.73899 1.048 0.296438
PE 0.11210 0.10621 1.056 0.292985
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 4.215 on 142 degrees of freedom
Multiple R-squared: 0.07366, Adjusted R-squared: 0.04105
F-statistic: 2.258 on 5 and 142 DF, p-value: 0.05179
> 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.9530700 0.09385996 0.04692998
[2,] 0.9194488 0.16110240 0.08055120
[3,] 0.8681070 0.26378592 0.13189296
[4,] 0.8147774 0.37044524 0.18522262
[5,] 0.7305509 0.53889811 0.26944906
[6,] 0.7951756 0.40964870 0.20482435
[7,] 0.7268044 0.54639127 0.27319563
[8,] 0.6709359 0.65812823 0.32906411
[9,] 0.6322905 0.73541908 0.36770954
[10,] 0.6640289 0.67194228 0.33597114
[11,] 0.7540255 0.49194892 0.24597446
[12,] 0.7637755 0.47244900 0.23622450
[13,] 0.7970246 0.40595073 0.20297537
[14,] 0.7550488 0.48990244 0.24495122
[15,] 0.7086684 0.58266322 0.29133161
[16,] 0.6998081 0.60038370 0.30019185
[17,] 0.6360132 0.72797364 0.36398682
[18,] 0.5726872 0.85462569 0.42731285
[19,] 0.5559629 0.88807424 0.44403712
[20,] 0.5030391 0.99392190 0.49696095
[21,] 0.4387532 0.87750645 0.56124677
[22,] 0.4044866 0.80897322 0.59551339
[23,] 0.3502794 0.70055880 0.64972060
[24,] 0.3289180 0.65783600 0.67108200
[25,] 0.3616248 0.72324961 0.63837519
[26,] 0.3536735 0.70734707 0.64632646
[27,] 0.3221255 0.64425101 0.67787449
[28,] 0.2712489 0.54249784 0.72875108
[29,] 0.3124591 0.62491826 0.68754087
[30,] 0.2914019 0.58280380 0.70859810
[31,] 0.2442627 0.48852542 0.75573729
[32,] 0.4149234 0.82984681 0.58507660
[33,] 0.4100285 0.82005710 0.58997145
[34,] 0.3887054 0.77741082 0.61129459
[35,] 0.3387491 0.67749810 0.66125095
[36,] 0.2902835 0.58056708 0.70971646
[37,] 0.2747829 0.54956588 0.72521706
[38,] 0.2313930 0.46278609 0.76860696
[39,] 0.2122548 0.42450961 0.78774520
[40,] 0.1796437 0.35928733 0.82035634
[41,] 0.2387391 0.47747821 0.76126090
[42,] 0.3802091 0.76041824 0.61979088
[43,] 0.4008715 0.80174299 0.59912850
[44,] 0.3699549 0.73990972 0.63004514
[45,] 0.3802282 0.76045634 0.61977183
[46,] 0.3331634 0.66632672 0.66683664
[47,] 0.5903529 0.81929413 0.40964706
[48,] 0.6429369 0.71412616 0.35706308
[49,] 0.6240846 0.75183082 0.37591541
[50,] 0.5771776 0.84564474 0.42282237
[51,] 0.6067668 0.78646648 0.39323324
[52,] 0.5586957 0.88260856 0.44130428
[53,] 0.5127625 0.97447506 0.48723753
[54,] 0.7401907 0.51961854 0.25980927
[55,] 0.7675533 0.46489340 0.23244670
[56,] 0.7313670 0.53726609 0.26863305
[57,] 0.6894802 0.62103954 0.31051977
[58,] 0.6939995 0.61200096 0.30600048
[59,] 0.7532739 0.49345213 0.24672606
[60,] 0.7167890 0.56642196 0.28321098
[61,] 0.6750539 0.64989221 0.32494610
[62,] 0.7534494 0.49310113 0.24655057
[63,] 0.7444855 0.51102906 0.25551453
[64,] 0.7271491 0.54570190 0.27285095
[65,] 0.6947302 0.61053960 0.30526980
[66,] 0.6615248 0.67695034 0.33847517
[67,] 0.6793440 0.64131192 0.32065596
[68,] 0.6389117 0.72217656 0.36108828
[69,] 0.8766101 0.24677989 0.12338995
[70,] 0.8857435 0.22851293 0.11425646
[71,] 0.8831366 0.23372673 0.11686336
[72,] 0.8588460 0.28230808 0.14115404
[73,] 0.8399139 0.32017219 0.16008609
[74,] 0.8179426 0.36411472 0.18205736
[75,] 0.7975955 0.40480909 0.20240455
[76,] 0.7614024 0.47719513 0.23859757
[77,] 0.7231422 0.55371552 0.27685776
[78,] 0.6935973 0.61280546 0.30640273
[79,] 0.6507373 0.69852540 0.34926270
[80,] 0.6200657 0.75986857 0.37993429
[81,] 0.5769255 0.84614897 0.42307448
[82,] 0.5392021 0.92159578 0.46079789
[83,] 0.6282887 0.74342261 0.37171131
[84,] 0.5828168 0.83436634 0.41718317
[85,] 0.5463247 0.90735058 0.45367529
[86,] 0.5646689 0.87066216 0.43533108
[87,] 0.5443197 0.91136069 0.45568034
[88,] 0.4997980 0.99959598 0.50020201
[89,] 0.4521766 0.90435319 0.54782340
[90,] 0.4940501 0.98810027 0.50594987
[91,] 0.4474453 0.89489055 0.55255473
[92,] 0.4416394 0.88327876 0.55836062
[93,] 0.3918083 0.78361654 0.60819173
[94,] 0.3617334 0.72346689 0.63826655
[95,] 0.3158976 0.63179526 0.68410237
[96,] 0.2737073 0.54741457 0.72629271
[97,] 0.3202516 0.64050315 0.67974842
[98,] 0.5158746 0.96825088 0.48412544
[99,] 0.4921443 0.98428854 0.50785573
[100,] 0.4395934 0.87918673 0.56040664
[101,] 0.9345358 0.13092841 0.06546420
[102,] 0.9554134 0.08917328 0.04458664
[103,] 0.9573681 0.08526381 0.04263191
[104,] 0.9664517 0.06709663 0.03354831
[105,] 0.9558103 0.08837935 0.04418968
[106,] 0.9718261 0.05634778 0.02817389
[107,] 0.9876820 0.02463600 0.01231800
[108,] 0.9831785 0.03364295 0.01682147
[109,] 0.9748483 0.05030332 0.02515166
[110,] 0.9708058 0.05838847 0.02919424
[111,] 0.9700095 0.05998097 0.02999048
[112,] 0.9606495 0.07870098 0.03935049
[113,] 0.9474713 0.10505730 0.05252865
[114,] 0.9417445 0.11651094 0.05825547
[115,] 0.9393553 0.12128931 0.06064465
[116,] 0.9204556 0.15908875 0.07954437
[117,] 0.8872438 0.22551230 0.11275615
[118,] 0.8524550 0.29508990 0.14754495
[119,] 0.8809730 0.23805396 0.11902698
[120,] 0.8505900 0.29881993 0.14940996
[121,] 0.7995576 0.40088483 0.20044242
[122,] 0.7435970 0.51280601 0.25640301
[123,] 0.6978036 0.60439278 0.30219639
[124,] 0.6127851 0.77442975 0.38721488
[125,] 0.5625086 0.87498274 0.43749137
[126,] 0.4812004 0.96240089 0.51879955
[127,] 0.4917816 0.98356317 0.50821842
[128,] 0.3858926 0.77178520 0.61410740
[129,] 0.2814683 0.56293655 0.71853172
[130,] 0.1968581 0.39371628 0.80314186
[131,] 0.2919082 0.58381644 0.70809178
> postscript(file="/var/www/rcomp/tmp/1psqt1292930815.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/rcomp/tmp/2psqt1292930815.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/rcomp/tmp/301pe1292930815.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/rcomp/tmp/401pe1292930815.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/rcomp/tmp/501pe1292930815.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 = 148
Frequency = 1
1 2 3 4 5 6
-8.63271143 3.18007613 -0.61763797 0.82923825 -1.64538486 -7.37035342
7 8 9 10 11 12
3.71730026 2.27030052 -0.01440454 3.19066912 -1.22938719 0.79319197
13 14 15 16 17 18
0.26035168 7.04741801 -2.61803428 -1.95156711 3.65476359 5.54230990
19 20 21 22 23 24
6.26130220 -4.72432495 5.84148501 2.92444519 2.28981640 -4.07453993
25 26 27 28 29 30
-0.34800468 -1.08608777 3.33873234 1.92950787 1.22065039 -2.07206751
31 32 33 34 35 36
2.07911631 -3.18211335 -4.36336990 4.32246549 3.07631167 0.45564338
37 38 39 40 41 42
-5.48095976 4.01289038 0.15768046 -8.69643423 -3.85357180 -4.01636152
43 44 45 46 47 48
1.08432282 -0.39887929 -3.66600704 -0.45179062 -2.77840724 -1.49533996
49 50 51 52 53 54
-6.79347902 8.75347058 5.73284840 2.77338108 -4.95009762 0.67708353
55 56 57 58 59 60
-9.80660549 6.35442844 2.82470705 0.59056738 -5.65537768 0.05363422
61 62 63 64 65 66
0.43112653 -10.50611314 -5.70268789 -0.80420389 0.02946618 4.47449206
67 68 69 70 71 72
6.69263519 1.43425416 0.58309204 -7.06199758 3.89436166 3.06751173
73 74 75 76 77 78
-2.05353941 -0.77912654 -5.01271003 -1.21377961 -11.52347412 -4.54284640
79 80 81 82 83 84
-3.94081862 0.01781789 -2.38377548 2.37444640 -2.62209402 0.44125885
85 86 87 88 89 90
0.81613540 2.62387743 0.95506754 -2.44007967 0.74576696 2.22159276
91 92 93 94 95 96
7.09738087 -1.14345515 2.20748345 -4.19894805 3.71410071 1.69999140
97 98 99 100 101 102
1.00568183 -5.79049089 1.42366960 4.32646414 0.96210455 2.55088998
103 104 105 106 107 108
1.38380790 1.35127469 -6.08957966 -8.58632323 2.10943465 1.58358386
109 110 111 112 113 114
-14.54321067 -2.94153791 4.79972521 4.73486238 -1.55565581 5.31309881
115 116 117 118 119 120
-4.59588939 4.50894669 0.81915664 -1.46998410 -2.51192384 2.78509204
121 122 123 124 125 126
2.32901474 3.01694251 -4.76734280 0.74294195 0.30231828 2.43126603
127 128 129 130 131 132
6.15604268 6.54259462 0.66135682 1.70832313 -1.94989296 -2.98455333
133 134 135 136 137 138
-3.15317250 -0.12600540 3.04243978 4.39231087 2.99328740 3.70170953
139 140 141 142 143 144
6.10569955 0.94888256 1.05041456 2.24220299 -0.19062827 5.32315680
145 146 147 148
-6.45116773 0.66950747 2.58864244 -3.75850868
> postscript(file="/var/www/rcomp/tmp/6atph1292930815.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 = 148
Frequency = 1
lag(myerror, k = 1) myerror
0 -8.63271143 NA
1 3.18007613 -8.63271143
2 -0.61763797 3.18007613
3 0.82923825 -0.61763797
4 -1.64538486 0.82923825
5 -7.37035342 -1.64538486
6 3.71730026 -7.37035342
7 2.27030052 3.71730026
8 -0.01440454 2.27030052
9 3.19066912 -0.01440454
10 -1.22938719 3.19066912
11 0.79319197 -1.22938719
12 0.26035168 0.79319197
13 7.04741801 0.26035168
14 -2.61803428 7.04741801
15 -1.95156711 -2.61803428
16 3.65476359 -1.95156711
17 5.54230990 3.65476359
18 6.26130220 5.54230990
19 -4.72432495 6.26130220
20 5.84148501 -4.72432495
21 2.92444519 5.84148501
22 2.28981640 2.92444519
23 -4.07453993 2.28981640
24 -0.34800468 -4.07453993
25 -1.08608777 -0.34800468
26 3.33873234 -1.08608777
27 1.92950787 3.33873234
28 1.22065039 1.92950787
29 -2.07206751 1.22065039
30 2.07911631 -2.07206751
31 -3.18211335 2.07911631
32 -4.36336990 -3.18211335
33 4.32246549 -4.36336990
34 3.07631167 4.32246549
35 0.45564338 3.07631167
36 -5.48095976 0.45564338
37 4.01289038 -5.48095976
38 0.15768046 4.01289038
39 -8.69643423 0.15768046
40 -3.85357180 -8.69643423
41 -4.01636152 -3.85357180
42 1.08432282 -4.01636152
43 -0.39887929 1.08432282
44 -3.66600704 -0.39887929
45 -0.45179062 -3.66600704
46 -2.77840724 -0.45179062
47 -1.49533996 -2.77840724
48 -6.79347902 -1.49533996
49 8.75347058 -6.79347902
50 5.73284840 8.75347058
51 2.77338108 5.73284840
52 -4.95009762 2.77338108
53 0.67708353 -4.95009762
54 -9.80660549 0.67708353
55 6.35442844 -9.80660549
56 2.82470705 6.35442844
57 0.59056738 2.82470705
58 -5.65537768 0.59056738
59 0.05363422 -5.65537768
60 0.43112653 0.05363422
61 -10.50611314 0.43112653
62 -5.70268789 -10.50611314
63 -0.80420389 -5.70268789
64 0.02946618 -0.80420389
65 4.47449206 0.02946618
66 6.69263519 4.47449206
67 1.43425416 6.69263519
68 0.58309204 1.43425416
69 -7.06199758 0.58309204
70 3.89436166 -7.06199758
71 3.06751173 3.89436166
72 -2.05353941 3.06751173
73 -0.77912654 -2.05353941
74 -5.01271003 -0.77912654
75 -1.21377961 -5.01271003
76 -11.52347412 -1.21377961
77 -4.54284640 -11.52347412
78 -3.94081862 -4.54284640
79 0.01781789 -3.94081862
80 -2.38377548 0.01781789
81 2.37444640 -2.38377548
82 -2.62209402 2.37444640
83 0.44125885 -2.62209402
84 0.81613540 0.44125885
85 2.62387743 0.81613540
86 0.95506754 2.62387743
87 -2.44007967 0.95506754
88 0.74576696 -2.44007967
89 2.22159276 0.74576696
90 7.09738087 2.22159276
91 -1.14345515 7.09738087
92 2.20748345 -1.14345515
93 -4.19894805 2.20748345
94 3.71410071 -4.19894805
95 1.69999140 3.71410071
96 1.00568183 1.69999140
97 -5.79049089 1.00568183
98 1.42366960 -5.79049089
99 4.32646414 1.42366960
100 0.96210455 4.32646414
101 2.55088998 0.96210455
102 1.38380790 2.55088998
103 1.35127469 1.38380790
104 -6.08957966 1.35127469
105 -8.58632323 -6.08957966
106 2.10943465 -8.58632323
107 1.58358386 2.10943465
108 -14.54321067 1.58358386
109 -2.94153791 -14.54321067
110 4.79972521 -2.94153791
111 4.73486238 4.79972521
112 -1.55565581 4.73486238
113 5.31309881 -1.55565581
114 -4.59588939 5.31309881
115 4.50894669 -4.59588939
116 0.81915664 4.50894669
117 -1.46998410 0.81915664
118 -2.51192384 -1.46998410
119 2.78509204 -2.51192384
120 2.32901474 2.78509204
121 3.01694251 2.32901474
122 -4.76734280 3.01694251
123 0.74294195 -4.76734280
124 0.30231828 0.74294195
125 2.43126603 0.30231828
126 6.15604268 2.43126603
127 6.54259462 6.15604268
128 0.66135682 6.54259462
129 1.70832313 0.66135682
130 -1.94989296 1.70832313
131 -2.98455333 -1.94989296
132 -3.15317250 -2.98455333
133 -0.12600540 -3.15317250
134 3.04243978 -0.12600540
135 4.39231087 3.04243978
136 2.99328740 4.39231087
137 3.70170953 2.99328740
138 6.10569955 3.70170953
139 0.94888256 6.10569955
140 1.05041456 0.94888256
141 2.24220299 1.05041456
142 -0.19062827 2.24220299
143 5.32315680 -0.19062827
144 -6.45116773 5.32315680
145 0.66950747 -6.45116773
146 2.58864244 0.66950747
147 -3.75850868 2.58864244
148 NA -3.75850868
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 3.18007613 -8.63271143
[2,] -0.61763797 3.18007613
[3,] 0.82923825 -0.61763797
[4,] -1.64538486 0.82923825
[5,] -7.37035342 -1.64538486
[6,] 3.71730026 -7.37035342
[7,] 2.27030052 3.71730026
[8,] -0.01440454 2.27030052
[9,] 3.19066912 -0.01440454
[10,] -1.22938719 3.19066912
[11,] 0.79319197 -1.22938719
[12,] 0.26035168 0.79319197
[13,] 7.04741801 0.26035168
[14,] -2.61803428 7.04741801
[15,] -1.95156711 -2.61803428
[16,] 3.65476359 -1.95156711
[17,] 5.54230990 3.65476359
[18,] 6.26130220 5.54230990
[19,] -4.72432495 6.26130220
[20,] 5.84148501 -4.72432495
[21,] 2.92444519 5.84148501
[22,] 2.28981640 2.92444519
[23,] -4.07453993 2.28981640
[24,] -0.34800468 -4.07453993
[25,] -1.08608777 -0.34800468
[26,] 3.33873234 -1.08608777
[27,] 1.92950787 3.33873234
[28,] 1.22065039 1.92950787
[29,] -2.07206751 1.22065039
[30,] 2.07911631 -2.07206751
[31,] -3.18211335 2.07911631
[32,] -4.36336990 -3.18211335
[33,] 4.32246549 -4.36336990
[34,] 3.07631167 4.32246549
[35,] 0.45564338 3.07631167
[36,] -5.48095976 0.45564338
[37,] 4.01289038 -5.48095976
[38,] 0.15768046 4.01289038
[39,] -8.69643423 0.15768046
[40,] -3.85357180 -8.69643423
[41,] -4.01636152 -3.85357180
[42,] 1.08432282 -4.01636152
[43,] -0.39887929 1.08432282
[44,] -3.66600704 -0.39887929
[45,] -0.45179062 -3.66600704
[46,] -2.77840724 -0.45179062
[47,] -1.49533996 -2.77840724
[48,] -6.79347902 -1.49533996
[49,] 8.75347058 -6.79347902
[50,] 5.73284840 8.75347058
[51,] 2.77338108 5.73284840
[52,] -4.95009762 2.77338108
[53,] 0.67708353 -4.95009762
[54,] -9.80660549 0.67708353
[55,] 6.35442844 -9.80660549
[56,] 2.82470705 6.35442844
[57,] 0.59056738 2.82470705
[58,] -5.65537768 0.59056738
[59,] 0.05363422 -5.65537768
[60,] 0.43112653 0.05363422
[61,] -10.50611314 0.43112653
[62,] -5.70268789 -10.50611314
[63,] -0.80420389 -5.70268789
[64,] 0.02946618 -0.80420389
[65,] 4.47449206 0.02946618
[66,] 6.69263519 4.47449206
[67,] 1.43425416 6.69263519
[68,] 0.58309204 1.43425416
[69,] -7.06199758 0.58309204
[70,] 3.89436166 -7.06199758
[71,] 3.06751173 3.89436166
[72,] -2.05353941 3.06751173
[73,] -0.77912654 -2.05353941
[74,] -5.01271003 -0.77912654
[75,] -1.21377961 -5.01271003
[76,] -11.52347412 -1.21377961
[77,] -4.54284640 -11.52347412
[78,] -3.94081862 -4.54284640
[79,] 0.01781789 -3.94081862
[80,] -2.38377548 0.01781789
[81,] 2.37444640 -2.38377548
[82,] -2.62209402 2.37444640
[83,] 0.44125885 -2.62209402
[84,] 0.81613540 0.44125885
[85,] 2.62387743 0.81613540
[86,] 0.95506754 2.62387743
[87,] -2.44007967 0.95506754
[88,] 0.74576696 -2.44007967
[89,] 2.22159276 0.74576696
[90,] 7.09738087 2.22159276
[91,] -1.14345515 7.09738087
[92,] 2.20748345 -1.14345515
[93,] -4.19894805 2.20748345
[94,] 3.71410071 -4.19894805
[95,] 1.69999140 3.71410071
[96,] 1.00568183 1.69999140
[97,] -5.79049089 1.00568183
[98,] 1.42366960 -5.79049089
[99,] 4.32646414 1.42366960
[100,] 0.96210455 4.32646414
[101,] 2.55088998 0.96210455
[102,] 1.38380790 2.55088998
[103,] 1.35127469 1.38380790
[104,] -6.08957966 1.35127469
[105,] -8.58632323 -6.08957966
[106,] 2.10943465 -8.58632323
[107,] 1.58358386 2.10943465
[108,] -14.54321067 1.58358386
[109,] -2.94153791 -14.54321067
[110,] 4.79972521 -2.94153791
[111,] 4.73486238 4.79972521
[112,] -1.55565581 4.73486238
[113,] 5.31309881 -1.55565581
[114,] -4.59588939 5.31309881
[115,] 4.50894669 -4.59588939
[116,] 0.81915664 4.50894669
[117,] -1.46998410 0.81915664
[118,] -2.51192384 -1.46998410
[119,] 2.78509204 -2.51192384
[120,] 2.32901474 2.78509204
[121,] 3.01694251 2.32901474
[122,] -4.76734280 3.01694251
[123,] 0.74294195 -4.76734280
[124,] 0.30231828 0.74294195
[125,] 2.43126603 0.30231828
[126,] 6.15604268 2.43126603
[127,] 6.54259462 6.15604268
[128,] 0.66135682 6.54259462
[129,] 1.70832313 0.66135682
[130,] -1.94989296 1.70832313
[131,] -2.98455333 -1.94989296
[132,] -3.15317250 -2.98455333
[133,] -0.12600540 -3.15317250
[134,] 3.04243978 -0.12600540
[135,] 4.39231087 3.04243978
[136,] 2.99328740 4.39231087
[137,] 3.70170953 2.99328740
[138,] 6.10569955 3.70170953
[139,] 0.94888256 6.10569955
[140,] 1.05041456 0.94888256
[141,] 2.24220299 1.05041456
[142,] -0.19062827 2.24220299
[143,] 5.32315680 -0.19062827
[144,] -6.45116773 5.32315680
[145,] 0.66950747 -6.45116773
[146,] 2.58864244 0.66950747
[147,] -3.75850868 2.58864244
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 3.18007613 -8.63271143
2 -0.61763797 3.18007613
3 0.82923825 -0.61763797
4 -1.64538486 0.82923825
5 -7.37035342 -1.64538486
6 3.71730026 -7.37035342
7 2.27030052 3.71730026
8 -0.01440454 2.27030052
9 3.19066912 -0.01440454
10 -1.22938719 3.19066912
11 0.79319197 -1.22938719
12 0.26035168 0.79319197
13 7.04741801 0.26035168
14 -2.61803428 7.04741801
15 -1.95156711 -2.61803428
16 3.65476359 -1.95156711
17 5.54230990 3.65476359
18 6.26130220 5.54230990
19 -4.72432495 6.26130220
20 5.84148501 -4.72432495
21 2.92444519 5.84148501
22 2.28981640 2.92444519
23 -4.07453993 2.28981640
24 -0.34800468 -4.07453993
25 -1.08608777 -0.34800468
26 3.33873234 -1.08608777
27 1.92950787 3.33873234
28 1.22065039 1.92950787
29 -2.07206751 1.22065039
30 2.07911631 -2.07206751
31 -3.18211335 2.07911631
32 -4.36336990 -3.18211335
33 4.32246549 -4.36336990
34 3.07631167 4.32246549
35 0.45564338 3.07631167
36 -5.48095976 0.45564338
37 4.01289038 -5.48095976
38 0.15768046 4.01289038
39 -8.69643423 0.15768046
40 -3.85357180 -8.69643423
41 -4.01636152 -3.85357180
42 1.08432282 -4.01636152
43 -0.39887929 1.08432282
44 -3.66600704 -0.39887929
45 -0.45179062 -3.66600704
46 -2.77840724 -0.45179062
47 -1.49533996 -2.77840724
48 -6.79347902 -1.49533996
49 8.75347058 -6.79347902
50 5.73284840 8.75347058
51 2.77338108 5.73284840
52 -4.95009762 2.77338108
53 0.67708353 -4.95009762
54 -9.80660549 0.67708353
55 6.35442844 -9.80660549
56 2.82470705 6.35442844
57 0.59056738 2.82470705
58 -5.65537768 0.59056738
59 0.05363422 -5.65537768
60 0.43112653 0.05363422
61 -10.50611314 0.43112653
62 -5.70268789 -10.50611314
63 -0.80420389 -5.70268789
64 0.02946618 -0.80420389
65 4.47449206 0.02946618
66 6.69263519 4.47449206
67 1.43425416 6.69263519
68 0.58309204 1.43425416
69 -7.06199758 0.58309204
70 3.89436166 -7.06199758
71 3.06751173 3.89436166
72 -2.05353941 3.06751173
73 -0.77912654 -2.05353941
74 -5.01271003 -0.77912654
75 -1.21377961 -5.01271003
76 -11.52347412 -1.21377961
77 -4.54284640 -11.52347412
78 -3.94081862 -4.54284640
79 0.01781789 -3.94081862
80 -2.38377548 0.01781789
81 2.37444640 -2.38377548
82 -2.62209402 2.37444640
83 0.44125885 -2.62209402
84 0.81613540 0.44125885
85 2.62387743 0.81613540
86 0.95506754 2.62387743
87 -2.44007967 0.95506754
88 0.74576696 -2.44007967
89 2.22159276 0.74576696
90 7.09738087 2.22159276
91 -1.14345515 7.09738087
92 2.20748345 -1.14345515
93 -4.19894805 2.20748345
94 3.71410071 -4.19894805
95 1.69999140 3.71410071
96 1.00568183 1.69999140
97 -5.79049089 1.00568183
98 1.42366960 -5.79049089
99 4.32646414 1.42366960
100 0.96210455 4.32646414
101 2.55088998 0.96210455
102 1.38380790 2.55088998
103 1.35127469 1.38380790
104 -6.08957966 1.35127469
105 -8.58632323 -6.08957966
106 2.10943465 -8.58632323
107 1.58358386 2.10943465
108 -14.54321067 1.58358386
109 -2.94153791 -14.54321067
110 4.79972521 -2.94153791
111 4.73486238 4.79972521
112 -1.55565581 4.73486238
113 5.31309881 -1.55565581
114 -4.59588939 5.31309881
115 4.50894669 -4.59588939
116 0.81915664 4.50894669
117 -1.46998410 0.81915664
118 -2.51192384 -1.46998410
119 2.78509204 -2.51192384
120 2.32901474 2.78509204
121 3.01694251 2.32901474
122 -4.76734280 3.01694251
123 0.74294195 -4.76734280
124 0.30231828 0.74294195
125 2.43126603 0.30231828
126 6.15604268 2.43126603
127 6.54259462 6.15604268
128 0.66135682 6.54259462
129 1.70832313 0.66135682
130 -1.94989296 1.70832313
131 -2.98455333 -1.94989296
132 -3.15317250 -2.98455333
133 -0.12600540 -3.15317250
134 3.04243978 -0.12600540
135 4.39231087 3.04243978
136 2.99328740 4.39231087
137 3.70170953 2.99328740
138 6.10569955 3.70170953
139 0.94888256 6.10569955
140 1.05041456 0.94888256
141 2.24220299 1.05041456
142 -0.19062827 2.24220299
143 5.32315680 -0.19062827
144 -6.45116773 5.32315680
145 0.66950747 -6.45116773
146 2.58864244 0.66950747
147 -3.75850868 2.58864244
> 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/rcomp/tmp/7lk6k1292930815.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/rcomp/tmp/8lk6k1292930815.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/rcomp/tmp/9lk6k1292930815.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/rcomp/tmp/10ebn51292930815.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/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/www/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/rcomp/tmp/11s4o61292930816.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/rcomp/tmp/12d45c1292930816.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/rcomp/tmp/13rekl1292930816.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/rcomp/tmp/14cwjq1292930816.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/rcomp/tmp/15gfhe1292930816.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/rcomp/tmp/161xgk1292930816.tab")
+ }
>
> try(system("convert tmp/1psqt1292930815.ps tmp/1psqt1292930815.png",intern=TRUE))
character(0)
> try(system("convert tmp/2psqt1292930815.ps tmp/2psqt1292930815.png",intern=TRUE))
character(0)
> try(system("convert tmp/301pe1292930815.ps tmp/301pe1292930815.png",intern=TRUE))
character(0)
> try(system("convert tmp/401pe1292930815.ps tmp/401pe1292930815.png",intern=TRUE))
character(0)
> try(system("convert tmp/501pe1292930815.ps tmp/501pe1292930815.png",intern=TRUE))
character(0)
> try(system("convert tmp/6atph1292930815.ps tmp/6atph1292930815.png",intern=TRUE))
character(0)
> try(system("convert tmp/7lk6k1292930815.ps tmp/7lk6k1292930815.png",intern=TRUE))
character(0)
> try(system("convert tmp/8lk6k1292930815.ps tmp/8lk6k1292930815.png",intern=TRUE))
character(0)
> try(system("convert tmp/9lk6k1292930815.ps tmp/9lk6k1292930815.png",intern=TRUE))
character(0)
> try(system("convert tmp/10ebn51292930815.ps tmp/10ebn51292930815.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
4.360 0.820 5.171