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(12
+ ,4
+ ,7
+ ,2
+ ,11
+ ,3
+ ,5
+ ,4
+ ,14
+ ,5
+ ,7
+ ,7
+ ,12
+ ,3
+ ,3
+ ,3
+ ,21
+ ,6
+ ,7
+ ,7
+ ,12
+ ,5
+ ,7
+ ,2
+ ,22
+ ,6
+ ,7
+ ,7
+ ,11
+ ,6
+ ,1
+ ,2
+ ,10
+ ,5
+ ,4
+ ,1
+ ,13
+ ,5
+ ,5
+ ,2
+ ,10
+ ,3
+ ,6
+ ,6
+ ,8
+ ,5
+ ,4
+ ,1
+ ,15
+ ,7
+ ,7
+ ,1
+ ,10
+ ,5
+ ,6
+ ,1
+ ,14
+ ,5
+ ,2
+ ,2
+ ,14
+ ,3
+ ,2
+ ,2
+ ,11
+ ,5
+ ,6
+ ,2
+ ,10
+ ,6
+ ,7
+ ,1
+ ,13
+ ,5
+ ,5
+ ,7
+ ,7
+ ,2
+ ,2
+ ,1
+ ,12
+ ,5
+ ,7
+ ,2
+ ,14
+ ,4
+ ,4
+ ,4
+ ,11
+ ,6
+ ,5
+ ,2
+ ,9
+ ,3
+ ,5
+ ,1
+ ,11
+ ,5
+ ,5
+ ,1
+ ,15
+ ,4
+ ,3
+ ,5
+ ,13
+ ,5
+ ,5
+ ,2
+ ,9
+ ,2
+ ,1
+ ,1
+ ,15
+ ,2
+ ,1
+ ,3
+ ,10
+ ,5
+ ,3
+ ,1
+ ,11
+ ,2
+ ,2
+ ,2
+ ,13
+ ,2
+ ,3
+ ,5
+ ,8
+ ,2
+ ,2
+ ,2
+ ,20
+ ,5
+ ,5
+ ,6
+ ,12
+ ,5
+ ,2
+ ,4
+ ,10
+ ,1
+ ,3
+ ,1
+ ,10
+ ,5
+ ,4
+ ,3
+ ,9
+ ,2
+ ,6
+ ,6
+ ,14
+ ,6
+ ,2
+ ,7
+ ,8
+ ,1
+ ,7
+ ,4
+ ,14
+ ,4
+ ,6
+ ,1
+ ,11
+ ,3
+ ,5
+ ,5
+ ,13
+ ,2
+ ,3
+ ,3
+ ,11
+ ,5
+ ,3
+ ,2
+ ,11
+ ,3
+ ,4
+ ,2
+ ,10
+ ,4
+ ,5
+ ,2
+ ,14
+ ,3
+ ,2
+ ,2
+ ,18
+ ,6
+ ,7
+ ,1
+ ,14
+ ,4
+ ,6
+ ,2
+ ,11
+ ,5
+ ,5
+ ,1
+ ,12
+ ,2
+ ,6
+ ,2
+ ,13
+ ,5
+ ,5
+ ,2
+ ,9
+ ,5
+ ,2
+ ,5
+ ,10
+ ,3
+ ,3
+ ,5
+ ,15
+ ,5
+ ,5
+ ,2
+ ,20
+ ,7
+ ,7
+ ,1
+ ,12
+ ,4
+ ,4
+ ,1
+ ,12
+ ,2
+ ,7
+ ,2
+ ,14
+ ,3
+ ,5
+ ,3
+ ,13
+ ,6
+ ,6
+ ,7
+ ,11
+ ,7
+ ,6
+ ,4
+ ,17
+ ,4
+ ,3
+ ,4
+ ,12
+ ,4
+ ,5
+ ,1
+ ,13
+ ,4
+ ,7
+ ,2
+ ,14
+ ,5
+ ,7
+ ,2
+ ,13
+ ,2
+ ,5
+ ,2
+ ,15
+ ,3
+ ,6
+ ,5
+ ,13
+ ,3
+ ,5
+ ,1
+ ,10
+ ,4
+ ,5
+ ,6
+ ,11
+ ,3
+ ,2
+ ,2
+ ,13
+ ,4
+ ,5
+ ,2
+ ,17
+ ,6
+ ,4
+ ,4
+ ,13
+ ,2
+ ,6
+ ,6
+ ,9
+ ,4
+ ,5
+ ,2
+ ,11
+ ,5
+ ,3
+ ,2
+ ,10
+ ,2
+ ,3
+ ,2
+ ,9
+ ,1
+ ,4
+ ,1
+ ,12
+ ,2
+ ,2
+ ,1
+ ,12
+ ,5
+ ,2
+ ,2
+ ,13
+ ,4
+ ,5
+ ,2
+ ,13
+ ,4
+ ,4
+ ,3
+ ,22
+ ,6
+ ,6
+ ,3
+ ,13
+ ,1
+ ,4
+ ,5
+ ,15
+ ,4
+ ,6
+ ,2
+ ,13
+ ,5
+ ,4
+ ,5
+ ,15
+ ,2
+ ,2
+ ,3
+ ,10
+ ,3
+ ,5
+ ,1
+ ,11
+ ,3
+ ,2
+ ,2
+ ,16
+ ,6
+ ,7
+ ,2
+ ,11
+ ,5
+ ,1
+ ,1
+ ,11
+ ,4
+ ,3
+ ,2
+ ,10
+ ,4
+ ,5
+ ,2
+ ,10
+ ,5
+ ,6
+ ,5
+ ,16
+ ,5
+ ,6
+ ,5
+ ,12
+ ,6
+ ,2
+ ,2
+ ,11
+ ,6
+ ,5
+ ,3
+ ,16
+ ,5
+ ,5
+ ,5
+ ,19
+ ,7
+ ,3
+ ,5
+ ,11
+ ,5
+ ,6
+ ,6
+ ,15
+ ,5
+ ,5
+ ,2
+ ,24
+ ,7
+ ,7
+ ,7
+ ,14
+ ,5
+ ,1
+ ,1
+ ,15
+ ,6
+ ,6
+ ,1
+ ,11
+ ,6
+ ,4
+ ,6
+ ,15
+ ,4
+ ,7
+ ,6
+ ,12
+ ,5
+ ,2
+ ,2
+ ,10
+ ,1
+ ,6
+ ,1
+ ,14
+ ,6
+ ,7
+ ,2
+ ,9
+ ,5
+ ,5
+ ,1
+ ,15
+ ,2
+ ,2
+ ,2
+ ,15
+ ,1
+ ,1
+ ,1
+ ,14
+ ,5
+ ,3
+ ,3
+ ,11
+ ,6
+ ,3
+ ,3
+ ,8
+ ,5
+ ,3
+ ,6
+ ,11
+ ,5
+ ,5
+ ,4
+ ,8
+ ,4
+ ,2
+ ,1
+ ,10
+ ,2
+ ,4
+ ,2
+ ,11
+ ,3
+ ,6
+ ,5
+ ,13
+ ,3
+ ,5
+ ,6
+ ,11
+ ,5
+ ,5
+ ,3
+ ,20
+ ,3
+ ,2
+ ,5
+ ,10
+ ,2
+ ,3
+ ,3
+ ,12
+ ,2
+ ,2
+ ,2
+ ,14
+ ,3
+ ,6
+ ,3
+ ,23
+ ,6
+ ,5
+ ,2
+ ,14
+ ,5
+ ,4
+ ,5
+ ,16
+ ,6
+ ,6
+ ,5
+ ,11
+ ,2
+ ,4
+ ,7
+ ,12
+ ,5
+ ,6
+ ,4
+ ,10
+ ,5
+ ,2
+ ,4
+ ,14
+ ,5
+ ,0
+ ,5
+ ,12
+ ,1
+ ,1
+ ,1
+ ,12
+ ,4
+ ,5
+ ,4
+ ,11
+ ,2
+ ,2
+ ,1
+ ,12
+ ,2
+ ,5
+ ,4
+ ,13
+ ,7
+ ,6
+ ,6
+ ,17
+ ,6
+ ,7
+ ,7
+ ,11
+ ,5
+ ,5
+ ,1
+ ,12
+ ,5
+ ,5
+ ,3
+ ,19
+ ,5
+ ,5
+ ,5
+ ,15
+ ,4
+ ,6
+ ,2
+ ,14
+ ,3
+ ,6
+ ,4
+ ,11
+ ,3
+ ,6
+ ,5
+ ,9
+ ,3
+ ,1
+ ,1
+ ,18
+ ,2
+ ,3
+ ,2)
+ ,dim=c(4
+ ,145)
+ ,dimnames=list(c('Depression'
+ ,'FutureWorrying'
+ ,'SleepDepri'
+ ,'ChangesLastYear
')
+ ,1:145))
> y <- array(NA,dim=c(4,145),dimnames=list(c('Depression','FutureWorrying','SleepDepri','ChangesLastYear
'),1:145))
> 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 = '1'
> #'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
Depression FutureWorrying SleepDepri ChangesLastYear\r
1 12 4 7 2
2 11 3 5 4
3 14 5 7 7
4 12 3 3 3
5 21 6 7 7
6 12 5 7 2
7 22 6 7 7
8 11 6 1 2
9 10 5 4 1
10 13 5 5 2
11 10 3 6 6
12 8 5 4 1
13 15 7 7 1
14 10 5 6 1
15 14 5 2 2
16 14 3 2 2
17 11 5 6 2
18 10 6 7 1
19 13 5 5 7
20 7 2 2 1
21 12 5 7 2
22 14 4 4 4
23 11 6 5 2
24 9 3 5 1
25 11 5 5 1
26 15 4 3 5
27 13 5 5 2
28 9 2 1 1
29 15 2 1 3
30 10 5 3 1
31 11 2 2 2
32 13 2 3 5
33 8 2 2 2
34 20 5 5 6
35 12 5 2 4
36 10 1 3 1
37 10 5 4 3
38 9 2 6 6
39 14 6 2 7
40 8 1 7 4
41 14 4 6 1
42 11 3 5 5
43 13 2 3 3
44 11 5 3 2
45 11 3 4 2
46 10 4 5 2
47 14 3 2 2
48 18 6 7 1
49 14 4 6 2
50 11 5 5 1
51 12 2 6 2
52 13 5 5 2
53 9 5 2 5
54 10 3 3 5
55 15 5 5 2
56 20 7 7 1
57 12 4 4 1
58 12 2 7 2
59 14 3 5 3
60 13 6 6 7
61 11 7 6 4
62 17 4 3 4
63 12 4 5 1
64 13 4 7 2
65 14 5 7 2
66 13 2 5 2
67 15 3 6 5
68 13 3 5 1
69 10 4 5 6
70 11 3 2 2
71 13 4 5 2
72 17 6 4 4
73 13 2 6 6
74 9 4 5 2
75 11 5 3 2
76 10 2 3 2
77 9 1 4 1
78 12 2 2 1
79 12 5 2 2
80 13 4 5 2
81 13 4 4 3
82 22 6 6 3
83 13 1 4 5
84 15 4 6 2
85 13 5 4 5
86 15 2 2 3
87 10 3 5 1
88 11 3 2 2
89 16 6 7 2
90 11 5 1 1
91 11 4 3 2
92 10 4 5 2
93 10 5 6 5
94 16 5 6 5
95 12 6 2 2
96 11 6 5 3
97 16 5 5 5
98 19 7 3 5
99 11 5 6 6
100 15 5 5 2
101 24 7 7 7
102 14 5 1 1
103 15 6 6 1
104 11 6 4 6
105 15 4 7 6
106 12 5 2 2
107 10 1 6 1
108 14 6 7 2
109 9 5 5 1
110 15 2 2 2
111 15 1 1 1
112 14 5 3 3
113 11 6 3 3
114 8 5 3 6
115 11 5 5 4
116 8 4 2 1
117 10 2 4 2
118 11 3 6 5
119 13 3 5 6
120 11 5 5 3
121 20 3 2 5
122 10 2 3 3
123 12 2 2 2
124 14 3 6 3
125 23 6 5 2
126 14 5 4 5
127 16 6 6 5
128 11 2 4 7
129 12 5 6 4
130 10 5 2 4
131 14 5 0 5
132 12 1 1 1
133 12 4 5 4
134 11 2 2 1
135 12 2 5 4
136 13 7 6 6
137 17 6 7 7
138 11 5 5 1
139 12 5 5 3
140 19 5 5 5
141 15 4 6 2
142 14 3 6 4
143 11 3 6 5
144 9 3 1 1
145 18 2 3 2
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) FutureWorrying SleepDepri
8.5485 0.5606 0.1807
`ChangesLastYear\r`
0.3702
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-6.1147 -1.9847 -0.3321 1.5987 9.4441
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 8.5485 0.8154 10.484 < 2e-16 ***
FutureWorrying 0.5606 0.1618 3.464 0.000705 ***
SleepDepri 0.1807 0.1396 1.294 0.197731
`ChangesLastYear\r` 0.3702 0.1322 2.801 0.005807 **
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 2.885 on 141 degrees of freedom
Multiple R-squared: 0.1847, Adjusted R-squared: 0.1673
F-statistic: 10.64 on 3 and 141 DF, p-value: 2.368e-06
> if (n > n25) {
+ kp3 <- k + 3
+ nmkm3 <- n - k - 3
+ gqarr <- array(NA, dim=c(nmkm3-kp3+1,3))
+ numgqtests <- 0
+ numsignificant1 <- 0
+ numsignificant5 <- 0
+ numsignificant10 <- 0
+ for (mypoint in kp3:nmkm3) {
+ j <- 0
+ numgqtests <- numgqtests + 1
+ for (myalt in c('greater', 'two.sided', 'less')) {
+ j <- j + 1
+ gqarr[mypoint-kp3+1,j] <- gqtest(mylm, point=mypoint, alternative=myalt)$p.value
+ }
+ if (gqarr[mypoint-kp3+1,2] < 0.01) numsignificant1 <- numsignificant1 + 1
+ if (gqarr[mypoint-kp3+1,2] < 0.05) numsignificant5 <- numsignificant5 + 1
+ if (gqarr[mypoint-kp3+1,2] < 0.10) numsignificant10 <- numsignificant10 + 1
+ }
+ gqarr
+ }
[,1] [,2] [,3]
[1,] 0.45882477 0.91764954 0.5411752
[2,] 0.59070120 0.81859760 0.4092988
[3,] 0.45297291 0.90594582 0.5470271
[4,] 0.34000751 0.68001502 0.6599925
[5,] 0.39849865 0.79699729 0.6015014
[6,] 0.40111835 0.80223670 0.5988817
[7,] 0.30194065 0.60388130 0.6980593
[8,] 0.23498719 0.46997438 0.7650128
[9,] 0.24677870 0.49355741 0.7532213
[10,] 0.44236247 0.88472494 0.5576375
[11,] 0.37325081 0.74650162 0.6267492
[12,] 0.34401899 0.68803798 0.6559810
[13,] 0.42639979 0.85279959 0.5736002
[14,] 0.36454527 0.72909053 0.6354547
[15,] 0.29757534 0.59515068 0.7024247
[16,] 0.24933750 0.49867501 0.7506625
[17,] 0.22885725 0.45771450 0.7711428
[18,] 0.18538281 0.37076563 0.8146172
[19,] 0.14453625 0.28907250 0.8554638
[20,] 0.11663787 0.23327575 0.8833621
[21,] 0.09068959 0.18137917 0.9093104
[22,] 0.07006658 0.14013316 0.9299334
[23,] 0.12206741 0.24413482 0.8779326
[24,] 0.10223028 0.20446056 0.8977697
[25,] 0.08040211 0.16080423 0.9195979
[26,] 0.05992173 0.11984346 0.9400783
[27,] 0.05278820 0.10557640 0.9472118
[28,] 0.08428278 0.16856555 0.9157172
[29,] 0.08224571 0.16449142 0.9177543
[30,] 0.07356875 0.14713750 0.9264312
[31,] 0.08178932 0.16357865 0.9182107
[32,] 0.12191154 0.24382308 0.8780885
[33,] 0.13607840 0.27215679 0.8639216
[34,] 0.13626517 0.27253034 0.8637348
[35,] 0.15662452 0.31324904 0.8433755
[36,] 0.13799204 0.27598409 0.8620080
[37,] 0.13113218 0.26226435 0.8688678
[38,] 0.11029396 0.22058792 0.8897060
[39,] 0.08843580 0.17687159 0.9115642
[40,] 0.07691435 0.15382869 0.9230857
[41,] 0.08458147 0.16916294 0.9154185
[42,] 0.16162464 0.32324928 0.8383754
[43,] 0.14954812 0.29909625 0.8504519
[44,] 0.12747100 0.25494199 0.8725290
[45,] 0.11171579 0.22343158 0.8882842
[46,] 0.08988124 0.17976248 0.9101188
[47,] 0.14052845 0.28105691 0.8594715
[48,] 0.13470885 0.26941770 0.8652912
[49,] 0.12645823 0.25291646 0.8735418
[50,] 0.23454207 0.46908414 0.7654579
[51,] 0.20015572 0.40031143 0.7998443
[52,] 0.17166425 0.34332850 0.8283357
[53,] 0.15705790 0.31411580 0.8429421
[54,] 0.15889895 0.31779790 0.8411011
[55,] 0.19505646 0.39011293 0.8049435
[56,] 0.24267438 0.48534876 0.7573256
[57,] 0.20706930 0.41413860 0.7929307
[58,] 0.17467906 0.34935812 0.8253209
[59,] 0.14656618 0.29313235 0.8534338
[60,] 0.13179515 0.26359030 0.8682049
[61,] 0.11710462 0.23420925 0.8828954
[62,] 0.10180955 0.20361911 0.8981904
[63,] 0.12052724 0.24105448 0.8794728
[64,] 0.09844446 0.19688891 0.9015555
[65,] 0.07993799 0.15987598 0.9200620
[66,] 0.08031112 0.16062225 0.9196889
[67,] 0.06375251 0.12750503 0.9362475
[68,] 0.07030292 0.14060583 0.9296971
[69,] 0.05969114 0.11938228 0.9403089
[70,] 0.04814868 0.09629735 0.9518513
[71,] 0.03968190 0.07936379 0.9603181
[72,] 0.03387316 0.06774633 0.9661268
[73,] 0.02594250 0.05188500 0.9740575
[74,] 0.01973928 0.03947857 0.9802607
[75,] 0.01473706 0.02947413 0.9852629
[76,] 0.07825127 0.15650254 0.9217487
[77,] 0.06530348 0.13060697 0.9346965
[78,] 0.05965960 0.11931919 0.9403404
[79,] 0.04771315 0.09542631 0.9522868
[80,] 0.05696703 0.11393405 0.9430330
[81,] 0.04799228 0.09598456 0.9520077
[82,] 0.03734302 0.07468604 0.9626570
[83,] 0.03238947 0.06477893 0.9676105
[84,] 0.02528329 0.05056658 0.9747167
[85,] 0.01980301 0.03960603 0.9801970
[86,] 0.01835054 0.03670108 0.9816495
[87,] 0.02568134 0.05136269 0.9743187
[88,] 0.02097989 0.04195978 0.9790201
[89,] 0.01616749 0.03233498 0.9838325
[90,] 0.01638980 0.03277961 0.9836102
[91,] 0.01346252 0.02692503 0.9865375
[92,] 0.01835940 0.03671880 0.9816406
[93,] 0.02123881 0.04247762 0.9787612
[94,] 0.01744260 0.03488520 0.9825574
[95,] 0.10343341 0.20686682 0.8965666
[96,] 0.09052913 0.18105825 0.9094709
[97,] 0.07699442 0.15398884 0.9230056
[98,] 0.08318384 0.16636768 0.9168162
[99,] 0.06645979 0.13291958 0.9335402
[100,] 0.05123842 0.10247683 0.9487616
[101,] 0.04256231 0.08512463 0.9574377
[102,] 0.03180607 0.06361214 0.9681939
[103,] 0.03907444 0.07814889 0.9609256
[104,] 0.04447793 0.08895586 0.9555221
[105,] 0.06377289 0.12754579 0.9362271
[106,] 0.04958327 0.09916654 0.9504167
[107,] 0.04410011 0.08820022 0.9558999
[108,] 0.09186807 0.18373615 0.9081319
[109,] 0.08900454 0.17800908 0.9109955
[110,] 0.11882582 0.23765164 0.8811742
[111,] 0.10083497 0.20166995 0.8991650
[112,] 0.08837926 0.17675851 0.9116207
[113,] 0.06606012 0.13212025 0.9339399
[114,] 0.06601730 0.13203459 0.9339827
[115,] 0.26203873 0.52407746 0.7379613
[116,] 0.22696299 0.45392598 0.7730370
[117,] 0.17986367 0.35972734 0.8201363
[118,] 0.13960157 0.27920314 0.8603984
[119,] 0.61642232 0.76715536 0.3835777
[120,] 0.54154740 0.91690520 0.4584526
[121,] 0.49363184 0.98726367 0.5063682
[122,] 0.50955083 0.98089834 0.4904492
[123,] 0.45044002 0.90088004 0.5495600
[124,] 0.45570737 0.91141473 0.5442926
[125,] 0.36766949 0.73533898 0.6323305
[126,] 0.28756243 0.57512487 0.7124376
[127,] 0.23193070 0.46386139 0.7680693
[128,] 0.16525702 0.33051403 0.8347430
[129,] 0.13944929 0.27889859 0.8605507
[130,] 0.10339361 0.20678723 0.8966064
[131,] 0.05737129 0.11474257 0.9426287
[132,] 0.03075450 0.06150901 0.9692455
> postscript(file="/var/www/html/rcomp/tmp/1590u1290546992.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/rcomp/tmp/2g0hf1290546992.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/rcomp/tmp/3g0hf1290546992.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/rcomp/tmp/4g0hf1290546992.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/rcomp/tmp/59ay01290546992.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 = 145
Frequency = 1
1 2 3 4 5 6
-0.796104421 -1.614535577 -1.207675929 0.117053073 5.231747135 -1.356681358
7 8 9 10 11 12
6.231747135 -1.833089085 -2.444397839 0.004708379 -3.535628274 -4.444397839
13 14 15 16 17 18
0.892363684 -2.805787575 1.546792983 2.667946856 -2.175986489 -3.547059380
19 20 21 22 23 24
-1.846286192 -3.401277294 -1.356681358 1.005582355 -2.555868557 -2.503938835
25 26 27 28 29 30
-1.625092707 1.816078309 0.004708379 -1.220582426 4.039019746 -2.263702971
31 32 33 34 35 36
0.228523792 0.937232181 -2.771476208 5.523912722 -1.193604845 -0.021395226
37 38 39 40 41 42
-3.184795667 -3.975051337 -0.864778524 -3.854771441 1.754789361 -1.984734491
43 44 45 46 47 48
1.677630010 -1.633901885 -0.693442881 -2.434714685 2.667946856 4.452940620
49 50 51 52 53 54
1.384590447 -1.625092707 0.505744319 0.004708379 -4.563803759 -2.623344755
55 56 57 58 59 60
2.004708379 5.892363684 0.116179097 0.325049451 1.755663337 -2.587557997
61 62 63 64 65 66
-4.037538190 4.186277223 -0.064515771 0.203895579 0.643318642 1.686439187
67 68 69 70 71 72
1.834570641 1.496061165 -3.915510342 -0.332053144 0.565285315 2.884428482
73 74 75 76 77 78
0.024948663 -3.434714685 -1.633901885 -0.952171076 -1.202090094 1.598722706
79 80 81 82 83 84
-0.453207017 0.565285315 0.375781269 7.893237660 1.317114249 2.384590447
85 86 87 88 89 90
-0.925193496 3.858324878 -1.503938835 -0.332053144 2.082741706 -0.902313234
91 92 93 94 95 96
-1.073324949 -2.434714685 -4.286583232 1.713416768 -1.013783953 -2.926067472
97 98 99 100 101 102
1.894111636 4.134347500 -3.656782146 2.004708379 7.671170199 2.097686766
103 104 105 106 107 108
1.633635489 -3.855969346 0.723099922 -0.453207017 -0.563479830 0.082741706
109 110 111 112 113 114
-3.625092707 4.228523792 5.339994510 0.995899201 -2.564677735 -6.114697542
115 116 117 118 119 120
-2.735689450 -3.522431166 -1.132865944 -2.165429359 -0.354933406 -2.365490535
121 122 123 124 125 126
7.557350113 -1.322369990 1.228523792 1.574968469 9.444131443 0.074806504
127 128 129 130 131 132
1.152839832 -1.983860515 -1.916384318 -3.193604845 0.797585977 2.339994510
133 134 135 136 137 138
-1.175112513 0.598722706 -0.053958641 -2.777936019 1.231747135 -1.625092707
139 140 141 142 143 144
-1.365490535 4.894111636 2.384590447 1.204769555 -2.165429359 -1.781159362
145
7.047828924
> postscript(file="/var/www/html/rcomp/tmp/69ay01290546992.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 = 145
Frequency = 1
lag(myerror, k = 1) myerror
0 -0.796104421 NA
1 -1.614535577 -0.796104421
2 -1.207675929 -1.614535577
3 0.117053073 -1.207675929
4 5.231747135 0.117053073
5 -1.356681358 5.231747135
6 6.231747135 -1.356681358
7 -1.833089085 6.231747135
8 -2.444397839 -1.833089085
9 0.004708379 -2.444397839
10 -3.535628274 0.004708379
11 -4.444397839 -3.535628274
12 0.892363684 -4.444397839
13 -2.805787575 0.892363684
14 1.546792983 -2.805787575
15 2.667946856 1.546792983
16 -2.175986489 2.667946856
17 -3.547059380 -2.175986489
18 -1.846286192 -3.547059380
19 -3.401277294 -1.846286192
20 -1.356681358 -3.401277294
21 1.005582355 -1.356681358
22 -2.555868557 1.005582355
23 -2.503938835 -2.555868557
24 -1.625092707 -2.503938835
25 1.816078309 -1.625092707
26 0.004708379 1.816078309
27 -1.220582426 0.004708379
28 4.039019746 -1.220582426
29 -2.263702971 4.039019746
30 0.228523792 -2.263702971
31 0.937232181 0.228523792
32 -2.771476208 0.937232181
33 5.523912722 -2.771476208
34 -1.193604845 5.523912722
35 -0.021395226 -1.193604845
36 -3.184795667 -0.021395226
37 -3.975051337 -3.184795667
38 -0.864778524 -3.975051337
39 -3.854771441 -0.864778524
40 1.754789361 -3.854771441
41 -1.984734491 1.754789361
42 1.677630010 -1.984734491
43 -1.633901885 1.677630010
44 -0.693442881 -1.633901885
45 -2.434714685 -0.693442881
46 2.667946856 -2.434714685
47 4.452940620 2.667946856
48 1.384590447 4.452940620
49 -1.625092707 1.384590447
50 0.505744319 -1.625092707
51 0.004708379 0.505744319
52 -4.563803759 0.004708379
53 -2.623344755 -4.563803759
54 2.004708379 -2.623344755
55 5.892363684 2.004708379
56 0.116179097 5.892363684
57 0.325049451 0.116179097
58 1.755663337 0.325049451
59 -2.587557997 1.755663337
60 -4.037538190 -2.587557997
61 4.186277223 -4.037538190
62 -0.064515771 4.186277223
63 0.203895579 -0.064515771
64 0.643318642 0.203895579
65 1.686439187 0.643318642
66 1.834570641 1.686439187
67 1.496061165 1.834570641
68 -3.915510342 1.496061165
69 -0.332053144 -3.915510342
70 0.565285315 -0.332053144
71 2.884428482 0.565285315
72 0.024948663 2.884428482
73 -3.434714685 0.024948663
74 -1.633901885 -3.434714685
75 -0.952171076 -1.633901885
76 -1.202090094 -0.952171076
77 1.598722706 -1.202090094
78 -0.453207017 1.598722706
79 0.565285315 -0.453207017
80 0.375781269 0.565285315
81 7.893237660 0.375781269
82 1.317114249 7.893237660
83 2.384590447 1.317114249
84 -0.925193496 2.384590447
85 3.858324878 -0.925193496
86 -1.503938835 3.858324878
87 -0.332053144 -1.503938835
88 2.082741706 -0.332053144
89 -0.902313234 2.082741706
90 -1.073324949 -0.902313234
91 -2.434714685 -1.073324949
92 -4.286583232 -2.434714685
93 1.713416768 -4.286583232
94 -1.013783953 1.713416768
95 -2.926067472 -1.013783953
96 1.894111636 -2.926067472
97 4.134347500 1.894111636
98 -3.656782146 4.134347500
99 2.004708379 -3.656782146
100 7.671170199 2.004708379
101 2.097686766 7.671170199
102 1.633635489 2.097686766
103 -3.855969346 1.633635489
104 0.723099922 -3.855969346
105 -0.453207017 0.723099922
106 -0.563479830 -0.453207017
107 0.082741706 -0.563479830
108 -3.625092707 0.082741706
109 4.228523792 -3.625092707
110 5.339994510 4.228523792
111 0.995899201 5.339994510
112 -2.564677735 0.995899201
113 -6.114697542 -2.564677735
114 -2.735689450 -6.114697542
115 -3.522431166 -2.735689450
116 -1.132865944 -3.522431166
117 -2.165429359 -1.132865944
118 -0.354933406 -2.165429359
119 -2.365490535 -0.354933406
120 7.557350113 -2.365490535
121 -1.322369990 7.557350113
122 1.228523792 -1.322369990
123 1.574968469 1.228523792
124 9.444131443 1.574968469
125 0.074806504 9.444131443
126 1.152839832 0.074806504
127 -1.983860515 1.152839832
128 -1.916384318 -1.983860515
129 -3.193604845 -1.916384318
130 0.797585977 -3.193604845
131 2.339994510 0.797585977
132 -1.175112513 2.339994510
133 0.598722706 -1.175112513
134 -0.053958641 0.598722706
135 -2.777936019 -0.053958641
136 1.231747135 -2.777936019
137 -1.625092707 1.231747135
138 -1.365490535 -1.625092707
139 4.894111636 -1.365490535
140 2.384590447 4.894111636
141 1.204769555 2.384590447
142 -2.165429359 1.204769555
143 -1.781159362 -2.165429359
144 7.047828924 -1.781159362
145 NA 7.047828924
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -1.614535577 -0.796104421
[2,] -1.207675929 -1.614535577
[3,] 0.117053073 -1.207675929
[4,] 5.231747135 0.117053073
[5,] -1.356681358 5.231747135
[6,] 6.231747135 -1.356681358
[7,] -1.833089085 6.231747135
[8,] -2.444397839 -1.833089085
[9,] 0.004708379 -2.444397839
[10,] -3.535628274 0.004708379
[11,] -4.444397839 -3.535628274
[12,] 0.892363684 -4.444397839
[13,] -2.805787575 0.892363684
[14,] 1.546792983 -2.805787575
[15,] 2.667946856 1.546792983
[16,] -2.175986489 2.667946856
[17,] -3.547059380 -2.175986489
[18,] -1.846286192 -3.547059380
[19,] -3.401277294 -1.846286192
[20,] -1.356681358 -3.401277294
[21,] 1.005582355 -1.356681358
[22,] -2.555868557 1.005582355
[23,] -2.503938835 -2.555868557
[24,] -1.625092707 -2.503938835
[25,] 1.816078309 -1.625092707
[26,] 0.004708379 1.816078309
[27,] -1.220582426 0.004708379
[28,] 4.039019746 -1.220582426
[29,] -2.263702971 4.039019746
[30,] 0.228523792 -2.263702971
[31,] 0.937232181 0.228523792
[32,] -2.771476208 0.937232181
[33,] 5.523912722 -2.771476208
[34,] -1.193604845 5.523912722
[35,] -0.021395226 -1.193604845
[36,] -3.184795667 -0.021395226
[37,] -3.975051337 -3.184795667
[38,] -0.864778524 -3.975051337
[39,] -3.854771441 -0.864778524
[40,] 1.754789361 -3.854771441
[41,] -1.984734491 1.754789361
[42,] 1.677630010 -1.984734491
[43,] -1.633901885 1.677630010
[44,] -0.693442881 -1.633901885
[45,] -2.434714685 -0.693442881
[46,] 2.667946856 -2.434714685
[47,] 4.452940620 2.667946856
[48,] 1.384590447 4.452940620
[49,] -1.625092707 1.384590447
[50,] 0.505744319 -1.625092707
[51,] 0.004708379 0.505744319
[52,] -4.563803759 0.004708379
[53,] -2.623344755 -4.563803759
[54,] 2.004708379 -2.623344755
[55,] 5.892363684 2.004708379
[56,] 0.116179097 5.892363684
[57,] 0.325049451 0.116179097
[58,] 1.755663337 0.325049451
[59,] -2.587557997 1.755663337
[60,] -4.037538190 -2.587557997
[61,] 4.186277223 -4.037538190
[62,] -0.064515771 4.186277223
[63,] 0.203895579 -0.064515771
[64,] 0.643318642 0.203895579
[65,] 1.686439187 0.643318642
[66,] 1.834570641 1.686439187
[67,] 1.496061165 1.834570641
[68,] -3.915510342 1.496061165
[69,] -0.332053144 -3.915510342
[70,] 0.565285315 -0.332053144
[71,] 2.884428482 0.565285315
[72,] 0.024948663 2.884428482
[73,] -3.434714685 0.024948663
[74,] -1.633901885 -3.434714685
[75,] -0.952171076 -1.633901885
[76,] -1.202090094 -0.952171076
[77,] 1.598722706 -1.202090094
[78,] -0.453207017 1.598722706
[79,] 0.565285315 -0.453207017
[80,] 0.375781269 0.565285315
[81,] 7.893237660 0.375781269
[82,] 1.317114249 7.893237660
[83,] 2.384590447 1.317114249
[84,] -0.925193496 2.384590447
[85,] 3.858324878 -0.925193496
[86,] -1.503938835 3.858324878
[87,] -0.332053144 -1.503938835
[88,] 2.082741706 -0.332053144
[89,] -0.902313234 2.082741706
[90,] -1.073324949 -0.902313234
[91,] -2.434714685 -1.073324949
[92,] -4.286583232 -2.434714685
[93,] 1.713416768 -4.286583232
[94,] -1.013783953 1.713416768
[95,] -2.926067472 -1.013783953
[96,] 1.894111636 -2.926067472
[97,] 4.134347500 1.894111636
[98,] -3.656782146 4.134347500
[99,] 2.004708379 -3.656782146
[100,] 7.671170199 2.004708379
[101,] 2.097686766 7.671170199
[102,] 1.633635489 2.097686766
[103,] -3.855969346 1.633635489
[104,] 0.723099922 -3.855969346
[105,] -0.453207017 0.723099922
[106,] -0.563479830 -0.453207017
[107,] 0.082741706 -0.563479830
[108,] -3.625092707 0.082741706
[109,] 4.228523792 -3.625092707
[110,] 5.339994510 4.228523792
[111,] 0.995899201 5.339994510
[112,] -2.564677735 0.995899201
[113,] -6.114697542 -2.564677735
[114,] -2.735689450 -6.114697542
[115,] -3.522431166 -2.735689450
[116,] -1.132865944 -3.522431166
[117,] -2.165429359 -1.132865944
[118,] -0.354933406 -2.165429359
[119,] -2.365490535 -0.354933406
[120,] 7.557350113 -2.365490535
[121,] -1.322369990 7.557350113
[122,] 1.228523792 -1.322369990
[123,] 1.574968469 1.228523792
[124,] 9.444131443 1.574968469
[125,] 0.074806504 9.444131443
[126,] 1.152839832 0.074806504
[127,] -1.983860515 1.152839832
[128,] -1.916384318 -1.983860515
[129,] -3.193604845 -1.916384318
[130,] 0.797585977 -3.193604845
[131,] 2.339994510 0.797585977
[132,] -1.175112513 2.339994510
[133,] 0.598722706 -1.175112513
[134,] -0.053958641 0.598722706
[135,] -2.777936019 -0.053958641
[136,] 1.231747135 -2.777936019
[137,] -1.625092707 1.231747135
[138,] -1.365490535 -1.625092707
[139,] 4.894111636 -1.365490535
[140,] 2.384590447 4.894111636
[141,] 1.204769555 2.384590447
[142,] -2.165429359 1.204769555
[143,] -1.781159362 -2.165429359
[144,] 7.047828924 -1.781159362
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -1.614535577 -0.796104421
2 -1.207675929 -1.614535577
3 0.117053073 -1.207675929
4 5.231747135 0.117053073
5 -1.356681358 5.231747135
6 6.231747135 -1.356681358
7 -1.833089085 6.231747135
8 -2.444397839 -1.833089085
9 0.004708379 -2.444397839
10 -3.535628274 0.004708379
11 -4.444397839 -3.535628274
12 0.892363684 -4.444397839
13 -2.805787575 0.892363684
14 1.546792983 -2.805787575
15 2.667946856 1.546792983
16 -2.175986489 2.667946856
17 -3.547059380 -2.175986489
18 -1.846286192 -3.547059380
19 -3.401277294 -1.846286192
20 -1.356681358 -3.401277294
21 1.005582355 -1.356681358
22 -2.555868557 1.005582355
23 -2.503938835 -2.555868557
24 -1.625092707 -2.503938835
25 1.816078309 -1.625092707
26 0.004708379 1.816078309
27 -1.220582426 0.004708379
28 4.039019746 -1.220582426
29 -2.263702971 4.039019746
30 0.228523792 -2.263702971
31 0.937232181 0.228523792
32 -2.771476208 0.937232181
33 5.523912722 -2.771476208
34 -1.193604845 5.523912722
35 -0.021395226 -1.193604845
36 -3.184795667 -0.021395226
37 -3.975051337 -3.184795667
38 -0.864778524 -3.975051337
39 -3.854771441 -0.864778524
40 1.754789361 -3.854771441
41 -1.984734491 1.754789361
42 1.677630010 -1.984734491
43 -1.633901885 1.677630010
44 -0.693442881 -1.633901885
45 -2.434714685 -0.693442881
46 2.667946856 -2.434714685
47 4.452940620 2.667946856
48 1.384590447 4.452940620
49 -1.625092707 1.384590447
50 0.505744319 -1.625092707
51 0.004708379 0.505744319
52 -4.563803759 0.004708379
53 -2.623344755 -4.563803759
54 2.004708379 -2.623344755
55 5.892363684 2.004708379
56 0.116179097 5.892363684
57 0.325049451 0.116179097
58 1.755663337 0.325049451
59 -2.587557997 1.755663337
60 -4.037538190 -2.587557997
61 4.186277223 -4.037538190
62 -0.064515771 4.186277223
63 0.203895579 -0.064515771
64 0.643318642 0.203895579
65 1.686439187 0.643318642
66 1.834570641 1.686439187
67 1.496061165 1.834570641
68 -3.915510342 1.496061165
69 -0.332053144 -3.915510342
70 0.565285315 -0.332053144
71 2.884428482 0.565285315
72 0.024948663 2.884428482
73 -3.434714685 0.024948663
74 -1.633901885 -3.434714685
75 -0.952171076 -1.633901885
76 -1.202090094 -0.952171076
77 1.598722706 -1.202090094
78 -0.453207017 1.598722706
79 0.565285315 -0.453207017
80 0.375781269 0.565285315
81 7.893237660 0.375781269
82 1.317114249 7.893237660
83 2.384590447 1.317114249
84 -0.925193496 2.384590447
85 3.858324878 -0.925193496
86 -1.503938835 3.858324878
87 -0.332053144 -1.503938835
88 2.082741706 -0.332053144
89 -0.902313234 2.082741706
90 -1.073324949 -0.902313234
91 -2.434714685 -1.073324949
92 -4.286583232 -2.434714685
93 1.713416768 -4.286583232
94 -1.013783953 1.713416768
95 -2.926067472 -1.013783953
96 1.894111636 -2.926067472
97 4.134347500 1.894111636
98 -3.656782146 4.134347500
99 2.004708379 -3.656782146
100 7.671170199 2.004708379
101 2.097686766 7.671170199
102 1.633635489 2.097686766
103 -3.855969346 1.633635489
104 0.723099922 -3.855969346
105 -0.453207017 0.723099922
106 -0.563479830 -0.453207017
107 0.082741706 -0.563479830
108 -3.625092707 0.082741706
109 4.228523792 -3.625092707
110 5.339994510 4.228523792
111 0.995899201 5.339994510
112 -2.564677735 0.995899201
113 -6.114697542 -2.564677735
114 -2.735689450 -6.114697542
115 -3.522431166 -2.735689450
116 -1.132865944 -3.522431166
117 -2.165429359 -1.132865944
118 -0.354933406 -2.165429359
119 -2.365490535 -0.354933406
120 7.557350113 -2.365490535
121 -1.322369990 7.557350113
122 1.228523792 -1.322369990
123 1.574968469 1.228523792
124 9.444131443 1.574968469
125 0.074806504 9.444131443
126 1.152839832 0.074806504
127 -1.983860515 1.152839832
128 -1.916384318 -1.983860515
129 -3.193604845 -1.916384318
130 0.797585977 -3.193604845
131 2.339994510 0.797585977
132 -1.175112513 2.339994510
133 0.598722706 -1.175112513
134 -0.053958641 0.598722706
135 -2.777936019 -0.053958641
136 1.231747135 -2.777936019
137 -1.625092707 1.231747135
138 -1.365490535 -1.625092707
139 4.894111636 -1.365490535
140 2.384590447 4.894111636
141 1.204769555 2.384590447
142 -2.165429359 1.204769555
143 -1.781159362 -2.165429359
144 7.047828924 -1.781159362
> 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/7jjyk1290546992.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/rcomp/tmp/8jjyk1290546992.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/rcomp/tmp/9usfn1290546992.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/rcomp/tmp/10usfn1290546992.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/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/11fsvt1290546992.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/12jbcz1290546992.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/13xls81290546992.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/140mqe1290546992.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/15m4pk1290546992.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/167n5q1290546992.tab")
+ }
>
> try(system("convert tmp/1590u1290546992.ps tmp/1590u1290546992.png",intern=TRUE))
character(0)
> try(system("convert tmp/2g0hf1290546992.ps tmp/2g0hf1290546992.png",intern=TRUE))
character(0)
> try(system("convert tmp/3g0hf1290546992.ps tmp/3g0hf1290546992.png",intern=TRUE))
character(0)
> try(system("convert tmp/4g0hf1290546992.ps tmp/4g0hf1290546992.png",intern=TRUE))
character(0)
> try(system("convert tmp/59ay01290546992.ps tmp/59ay01290546992.png",intern=TRUE))
character(0)
> try(system("convert tmp/69ay01290546992.ps tmp/69ay01290546992.png",intern=TRUE))
character(0)
> try(system("convert tmp/7jjyk1290546992.ps tmp/7jjyk1290546992.png",intern=TRUE))
character(0)
> try(system("convert tmp/8jjyk1290546992.ps tmp/8jjyk1290546992.png",intern=TRUE))
character(0)
> try(system("convert tmp/9usfn1290546992.ps tmp/9usfn1290546992.png",intern=TRUE))
character(0)
> try(system("convert tmp/10usfn1290546992.ps tmp/10usfn1290546992.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
4.191 1.968 9.321