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(14
+ ,11
+ ,12
+ ,11
+ ,12
+ ,6
+ ,6
+ ,53
+ ,6
+ ,18
+ ,12
+ ,12
+ ,8
+ ,13
+ ,5
+ ,3
+ ,86
+ ,6
+ ,11
+ ,15
+ ,10
+ ,12
+ ,16
+ ,6
+ ,0
+ ,66
+ ,13
+ ,12
+ ,10
+ ,10
+ ,10
+ ,11
+ ,5
+ ,4
+ ,67
+ ,8
+ ,16
+ ,12
+ ,9
+ ,7
+ ,12
+ ,6
+ ,7
+ ,76
+ ,7
+ ,18
+ ,11
+ ,6
+ ,6
+ ,9
+ ,4
+ ,0
+ ,78
+ ,9
+ ,14
+ ,5
+ ,15
+ ,8
+ ,12
+ ,3
+ ,3
+ ,53
+ ,5
+ ,14
+ ,16
+ ,11
+ ,16
+ ,16
+ ,7
+ ,10
+ ,80
+ ,8
+ ,15
+ ,11
+ ,11
+ ,8
+ ,12
+ ,6
+ ,3
+ ,74
+ ,9
+ ,15
+ ,15
+ ,13
+ ,16
+ ,18
+ ,8
+ ,6
+ ,76
+ ,11
+ ,17
+ ,12
+ ,12
+ ,7
+ ,12
+ ,3
+ ,1
+ ,79
+ ,8
+ ,19
+ ,9
+ ,12
+ ,11
+ ,11
+ ,4
+ ,3
+ ,54
+ ,11
+ ,10
+ ,11
+ ,5
+ ,16
+ ,14
+ ,6
+ ,5
+ ,67
+ ,12
+ ,18
+ ,15
+ ,11
+ ,16
+ ,11
+ ,5
+ ,6
+ ,87
+ ,8
+ ,14
+ ,12
+ ,13
+ ,12
+ ,12
+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+ ,'ParentalCritism')
+ ,1:145))
> y <- array(NA,dim=c(9,145),dimnames=list(c('Happiness','Popularity','FindingFriends','KnowingPeople','Liked','Celebrity','WeightedSum','BelongingtoSports','ParentalCritism'),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
Happiness Popularity FindingFriends KnowingPeople Liked Celebrity
1 14 11 12 11 12 6
2 18 12 12 8 13 5
3 11 15 10 12 16 6
4 12 10 10 10 11 5
5 16 12 9 7 12 6
6 18 11 6 6 9 4
7 14 5 15 8 12 3
8 14 16 11 16 16 7
9 15 11 11 8 12 6
10 15 15 13 16 18 8
11 17 12 12 7 12 3
12 19 9 12 11 11 4
13 10 11 5 16 14 6
14 18 15 11 16 11 5
15 14 12 13 12 12 6
16 14 16 11 13 14 7
17 17 14 9 19 12 6
18 14 11 14 7 13 6
19 16 10 12 8 11 4
20 18 7 14 12 12 4
21 14 11 12 13 11 4
22 12 10 12 11 12 6
23 17 11 8 8 13 4
24 9 16 9 16 16 6
25 16 14 11 15 16 6
26 14 12 7 11 15 5
27 11 12 12 12 14 5
28 16 11 9 7 13 2
29 13 6 7 9 11 4
30 17 14 12 15 13 6
31 15 9 9 6 12 5
32 14 15 11 14 15 7
33 16 12 10 14 13 7
34 9 12 12 7 11 4
35 15 9 11 15 15 7
36 17 13 8 14 14 5
37 13 15 11 17 16 6
38 15 11 8 14 15 5
39 16 10 12 5 13 6
40 16 13 9 14 14 6
41 12 16 12 8 14 4
42 11 13 10 8 8 4
43 15 14 12 13 15 6
44 17 14 12 14 15 7
45 13 16 11 16 15 6
46 16 9 12 11 11 4
47 14 8 10 10 6 4
48 11 8 11 10 15 2
49 12 12 12 10 15 6
50 12 10 7 8 9 5
51 15 16 11 14 15 8
52 16 13 11 14 13 6
53 15 11 10 12 14 5
54 12 14 12 13 13 6
55 12 15 9 5 11 3
56 8 8 11 10 12 4
57 13 9 15 6 8 4
58 11 17 11 15 14 5
59 14 9 11 12 13 5
60 15 13 12 16 16 6
61 10 6 9 15 11 6
62 11 13 11 12 13 7
63 12 8 12 8 13 4
64 15 12 11 14 13 5
65 15 13 13 14 13 3
66 14 14 13 13 13 5
67 16 11 9 12 12 4
68 15 15 11 15 15 8
69 15 7 12 8 12 3
70 13 16 12 16 14 6
71 17 16 11 14 15 6
72 13 14 12 13 13 5
73 15 11 12 15 12 6
74 13 13 12 7 12 5
75 15 13 12 5 12 3
76 16 7 12 7 12 4
77 15 15 12 13 13 6
78 16 11 6 14 17 6
79 15 15 11 14 13 5
80 14 13 12 13 13 5
81 15 11 11 11 14 5
82 7 12 12 15 13 6
83 17 10 11 13 15 6
84 13 12 13 14 12 5
85 15 12 8 13 13 5
86 14 12 12 9 13 4
87 13 14 12 8 14 4
88 16 6 12 6 11 2
89 12 14 11 13 16 6
90 14 15 10 16 13 6
91 17 8 13 7 10 3
92 15 12 11 11 12 5
93 17 10 12 8 16 4
94 12 15 12 13 14 6
95 16 11 10 5 13 3
96 11 9 11 8 10 4
97 15 14 11 10 16 6
98 9 10 11 9 12 4
99 16 16 12 16 16 7
100 10 5 14 4 5 2
101 10 8 7 4 13 6
102 15 13 12 11 13 6
103 11 16 12 14 16 8
104 13 16 12 15 15 7
105 14 14 14 17 18 6
106 18 14 13 10 16 8
107 16 10 15 15 15 6
108 14 9 10 11 13 3
109 14 14 11 15 15 8
110 14 8 10 10 14 3
111 14 8 7 9 15 4
112 12 16 11 14 14 6
113 14 12 8 15 13 7
114 15 9 11 9 12 4
115 15 15 12 12 16 7
116 13 12 12 10 13 4
117 17 14 11 16 12 5
118 17 12 12 15 13 6
119 19 16 12 14 14 6
120 15 12 12 12 13 4
121 13 14 12 15 14 6
122 9 8 11 9 12 4
123 15 15 11 12 13 6
124 15 16 12 15 14 6
125 16 12 12 6 14 5
126 11 4 10 4 10 2
127 14 8 12 8 14 5
128 11 11 8 10 14 5
129 15 4 8 6 4 4
130 13 14 10 12 15 6
131 16 14 11 14 12 6
132 14 13 13 11 15 6
133 15 14 11 15 14 6
134 16 7 12 13 12 3
135 16 19 12 15 15 6
136 11 12 11 16 13 4
137 13 10 13 4 13 6
138 16 14 11 15 16 6
139 12 16 12 12 15 8
140 9 11 11 15 10 5
141 13 16 12 15 16 7
142 13 12 13 14 12 5
143 14 12 10 14 14 5
144 19 16 12 14 14 6
145 13 12 11 11 14 2
WeightedSum BelongingtoSports ParentalCritism
1 6 53 6
2 3 86 6
3 0 66 13
4 4 67 8
5 7 76 7
6 0 78 9
7 3 53 5
8 10 80 8
9 3 74 9
10 6 76 11
11 1 79 8
12 3 54 11
13 5 67 12
14 6 87 8
15 6 58 7
16 7 75 9
17 2 88 12
18 2 64 20
19 0 57 7
20 6 66 8
21 1 54 8
22 5 56 16
23 4 86 10
24 7 80 6
25 7 76 8
26 2 69 9
27 2 67 9
28 3 80 11
29 3 54 12
30 3 71 8
31 8 84 7
32 7 74 8
33 6 71 9
34 6 63 4
35 5 71 8
36 10 76 8
37 5 69 8
38 5 74 6
39 5 75 8
40 2 54 4
41 6 69 14
42 4 68 10
43 2 75 9
44 8 74 6
45 10 75 8
46 5 72 11
47 10 67 8
48 7 63 8
49 6 62 10
50 7 63 8
51 4 76 10
52 4 74 7
53 3 67 8
54 4 73 7
55 3 70 9
56 3 53 5
57 0 77 7
58 15 77 7
59 0 52 7
60 4 54 9
61 5 80 5
62 6 66 8
63 3 73 8
64 9 63 8
65 5 69 9
66 0 67 6
67 2 54 8
68 0 81 6
69 0 69 4
70 10 84 6
71 1 70 4
72 6 69 12
73 11 77 6
74 3 54 11
75 9 79 8
76 2 30 10
77 8 71 10
78 8 73 4
79 9 72 8
80 9 77 9
81 8 75 9
82 6 70 7
83 6 73 7
84 5 54 11
85 4 77 8
86 2 82 8
87 6 80 7
88 3 80 5
89 8 69 7
90 8 78 9
91 5 81 8
92 6 76 6
93 2 76 8
94 4 73 10
95 3 85 10
96 5 66 8
97 5 79 11
98 7 68 8
99 7 76 8
100 6 54 6
101 1 46 20
102 5 82 6
103 14 74 12
104 7 88 9
105 1 38 5
106 8 76 10
107 10 86 5
108 6 54 6
109 6 70 10
110 2 69 6
111 2 90 10
112 8 54 5
113 3 76 13
114 0 89 7
115 8 76 9
116 4 79 8
117 3 90 5
118 0 74 4
119 0 81 9
120 6 72 7
121 9 71 5
122 9 66 5
123 5 77 4
124 8 74 7
125 0 82 9
126 4 54 8
127 3 63 8
128 5 54 11
129 0 64 10
130 4 69 9
131 10 84 10
132 8 86 10
133 6 77 7
134 3 89 10
135 5 76 6
136 3 60 6
137 2 79 11
138 7 76 8
139 0 72 9
140 8 69 9
141 8 78 13
142 5 54 11
143 9 69 4
144 0 81 9
145 5 84 5
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Popularity FindingFriends KnowingPeople
7.35960 -0.03127 0.12540 0.06417
Liked Celebrity WeightedSum BelongingtoSports
0.04990 0.03736 -0.22005 0.07853
ParentalCritism
-0.04344
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-7.1976 -1.4464 0.1916 1.5164 5.9100
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 7.35960 2.11808 3.475 0.000687 ***
Popularity -0.03127 0.09065 -0.345 0.730642
FindingFriends 0.12540 0.10554 1.188 0.236850
KnowingPeople 0.06417 0.07449 0.861 0.390509
Liked 0.04990 0.10854 0.460 0.646427
Celebrity 0.03736 0.18760 0.199 0.842455
WeightedSum -0.22005 0.06414 -3.431 0.000797 ***
BelongingtoSports 0.07853 0.01831 4.288 3.39e-05 ***
ParentalCritism -0.04344 0.07510 -0.579 0.563883
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 2.204 on 136 degrees of freedom
Multiple R-squared: 0.1868, Adjusted R-squared: 0.139
F-statistic: 3.906 on 8 and 136 DF, p-value: 0.000353
> 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.9022546 0.19549075 0.097745374
[2,] 0.8297107 0.34057859 0.170289293
[3,] 0.7615636 0.47687286 0.238436431
[4,] 0.6713884 0.65722324 0.328611619
[5,] 0.5938017 0.81239666 0.406198331
[6,] 0.4885079 0.97701588 0.511492058
[7,] 0.5970000 0.80599993 0.402999966
[8,] 0.5183057 0.96338855 0.481694273
[9,] 0.4962752 0.99255049 0.503724757
[10,] 0.4257546 0.85150911 0.574245443
[11,] 0.3857110 0.77142191 0.614289045
[12,] 0.3242983 0.64859664 0.675701678
[13,] 0.5744280 0.85114392 0.425571959
[14,] 0.6118181 0.77636382 0.388181908
[15,] 0.6018944 0.79621126 0.398105628
[16,] 0.6936982 0.61260350 0.306301752
[17,] 0.6361263 0.72774737 0.363873684
[18,] 0.5696569 0.86068623 0.430343114
[19,] 0.5683722 0.86325559 0.431627795
[20,] 0.5376256 0.92474880 0.462374402
[21,] 0.4747045 0.94940891 0.525295546
[22,] 0.4583903 0.91678052 0.541609740
[23,] 0.7239775 0.55204501 0.276022505
[24,] 0.6728348 0.65433040 0.327165198
[25,] 0.7715466 0.45690679 0.228453395
[26,] 0.7298084 0.54038321 0.270191606
[27,] 0.6882647 0.62347067 0.311735336
[28,] 0.6530400 0.69392002 0.346960009
[29,] 0.7625713 0.47485741 0.237428707
[30,] 0.7210079 0.55798419 0.278992093
[31,] 0.7791765 0.44164695 0.220823476
[32,] 0.7354951 0.52900981 0.264504904
[33,] 0.7576322 0.48473567 0.242367835
[34,] 0.7143038 0.57139249 0.285696247
[35,] 0.6863328 0.62733445 0.313667227
[36,] 0.6850337 0.62993256 0.314966282
[37,] 0.6850311 0.62993772 0.314968858
[38,] 0.6439808 0.71203836 0.356019181
[39,] 0.6021103 0.79577940 0.397889700
[40,] 0.5501393 0.89972139 0.449860695
[41,] 0.5092326 0.98153481 0.490767404
[42,] 0.4618071 0.92361412 0.538192942
[43,] 0.5185051 0.96298988 0.481494942
[44,] 0.4776408 0.95528165 0.522359176
[45,] 0.7246168 0.55076630 0.275383152
[46,] 0.8225360 0.35492810 0.177464050
[47,] 0.8019193 0.39616150 0.198080749
[48,] 0.7653885 0.46922304 0.234611518
[49,] 0.7609168 0.47816634 0.239083171
[50,] 0.9238418 0.15231638 0.076158190
[51,] 0.9266765 0.14664691 0.073323456
[52,] 0.9352381 0.12952386 0.064761928
[53,] 0.9353899 0.12922027 0.064610136
[54,] 0.9203151 0.15936986 0.079684930
[55,] 0.9055054 0.18898921 0.094494604
[56,] 0.9211419 0.15771617 0.078858083
[57,] 0.9091951 0.18160972 0.090804861
[58,] 0.8869467 0.22610670 0.113053348
[59,] 0.8722370 0.25552597 0.127762983
[60,] 0.8653377 0.26932456 0.134662279
[61,] 0.8389358 0.32212838 0.161064190
[62,] 0.8196583 0.36068338 0.180341690
[63,] 0.7850662 0.42986763 0.214933817
[64,] 0.7706707 0.45865868 0.229329340
[65,] 0.8939976 0.21200481 0.106002405
[66,] 0.8857490 0.22850195 0.114250977
[67,] 0.8878048 0.22439036 0.112195180
[68,] 0.8831173 0.23376539 0.116882695
[69,] 0.8586059 0.28278816 0.141394082
[70,] 0.8437907 0.31241858 0.156209292
[71,] 0.9894415 0.02111705 0.010558524
[72,] 0.9910595 0.01788093 0.008940465
[73,] 0.9878333 0.02433349 0.012166743
[74,] 0.9838113 0.03237739 0.016188693
[75,] 0.9808874 0.03822513 0.019112567
[76,] 0.9766022 0.04679562 0.023397809
[77,] 0.9708247 0.05835065 0.029175323
[78,] 0.9649007 0.07019864 0.035099318
[79,] 0.9534953 0.09300941 0.046504703
[80,] 0.9625910 0.07481804 0.037409020
[81,] 0.9534207 0.09315851 0.046579256
[82,] 0.9519025 0.09619504 0.048097519
[83,] 0.9573885 0.08522296 0.042611480
[84,] 0.9557761 0.08844776 0.044223882
[85,] 0.9524456 0.09510889 0.047554444
[86,] 0.9390843 0.12183138 0.060915692
[87,] 0.9650619 0.06987626 0.034938129
[88,] 0.9580517 0.08389652 0.041948262
[89,] 0.9514642 0.09707164 0.048535821
[90,] 0.9398343 0.12033131 0.060165657
[91,] 0.9204514 0.15909726 0.079548630
[92,] 0.9058390 0.18832205 0.094161023
[93,] 0.9186975 0.16260494 0.081302468
[94,] 0.8954354 0.20912921 0.104564603
[95,] 0.9526602 0.09467954 0.047339769
[96,] 0.9431794 0.11364120 0.056820598
[97,] 0.9546851 0.09062973 0.045314865
[98,] 0.9371595 0.12568097 0.062840485
[99,] 0.9196683 0.16066336 0.080331678
[100,] 0.8986917 0.20261665 0.101308327
[101,] 0.8658827 0.26823464 0.134117320
[102,] 0.8377573 0.32448539 0.162242696
[103,] 0.8194550 0.36109008 0.180545040
[104,] 0.7943067 0.41138651 0.205693256
[105,] 0.7729292 0.45414160 0.227070798
[106,] 0.7261478 0.54770435 0.273852177
[107,] 0.6730930 0.65381396 0.326906980
[108,] 0.6700525 0.65989504 0.329947520
[109,] 0.6382982 0.72340359 0.361701796
[110,] 0.5636444 0.87271116 0.436355582
[111,] 0.6001655 0.79966902 0.399834509
[112,] 0.5181159 0.96376821 0.481884107
[113,] 0.4548090 0.90961798 0.545191011
[114,] 0.3735536 0.74710720 0.626446398
[115,] 0.2971588 0.59431754 0.702841229
[116,] 0.2905372 0.58107450 0.709462750
[117,] 0.2130609 0.42612171 0.786939143
[118,] 0.2392434 0.47848673 0.760756636
[119,] 0.1715847 0.34316934 0.828415328
[120,] 0.1909428 0.38188555 0.809057223
[121,] 0.2223288 0.44465756 0.777671222
[122,] 0.1257957 0.25159135 0.874204327
> postscript(file="/var/www/html/rcomp/tmp/1mups1290528088.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/2s0z61290528088.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/3s0z61290528088.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/4s0z61290528088.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/5s0z61290528088.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
1.36935227 2.32878915 -3.55568006 -1.71239071 2.49070548 3.51369216
7 8 9 10 11 12
0.40649909 -0.06005778 0.50821447 0.08497662 1.71410827 5.90995519
13 14 15 16 17 18
-3.23237586 2.80294476 0.86182147 0.00822845 0.95774060 0.18946417
19 20 21 22 23 24
2.06421091 4.06993184 0.27372539 -0.68313593 2.23030476 -5.51893752
25 26 27 28 29 30
1.63291311 -0.09114564 -3.57535239 1.53839211 0.61492989 2.16969043
31 32 33 34 35 36
1.09018478 -0.10202711 2.08835696 -4.09031093 0.44166658 3.83932710
37 38 39 40 41 42
-1.35451276 0.69680904 1.81227479 2.47015973 -1.21586486 -2.29481296
43 44 45 46 47 48
-0.29251618 2.87446068 -0.58012430 1.93642599 1.83223080 -2.01358404
49 50 51 52 53 54
-1.21794707 -0.13374868 0.16155622 1.26899163 0.82078356 -2.68242998
55 56 57 58 59 60
-1.44726336 -5.16377591 -2.63591785 -1.49768313 0.15716742 1.52312980
61 62 63 64 65 66
-5.00153347 -2.52819707 -2.65110368 2.28265617 0.82987253 -1.22291021
67 68 69 70 71 72
2.88424977 -1.38054123 -0.11490564 -1.44932698 1.78666432 -0.67361231
73 74 75 76 77 78
1.32807776 0.20447579 1.63412776 4.67553916 1.51644682 2.46224965
79 80 81 82 83 84
1.66966064 0.19665361 1.27496978 -7.19761375 2.65817606 0.03870071
85 86 87 88 89 90
0.52329000 -1.51704806 -1.44640438 0.90913314 -1.51239231 -0.01845431
91 92 93 94 95 96
2.28654934 0.75707857 1.80608199 -2.57072648 1.06785821 -2.35487813
97 98 99 100 101 102
0.40839753 -4.20454932 1.46852968 -2.19968386 -1.64045120 -0.11556852
103 104 105 106 107 108
-1.56928498 -2.31637290 0.56225776 3.93519343 0.80058582 1.54124217
109 110 111 112 113 114
-0.05385094 -0.53398764 -1.65632922 -0.32307721 -0.60406193 -1.46885419
115 116 117 118 119 120
0.95743742 -1.90551391 0.69568160 1.03761183 2.84444949 0.91254458
121 122 123 124 125 126
-0.69024110 -3.80025696 0.31399447 1.00353789 0.19155157 -1.33207297
127 128 129 130 131 132
0.04698782 -1.20868259 1.43642012 -1.06623105 2.01545097 -0.82098611
133 134 135 136 137 138
0.39068719 -0.08564835 1.18679040 -2.97991573 -2.09291402 1.63291311
139 140 141 142 143 144
-3.44500751 -4.31089969 -1.18709815 0.03870071 0.71316967 2.84444949
145
-2.12242914
> postscript(file="/var/www/html/rcomp/tmp/62ryr1290528088.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 1.36935227 NA
1 2.32878915 1.36935227
2 -3.55568006 2.32878915
3 -1.71239071 -3.55568006
4 2.49070548 -1.71239071
5 3.51369216 2.49070548
6 0.40649909 3.51369216
7 -0.06005778 0.40649909
8 0.50821447 -0.06005778
9 0.08497662 0.50821447
10 1.71410827 0.08497662
11 5.90995519 1.71410827
12 -3.23237586 5.90995519
13 2.80294476 -3.23237586
14 0.86182147 2.80294476
15 0.00822845 0.86182147
16 0.95774060 0.00822845
17 0.18946417 0.95774060
18 2.06421091 0.18946417
19 4.06993184 2.06421091
20 0.27372539 4.06993184
21 -0.68313593 0.27372539
22 2.23030476 -0.68313593
23 -5.51893752 2.23030476
24 1.63291311 -5.51893752
25 -0.09114564 1.63291311
26 -3.57535239 -0.09114564
27 1.53839211 -3.57535239
28 0.61492989 1.53839211
29 2.16969043 0.61492989
30 1.09018478 2.16969043
31 -0.10202711 1.09018478
32 2.08835696 -0.10202711
33 -4.09031093 2.08835696
34 0.44166658 -4.09031093
35 3.83932710 0.44166658
36 -1.35451276 3.83932710
37 0.69680904 -1.35451276
38 1.81227479 0.69680904
39 2.47015973 1.81227479
40 -1.21586486 2.47015973
41 -2.29481296 -1.21586486
42 -0.29251618 -2.29481296
43 2.87446068 -0.29251618
44 -0.58012430 2.87446068
45 1.93642599 -0.58012430
46 1.83223080 1.93642599
47 -2.01358404 1.83223080
48 -1.21794707 -2.01358404
49 -0.13374868 -1.21794707
50 0.16155622 -0.13374868
51 1.26899163 0.16155622
52 0.82078356 1.26899163
53 -2.68242998 0.82078356
54 -1.44726336 -2.68242998
55 -5.16377591 -1.44726336
56 -2.63591785 -5.16377591
57 -1.49768313 -2.63591785
58 0.15716742 -1.49768313
59 1.52312980 0.15716742
60 -5.00153347 1.52312980
61 -2.52819707 -5.00153347
62 -2.65110368 -2.52819707
63 2.28265617 -2.65110368
64 0.82987253 2.28265617
65 -1.22291021 0.82987253
66 2.88424977 -1.22291021
67 -1.38054123 2.88424977
68 -0.11490564 -1.38054123
69 -1.44932698 -0.11490564
70 1.78666432 -1.44932698
71 -0.67361231 1.78666432
72 1.32807776 -0.67361231
73 0.20447579 1.32807776
74 1.63412776 0.20447579
75 4.67553916 1.63412776
76 1.51644682 4.67553916
77 2.46224965 1.51644682
78 1.66966064 2.46224965
79 0.19665361 1.66966064
80 1.27496978 0.19665361
81 -7.19761375 1.27496978
82 2.65817606 -7.19761375
83 0.03870071 2.65817606
84 0.52329000 0.03870071
85 -1.51704806 0.52329000
86 -1.44640438 -1.51704806
87 0.90913314 -1.44640438
88 -1.51239231 0.90913314
89 -0.01845431 -1.51239231
90 2.28654934 -0.01845431
91 0.75707857 2.28654934
92 1.80608199 0.75707857
93 -2.57072648 1.80608199
94 1.06785821 -2.57072648
95 -2.35487813 1.06785821
96 0.40839753 -2.35487813
97 -4.20454932 0.40839753
98 1.46852968 -4.20454932
99 -2.19968386 1.46852968
100 -1.64045120 -2.19968386
101 -0.11556852 -1.64045120
102 -1.56928498 -0.11556852
103 -2.31637290 -1.56928498
104 0.56225776 -2.31637290
105 3.93519343 0.56225776
106 0.80058582 3.93519343
107 1.54124217 0.80058582
108 -0.05385094 1.54124217
109 -0.53398764 -0.05385094
110 -1.65632922 -0.53398764
111 -0.32307721 -1.65632922
112 -0.60406193 -0.32307721
113 -1.46885419 -0.60406193
114 0.95743742 -1.46885419
115 -1.90551391 0.95743742
116 0.69568160 -1.90551391
117 1.03761183 0.69568160
118 2.84444949 1.03761183
119 0.91254458 2.84444949
120 -0.69024110 0.91254458
121 -3.80025696 -0.69024110
122 0.31399447 -3.80025696
123 1.00353789 0.31399447
124 0.19155157 1.00353789
125 -1.33207297 0.19155157
126 0.04698782 -1.33207297
127 -1.20868259 0.04698782
128 1.43642012 -1.20868259
129 -1.06623105 1.43642012
130 2.01545097 -1.06623105
131 -0.82098611 2.01545097
132 0.39068719 -0.82098611
133 -0.08564835 0.39068719
134 1.18679040 -0.08564835
135 -2.97991573 1.18679040
136 -2.09291402 -2.97991573
137 1.63291311 -2.09291402
138 -3.44500751 1.63291311
139 -4.31089969 -3.44500751
140 -1.18709815 -4.31089969
141 0.03870071 -1.18709815
142 0.71316967 0.03870071
143 2.84444949 0.71316967
144 -2.12242914 2.84444949
145 NA -2.12242914
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 2.32878915 1.36935227
[2,] -3.55568006 2.32878915
[3,] -1.71239071 -3.55568006
[4,] 2.49070548 -1.71239071
[5,] 3.51369216 2.49070548
[6,] 0.40649909 3.51369216
[7,] -0.06005778 0.40649909
[8,] 0.50821447 -0.06005778
[9,] 0.08497662 0.50821447
[10,] 1.71410827 0.08497662
[11,] 5.90995519 1.71410827
[12,] -3.23237586 5.90995519
[13,] 2.80294476 -3.23237586
[14,] 0.86182147 2.80294476
[15,] 0.00822845 0.86182147
[16,] 0.95774060 0.00822845
[17,] 0.18946417 0.95774060
[18,] 2.06421091 0.18946417
[19,] 4.06993184 2.06421091
[20,] 0.27372539 4.06993184
[21,] -0.68313593 0.27372539
[22,] 2.23030476 -0.68313593
[23,] -5.51893752 2.23030476
[24,] 1.63291311 -5.51893752
[25,] -0.09114564 1.63291311
[26,] -3.57535239 -0.09114564
[27,] 1.53839211 -3.57535239
[28,] 0.61492989 1.53839211
[29,] 2.16969043 0.61492989
[30,] 1.09018478 2.16969043
[31,] -0.10202711 1.09018478
[32,] 2.08835696 -0.10202711
[33,] -4.09031093 2.08835696
[34,] 0.44166658 -4.09031093
[35,] 3.83932710 0.44166658
[36,] -1.35451276 3.83932710
[37,] 0.69680904 -1.35451276
[38,] 1.81227479 0.69680904
[39,] 2.47015973 1.81227479
[40,] -1.21586486 2.47015973
[41,] -2.29481296 -1.21586486
[42,] -0.29251618 -2.29481296
[43,] 2.87446068 -0.29251618
[44,] -0.58012430 2.87446068
[45,] 1.93642599 -0.58012430
[46,] 1.83223080 1.93642599
[47,] -2.01358404 1.83223080
[48,] -1.21794707 -2.01358404
[49,] -0.13374868 -1.21794707
[50,] 0.16155622 -0.13374868
[51,] 1.26899163 0.16155622
[52,] 0.82078356 1.26899163
[53,] -2.68242998 0.82078356
[54,] -1.44726336 -2.68242998
[55,] -5.16377591 -1.44726336
[56,] -2.63591785 -5.16377591
[57,] -1.49768313 -2.63591785
[58,] 0.15716742 -1.49768313
[59,] 1.52312980 0.15716742
[60,] -5.00153347 1.52312980
[61,] -2.52819707 -5.00153347
[62,] -2.65110368 -2.52819707
[63,] 2.28265617 -2.65110368
[64,] 0.82987253 2.28265617
[65,] -1.22291021 0.82987253
[66,] 2.88424977 -1.22291021
[67,] -1.38054123 2.88424977
[68,] -0.11490564 -1.38054123
[69,] -1.44932698 -0.11490564
[70,] 1.78666432 -1.44932698
[71,] -0.67361231 1.78666432
[72,] 1.32807776 -0.67361231
[73,] 0.20447579 1.32807776
[74,] 1.63412776 0.20447579
[75,] 4.67553916 1.63412776
[76,] 1.51644682 4.67553916
[77,] 2.46224965 1.51644682
[78,] 1.66966064 2.46224965
[79,] 0.19665361 1.66966064
[80,] 1.27496978 0.19665361
[81,] -7.19761375 1.27496978
[82,] 2.65817606 -7.19761375
[83,] 0.03870071 2.65817606
[84,] 0.52329000 0.03870071
[85,] -1.51704806 0.52329000
[86,] -1.44640438 -1.51704806
[87,] 0.90913314 -1.44640438
[88,] -1.51239231 0.90913314
[89,] -0.01845431 -1.51239231
[90,] 2.28654934 -0.01845431
[91,] 0.75707857 2.28654934
[92,] 1.80608199 0.75707857
[93,] -2.57072648 1.80608199
[94,] 1.06785821 -2.57072648
[95,] -2.35487813 1.06785821
[96,] 0.40839753 -2.35487813
[97,] -4.20454932 0.40839753
[98,] 1.46852968 -4.20454932
[99,] -2.19968386 1.46852968
[100,] -1.64045120 -2.19968386
[101,] -0.11556852 -1.64045120
[102,] -1.56928498 -0.11556852
[103,] -2.31637290 -1.56928498
[104,] 0.56225776 -2.31637290
[105,] 3.93519343 0.56225776
[106,] 0.80058582 3.93519343
[107,] 1.54124217 0.80058582
[108,] -0.05385094 1.54124217
[109,] -0.53398764 -0.05385094
[110,] -1.65632922 -0.53398764
[111,] -0.32307721 -1.65632922
[112,] -0.60406193 -0.32307721
[113,] -1.46885419 -0.60406193
[114,] 0.95743742 -1.46885419
[115,] -1.90551391 0.95743742
[116,] 0.69568160 -1.90551391
[117,] 1.03761183 0.69568160
[118,] 2.84444949 1.03761183
[119,] 0.91254458 2.84444949
[120,] -0.69024110 0.91254458
[121,] -3.80025696 -0.69024110
[122,] 0.31399447 -3.80025696
[123,] 1.00353789 0.31399447
[124,] 0.19155157 1.00353789
[125,] -1.33207297 0.19155157
[126,] 0.04698782 -1.33207297
[127,] -1.20868259 0.04698782
[128,] 1.43642012 -1.20868259
[129,] -1.06623105 1.43642012
[130,] 2.01545097 -1.06623105
[131,] -0.82098611 2.01545097
[132,] 0.39068719 -0.82098611
[133,] -0.08564835 0.39068719
[134,] 1.18679040 -0.08564835
[135,] -2.97991573 1.18679040
[136,] -2.09291402 -2.97991573
[137,] 1.63291311 -2.09291402
[138,] -3.44500751 1.63291311
[139,] -4.31089969 -3.44500751
[140,] -1.18709815 -4.31089969
[141,] 0.03870071 -1.18709815
[142,] 0.71316967 0.03870071
[143,] 2.84444949 0.71316967
[144,] -2.12242914 2.84444949
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 2.32878915 1.36935227
2 -3.55568006 2.32878915
3 -1.71239071 -3.55568006
4 2.49070548 -1.71239071
5 3.51369216 2.49070548
6 0.40649909 3.51369216
7 -0.06005778 0.40649909
8 0.50821447 -0.06005778
9 0.08497662 0.50821447
10 1.71410827 0.08497662
11 5.90995519 1.71410827
12 -3.23237586 5.90995519
13 2.80294476 -3.23237586
14 0.86182147 2.80294476
15 0.00822845 0.86182147
16 0.95774060 0.00822845
17 0.18946417 0.95774060
18 2.06421091 0.18946417
19 4.06993184 2.06421091
20 0.27372539 4.06993184
21 -0.68313593 0.27372539
22 2.23030476 -0.68313593
23 -5.51893752 2.23030476
24 1.63291311 -5.51893752
25 -0.09114564 1.63291311
26 -3.57535239 -0.09114564
27 1.53839211 -3.57535239
28 0.61492989 1.53839211
29 2.16969043 0.61492989
30 1.09018478 2.16969043
31 -0.10202711 1.09018478
32 2.08835696 -0.10202711
33 -4.09031093 2.08835696
34 0.44166658 -4.09031093
35 3.83932710 0.44166658
36 -1.35451276 3.83932710
37 0.69680904 -1.35451276
38 1.81227479 0.69680904
39 2.47015973 1.81227479
40 -1.21586486 2.47015973
41 -2.29481296 -1.21586486
42 -0.29251618 -2.29481296
43 2.87446068 -0.29251618
44 -0.58012430 2.87446068
45 1.93642599 -0.58012430
46 1.83223080 1.93642599
47 -2.01358404 1.83223080
48 -1.21794707 -2.01358404
49 -0.13374868 -1.21794707
50 0.16155622 -0.13374868
51 1.26899163 0.16155622
52 0.82078356 1.26899163
53 -2.68242998 0.82078356
54 -1.44726336 -2.68242998
55 -5.16377591 -1.44726336
56 -2.63591785 -5.16377591
57 -1.49768313 -2.63591785
58 0.15716742 -1.49768313
59 1.52312980 0.15716742
60 -5.00153347 1.52312980
61 -2.52819707 -5.00153347
62 -2.65110368 -2.52819707
63 2.28265617 -2.65110368
64 0.82987253 2.28265617
65 -1.22291021 0.82987253
66 2.88424977 -1.22291021
67 -1.38054123 2.88424977
68 -0.11490564 -1.38054123
69 -1.44932698 -0.11490564
70 1.78666432 -1.44932698
71 -0.67361231 1.78666432
72 1.32807776 -0.67361231
73 0.20447579 1.32807776
74 1.63412776 0.20447579
75 4.67553916 1.63412776
76 1.51644682 4.67553916
77 2.46224965 1.51644682
78 1.66966064 2.46224965
79 0.19665361 1.66966064
80 1.27496978 0.19665361
81 -7.19761375 1.27496978
82 2.65817606 -7.19761375
83 0.03870071 2.65817606
84 0.52329000 0.03870071
85 -1.51704806 0.52329000
86 -1.44640438 -1.51704806
87 0.90913314 -1.44640438
88 -1.51239231 0.90913314
89 -0.01845431 -1.51239231
90 2.28654934 -0.01845431
91 0.75707857 2.28654934
92 1.80608199 0.75707857
93 -2.57072648 1.80608199
94 1.06785821 -2.57072648
95 -2.35487813 1.06785821
96 0.40839753 -2.35487813
97 -4.20454932 0.40839753
98 1.46852968 -4.20454932
99 -2.19968386 1.46852968
100 -1.64045120 -2.19968386
101 -0.11556852 -1.64045120
102 -1.56928498 -0.11556852
103 -2.31637290 -1.56928498
104 0.56225776 -2.31637290
105 3.93519343 0.56225776
106 0.80058582 3.93519343
107 1.54124217 0.80058582
108 -0.05385094 1.54124217
109 -0.53398764 -0.05385094
110 -1.65632922 -0.53398764
111 -0.32307721 -1.65632922
112 -0.60406193 -0.32307721
113 -1.46885419 -0.60406193
114 0.95743742 -1.46885419
115 -1.90551391 0.95743742
116 0.69568160 -1.90551391
117 1.03761183 0.69568160
118 2.84444949 1.03761183
119 0.91254458 2.84444949
120 -0.69024110 0.91254458
121 -3.80025696 -0.69024110
122 0.31399447 -3.80025696
123 1.00353789 0.31399447
124 0.19155157 1.00353789
125 -1.33207297 0.19155157
126 0.04698782 -1.33207297
127 -1.20868259 0.04698782
128 1.43642012 -1.20868259
129 -1.06623105 1.43642012
130 2.01545097 -1.06623105
131 -0.82098611 2.01545097
132 0.39068719 -0.82098611
133 -0.08564835 0.39068719
134 1.18679040 -0.08564835
135 -2.97991573 1.18679040
136 -2.09291402 -2.97991573
137 1.63291311 -2.09291402
138 -3.44500751 1.63291311
139 -4.31089969 -3.44500751
140 -1.18709815 -4.31089969
141 0.03870071 -1.18709815
142 0.71316967 0.03870071
143 2.84444949 0.71316967
144 -2.12242914 2.84444949
> 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/7v1fc1290528088.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/8v1fc1290528088.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/9naff1290528088.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/10naff1290528088.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/119avl1290528088.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/12ubc91290528088.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/13jur21290528088.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/14u3861290528088.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/15x4pt1290528088.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/16td421290528088.tab")
+ }
>
> try(system("convert tmp/1mups1290528088.ps tmp/1mups1290528088.png",intern=TRUE))
character(0)
> try(system("convert tmp/2s0z61290528088.ps tmp/2s0z61290528088.png",intern=TRUE))
character(0)
> try(system("convert tmp/3s0z61290528088.ps tmp/3s0z61290528088.png",intern=TRUE))
character(0)
> try(system("convert tmp/4s0z61290528088.ps tmp/4s0z61290528088.png",intern=TRUE))
character(0)
> try(system("convert tmp/5s0z61290528088.ps tmp/5s0z61290528088.png",intern=TRUE))
character(0)
> try(system("convert tmp/62ryr1290528088.ps tmp/62ryr1290528088.png",intern=TRUE))
character(0)
> try(system("convert tmp/7v1fc1290528088.ps tmp/7v1fc1290528088.png",intern=TRUE))
character(0)
> try(system("convert tmp/8v1fc1290528088.ps tmp/8v1fc1290528088.png",intern=TRUE))
character(0)
> try(system("convert tmp/9naff1290528088.ps tmp/9naff1290528088.png",intern=TRUE))
character(0)
> try(system("convert tmp/10naff1290528088.ps tmp/10naff1290528088.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
3.993 1.702 8.761