R version 2.15.1 (2012-06-22) -- "Roasted Marshmallows"
Copyright (C) 2012 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: i686-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(41
+ ,38
+ ,13
+ ,12
+ ,14
+ ,12
+ ,32
+ ,39
+ ,32
+ ,16
+ ,11
+ ,18
+ ,11
+ ,51
+ ,30
+ ,35
+ ,19
+ ,15
+ ,11
+ ,14
+ ,42
+ ,31
+ ,33
+ ,15
+ ,6
+ ,12
+ ,12
+ ,41
+ ,34
+ ,37
+ ,14
+ ,13
+ ,16
+ ,21
+ ,46
+ ,35
+ ,29
+ ,13
+ ,10
+ ,18
+ ,12
+ ,47
+ ,39
+ ,31
+ ,19
+ ,12
+ ,14
+ ,22
+ ,37
+ ,34
+ ,36
+ ,15
+ ,14
+ ,14
+ ,11
+ ,49
+ ,36
+ ,35
+ ,14
+ ,12
+ ,15
+ ,10
+ ,45
+ ,37
+ ,38
+ ,15
+ ,6
+ ,15
+ ,13
+ ,47
+ ,38
+ ,31
+ ,16
+ ,10
+ ,17
+ ,10
+ ,49
+ ,36
+ ,34
+ ,16
+ ,12
+ ,19
+ ,8
+ ,33
+ ,38
+ ,35
+ ,16
+ ,12
+ ,10
+ ,15
+ ,42
+ ,39
+ ,38
+ ,16
+ ,11
+ ,16
+ ,14
+ ,33
+ ,33
+ ,37
+ ,17
+ ,15
+ ,18
+ ,10
+ ,53
+ ,32
+ ,33
+ ,15
+ ,12
+ ,14
+ ,14
+ ,36
+ ,36
+ ,32
+ ,15
+ ,10
+ ,14
+ ,14
+ ,45
+ ,38
+ ,38
+ ,20
+ ,12
+ ,17
+ ,11
+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'Belonging_Final')
+ ,1:162))
> y <- array(NA,dim=c(7,162),dimnames=list(c('Connected','Separate','Learning','Software','Happiness','Depression','Belonging_Final'),1:162))
> 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 = '4'
> par3 <- 'No Linear Trend'
> par2 <- 'Do not include Seasonal Dummies'
> par1 <- '4'
> #'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, 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
Software Connected Separate Learning Happiness Depression Belonging_Final
1 12 41 38 13 14 12 32
2 11 39 32 16 18 11 51
3 15 30 35 19 11 14 42
4 6 31 33 15 12 12 41
5 13 34 37 14 16 21 46
6 10 35 29 13 18 12 47
7 12 39 31 19 14 22 37
8 14 34 36 15 14 11 49
9 12 36 35 14 15 10 45
10 6 37 38 15 15 13 47
11 10 38 31 16 17 10 49
12 12 36 34 16 19 8 33
13 12 38 35 16 10 15 42
14 11 39 38 16 16 14 33
15 15 33 37 17 18 10 53
16 12 32 33 15 14 14 36
17 10 36 32 15 14 14 45
18 12 38 38 20 17 11 54
19 11 39 38 18 14 10 41
20 12 32 32 16 16 13 36
21 11 32 33 16 18 7 41
22 12 31 31 16 11 14 44
23 13 39 38 19 14 12 33
24 11 37 39 16 12 14 37
25 9 39 32 17 17 11 52
26 13 41 32 17 9 9 47
27 10 36 35 16 16 11 43
28 14 33 37 15 14 15 44
29 12 33 33 16 15 14 45
30 10 34 33 14 11 13 44
31 12 31 28 15 16 9 49
32 8 27 32 12 13 15 33
33 10 37 31 14 17 10 43
34 12 34 37 16 15 11 54
35 12 34 30 14 14 13 42
36 7 32 33 7 16 8 44
37 6 29 31 10 9 20 37
38 12 36 33 14 15 12 43
39 10 29 31 16 17 10 46
40 10 35 33 16 13 10 42
41 10 37 32 16 15 9 45
42 12 34 33 14 16 14 44
43 15 38 32 20 16 8 33
44 10 35 33 14 12 14 31
45 10 38 28 14 12 11 42
46 12 37 35 11 11 13 40
47 13 38 39 14 15 9 43
48 11 33 34 15 15 11 46
49 11 36 38 16 17 15 42
50 12 38 32 14 13 11 45
51 14 32 38 16 16 10 44
52 10 32 30 14 14 14 40
53 12 32 33 12 11 18 37
54 13 34 38 16 12 14 46
55 5 32 32 9 12 11 36
56 6 37 32 14 15 12 47
57 12 39 34 16 16 13 45
58 12 29 34 16 15 9 42
59 11 37 36 15 12 10 43
60 10 35 34 16 12 15 43
61 7 30 28 12 8 20 32
62 12 38 34 16 13 12 45
63 14 34 35 16 11 12 45
64 11 31 35 14 14 14 31
65 12 34 31 16 15 13 33
66 13 35 37 17 10 11 49
67 14 36 35 18 11 17 42
68 11 30 27 18 12 12 41
69 12 39 40 12 15 13 38
70 12 35 37 16 15 14 42
71 8 38 36 10 14 13 44
72 11 31 38 14 16 15 33
73 14 34 39 18 15 13 48
74 14 38 41 18 15 10 40
75 12 34 27 16 13 11 50
76 9 39 30 17 12 19 49
77 13 37 37 16 17 13 43
78 11 34 31 16 13 17 44
79 12 28 31 13 15 13 47
80 12 37 27 16 13 9 33
81 12 33 36 16 15 11 46
82 12 37 38 20 16 10 0
83 12 35 37 16 15 9 45
84 12 37 33 15 16 12 43
85 11 32 34 15 15 12 44
86 10 33 31 16 14 13 47
87 9 38 39 14 15 13 45
88 12 33 34 16 14 12 42
89 12 29 32 16 13 15 33
90 12 33 33 15 7 22 43
91 9 31 36 12 17 13 46
92 15 36 32 17 13 15 33
93 12 35 41 16 15 13 46
94 12 32 28 15 14 15 48
95 12 29 30 13 13 10 47
96 10 39 36 16 16 11 47
97 13 37 35 16 12 16 43
98 9 35 31 16 14 11 46
99 12 37 34 16 17 11 48
100 10 32 36 14 15 10 46
101 14 38 36 16 17 10 45
102 11 37 35 16 12 16 45
103 15 36 37 20 16 12 52
104 11 32 28 15 11 11 42
105 11 33 39 16 15 16 47
106 12 40 32 13 9 19 41
107 12 38 35 17 16 11 47
108 12 41 39 16 15 16 43
109 11 36 35 16 10 15 33
110 7 43 42 12 10 24 30
111 12 30 34 16 15 14 49
112 14 31 33 16 11 15 44
113 11 32 41 17 13 11 55
114 11 32 33 13 14 15 11
115 10 37 34 12 18 12 47
116 13 37 32 18 16 10 53
117 13 33 40 14 14 14 33
118 8 34 40 14 14 13 44
119 11 33 35 13 14 9 42
120 12 38 36 16 14 15 55
121 11 33 37 13 12 15 33
122 13 31 27 16 14 14 46
123 12 38 39 13 15 11 54
124 14 37 38 16 15 8 47
125 13 33 31 15 15 11 45
126 15 31 33 16 13 11 47
127 10 39 32 15 17 8 55
128 11 44 39 17 17 10 44
129 9 33 36 15 19 11 53
130 11 35 33 12 15 13 44
131 10 32 33 16 13 11 42
132 11 28 32 10 9 20 40
133 8 40 37 16 15 10 46
134 11 27 30 12 15 15 40
135 12 37 38 14 15 12 46
136 12 32 29 15 16 14 53
137 9 28 22 13 11 23 33
138 11 34 35 15 14 14 42
139 10 30 35 11 11 16 35
140 8 35 34 12 15 11 40
141 9 31 35 8 13 12 41
142 8 32 34 16 15 10 33
143 9 30 34 15 16 14 51
144 15 30 35 17 14 12 53
145 11 31 23 16 15 12 46
146 8 40 31 10 16 11 55
147 13 32 27 18 16 12 47
148 12 36 36 13 11 13 38
149 12 32 31 16 12 11 46
150 9 35 32 13 9 19 46
151 7 38 39 10 16 12 53
152 13 42 37 15 13 17 47
153 9 34 38 16 16 9 41
154 6 35 39 16 12 12 44
155 8 35 34 14 9 19 43
156 8 33 31 10 13 18 51
157 15 36 32 17 13 15 33
158 6 32 37 13 14 14 43
159 9 33 36 15 19 11 53
160 11 34 32 16 13 9 51
161 8 32 35 12 12 18 50
162 8 34 36 13 13 16 46
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Connected Separate Learning
4.5599230 -0.0474962 0.0332067 0.5290190
Happiness Depression Belonging_Final
-0.0399388 -0.0231957 -0.0009484
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-5.8576 -0.9756 0.2449 1.3506 3.1713
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 4.5599230 2.5056777 1.820 0.0707 .
Connected -0.0474962 0.0468210 -1.014 0.3120
Separate 0.0332067 0.0437937 0.758 0.4495
Learning 0.5290190 0.0667335 7.927 4.11e-13 ***
Happiness -0.0399388 0.0748458 -0.534 0.5944
Depression -0.0231957 0.0550132 -0.422 0.6739
Belonging_Final -0.0009484 0.0203663 -0.047 0.9629
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 1.82 on 155 degrees of freedom
Multiple R-squared: 0.3045, Adjusted R-squared: 0.2776
F-statistic: 11.31 on 6 and 155 DF, p-value: 1.842e-10
> 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.99985142 0.0002971510 0.0001485755
[2,] 0.99958475 0.0008304954 0.0004152477
[3,] 0.99950825 0.0009834907 0.0004917454
[4,] 0.99906705 0.0018658949 0.0009329474
[5,] 0.99832063 0.0033587481 0.0016793741
[6,] 0.99801607 0.0039678659 0.0019839329
[7,] 0.99662713 0.0067457418 0.0033728709
[8,] 0.99394183 0.0121163392 0.0060581696
[9,] 0.99255958 0.0148808392 0.0074404196
[10,] 0.98884198 0.0223160367 0.0111580184
[11,] 0.98190888 0.0361822316 0.0180911158
[12,] 0.97340322 0.0531935536 0.0265967768
[13,] 0.96234950 0.0753009972 0.0376504986
[14,] 0.94649226 0.1070154882 0.0535077441
[15,] 0.92776407 0.1444718642 0.0722359321
[16,] 0.92492569 0.1501486150 0.0750743075
[17,] 0.94327444 0.1134511178 0.0567255589
[18,] 0.93291226 0.1341754730 0.0670877365
[19,] 0.93961891 0.1207621781 0.0603810890
[20,] 0.91884145 0.1623170994 0.0811585497
[21,] 0.89829275 0.2034144922 0.1017072461
[22,] 0.87962458 0.2407508343 0.1203754172
[23,] 0.89716923 0.2056615361 0.1028307680
[24,] 0.86804824 0.2639035229 0.1319517615
[25,] 0.83377878 0.3324424386 0.1662212193
[26,] 0.82424223 0.3515155456 0.1757577728
[27,] 0.78799359 0.4240128131 0.2120064065
[28,] 0.82599653 0.3480069476 0.1740034738
[29,] 0.81735641 0.3652871751 0.1826435875
[30,] 0.80671821 0.3865635747 0.1932817874
[31,] 0.78785715 0.4242856976 0.2121428488
[32,] 0.76314974 0.4737005138 0.2368502569
[33,] 0.74803263 0.5039347452 0.2519673726
[34,] 0.74797748 0.5040450424 0.2520225212
[35,] 0.70543893 0.5891221487 0.2945610743
[36,] 0.66117981 0.6776403741 0.3388201871
[37,] 0.72871554 0.5425689113 0.2712844557
[38,] 0.73483247 0.5303350519 0.2651675260
[39,] 0.69083407 0.6183318579 0.3091659290
[40,] 0.65304524 0.6939095124 0.3469547562
[41,] 0.63899741 0.7220051883 0.3610025941
[42,] 0.64453229 0.7109354284 0.3554677142
[43,] 0.59792382 0.8041523681 0.4020761840
[44,] 0.62604489 0.7479102192 0.3739551096
[45,] 0.59083666 0.8183266724 0.4091633362
[46,] 0.68440084 0.6311983106 0.3155991553
[47,] 0.84448473 0.3110305495 0.1555152748
[48,] 0.81732978 0.3653404451 0.1826702225
[49,] 0.78342831 0.4331433867 0.2165716934
[50,] 0.74705992 0.5058801549 0.2529400775
[51,] 0.73564137 0.5287172559 0.2643586279
[52,] 0.75369890 0.4926021990 0.2463010995
[53,] 0.71757364 0.5648527148 0.2824263574
[54,] 0.73274804 0.5345039232 0.2672519616
[55,] 0.69252833 0.6149433437 0.3074716718
[56,] 0.65770359 0.6845928208 0.3422964104
[57,] 0.61628170 0.7674366014 0.3837183007
[58,] 0.59618190 0.8076361929 0.4038180964
[59,] 0.57915365 0.8416926965 0.4208463483
[60,] 0.59710442 0.8057911511 0.4028955755
[61,] 0.55331569 0.8933686130 0.4466843065
[62,] 0.51326834 0.9734633274 0.4867316637
[63,] 0.47003338 0.9400667603 0.5299666198
[64,] 0.44216225 0.8843244962 0.5578377519
[65,] 0.41793530 0.8358706098 0.5820646951
[66,] 0.39245098 0.7849019543 0.6075490229
[67,] 0.44048837 0.8809767306 0.5595116347
[68,] 0.42621826 0.8524365296 0.5737817352
[69,] 0.38550064 0.7710012862 0.6144993569
[70,] 0.39102488 0.7820497663 0.6089751168
[71,] 0.36792385 0.7358476927 0.6320761536
[72,] 0.32733659 0.6546731853 0.6726634073
[73,] 0.32292143 0.6458428538 0.6770785731
[74,] 0.28487343 0.5697468657 0.7151265671
[75,] 0.25960609 0.5192121782 0.7403939109
[76,] 0.22387309 0.4477461808 0.7761269096
[77,] 0.21599501 0.4319900152 0.7840049924
[78,] 0.21598759 0.4319751897 0.7840124051
[79,] 0.18398106 0.3679621137 0.8160189432
[80,] 0.15615847 0.3123169441 0.8438415279
[81,] 0.13546699 0.2709339709 0.8645330146
[82,] 0.11602625 0.2320524950 0.8839737525
[83,] 0.16048321 0.3209664147 0.8395167927
[84,] 0.14018276 0.2803655153 0.8598172424
[85,] 0.12489101 0.2497820248 0.8751089876
[86,] 0.12095468 0.2419093577 0.8790453212
[87,] 0.11276242 0.2255248484 0.8872375758
[88,] 0.10399633 0.2079926512 0.8960036744
[89,] 0.12860028 0.2572005541 0.8713997229
[90,] 0.10719921 0.2143984187 0.8928007907
[91,] 0.09061175 0.1812235009 0.9093882495
[92,] 0.11013612 0.2202722349 0.8898638825
[93,] 0.09105074 0.1821014752 0.9089492624
[94,] 0.08730007 0.1746001361 0.9126999320
[95,] 0.07365389 0.1473077841 0.9263461080
[96,] 0.06228990 0.1245797946 0.9377101027
[97,] 0.06363986 0.1272797257 0.9363601372
[98,] 0.05011052 0.1002210467 0.9498894767
[99,] 0.04414704 0.0882940825 0.9558529588
[100,] 0.03528454 0.0705690765 0.9647154617
[101,] 0.03680187 0.0736037399 0.9631981301
[102,] 0.02897914 0.0579582866 0.9710208567
[103,] 0.03251126 0.0650225229 0.9674887385
[104,] 0.02930893 0.0586178554 0.9706910723
[105,] 0.02321713 0.0464342504 0.9767828748
[106,] 0.01821738 0.0364347632 0.9817826184
[107,] 0.01378971 0.0275794171 0.9862102914
[108,] 0.02165428 0.0433085623 0.9783457188
[109,] 0.02486545 0.0497309097 0.9751345452
[110,] 0.01906997 0.0381399339 0.9809300331
[111,] 0.01487461 0.0297492288 0.9851253856
[112,] 0.01235182 0.0247036439 0.9876481780
[113,] 0.01034590 0.0206918082 0.9896540959
[114,] 0.01231056 0.0246211207 0.9876894397
[115,] 0.01932789 0.0386557844 0.9806721078
[116,] 0.02035044 0.0407008886 0.9796495557
[117,] 0.04885802 0.0977160402 0.9511419799
[118,] 0.03734747 0.0746949431 0.9626525285
[119,] 0.02863466 0.0572693145 0.9713653428
[120,] 0.02402419 0.0480483767 0.9759758117
[121,] 0.02260707 0.0452141489 0.9773929256
[122,] 0.01832526 0.0366505135 0.9816747433
[123,] 0.02079951 0.0415990169 0.9792004916
[124,] 0.03284367 0.0656873417 0.9671563291
[125,] 0.03575727 0.0715145461 0.9642427270
[126,] 0.03983614 0.0796722710 0.9601638645
[127,] 0.03380655 0.0676130917 0.9661934541
[128,] 0.02929564 0.0585912781 0.9707043610
[129,] 0.02129630 0.0425925945 0.9787037027
[130,] 0.02077921 0.0415584103 0.9792207949
[131,] 0.01490156 0.0298031107 0.9850984447
[132,] 0.04762296 0.0952459208 0.9523770396
[133,] 0.05098790 0.1019758038 0.9490120981
[134,] 0.03752332 0.0750466459 0.9624766770
[135,] 0.35499712 0.7099942491 0.6450028754
[136,] 0.39692048 0.7938409695 0.6030795153
[137,] 0.70874810 0.5825038025 0.2912519013
[138,] 0.70746478 0.5850704345 0.2925352173
[139,] 0.86758937 0.2648212547 0.1324106274
[140,] 0.86764064 0.2647187278 0.1323593639
[141,] 0.78720152 0.4255969674 0.2127984837
[142,] 0.67068760 0.6586247949 0.3293123975
[143,] 0.67457239 0.6508552298 0.3254276149
> postscript(file="/var/wessaorg/rcomp/tmp/13jkr1351696406.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/wessaorg/rcomp/tmp/2zhsj1351696406.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/wessaorg/rcomp/tmp/3ndaq1351696406.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/wessaorg/rcomp/tmp/4oegl1351696406.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/wessaorg/rcomp/tmp/5gmbt1351696406.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 = 162
Frequency = 1
1 2 3 4 5 6
2.11615694 -0.21207279 1.45526394 -5.32215120 2.58978765 0.30402186
7 8 9 10 11 12
-0.68380366 2.78498628 1.45515395 -5.05450533 -1.29139351 0.53230571
13 14 15 16 17 18
0.40554735 -0.43867515 2.78659847 0.84687193 -0.92140097 -1.61197918
19 20 21 22 23 24
-1.66178627 0.40774160 -0.68001953 0.22454101 -0.15200119 -0.72283589
25 26 27 28 29 30
-2.78008223 0.94426632 -1.54164643 2.79232401 0.41382352 -0.66454155
31 32 33 34 35 36
0.94163800 -1.78993351 -0.28654206 0.26744133 1.55299831 0.02731498
37 38 39 40 41 42
-2.64367963 1.56606198 -1.72170437 -1.66668961 -1.47896334 1.55834816
43 44 45 46 47 48
1.45781904 -0.56624013 -0.31687241 2.99479697 2.39222685 -0.15900280
49 50 51 52 53 54
-0.50949360 1.59308462 2.14650133 -0.52069519 2.40784366 1.17641793
55 56 57 58 59 60
-3.09527178 -4.34944148 0.68233701 0.07180849 -0.18128887 -1.62290843
61 62 63 64 65 66
-2.59928208 0.49182873 2.18875963 0.25723926 0.49315669 0.58148243
67 68 69 70 71 72
1.33884707 -1.75746397 2.55259500 0.37314368 -0.33828453 0.26258911
73 74 75 76 77 78
1.18369070 1.23008771 0.51583758 -2.73064264 1.52576640 -0.48350582
79 80 81 82 83 84
1.80851432 0.59581195 0.24556467 -1.77382359 0.26001055 1.12447795
85 86 87 88 89 90
-0.18520013 -1.58100066 -1.51309367 0.29144142 0.18898275 0.80700061
91 92 93 94 95 96
-0.60708263 2.99243700 0.22091463 1.04748217 1.73975263 -1.42857102
97 98 99 100 101 102
1.46207286 -2.53334803 0.58373733 -0.76708913 2.53877914 -0.53603034
103 104 105 106 107 108
1.30759526 -0.17080735 -0.73712883 2.23911250 0.02812052 0.63904702
109 110 111 112 113 114
-0.69798064 -2.27596268 0.24192183 2.18132318 -1.56832627 0.90439558
115 116 117 118 119 120
0.76199951 0.53372030 2.18809469 -2.77717236 0.77570475 0.54442508
121 122 123 124 125 126
0.76005201 1.47908123 1.97806965 2.30049731 1.93966904 3.17126333
127 128 129 130 131 132
-0.78878597 -0.80583144 -2.05902225 1.60074792 -1.78598250 2.27846265
133 134 135 136 137 138
-3.47836446 1.36299642 1.45036963 1.07569939 -0.83370115 -0.11885879
139 140 141 142 143 144
0.72716868 -1.48264377 1.35450731 -3.77104292 -2.18722353 2.59715952
145 146 147 148 149 150
-0.39454430 -0.03333970 0.50297405 1.85415918 0.24428580 -0.99362640
151 152 153 154 155 156
-1.37268720 2.22908739 -2.78454718 -5.85758077 -2.59190413 -0.32705335
157 158 159 160 161 162
2.99243700 -4.22127819 -2.05902225 -0.69563909 -1.60630179 -2.08378134
> postscript(file="/var/wessaorg/rcomp/tmp/6m5v21351696406.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 = 162
Frequency = 1
lag(myerror, k = 1) myerror
0 2.11615694 NA
1 -0.21207279 2.11615694
2 1.45526394 -0.21207279
3 -5.32215120 1.45526394
4 2.58978765 -5.32215120
5 0.30402186 2.58978765
6 -0.68380366 0.30402186
7 2.78498628 -0.68380366
8 1.45515395 2.78498628
9 -5.05450533 1.45515395
10 -1.29139351 -5.05450533
11 0.53230571 -1.29139351
12 0.40554735 0.53230571
13 -0.43867515 0.40554735
14 2.78659847 -0.43867515
15 0.84687193 2.78659847
16 -0.92140097 0.84687193
17 -1.61197918 -0.92140097
18 -1.66178627 -1.61197918
19 0.40774160 -1.66178627
20 -0.68001953 0.40774160
21 0.22454101 -0.68001953
22 -0.15200119 0.22454101
23 -0.72283589 -0.15200119
24 -2.78008223 -0.72283589
25 0.94426632 -2.78008223
26 -1.54164643 0.94426632
27 2.79232401 -1.54164643
28 0.41382352 2.79232401
29 -0.66454155 0.41382352
30 0.94163800 -0.66454155
31 -1.78993351 0.94163800
32 -0.28654206 -1.78993351
33 0.26744133 -0.28654206
34 1.55299831 0.26744133
35 0.02731498 1.55299831
36 -2.64367963 0.02731498
37 1.56606198 -2.64367963
38 -1.72170437 1.56606198
39 -1.66668961 -1.72170437
40 -1.47896334 -1.66668961
41 1.55834816 -1.47896334
42 1.45781904 1.55834816
43 -0.56624013 1.45781904
44 -0.31687241 -0.56624013
45 2.99479697 -0.31687241
46 2.39222685 2.99479697
47 -0.15900280 2.39222685
48 -0.50949360 -0.15900280
49 1.59308462 -0.50949360
50 2.14650133 1.59308462
51 -0.52069519 2.14650133
52 2.40784366 -0.52069519
53 1.17641793 2.40784366
54 -3.09527178 1.17641793
55 -4.34944148 -3.09527178
56 0.68233701 -4.34944148
57 0.07180849 0.68233701
58 -0.18128887 0.07180849
59 -1.62290843 -0.18128887
60 -2.59928208 -1.62290843
61 0.49182873 -2.59928208
62 2.18875963 0.49182873
63 0.25723926 2.18875963
64 0.49315669 0.25723926
65 0.58148243 0.49315669
66 1.33884707 0.58148243
67 -1.75746397 1.33884707
68 2.55259500 -1.75746397
69 0.37314368 2.55259500
70 -0.33828453 0.37314368
71 0.26258911 -0.33828453
72 1.18369070 0.26258911
73 1.23008771 1.18369070
74 0.51583758 1.23008771
75 -2.73064264 0.51583758
76 1.52576640 -2.73064264
77 -0.48350582 1.52576640
78 1.80851432 -0.48350582
79 0.59581195 1.80851432
80 0.24556467 0.59581195
81 -1.77382359 0.24556467
82 0.26001055 -1.77382359
83 1.12447795 0.26001055
84 -0.18520013 1.12447795
85 -1.58100066 -0.18520013
86 -1.51309367 -1.58100066
87 0.29144142 -1.51309367
88 0.18898275 0.29144142
89 0.80700061 0.18898275
90 -0.60708263 0.80700061
91 2.99243700 -0.60708263
92 0.22091463 2.99243700
93 1.04748217 0.22091463
94 1.73975263 1.04748217
95 -1.42857102 1.73975263
96 1.46207286 -1.42857102
97 -2.53334803 1.46207286
98 0.58373733 -2.53334803
99 -0.76708913 0.58373733
100 2.53877914 -0.76708913
101 -0.53603034 2.53877914
102 1.30759526 -0.53603034
103 -0.17080735 1.30759526
104 -0.73712883 -0.17080735
105 2.23911250 -0.73712883
106 0.02812052 2.23911250
107 0.63904702 0.02812052
108 -0.69798064 0.63904702
109 -2.27596268 -0.69798064
110 0.24192183 -2.27596268
111 2.18132318 0.24192183
112 -1.56832627 2.18132318
113 0.90439558 -1.56832627
114 0.76199951 0.90439558
115 0.53372030 0.76199951
116 2.18809469 0.53372030
117 -2.77717236 2.18809469
118 0.77570475 -2.77717236
119 0.54442508 0.77570475
120 0.76005201 0.54442508
121 1.47908123 0.76005201
122 1.97806965 1.47908123
123 2.30049731 1.97806965
124 1.93966904 2.30049731
125 3.17126333 1.93966904
126 -0.78878597 3.17126333
127 -0.80583144 -0.78878597
128 -2.05902225 -0.80583144
129 1.60074792 -2.05902225
130 -1.78598250 1.60074792
131 2.27846265 -1.78598250
132 -3.47836446 2.27846265
133 1.36299642 -3.47836446
134 1.45036963 1.36299642
135 1.07569939 1.45036963
136 -0.83370115 1.07569939
137 -0.11885879 -0.83370115
138 0.72716868 -0.11885879
139 -1.48264377 0.72716868
140 1.35450731 -1.48264377
141 -3.77104292 1.35450731
142 -2.18722353 -3.77104292
143 2.59715952 -2.18722353
144 -0.39454430 2.59715952
145 -0.03333970 -0.39454430
146 0.50297405 -0.03333970
147 1.85415918 0.50297405
148 0.24428580 1.85415918
149 -0.99362640 0.24428580
150 -1.37268720 -0.99362640
151 2.22908739 -1.37268720
152 -2.78454718 2.22908739
153 -5.85758077 -2.78454718
154 -2.59190413 -5.85758077
155 -0.32705335 -2.59190413
156 2.99243700 -0.32705335
157 -4.22127819 2.99243700
158 -2.05902225 -4.22127819
159 -0.69563909 -2.05902225
160 -1.60630179 -0.69563909
161 -2.08378134 -1.60630179
162 NA -2.08378134
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -0.21207279 2.11615694
[2,] 1.45526394 -0.21207279
[3,] -5.32215120 1.45526394
[4,] 2.58978765 -5.32215120
[5,] 0.30402186 2.58978765
[6,] -0.68380366 0.30402186
[7,] 2.78498628 -0.68380366
[8,] 1.45515395 2.78498628
[9,] -5.05450533 1.45515395
[10,] -1.29139351 -5.05450533
[11,] 0.53230571 -1.29139351
[12,] 0.40554735 0.53230571
[13,] -0.43867515 0.40554735
[14,] 2.78659847 -0.43867515
[15,] 0.84687193 2.78659847
[16,] -0.92140097 0.84687193
[17,] -1.61197918 -0.92140097
[18,] -1.66178627 -1.61197918
[19,] 0.40774160 -1.66178627
[20,] -0.68001953 0.40774160
[21,] 0.22454101 -0.68001953
[22,] -0.15200119 0.22454101
[23,] -0.72283589 -0.15200119
[24,] -2.78008223 -0.72283589
[25,] 0.94426632 -2.78008223
[26,] -1.54164643 0.94426632
[27,] 2.79232401 -1.54164643
[28,] 0.41382352 2.79232401
[29,] -0.66454155 0.41382352
[30,] 0.94163800 -0.66454155
[31,] -1.78993351 0.94163800
[32,] -0.28654206 -1.78993351
[33,] 0.26744133 -0.28654206
[34,] 1.55299831 0.26744133
[35,] 0.02731498 1.55299831
[36,] -2.64367963 0.02731498
[37,] 1.56606198 -2.64367963
[38,] -1.72170437 1.56606198
[39,] -1.66668961 -1.72170437
[40,] -1.47896334 -1.66668961
[41,] 1.55834816 -1.47896334
[42,] 1.45781904 1.55834816
[43,] -0.56624013 1.45781904
[44,] -0.31687241 -0.56624013
[45,] 2.99479697 -0.31687241
[46,] 2.39222685 2.99479697
[47,] -0.15900280 2.39222685
[48,] -0.50949360 -0.15900280
[49,] 1.59308462 -0.50949360
[50,] 2.14650133 1.59308462
[51,] -0.52069519 2.14650133
[52,] 2.40784366 -0.52069519
[53,] 1.17641793 2.40784366
[54,] -3.09527178 1.17641793
[55,] -4.34944148 -3.09527178
[56,] 0.68233701 -4.34944148
[57,] 0.07180849 0.68233701
[58,] -0.18128887 0.07180849
[59,] -1.62290843 -0.18128887
[60,] -2.59928208 -1.62290843
[61,] 0.49182873 -2.59928208
[62,] 2.18875963 0.49182873
[63,] 0.25723926 2.18875963
[64,] 0.49315669 0.25723926
[65,] 0.58148243 0.49315669
[66,] 1.33884707 0.58148243
[67,] -1.75746397 1.33884707
[68,] 2.55259500 -1.75746397
[69,] 0.37314368 2.55259500
[70,] -0.33828453 0.37314368
[71,] 0.26258911 -0.33828453
[72,] 1.18369070 0.26258911
[73,] 1.23008771 1.18369070
[74,] 0.51583758 1.23008771
[75,] -2.73064264 0.51583758
[76,] 1.52576640 -2.73064264
[77,] -0.48350582 1.52576640
[78,] 1.80851432 -0.48350582
[79,] 0.59581195 1.80851432
[80,] 0.24556467 0.59581195
[81,] -1.77382359 0.24556467
[82,] 0.26001055 -1.77382359
[83,] 1.12447795 0.26001055
[84,] -0.18520013 1.12447795
[85,] -1.58100066 -0.18520013
[86,] -1.51309367 -1.58100066
[87,] 0.29144142 -1.51309367
[88,] 0.18898275 0.29144142
[89,] 0.80700061 0.18898275
[90,] -0.60708263 0.80700061
[91,] 2.99243700 -0.60708263
[92,] 0.22091463 2.99243700
[93,] 1.04748217 0.22091463
[94,] 1.73975263 1.04748217
[95,] -1.42857102 1.73975263
[96,] 1.46207286 -1.42857102
[97,] -2.53334803 1.46207286
[98,] 0.58373733 -2.53334803
[99,] -0.76708913 0.58373733
[100,] 2.53877914 -0.76708913
[101,] -0.53603034 2.53877914
[102,] 1.30759526 -0.53603034
[103,] -0.17080735 1.30759526
[104,] -0.73712883 -0.17080735
[105,] 2.23911250 -0.73712883
[106,] 0.02812052 2.23911250
[107,] 0.63904702 0.02812052
[108,] -0.69798064 0.63904702
[109,] -2.27596268 -0.69798064
[110,] 0.24192183 -2.27596268
[111,] 2.18132318 0.24192183
[112,] -1.56832627 2.18132318
[113,] 0.90439558 -1.56832627
[114,] 0.76199951 0.90439558
[115,] 0.53372030 0.76199951
[116,] 2.18809469 0.53372030
[117,] -2.77717236 2.18809469
[118,] 0.77570475 -2.77717236
[119,] 0.54442508 0.77570475
[120,] 0.76005201 0.54442508
[121,] 1.47908123 0.76005201
[122,] 1.97806965 1.47908123
[123,] 2.30049731 1.97806965
[124,] 1.93966904 2.30049731
[125,] 3.17126333 1.93966904
[126,] -0.78878597 3.17126333
[127,] -0.80583144 -0.78878597
[128,] -2.05902225 -0.80583144
[129,] 1.60074792 -2.05902225
[130,] -1.78598250 1.60074792
[131,] 2.27846265 -1.78598250
[132,] -3.47836446 2.27846265
[133,] 1.36299642 -3.47836446
[134,] 1.45036963 1.36299642
[135,] 1.07569939 1.45036963
[136,] -0.83370115 1.07569939
[137,] -0.11885879 -0.83370115
[138,] 0.72716868 -0.11885879
[139,] -1.48264377 0.72716868
[140,] 1.35450731 -1.48264377
[141,] -3.77104292 1.35450731
[142,] -2.18722353 -3.77104292
[143,] 2.59715952 -2.18722353
[144,] -0.39454430 2.59715952
[145,] -0.03333970 -0.39454430
[146,] 0.50297405 -0.03333970
[147,] 1.85415918 0.50297405
[148,] 0.24428580 1.85415918
[149,] -0.99362640 0.24428580
[150,] -1.37268720 -0.99362640
[151,] 2.22908739 -1.37268720
[152,] -2.78454718 2.22908739
[153,] -5.85758077 -2.78454718
[154,] -2.59190413 -5.85758077
[155,] -0.32705335 -2.59190413
[156,] 2.99243700 -0.32705335
[157,] -4.22127819 2.99243700
[158,] -2.05902225 -4.22127819
[159,] -0.69563909 -2.05902225
[160,] -1.60630179 -0.69563909
[161,] -2.08378134 -1.60630179
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -0.21207279 2.11615694
2 1.45526394 -0.21207279
3 -5.32215120 1.45526394
4 2.58978765 -5.32215120
5 0.30402186 2.58978765
6 -0.68380366 0.30402186
7 2.78498628 -0.68380366
8 1.45515395 2.78498628
9 -5.05450533 1.45515395
10 -1.29139351 -5.05450533
11 0.53230571 -1.29139351
12 0.40554735 0.53230571
13 -0.43867515 0.40554735
14 2.78659847 -0.43867515
15 0.84687193 2.78659847
16 -0.92140097 0.84687193
17 -1.61197918 -0.92140097
18 -1.66178627 -1.61197918
19 0.40774160 -1.66178627
20 -0.68001953 0.40774160
21 0.22454101 -0.68001953
22 -0.15200119 0.22454101
23 -0.72283589 -0.15200119
24 -2.78008223 -0.72283589
25 0.94426632 -2.78008223
26 -1.54164643 0.94426632
27 2.79232401 -1.54164643
28 0.41382352 2.79232401
29 -0.66454155 0.41382352
30 0.94163800 -0.66454155
31 -1.78993351 0.94163800
32 -0.28654206 -1.78993351
33 0.26744133 -0.28654206
34 1.55299831 0.26744133
35 0.02731498 1.55299831
36 -2.64367963 0.02731498
37 1.56606198 -2.64367963
38 -1.72170437 1.56606198
39 -1.66668961 -1.72170437
40 -1.47896334 -1.66668961
41 1.55834816 -1.47896334
42 1.45781904 1.55834816
43 -0.56624013 1.45781904
44 -0.31687241 -0.56624013
45 2.99479697 -0.31687241
46 2.39222685 2.99479697
47 -0.15900280 2.39222685
48 -0.50949360 -0.15900280
49 1.59308462 -0.50949360
50 2.14650133 1.59308462
51 -0.52069519 2.14650133
52 2.40784366 -0.52069519
53 1.17641793 2.40784366
54 -3.09527178 1.17641793
55 -4.34944148 -3.09527178
56 0.68233701 -4.34944148
57 0.07180849 0.68233701
58 -0.18128887 0.07180849
59 -1.62290843 -0.18128887
60 -2.59928208 -1.62290843
61 0.49182873 -2.59928208
62 2.18875963 0.49182873
63 0.25723926 2.18875963
64 0.49315669 0.25723926
65 0.58148243 0.49315669
66 1.33884707 0.58148243
67 -1.75746397 1.33884707
68 2.55259500 -1.75746397
69 0.37314368 2.55259500
70 -0.33828453 0.37314368
71 0.26258911 -0.33828453
72 1.18369070 0.26258911
73 1.23008771 1.18369070
74 0.51583758 1.23008771
75 -2.73064264 0.51583758
76 1.52576640 -2.73064264
77 -0.48350582 1.52576640
78 1.80851432 -0.48350582
79 0.59581195 1.80851432
80 0.24556467 0.59581195
81 -1.77382359 0.24556467
82 0.26001055 -1.77382359
83 1.12447795 0.26001055
84 -0.18520013 1.12447795
85 -1.58100066 -0.18520013
86 -1.51309367 -1.58100066
87 0.29144142 -1.51309367
88 0.18898275 0.29144142
89 0.80700061 0.18898275
90 -0.60708263 0.80700061
91 2.99243700 -0.60708263
92 0.22091463 2.99243700
93 1.04748217 0.22091463
94 1.73975263 1.04748217
95 -1.42857102 1.73975263
96 1.46207286 -1.42857102
97 -2.53334803 1.46207286
98 0.58373733 -2.53334803
99 -0.76708913 0.58373733
100 2.53877914 -0.76708913
101 -0.53603034 2.53877914
102 1.30759526 -0.53603034
103 -0.17080735 1.30759526
104 -0.73712883 -0.17080735
105 2.23911250 -0.73712883
106 0.02812052 2.23911250
107 0.63904702 0.02812052
108 -0.69798064 0.63904702
109 -2.27596268 -0.69798064
110 0.24192183 -2.27596268
111 2.18132318 0.24192183
112 -1.56832627 2.18132318
113 0.90439558 -1.56832627
114 0.76199951 0.90439558
115 0.53372030 0.76199951
116 2.18809469 0.53372030
117 -2.77717236 2.18809469
118 0.77570475 -2.77717236
119 0.54442508 0.77570475
120 0.76005201 0.54442508
121 1.47908123 0.76005201
122 1.97806965 1.47908123
123 2.30049731 1.97806965
124 1.93966904 2.30049731
125 3.17126333 1.93966904
126 -0.78878597 3.17126333
127 -0.80583144 -0.78878597
128 -2.05902225 -0.80583144
129 1.60074792 -2.05902225
130 -1.78598250 1.60074792
131 2.27846265 -1.78598250
132 -3.47836446 2.27846265
133 1.36299642 -3.47836446
134 1.45036963 1.36299642
135 1.07569939 1.45036963
136 -0.83370115 1.07569939
137 -0.11885879 -0.83370115
138 0.72716868 -0.11885879
139 -1.48264377 0.72716868
140 1.35450731 -1.48264377
141 -3.77104292 1.35450731
142 -2.18722353 -3.77104292
143 2.59715952 -2.18722353
144 -0.39454430 2.59715952
145 -0.03333970 -0.39454430
146 0.50297405 -0.03333970
147 1.85415918 0.50297405
148 0.24428580 1.85415918
149 -0.99362640 0.24428580
150 -1.37268720 -0.99362640
151 2.22908739 -1.37268720
152 -2.78454718 2.22908739
153 -5.85758077 -2.78454718
154 -2.59190413 -5.85758077
155 -0.32705335 -2.59190413
156 2.99243700 -0.32705335
157 -4.22127819 2.99243700
158 -2.05902225 -4.22127819
159 -0.69563909 -2.05902225
160 -1.60630179 -0.69563909
161 -2.08378134 -1.60630179
> 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/wessaorg/rcomp/tmp/79my21351696406.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/wessaorg/rcomp/tmp/822jr1351696406.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/wessaorg/rcomp/tmp/93nki1351696406.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/wessaorg/rcomp/tmp/10018g1351696406.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/wessaorg/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/wessaorg/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/wessaorg/rcomp/tmp/11s3z11351696406.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/wessaorg/rcomp/tmp/12gbfm1351696406.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/wessaorg/rcomp/tmp/13ir1m1351696406.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/wessaorg/rcomp/tmp/14ut831351696406.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/wessaorg/rcomp/tmp/15j1mw1351696406.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/wessaorg/rcomp/tmp/16ixhy1351696406.tab")
+ }
>
> try(system("convert tmp/13jkr1351696406.ps tmp/13jkr1351696406.png",intern=TRUE))
character(0)
> try(system("convert tmp/2zhsj1351696406.ps tmp/2zhsj1351696406.png",intern=TRUE))
character(0)
> try(system("convert tmp/3ndaq1351696406.ps tmp/3ndaq1351696406.png",intern=TRUE))
character(0)
> try(system("convert tmp/4oegl1351696406.ps tmp/4oegl1351696406.png",intern=TRUE))
character(0)
> try(system("convert tmp/5gmbt1351696406.ps tmp/5gmbt1351696406.png",intern=TRUE))
character(0)
> try(system("convert tmp/6m5v21351696406.ps tmp/6m5v21351696406.png",intern=TRUE))
character(0)
> try(system("convert tmp/79my21351696406.ps tmp/79my21351696406.png",intern=TRUE))
character(0)
> try(system("convert tmp/822jr1351696406.ps tmp/822jr1351696406.png",intern=TRUE))
character(0)
> try(system("convert tmp/93nki1351696406.ps tmp/93nki1351696406.png",intern=TRUE))
character(0)
> try(system("convert tmp/10018g1351696406.ps tmp/10018g1351696406.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
8.384 1.291 9.868