R version 2.13.0 (2011-04-13)
Copyright (C) 2011 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: i486-pc-linux-gnu (32-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> x <- array(list(3
+ ,4
+ ,3
+ ,1
+ ,4
+ ,4
+ ,4
+ ,1
+ ,4
+ ,5
+ ,5
+ ,3
+ ,4
+ ,2
+ ,3
+ ,2
+ ,4
+ ,5
+ ,3
+ ,3
+ ,3
+ ,3
+ ,3
+ ,2
+ ,5
+ ,3
+ ,5
+ ,3
+ ,4
+ ,5
+ ,3
+ ,2
+ ,3
+ ,3
+ ,4
+ ,2
+ ,3
+ ,3
+ ,4
+ ,2
+ ,4
+ ,4
+ ,5
+ ,1
+ ,4
+ ,4
+ ,4
+ ,1
+ ,4
+ ,4
+ ,4
+ ,3
+ ,4
+ ,3
+ ,4
+ ,3
+ ,4
+ ,5
+ ,4
+ ,2
+ ,4
+ ,4
+ ,3
+ ,3
+ ,4
+ ,4
+ ,5
+ ,1
+ ,5
+ ,4
+ ,5
+ ,1
+ ,4
+ ,4
+ ,5
+ ,2
+ ,4
+ ,4
+ ,4
+ ,1
+ ,4
+ ,4
+ ,4
+ ,4
+ ,4
+ ,4
+ ,2
+ ,5
+ ,4
+ ,4
+ ,2
+ ,4
+ ,4
+ ,4
+ ,2
+ ,4
+ ,5
+ ,1
+ ,4
+ ,4
+ ,5
+ ,2
+ ,4
+ ,3
+ ,4
+ ,2
+ ,4
+ ,5
+ ,3
+ ,3
+ ,4
+ ,4
+ ,4
+ ,3
+ ,4
+ ,4
+ ,4
+ ,1
+ ,4
+ ,4
+ ,4
+ ,2
+ ,3
+ ,2
+ ,3
+ ,1
+ ,4
+ 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,3
+ ,4
+ ,3
+ ,3
+ ,4)
+ ,dim=c(4
+ ,162)
+ ,dimnames=list(c('Yt'
+ ,'X1'
+ ,'X2'
+ ,'X3')
+ ,1:162))
> y <- array(NA,dim=c(4,162),dimnames=list(c('Yt','X1','X2','X3'),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 = '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
> 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
Yt X1 X2 X3
1 3 4 3 1
2 4 4 4 1
3 4 5 5 3
4 4 2 3 2
5 4 5 3 3
6 3 3 3 2
7 5 3 5 3
8 4 5 3 2
9 3 3 4 2
10 3 3 4 2
11 4 4 5 1
12 4 4 4 1
13 4 4 4 3
14 4 3 4 3
15 4 5 4 2
16 4 4 3 3
17 4 4 5 1
18 5 4 5 1
19 4 4 5 2
20 4 4 4 1
21 4 4 4 4
22 4 4 2 5
23 4 4 2 4
24 4 4 2 4
25 5 1 4 4
26 5 2 4 3
27 4 2 4 5
28 3 3 4 4
29 4 3 4 4
30 4 1 4 4
31 4 2 3 2
32 3 1 4 3
33 3 1 4 4
34 4 1 3 4
35 4 2 3 2
36 2 1 2 4
37 2 3 4 4
38 2 4 4 4
39 2 4 3 4
40 1 4 4 4
41 1 4 4 4
42 3 5 5 5
43 1 4 3 3
44 2 4 4 3
45 2 4 4 2
46 1 3 4 4
47 1 4 4 4
48 2 4 4 4
49 3 3 4 4
50 1 4 5 4
51 1 3 3 4
52 3 3 4 3
53 3 5 4 3
54 2 2 1 2
55 3 4 2 3
56 2 4 4 4
57 2 4 4 4
58 1 3 3 3
59 1 4 3 4
60 3 3 2 4
61 3 4 4 4
62 2 4 5 4
63 1 4 4 3
64 2 4 4 4
65 2 4 4 5
66 1 5 5 4
67 2 5 4 4
68 1 3 4 3
69 2 4 4 4
70 2 3 3 3
71 2 4 4 4
72 4 5 5 4
73 3 5 5 4
74 1 4 4 4
75 2 4 2 4
76 3 4 4 4
77 2 4 4 4
78 2 4 4 4
79 2 4 4 4
80 2 4 4 5
81 1 5 4 5
82 1 4 4 4
83 1 4 4 4
84 4 4 4 4
85 2 4 4 4
86 2 4 3 3
87 3 4 4 4
88 2 4 4 4
89 3 4 4 4
90 4 3 3 3
91 1 4 5 4
92 3 4 4 4
93 1 4 4 3
94 2 4 4 2
95 1 4 4 4
96 1 4 4 4
97 3 4 3 4
98 2 4 4 4
99 2 4 4 4
100 2 4 5 4
101 2 5 4 4
102 2 5 5 5
103 2 4 4 4
104 1 4 4 4
105 2 3 4 3
106 3 4 4 5
107 2 4 4 4
108 2 4 3 5
109 1 2 4 4
110 4 4 4 4
111 2 4 5 4
112 2 4 4 4
113 1 3 3 3
114 2 4 4 4
115 2 4 4 4
116 3 3 5 3
117 2 4 2 4
118 4 4 4 3
119 2 4 4 4
120 4 4 4 4
121 1 4 4 4
122 2 4 4 3
123 2 4 5 4
124 1 4 4 4
125 1 4 5 4
126 1 4 3 4
127 1 4 4 5
128 1 4 3 4
129 2 3 4 3
130 2 4 4 5
131 1 3 4 3
132 3 4 2 4
133 2 3 4 2
134 2 3 4 4
135 3 3 4 4
136 3 4 3 2
137 2 4 4 3
138 2 4 4 2
139 2 4 3 3
140 2 3 3 2
141 4 2 4 1
142 4 4 4 1
143 5 5 4 3
144 4 4 4 2
145 3 4 2 2
146 4 4 4 3
147 3 4 3 3
148 4 4 4 1
149 4 3 4 3
150 3 2 2 2
151 4 4 3 1
152 4 2 4 1
153 4 2 4 2
154 4 3 3 2
155 3 3 2 3
156 4 5 4 3
157 3 2 4 1
158 4 3 4 2
159 4 4 4 2
160 3 2 3 3
161 4 3 3 4
162 3 4 3 1
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) X1 X2 X3
4.53591 -0.15472 0.03894 -0.44591
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-1.8898 -0.7351 -0.2053 0.7108 2.4196
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 4.53591 0.50595 8.965 8.38e-16 ***
X1 -0.15472 0.09558 -1.619 0.108
X2 0.03894 0.10893 0.357 0.721
X3 -0.44591 0.07767 -5.741 4.69e-08 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 1.042 on 158 degrees of freedom
Multiple R-squared: 0.2013, Adjusted R-squared: 0.1862
F-statistic: 13.28 on 3 and 158 DF, p-value: 8.959e-08
> 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.1920188210 3.840376e-01 8.079812e-01
[2,] 0.1344211019 2.688422e-01 8.655789e-01
[3,] 0.1586635614 3.173271e-01 8.413364e-01
[4,] 0.1391514665 2.783029e-01 8.608485e-01
[5,] 0.0832398366 1.664797e-01 9.167602e-01
[6,] 0.0530012648 1.060025e-01 9.469987e-01
[7,] 0.0286720204 5.734404e-02 9.713280e-01
[8,] 0.0147987388 2.959748e-02 9.852013e-01
[9,] 0.0073938755 1.478775e-02 9.926061e-01
[10,] 0.0038919049 7.783810e-03 9.961081e-01
[11,] 0.0017941261 3.588252e-03 9.982059e-01
[12,] 0.0035764257 7.152851e-03 9.964236e-01
[13,] 0.0020159016 4.031803e-03 9.979841e-01
[14,] 0.0010465073 2.093015e-03 9.989535e-01
[15,] 0.0005750506 1.150101e-03 9.994249e-01
[16,] 0.0003910211 7.820421e-04 9.996090e-01
[17,] 0.0002624946 5.249892e-04 9.997375e-01
[18,] 0.0001701604 3.403207e-04 9.998298e-01
[19,] 0.0002925507 5.851013e-04 9.997074e-01
[20,] 0.0004234145 8.468289e-04 9.995766e-01
[21,] 0.0005099395 1.019879e-03 9.994901e-01
[22,] 0.0019144638 3.828928e-03 9.980855e-01
[23,] 0.0013873419 2.774684e-03 9.986127e-01
[24,] 0.0009957739 1.991548e-03 9.990042e-01
[25,] 0.0006262851 1.252570e-03 9.993737e-01
[26,] 0.0010867178 2.173436e-03 9.989133e-01
[27,] 0.0016105972 3.221194e-03 9.983894e-01
[28,] 0.0014651090 2.930218e-03 9.985349e-01
[29,] 0.0010967500 2.193500e-03 9.989033e-01
[30,] 0.0037875106 7.575021e-03 9.962125e-01
[31,] 0.0242510714 4.850214e-02 9.757489e-01
[32,] 0.0715593117 1.431186e-01 9.284407e-01
[33,] 0.1129629590 2.259259e-01 8.870370e-01
[34,] 0.3494169557 6.988339e-01 6.505830e-01
[35,] 0.5701559825 8.596880e-01 4.298440e-01
[36,] 0.5409270319 9.181459e-01 4.590730e-01
[37,] 0.7420659408 5.158681e-01 2.579341e-01
[38,] 0.7667386847 4.665226e-01 2.332613e-01
[39,] 0.8133269464 3.733461e-01 1.866731e-01
[40,] 0.8902555515 2.194889e-01 1.097444e-01
[41,] 0.9283316851 1.433366e-01 7.166831e-02
[42,] 0.9193896038 1.612208e-01 8.061040e-02
[43,] 0.9076361410 1.847277e-01 9.236386e-02
[44,] 0.9340315586 1.319369e-01 6.596844e-02
[45,] 0.9548865239 9.022695e-02 4.511348e-02
[46,] 0.9443047320 1.113905e-01 5.569527e-02
[47,] 0.9297301478 1.405397e-01 7.026985e-02
[48,] 0.9416913278 1.166173e-01 5.830867e-02
[49,] 0.9271168643 1.457663e-01 7.288314e-02
[50,] 0.9151779098 1.696442e-01 8.482209e-02
[51,] 0.9013440808 1.973118e-01 9.865592e-02
[52,] 0.9418577588 1.162845e-01 5.814224e-02
[53,] 0.9514150249 9.716995e-02 4.858498e-02
[54,] 0.9443156957 1.113686e-01 5.568430e-02
[55,] 0.9357896265 1.284207e-01 6.421037e-02
[56,] 0.9253483228 1.493034e-01 7.465168e-02
[57,] 0.9548159569 9.036809e-02 4.518404e-02
[58,] 0.9448431990 1.103136e-01 5.515680e-02
[59,] 0.9319954186 1.360092e-01 6.800458e-02
[60,] 0.9416150558 1.167699e-01 5.838494e-02
[61,] 0.9280754772 1.438490e-01 7.192452e-02
[62,] 0.9572121975 8.557561e-02 4.278780e-02
[63,] 0.9470045123 1.059910e-01 5.299549e-02
[64,] 0.9421142488 1.157715e-01 5.788575e-02
[65,] 0.9291324792 1.417350e-01 7.086752e-02
[66,] 0.9521090661 9.578187e-02 4.789093e-02
[67,] 0.9461417718 1.077165e-01 5.385823e-02
[68,] 0.9532867836 9.342643e-02 4.671322e-02
[69,] 0.9417626011 1.164748e-01 5.823740e-02
[70,] 0.9348112273 1.303775e-01 6.518877e-02
[71,] 0.9207406164 1.585188e-01 7.925938e-02
[72,] 0.9044031032 1.911938e-01 9.559690e-02
[73,] 0.8856268893 2.287462e-01 1.143731e-01
[74,] 0.8639627437 2.720745e-01 1.360373e-01
[75,] 0.8513669120 2.972662e-01 1.486331e-01
[76,] 0.8647653771 2.704692e-01 1.352346e-01
[77,] 0.8770996125 2.458008e-01 1.229004e-01
[78,] 0.9152788774 1.694422e-01 8.472112e-02
[79,] 0.8975030601 2.049939e-01 1.024969e-01
[80,] 0.8871362201 2.257276e-01 1.128638e-01
[81,] 0.8767723021 2.464554e-01 1.232277e-01
[82,] 0.8535490018 2.929020e-01 1.464510e-01
[83,] 0.8415657554 3.168685e-01 1.584342e-01
[84,] 0.8552589483 2.894821e-01 1.447411e-01
[85,] 0.8682583704 2.634833e-01 1.317416e-01
[86,] 0.8575392701 2.849215e-01 1.424607e-01
[87,] 0.9011760156 1.976480e-01 9.882398e-02
[88,] 0.9114348104 1.771304e-01 8.856519e-02
[89,] 0.9202913939 1.594172e-01 7.970861e-02
[90,] 0.9289041079 1.421918e-01 7.109589e-02
[91,] 0.9220014826 1.559970e-01 7.799852e-02
[92,] 0.9044114006 1.911772e-01 9.558860e-02
[93,] 0.8840123979 2.319752e-01 1.159876e-01
[94,] 0.8611950396 2.776099e-01 1.388050e-01
[95,] 0.8363799560 3.272401e-01 1.636200e-01
[96,] 0.8061661644 3.876677e-01 1.938338e-01
[97,] 0.7737625760 4.524748e-01 2.262374e-01
[98,] 0.7931029363 4.137941e-01 2.068971e-01
[99,] 0.7771223845 4.457552e-01 2.228776e-01
[100,] 0.7944706081 4.110588e-01 2.055294e-01
[101,] 0.7602083575 4.795833e-01 2.397916e-01
[102,] 0.7247035457 5.505929e-01 2.752965e-01
[103,] 0.7416002570 5.167995e-01 2.583997e-01
[104,] 0.8136962065 3.726076e-01 1.863038e-01
[105,] 0.7805290108 4.389420e-01 2.194710e-01
[106,] 0.7433022477 5.133955e-01 2.566978e-01
[107,] 0.8096281490 3.807437e-01 1.903719e-01
[108,] 0.7748279772 4.503440e-01 2.251720e-01
[109,] 0.7365791001 5.268418e-01 2.634209e-01
[110,] 0.6955760323 6.088479e-01 3.044240e-01
[111,] 0.6506542087 6.986916e-01 3.493458e-01
[112,] 0.6724737701 6.550525e-01 3.275262e-01
[113,] 0.6254976383 7.490047e-01 3.745024e-01
[114,] 0.7267080058 5.465840e-01 2.732920e-01
[115,] 0.7390638124 5.218724e-01 2.609362e-01
[116,] 0.7163769157 5.672462e-01 2.836231e-01
[117,] 0.6700464419 6.599071e-01 3.299536e-01
[118,] 0.6933624100 6.132752e-01 3.066376e-01
[119,] 0.7357955463 5.284089e-01 2.642045e-01
[120,] 0.7706891617 4.586217e-01 2.293108e-01
[121,] 0.7826091507 4.347817e-01 2.173908e-01
[122,] 0.8435176126 3.129648e-01 1.564824e-01
[123,] 0.8438819171 3.122362e-01 1.561181e-01
[124,] 0.8223657675 3.552685e-01 1.776342e-01
[125,] 0.9399068200 1.201864e-01 6.009318e-02
[126,] 0.9222159216 1.555682e-01 7.778408e-02
[127,] 0.9530042180 9.399156e-02 4.699578e-02
[128,] 0.9660455104 6.790898e-02 3.395449e-02
[129,] 0.9567810407 8.643792e-02 4.321896e-02
[130,] 0.9398430775 1.203138e-01 6.015692e-02
[131,] 0.9790654989 4.186900e-02 2.093450e-02
[132,] 0.9976289414 4.742117e-03 2.371059e-03
[133,] 0.9997026040 5.947920e-04 2.973960e-04
[134,] 0.9999861142 2.777151e-05 1.388575e-05
[135,] 0.9999701460 5.970800e-05 2.985400e-05
[136,] 0.9999223847 1.552306e-04 7.761528e-05
[137,] 0.9999675708 6.485838e-05 3.242919e-05
[138,] 0.9999109289 1.781422e-04 8.907111e-05
[139,] 0.9997590353 4.819295e-04 2.409647e-04
[140,] 0.9993944006 1.211199e-03 6.055994e-04
[141,] 0.9994369349 1.126130e-03 5.630651e-04
[142,] 0.9984992944 3.001411e-03 1.500706e-03
[143,] 0.9961967101 7.606580e-03 3.803290e-03
[144,] 0.9905697940 1.886041e-02 9.430206e-03
[145,] 0.9895820630 2.083587e-02 1.041794e-02
[146,] 0.9835254749 3.294905e-02 1.647453e-02
[147,] 0.9682523593 6.349528e-02 3.174764e-02
[148,] 0.9843294592 3.134108e-02 1.567054e-02
[149,] 0.9455683102 1.088634e-01 5.443169e-02
> postscript(file="/var/wessaorg/rcomp/tmp/1yji41324664466.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/2mlux1324664466.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/3eedu1324664466.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/4nrse1324664466.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/52iuh1324664466.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
-0.587965036 0.373093801 1.380680566 0.548510291 1.458562892 -0.296774254
7 8 9 10 11 12
2.071249656 1.012656655 -0.335715417 -0.335715417 0.334152639 0.373093801
13 14 15 16 17 18
1.264906274 1.110190819 0.973715493 1.303847437 0.334152639 1.334152639
19 20 21 22 23 24
0.780058875 0.373093801 1.710812510 2.234601072 1.788694836 1.788694836
25 26 27 28 29 30
2.246666145 1.955475364 1.847287837 0.556097055 1.556097055 1.246666145
31 32 33 34 35 36
0.548510291 -0.199240091 0.246666145 1.285607308 0.548510291 -0.675451529
37 38 39 40 41 42
-0.443902945 -0.289187490 -0.250246327 -1.289187490 -1.289187490 1.272493038
43 44 45 46 47 48
-1.696152563 -0.735093726 -1.180999962 -1.443902945 -1.289187490 -0.289187490
49 50 51 52 53 54
0.556097055 -1.328128653 -1.404961782 0.110190819 0.419621729 -1.373607384
55 56 57 58 59 60
0.342788600 -0.289187490 -0.289187490 -1.850868018 -1.250246327 0.633979381
61 62 63 64 65 66
0.710812510 -0.328128653 -1.735093726 -0.289187490 0.156718746 -1.173413198
67 68 69 70 71 72
-0.134472035 -1.889809181 -0.289187490 -0.850868018 -0.289187490 1.826586802
73 74 75 76 77 78
0.826586802 -1.289187490 -0.211305164 0.710812510 -0.289187490 -0.289187490
79 80 81 82 83 84
-0.289187490 0.156718746 -0.688565799 -1.289187490 -1.289187490 1.710812510
85 86 87 88 89 90
-0.289187490 -0.696152563 0.710812510 -0.289187490 0.710812510 1.149131982
91 92 93 94 95 96
-1.328128653 0.710812510 -1.735093726 -1.180999962 -1.289187490 -1.289187490
97 98 99 100 101 102
0.749753673 -0.289187490 -0.289187490 -0.328128653 -0.134472035 0.272493038
103 104 105 106 107 108
-0.289187490 -1.289187490 -0.889809181 1.156718746 -0.289187490 0.195659909
109 110 111 112 113 114
-1.598618400 1.710812510 -0.328128653 -0.289187490 -1.850868018 -0.289187490
115 116 117 118 119 120
-0.289187490 0.071249656 -0.211305164 1.264906274 -0.289187490 1.710812510
121 122 123 124 125 126
-1.289187490 -0.735093726 -0.328128653 -1.289187490 -1.328128653 -1.250246327
127 128 129 130 131 132
-0.843281254 -1.250246327 -0.889809181 0.156718746 -1.889809181 0.788694836
133 134 135 136 137 138
-1.335715417 -0.443902945 0.556097055 -0.142058800 -0.735093726 -1.180999962
139 140 141 142 143 144
-0.696152563 -1.296774254 0.063662892 0.373093801 2.419621729 0.819000038
145 146 147 148 149 150
-0.103117637 1.264906274 0.303847437 0.373093801 1.110190819 -0.412548546
151 152 153 154 155 156
0.412034964 0.063662892 0.509569128 0.703225746 0.188073145 1.419621729
157 158 159 160 161 162
-0.936337108 0.664284583 0.819000038 -0.005583473 1.595038218 -0.587965036
> postscript(file="/var/wessaorg/rcomp/tmp/6fgcc1324664466.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 -0.587965036 NA
1 0.373093801 -0.587965036
2 1.380680566 0.373093801
3 0.548510291 1.380680566
4 1.458562892 0.548510291
5 -0.296774254 1.458562892
6 2.071249656 -0.296774254
7 1.012656655 2.071249656
8 -0.335715417 1.012656655
9 -0.335715417 -0.335715417
10 0.334152639 -0.335715417
11 0.373093801 0.334152639
12 1.264906274 0.373093801
13 1.110190819 1.264906274
14 0.973715493 1.110190819
15 1.303847437 0.973715493
16 0.334152639 1.303847437
17 1.334152639 0.334152639
18 0.780058875 1.334152639
19 0.373093801 0.780058875
20 1.710812510 0.373093801
21 2.234601072 1.710812510
22 1.788694836 2.234601072
23 1.788694836 1.788694836
24 2.246666145 1.788694836
25 1.955475364 2.246666145
26 1.847287837 1.955475364
27 0.556097055 1.847287837
28 1.556097055 0.556097055
29 1.246666145 1.556097055
30 0.548510291 1.246666145
31 -0.199240091 0.548510291
32 0.246666145 -0.199240091
33 1.285607308 0.246666145
34 0.548510291 1.285607308
35 -0.675451529 0.548510291
36 -0.443902945 -0.675451529
37 -0.289187490 -0.443902945
38 -0.250246327 -0.289187490
39 -1.289187490 -0.250246327
40 -1.289187490 -1.289187490
41 1.272493038 -1.289187490
42 -1.696152563 1.272493038
43 -0.735093726 -1.696152563
44 -1.180999962 -0.735093726
45 -1.443902945 -1.180999962
46 -1.289187490 -1.443902945
47 -0.289187490 -1.289187490
48 0.556097055 -0.289187490
49 -1.328128653 0.556097055
50 -1.404961782 -1.328128653
51 0.110190819 -1.404961782
52 0.419621729 0.110190819
53 -1.373607384 0.419621729
54 0.342788600 -1.373607384
55 -0.289187490 0.342788600
56 -0.289187490 -0.289187490
57 -1.850868018 -0.289187490
58 -1.250246327 -1.850868018
59 0.633979381 -1.250246327
60 0.710812510 0.633979381
61 -0.328128653 0.710812510
62 -1.735093726 -0.328128653
63 -0.289187490 -1.735093726
64 0.156718746 -0.289187490
65 -1.173413198 0.156718746
66 -0.134472035 -1.173413198
67 -1.889809181 -0.134472035
68 -0.289187490 -1.889809181
69 -0.850868018 -0.289187490
70 -0.289187490 -0.850868018
71 1.826586802 -0.289187490
72 0.826586802 1.826586802
73 -1.289187490 0.826586802
74 -0.211305164 -1.289187490
75 0.710812510 -0.211305164
76 -0.289187490 0.710812510
77 -0.289187490 -0.289187490
78 -0.289187490 -0.289187490
79 0.156718746 -0.289187490
80 -0.688565799 0.156718746
81 -1.289187490 -0.688565799
82 -1.289187490 -1.289187490
83 1.710812510 -1.289187490
84 -0.289187490 1.710812510
85 -0.696152563 -0.289187490
86 0.710812510 -0.696152563
87 -0.289187490 0.710812510
88 0.710812510 -0.289187490
89 1.149131982 0.710812510
90 -1.328128653 1.149131982
91 0.710812510 -1.328128653
92 -1.735093726 0.710812510
93 -1.180999962 -1.735093726
94 -1.289187490 -1.180999962
95 -1.289187490 -1.289187490
96 0.749753673 -1.289187490
97 -0.289187490 0.749753673
98 -0.289187490 -0.289187490
99 -0.328128653 -0.289187490
100 -0.134472035 -0.328128653
101 0.272493038 -0.134472035
102 -0.289187490 0.272493038
103 -1.289187490 -0.289187490
104 -0.889809181 -1.289187490
105 1.156718746 -0.889809181
106 -0.289187490 1.156718746
107 0.195659909 -0.289187490
108 -1.598618400 0.195659909
109 1.710812510 -1.598618400
110 -0.328128653 1.710812510
111 -0.289187490 -0.328128653
112 -1.850868018 -0.289187490
113 -0.289187490 -1.850868018
114 -0.289187490 -0.289187490
115 0.071249656 -0.289187490
116 -0.211305164 0.071249656
117 1.264906274 -0.211305164
118 -0.289187490 1.264906274
119 1.710812510 -0.289187490
120 -1.289187490 1.710812510
121 -0.735093726 -1.289187490
122 -0.328128653 -0.735093726
123 -1.289187490 -0.328128653
124 -1.328128653 -1.289187490
125 -1.250246327 -1.328128653
126 -0.843281254 -1.250246327
127 -1.250246327 -0.843281254
128 -0.889809181 -1.250246327
129 0.156718746 -0.889809181
130 -1.889809181 0.156718746
131 0.788694836 -1.889809181
132 -1.335715417 0.788694836
133 -0.443902945 -1.335715417
134 0.556097055 -0.443902945
135 -0.142058800 0.556097055
136 -0.735093726 -0.142058800
137 -1.180999962 -0.735093726
138 -0.696152563 -1.180999962
139 -1.296774254 -0.696152563
140 0.063662892 -1.296774254
141 0.373093801 0.063662892
142 2.419621729 0.373093801
143 0.819000038 2.419621729
144 -0.103117637 0.819000038
145 1.264906274 -0.103117637
146 0.303847437 1.264906274
147 0.373093801 0.303847437
148 1.110190819 0.373093801
149 -0.412548546 1.110190819
150 0.412034964 -0.412548546
151 0.063662892 0.412034964
152 0.509569128 0.063662892
153 0.703225746 0.509569128
154 0.188073145 0.703225746
155 1.419621729 0.188073145
156 -0.936337108 1.419621729
157 0.664284583 -0.936337108
158 0.819000038 0.664284583
159 -0.005583473 0.819000038
160 1.595038218 -0.005583473
161 -0.587965036 1.595038218
162 NA -0.587965036
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 0.373093801 -0.587965036
[2,] 1.380680566 0.373093801
[3,] 0.548510291 1.380680566
[4,] 1.458562892 0.548510291
[5,] -0.296774254 1.458562892
[6,] 2.071249656 -0.296774254
[7,] 1.012656655 2.071249656
[8,] -0.335715417 1.012656655
[9,] -0.335715417 -0.335715417
[10,] 0.334152639 -0.335715417
[11,] 0.373093801 0.334152639
[12,] 1.264906274 0.373093801
[13,] 1.110190819 1.264906274
[14,] 0.973715493 1.110190819
[15,] 1.303847437 0.973715493
[16,] 0.334152639 1.303847437
[17,] 1.334152639 0.334152639
[18,] 0.780058875 1.334152639
[19,] 0.373093801 0.780058875
[20,] 1.710812510 0.373093801
[21,] 2.234601072 1.710812510
[22,] 1.788694836 2.234601072
[23,] 1.788694836 1.788694836
[24,] 2.246666145 1.788694836
[25,] 1.955475364 2.246666145
[26,] 1.847287837 1.955475364
[27,] 0.556097055 1.847287837
[28,] 1.556097055 0.556097055
[29,] 1.246666145 1.556097055
[30,] 0.548510291 1.246666145
[31,] -0.199240091 0.548510291
[32,] 0.246666145 -0.199240091
[33,] 1.285607308 0.246666145
[34,] 0.548510291 1.285607308
[35,] -0.675451529 0.548510291
[36,] -0.443902945 -0.675451529
[37,] -0.289187490 -0.443902945
[38,] -0.250246327 -0.289187490
[39,] -1.289187490 -0.250246327
[40,] -1.289187490 -1.289187490
[41,] 1.272493038 -1.289187490
[42,] -1.696152563 1.272493038
[43,] -0.735093726 -1.696152563
[44,] -1.180999962 -0.735093726
[45,] -1.443902945 -1.180999962
[46,] -1.289187490 -1.443902945
[47,] -0.289187490 -1.289187490
[48,] 0.556097055 -0.289187490
[49,] -1.328128653 0.556097055
[50,] -1.404961782 -1.328128653
[51,] 0.110190819 -1.404961782
[52,] 0.419621729 0.110190819
[53,] -1.373607384 0.419621729
[54,] 0.342788600 -1.373607384
[55,] -0.289187490 0.342788600
[56,] -0.289187490 -0.289187490
[57,] -1.850868018 -0.289187490
[58,] -1.250246327 -1.850868018
[59,] 0.633979381 -1.250246327
[60,] 0.710812510 0.633979381
[61,] -0.328128653 0.710812510
[62,] -1.735093726 -0.328128653
[63,] -0.289187490 -1.735093726
[64,] 0.156718746 -0.289187490
[65,] -1.173413198 0.156718746
[66,] -0.134472035 -1.173413198
[67,] -1.889809181 -0.134472035
[68,] -0.289187490 -1.889809181
[69,] -0.850868018 -0.289187490
[70,] -0.289187490 -0.850868018
[71,] 1.826586802 -0.289187490
[72,] 0.826586802 1.826586802
[73,] -1.289187490 0.826586802
[74,] -0.211305164 -1.289187490
[75,] 0.710812510 -0.211305164
[76,] -0.289187490 0.710812510
[77,] -0.289187490 -0.289187490
[78,] -0.289187490 -0.289187490
[79,] 0.156718746 -0.289187490
[80,] -0.688565799 0.156718746
[81,] -1.289187490 -0.688565799
[82,] -1.289187490 -1.289187490
[83,] 1.710812510 -1.289187490
[84,] -0.289187490 1.710812510
[85,] -0.696152563 -0.289187490
[86,] 0.710812510 -0.696152563
[87,] -0.289187490 0.710812510
[88,] 0.710812510 -0.289187490
[89,] 1.149131982 0.710812510
[90,] -1.328128653 1.149131982
[91,] 0.710812510 -1.328128653
[92,] -1.735093726 0.710812510
[93,] -1.180999962 -1.735093726
[94,] -1.289187490 -1.180999962
[95,] -1.289187490 -1.289187490
[96,] 0.749753673 -1.289187490
[97,] -0.289187490 0.749753673
[98,] -0.289187490 -0.289187490
[99,] -0.328128653 -0.289187490
[100,] -0.134472035 -0.328128653
[101,] 0.272493038 -0.134472035
[102,] -0.289187490 0.272493038
[103,] -1.289187490 -0.289187490
[104,] -0.889809181 -1.289187490
[105,] 1.156718746 -0.889809181
[106,] -0.289187490 1.156718746
[107,] 0.195659909 -0.289187490
[108,] -1.598618400 0.195659909
[109,] 1.710812510 -1.598618400
[110,] -0.328128653 1.710812510
[111,] -0.289187490 -0.328128653
[112,] -1.850868018 -0.289187490
[113,] -0.289187490 -1.850868018
[114,] -0.289187490 -0.289187490
[115,] 0.071249656 -0.289187490
[116,] -0.211305164 0.071249656
[117,] 1.264906274 -0.211305164
[118,] -0.289187490 1.264906274
[119,] 1.710812510 -0.289187490
[120,] -1.289187490 1.710812510
[121,] -0.735093726 -1.289187490
[122,] -0.328128653 -0.735093726
[123,] -1.289187490 -0.328128653
[124,] -1.328128653 -1.289187490
[125,] -1.250246327 -1.328128653
[126,] -0.843281254 -1.250246327
[127,] -1.250246327 -0.843281254
[128,] -0.889809181 -1.250246327
[129,] 0.156718746 -0.889809181
[130,] -1.889809181 0.156718746
[131,] 0.788694836 -1.889809181
[132,] -1.335715417 0.788694836
[133,] -0.443902945 -1.335715417
[134,] 0.556097055 -0.443902945
[135,] -0.142058800 0.556097055
[136,] -0.735093726 -0.142058800
[137,] -1.180999962 -0.735093726
[138,] -0.696152563 -1.180999962
[139,] -1.296774254 -0.696152563
[140,] 0.063662892 -1.296774254
[141,] 0.373093801 0.063662892
[142,] 2.419621729 0.373093801
[143,] 0.819000038 2.419621729
[144,] -0.103117637 0.819000038
[145,] 1.264906274 -0.103117637
[146,] 0.303847437 1.264906274
[147,] 0.373093801 0.303847437
[148,] 1.110190819 0.373093801
[149,] -0.412548546 1.110190819
[150,] 0.412034964 -0.412548546
[151,] 0.063662892 0.412034964
[152,] 0.509569128 0.063662892
[153,] 0.703225746 0.509569128
[154,] 0.188073145 0.703225746
[155,] 1.419621729 0.188073145
[156,] -0.936337108 1.419621729
[157,] 0.664284583 -0.936337108
[158,] 0.819000038 0.664284583
[159,] -0.005583473 0.819000038
[160,] 1.595038218 -0.005583473
[161,] -0.587965036 1.595038218
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 0.373093801 -0.587965036
2 1.380680566 0.373093801
3 0.548510291 1.380680566
4 1.458562892 0.548510291
5 -0.296774254 1.458562892
6 2.071249656 -0.296774254
7 1.012656655 2.071249656
8 -0.335715417 1.012656655
9 -0.335715417 -0.335715417
10 0.334152639 -0.335715417
11 0.373093801 0.334152639
12 1.264906274 0.373093801
13 1.110190819 1.264906274
14 0.973715493 1.110190819
15 1.303847437 0.973715493
16 0.334152639 1.303847437
17 1.334152639 0.334152639
18 0.780058875 1.334152639
19 0.373093801 0.780058875
20 1.710812510 0.373093801
21 2.234601072 1.710812510
22 1.788694836 2.234601072
23 1.788694836 1.788694836
24 2.246666145 1.788694836
25 1.955475364 2.246666145
26 1.847287837 1.955475364
27 0.556097055 1.847287837
28 1.556097055 0.556097055
29 1.246666145 1.556097055
30 0.548510291 1.246666145
31 -0.199240091 0.548510291
32 0.246666145 -0.199240091
33 1.285607308 0.246666145
34 0.548510291 1.285607308
35 -0.675451529 0.548510291
36 -0.443902945 -0.675451529
37 -0.289187490 -0.443902945
38 -0.250246327 -0.289187490
39 -1.289187490 -0.250246327
40 -1.289187490 -1.289187490
41 1.272493038 -1.289187490
42 -1.696152563 1.272493038
43 -0.735093726 -1.696152563
44 -1.180999962 -0.735093726
45 -1.443902945 -1.180999962
46 -1.289187490 -1.443902945
47 -0.289187490 -1.289187490
48 0.556097055 -0.289187490
49 -1.328128653 0.556097055
50 -1.404961782 -1.328128653
51 0.110190819 -1.404961782
52 0.419621729 0.110190819
53 -1.373607384 0.419621729
54 0.342788600 -1.373607384
55 -0.289187490 0.342788600
56 -0.289187490 -0.289187490
57 -1.850868018 -0.289187490
58 -1.250246327 -1.850868018
59 0.633979381 -1.250246327
60 0.710812510 0.633979381
61 -0.328128653 0.710812510
62 -1.735093726 -0.328128653
63 -0.289187490 -1.735093726
64 0.156718746 -0.289187490
65 -1.173413198 0.156718746
66 -0.134472035 -1.173413198
67 -1.889809181 -0.134472035
68 -0.289187490 -1.889809181
69 -0.850868018 -0.289187490
70 -0.289187490 -0.850868018
71 1.826586802 -0.289187490
72 0.826586802 1.826586802
73 -1.289187490 0.826586802
74 -0.211305164 -1.289187490
75 0.710812510 -0.211305164
76 -0.289187490 0.710812510
77 -0.289187490 -0.289187490
78 -0.289187490 -0.289187490
79 0.156718746 -0.289187490
80 -0.688565799 0.156718746
81 -1.289187490 -0.688565799
82 -1.289187490 -1.289187490
83 1.710812510 -1.289187490
84 -0.289187490 1.710812510
85 -0.696152563 -0.289187490
86 0.710812510 -0.696152563
87 -0.289187490 0.710812510
88 0.710812510 -0.289187490
89 1.149131982 0.710812510
90 -1.328128653 1.149131982
91 0.710812510 -1.328128653
92 -1.735093726 0.710812510
93 -1.180999962 -1.735093726
94 -1.289187490 -1.180999962
95 -1.289187490 -1.289187490
96 0.749753673 -1.289187490
97 -0.289187490 0.749753673
98 -0.289187490 -0.289187490
99 -0.328128653 -0.289187490
100 -0.134472035 -0.328128653
101 0.272493038 -0.134472035
102 -0.289187490 0.272493038
103 -1.289187490 -0.289187490
104 -0.889809181 -1.289187490
105 1.156718746 -0.889809181
106 -0.289187490 1.156718746
107 0.195659909 -0.289187490
108 -1.598618400 0.195659909
109 1.710812510 -1.598618400
110 -0.328128653 1.710812510
111 -0.289187490 -0.328128653
112 -1.850868018 -0.289187490
113 -0.289187490 -1.850868018
114 -0.289187490 -0.289187490
115 0.071249656 -0.289187490
116 -0.211305164 0.071249656
117 1.264906274 -0.211305164
118 -0.289187490 1.264906274
119 1.710812510 -0.289187490
120 -1.289187490 1.710812510
121 -0.735093726 -1.289187490
122 -0.328128653 -0.735093726
123 -1.289187490 -0.328128653
124 -1.328128653 -1.289187490
125 -1.250246327 -1.328128653
126 -0.843281254 -1.250246327
127 -1.250246327 -0.843281254
128 -0.889809181 -1.250246327
129 0.156718746 -0.889809181
130 -1.889809181 0.156718746
131 0.788694836 -1.889809181
132 -1.335715417 0.788694836
133 -0.443902945 -1.335715417
134 0.556097055 -0.443902945
135 -0.142058800 0.556097055
136 -0.735093726 -0.142058800
137 -1.180999962 -0.735093726
138 -0.696152563 -1.180999962
139 -1.296774254 -0.696152563
140 0.063662892 -1.296774254
141 0.373093801 0.063662892
142 2.419621729 0.373093801
143 0.819000038 2.419621729
144 -0.103117637 0.819000038
145 1.264906274 -0.103117637
146 0.303847437 1.264906274
147 0.373093801 0.303847437
148 1.110190819 0.373093801
149 -0.412548546 1.110190819
150 0.412034964 -0.412548546
151 0.063662892 0.412034964
152 0.509569128 0.063662892
153 0.703225746 0.509569128
154 0.188073145 0.703225746
155 1.419621729 0.188073145
156 -0.936337108 1.419621729
157 0.664284583 -0.936337108
158 0.819000038 0.664284583
159 -0.005583473 0.819000038
160 1.595038218 -0.005583473
161 -0.587965036 1.595038218
> 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/7u0rl1324664466.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/80bvy1324664466.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/9ue2h1324664466.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/100xee1324664466.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/11cs8z1324664466.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/12j1em1324664466.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/13j83z1324664466.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/14pgbj1324664466.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/15g24h1324664466.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/16e0f81324664466.tab")
+ }
>
> try(system("convert tmp/1yji41324664466.ps tmp/1yji41324664466.png",intern=TRUE))
character(0)
> try(system("convert tmp/2mlux1324664466.ps tmp/2mlux1324664466.png",intern=TRUE))
character(0)
> try(system("convert tmp/3eedu1324664466.ps tmp/3eedu1324664466.png",intern=TRUE))
character(0)
> try(system("convert tmp/4nrse1324664466.ps tmp/4nrse1324664466.png",intern=TRUE))
character(0)
> try(system("convert tmp/52iuh1324664466.ps tmp/52iuh1324664466.png",intern=TRUE))
character(0)
> try(system("convert tmp/6fgcc1324664466.ps tmp/6fgcc1324664466.png",intern=TRUE))
character(0)
> try(system("convert tmp/7u0rl1324664466.ps tmp/7u0rl1324664466.png",intern=TRUE))
character(0)
> try(system("convert tmp/80bvy1324664466.ps tmp/80bvy1324664466.png",intern=TRUE))
character(0)
> try(system("convert tmp/9ue2h1324664466.ps tmp/9ue2h1324664466.png",intern=TRUE))
character(0)
> try(system("convert tmp/100xee1324664466.ps tmp/100xee1324664466.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
4.743 0.777 5.550