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(13
+ ,1
+ ,0
+ ,12
+ ,1
+ ,0
+ ,11
+ ,1
+ ,0
+ ,10
+ ,1
+ ,1
+ ,8
+ ,1
+ ,1
+ ,7
+ ,1
+ ,0
+ ,10
+ ,1
+ ,1
+ ,8
+ ,1
+ ,1
+ ,13
+ ,1
+ ,1
+ ,11
+ ,1
+ ,1
+ ,8
+ ,1
+ ,1
+ ,9
+ ,1
+ ,0
+ ,12
+ ,1
+ ,0
+ ,11
+ ,0
+ ,1
+ ,9
+ ,1
+ ,0
+ ,8
+ ,1
+ ,1
+ ,9
+ ,1
+ ,1
+ ,8
+ ,1
+ ,0
+ ,11
+ ,1
+ ,1
+ ,10
+ ,1
+ ,0
+ ,15
+ ,1
+ ,0
+ ,11
+ ,1
+ ,1
+ ,16
+ ,1
+ ,1
+ ,12
+ ,1
+ ,1
+ ,11
+ ,1
+ ,1
+ ,11
+ ,1
+ ,0
+ ,10
+ ,0
+ ,1
+ ,8
+ ,1
+ ,1
+ ,11
+ ,1
+ ,1
+ ,11
+ ,1
+ ,1
+ ,13
+ ,1
+ ,1
+ ,15
+ ,0
+ ,1
+ ,12
+ ,1
+ ,0
+ ,14
+ ,0
+ ,1
+ ,12
+ ,1
+ ,1
+ ,7
+ ,1
+ ,1
+ ,8
+ ,1
+ ,1
+ ,12
+ ,1
+ ,0
+ ,10
+ ,0
+ ,1
+ ,9
+ ,1
+ ,1
+ ,12
+ ,0
+ ,1
+ ,10
+ ,1
+ ,0
+ ,9
+ ,0
+ ,1
+ ,10
+ ,1
+ ,1
+ ,13
+ ,0
+ ,1
+ ,8
+ ,1
+ ,0
+ ,11
+ ,0
+ ,0
+ ,11
+ ,0
+ ,1
+ ,9
+ ,1
+ ,1
+ ,9
+ ,1
+ ,1
+ ,12
+ ,0
+ ,0
+ ,10
+ ,0
+ ,0
+ ,9
+ ,0
+ ,0
+ ,14
+ ,0
+ ,1
+ ,8
+ ,0
+ ,1
+ ,9
+ ,0
+ ,0
+ ,14
+ ,0
+ ,0
+ ,8
+ ,0
+ ,1
+ ,16
+ ,0
+ ,1
+ ,14
+ ,0
+ ,1
+ ,14
+ ,0
+ ,0
+ ,8
+ ,0
+ ,1
+ ,11
+ ,0
+ ,1
+ ,11
+ ,0
+ ,0
+ ,13
+ ,0
+ ,1
+ ,12
+ ,0
+ ,1
+ ,9
+ ,0
+ ,1
+ ,10
+ ,0
+ ,0
+ ,12
+ ,0
+ ,1
+ ,11
+ ,0
+ ,1
+ ,15
+ ,0
+ ,0
+ ,14
+ ,0
+ ,1
+ ,16
+ ,1
+ ,1
+ ,16
+ ,1
+ ,1
+ ,9
+ ,1
+ ,1
+ ,10
+ ,1
+ ,1
+ ,14
+ ,1
+ ,1
+ ,14
+ ,0
+ ,1
+ ,21
+ ,0
+ ,0
+ ,14
+ ,1
+ ,0
+ ,17
+ ,1
+ ,1
+ ,18
+ ,1
+ ,0
+ ,16
+ ,1
+ ,1
+ ,14
+ ,0
+ ,1
+ ,13
+ ,0
+ ,0
+ ,17
+ ,1
+ ,1
+ ,10
+ ,1
+ ,1
+ ,17
+ ,1
+ ,0
+ ,13
+ ,1
+ ,1
+ ,18
+ ,1
+ ,1
+ ,14
+ ,1
+ ,0
+ ,14
+ ,1
+ ,1
+ ,15
+ ,1
+ ,0
+ ,12
+ ,0
+ ,1
+ ,17
+ ,0
+ ,1
+ ,15
+ ,0
+ ,1
+ ,12
+ ,0
+ ,0
+ ,13
+ ,0
+ ,1
+ ,14
+ ,0
+ ,0
+ ,18
+ ,0
+ ,1
+ ,16
+ ,1
+ ,1
+ ,21
+ ,1
+ ,0
+ ,20
+ ,1
+ ,1
+ ,10
+ ,0
+ ,0
+ ,16
+ ,0
+ ,0
+ ,19
+ ,1
+ ,0
+ ,12
+ ,1
+ ,1
+ ,13
+ ,0
+ ,1
+ ,20
+ ,0
+ ,0
+ ,14
+ ,0
+ ,0
+ ,10
+ ,0
+ ,1
+ ,13
+ ,0
+ ,0
+ ,11
+ ,0
+ ,0
+ ,13
+ ,0
+ ,1
+ ,13
+ ,0
+ ,1
+ ,11
+ ,0
+ ,1
+ ,15
+ ,0
+ ,0
+ ,14
+ ,0
+ ,0
+ ,10
+ ,0
+ ,0
+ ,24
+ ,1
+ ,0
+ ,23
+ ,1
+ ,1
+ ,19
+ ,1
+ ,0
+ ,19
+ ,1
+ ,0
+ ,22
+ ,1
+ ,1
+ ,16
+ ,1
+ ,1
+ ,16
+ ,0
+ ,0
+ ,20
+ ,1
+ ,1
+ ,11
+ ,1
+ ,0
+ ,20
+ ,1
+ ,1
+ ,15
+ ,1
+ ,0
+ ,21
+ ,1
+ ,0
+ ,17
+ ,1
+ ,0
+ ,25
+ ,0
+ ,0
+ ,17
+ ,0
+ ,1
+ ,16
+ ,0
+ ,0
+ ,17
+ ,0
+ ,0
+ ,15
+ ,0
+ ,0
+ ,15
+ ,0
+ ,0
+ ,26
+ ,1
+ ,0
+ ,25
+ ,1
+ ,0
+ ,20
+ ,1
+ ,0
+ ,20
+ ,1
+ ,1
+ ,26
+ ,1
+ ,0)
+ ,dim=c(3
+ ,143)
+ ,dimnames=list(c('depression'
+ ,'course'
+ ,'gender')
+ ,1:143))
> y <- array(NA,dim=c(3,143),dimnames=list(c('depression','course','gender'),1:143))
> 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
depression course gender
1 13 1 0
2 12 1 0
3 11 1 0
4 10 1 1
5 8 1 1
6 7 1 0
7 10 1 1
8 8 1 1
9 13 1 1
10 11 1 1
11 8 1 1
12 9 1 0
13 12 1 0
14 11 0 1
15 9 1 0
16 8 1 1
17 9 1 1
18 8 1 0
19 11 1 1
20 10 1 0
21 15 1 0
22 11 1 1
23 16 1 1
24 12 1 1
25 11 1 1
26 11 1 0
27 10 0 1
28 8 1 1
29 11 1 1
30 11 1 1
31 13 1 1
32 15 0 1
33 12 1 0
34 14 0 1
35 12 1 1
36 7 1 1
37 8 1 1
38 12 1 0
39 10 0 1
40 9 1 1
41 12 0 1
42 10 1 0
43 9 0 1
44 10 1 1
45 13 0 1
46 8 1 0
47 11 0 0
48 11 0 1
49 9 1 1
50 9 1 1
51 12 0 0
52 10 0 0
53 9 0 0
54 14 0 1
55 8 0 1
56 9 0 0
57 14 0 0
58 8 0 1
59 16 0 1
60 14 0 1
61 14 0 0
62 8 0 1
63 11 0 1
64 11 0 0
65 13 0 1
66 12 0 1
67 9 0 1
68 10 0 0
69 12 0 1
70 11 0 1
71 15 0 0
72 14 0 1
73 16 1 1
74 16 1 1
75 9 1 1
76 10 1 1
77 14 1 1
78 14 0 1
79 21 0 0
80 14 1 0
81 17 1 1
82 18 1 0
83 16 1 1
84 14 0 1
85 13 0 0
86 17 1 1
87 10 1 1
88 17 1 0
89 13 1 1
90 18 1 1
91 14 1 0
92 14 1 1
93 15 1 0
94 12 0 1
95 17 0 1
96 15 0 1
97 12 0 0
98 13 0 1
99 14 0 0
100 18 0 1
101 16 1 1
102 21 1 0
103 20 1 1
104 10 0 0
105 16 0 0
106 19 1 0
107 12 1 1
108 13 0 1
109 20 0 0
110 14 0 0
111 10 0 1
112 13 0 0
113 11 0 0
114 13 0 1
115 13 0 1
116 11 0 1
117 15 0 0
118 14 0 0
119 10 0 0
120 24 1 0
121 23 1 1
122 19 1 0
123 19 1 0
124 22 1 1
125 16 1 1
126 16 0 0
127 20 1 1
128 11 1 0
129 20 1 1
130 15 1 0
131 21 1 0
132 17 1 0
133 25 0 0
134 17 0 1
135 16 0 0
136 17 0 0
137 15 0 0
138 15 0 0
139 26 1 0
140 25 1 0
141 20 1 0
142 20 1 1
143 26 1 0
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) course gender
14.1163 0.8119 -1.8983
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-7.928 -3.073 -0.218 2.427 11.072
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 14.1163 0.6434 21.940 < 2e-16 ***
course 0.8119 0.6967 1.165 0.24589
gender -1.8983 0.6991 -2.715 0.00745 **
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 4.14 on 140 degrees of freedom
Multiple R-squared: 0.05735, Adjusted R-squared: 0.04388
F-statistic: 4.259 on 2 and 140 DF, p-value: 0.01601
> 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,] 2.813502e-01 5.627004e-01 0.71864982
[2,] 1.531991e-01 3.063983e-01 0.84680087
[3,] 8.428228e-02 1.685646e-01 0.91571772
[4,] 1.022293e-01 2.044586e-01 0.89777070
[5,] 5.822263e-02 1.164453e-01 0.94177737
[6,] 3.924035e-02 7.848071e-02 0.96075965
[7,] 2.526460e-02 5.052920e-02 0.97473540
[8,] 1.513956e-02 3.027912e-02 0.98486044
[9,] 7.265325e-03 1.453065e-02 0.99273468
[10,] 4.685513e-03 9.371026e-03 0.99531449
[11,] 3.020391e-03 6.040783e-03 0.99697961
[12,] 1.501034e-03 3.002068e-03 0.99849897
[13,] 1.416292e-03 2.832584e-03 0.99858371
[14,] 8.395328e-04 1.679066e-03 0.99916047
[15,] 4.351213e-04 8.702425e-04 0.99956488
[16,] 1.625496e-03 3.250991e-03 0.99837450
[17,] 9.781207e-04 1.956241e-03 0.99902188
[18,] 6.079646e-03 1.215929e-02 0.99392035
[19,] 4.134130e-03 8.268260e-03 0.99586587
[20,] 2.469882e-03 4.939763e-03 0.99753012
[21,] 1.564175e-03 3.128350e-03 0.99843583
[22,] 8.922606e-04 1.784521e-03 0.99910774
[23,] 8.386671e-04 1.677334e-03 0.99916133
[24,] 4.965326e-04 9.930652e-04 0.99950347
[25,] 2.905340e-04 5.810679e-04 0.99970947
[26,] 2.486254e-04 4.972508e-04 0.99975137
[27,] 3.442410e-04 6.884820e-04 0.99965576
[28,] 2.384314e-04 4.768627e-04 0.99976157
[29,] 1.592426e-04 3.184851e-04 0.99984076
[30,] 1.025263e-04 2.050525e-04 0.99989747
[31,] 1.850566e-04 3.701133e-04 0.99981494
[32,] 2.028198e-04 4.056396e-04 0.99979718
[33,] 1.496874e-04 2.993747e-04 0.99985031
[34,] 1.168350e-04 2.336699e-04 0.99988317
[35,] 9.752613e-05 1.950523e-04 0.99990247
[36,] 5.304057e-05 1.060811e-04 0.99994696
[37,] 4.861986e-05 9.723971e-05 0.99995138
[38,] 4.841618e-05 9.683235e-05 0.99995158
[39,] 3.574923e-05 7.149847e-05 0.99996425
[40,] 2.188569e-05 4.377138e-05 0.99997811
[41,] 5.155299e-05 1.031060e-04 0.99994845
[42,] 3.423128e-05 6.846256e-05 0.99996577
[43,] 1.947873e-05 3.895746e-05 0.99998052
[44,] 2.067581e-05 4.135162e-05 0.99997932
[45,] 2.354769e-05 4.709539e-05 0.99997645
[46,] 1.376676e-05 2.753351e-05 0.99998623
[47,] 1.209295e-05 2.418590e-05 0.99998791
[48,] 1.547327e-05 3.094653e-05 0.99998453
[49,] 1.415674e-05 2.831347e-05 0.99998584
[50,] 2.180664e-05 4.361328e-05 0.99997819
[51,] 2.650847e-05 5.301693e-05 0.99997349
[52,] 2.445913e-05 4.891825e-05 0.99997554
[53,] 3.469747e-05 6.939493e-05 0.99996530
[54,] 8.595260e-05 1.719052e-04 0.99991405
[55,] 7.449438e-05 1.489888e-04 0.99992551
[56,] 5.994294e-05 1.198859e-04 0.99994006
[57,] 9.025071e-05 1.805014e-04 0.99990975
[58,] 5.702642e-05 1.140528e-04 0.99994297
[59,] 4.400666e-05 8.801331e-05 0.99995599
[60,] 2.962328e-05 5.924656e-05 0.99997038
[61,] 1.774358e-05 3.548717e-05 0.99998226
[62,] 1.816812e-05 3.633623e-05 0.99998183
[63,] 1.899167e-05 3.798334e-05 0.99998101
[64,] 1.152055e-05 2.304111e-05 0.99998848
[65,] 7.261019e-06 1.452204e-05 0.99999274
[66,] 7.855570e-06 1.571114e-05 0.99999214
[67,] 6.380373e-06 1.276075e-05 0.99999362
[68,] 1.856869e-05 3.713739e-05 0.99998143
[69,] 4.207366e-05 8.414732e-05 0.99995793
[70,] 7.755698e-05 1.551140e-04 0.99992244
[71,] 1.152573e-04 2.305147e-04 0.99988474
[72,] 1.362585e-04 2.725170e-04 0.99986374
[73,] 1.050078e-04 2.100156e-04 0.99989499
[74,] 1.793988e-03 3.587977e-03 0.99820601
[75,] 2.301682e-03 4.603365e-03 0.99769832
[76,] 4.152620e-03 8.305240e-03 0.99584738
[77,] 7.782448e-03 1.556490e-02 0.99221755
[78,] 9.386234e-03 1.877247e-02 0.99061377
[79,] 7.359256e-03 1.471851e-02 0.99264074
[80,] 5.607744e-03 1.121549e-02 0.99439226
[81,] 7.600506e-03 1.520101e-02 0.99239949
[82,] 1.335018e-02 2.670036e-02 0.98664982
[83,] 1.675693e-02 3.351386e-02 0.98324307
[84,] 1.907253e-02 3.814507e-02 0.98092747
[85,] 2.644063e-02 5.288125e-02 0.97355937
[86,] 3.276860e-02 6.553720e-02 0.96723140
[87,] 3.638802e-02 7.277605e-02 0.96361198
[88,] 4.421104e-02 8.842207e-02 0.95578896
[89,] 3.525106e-02 7.050212e-02 0.96474894
[90,] 4.188072e-02 8.376144e-02 0.95811928
[91,] 3.610483e-02 7.220967e-02 0.96389517
[92,] 3.113294e-02 6.226588e-02 0.96886706
[93,] 2.350064e-02 4.700129e-02 0.97649936
[94,] 1.806258e-02 3.612516e-02 0.98193742
[95,] 2.771233e-02 5.542466e-02 0.97228767
[96,] 2.857005e-02 5.714009e-02 0.97142995
[97,] 4.689254e-02 9.378509e-02 0.95310746
[98,] 6.371559e-02 1.274312e-01 0.93628441
[99,] 7.401558e-02 1.480312e-01 0.92598442
[100,] 6.247412e-02 1.249482e-01 0.93752588
[101,] 6.771347e-02 1.354269e-01 0.93228653
[102,] 1.023669e-01 2.047338e-01 0.89763308
[103,] 8.056074e-02 1.611215e-01 0.91943926
[104,] 1.209998e-01 2.419995e-01 0.87900023
[105,] 9.598937e-02 1.919787e-01 0.90401063
[106,] 9.544370e-02 1.908874e-01 0.90455630
[107,] 7.792012e-02 1.558402e-01 0.92207988
[108,] 8.109531e-02 1.621906e-01 0.91890469
[109,] 6.373760e-02 1.274752e-01 0.93626240
[110,] 5.014800e-02 1.002960e-01 0.94985200
[111,] 5.371342e-02 1.074268e-01 0.94628658
[112,] 4.070936e-02 8.141872e-02 0.95929064
[113,] 3.205759e-02 6.411518e-02 0.96794241
[114,] 6.115730e-02 1.223146e-01 0.93884270
[115,] 1.112842e-01 2.225685e-01 0.88871577
[116,] 1.568140e-01 3.136280e-01 0.84318602
[117,] 1.366816e-01 2.733632e-01 0.86331838
[118,] 1.167541e-01 2.335083e-01 0.88324587
[119,] 1.309448e-01 2.618897e-01 0.86905517
[120,] 1.226190e-01 2.452380e-01 0.87738099
[121,] 9.392793e-02 1.878559e-01 0.90607207
[122,] 7.868966e-02 1.573793e-01 0.92131034
[123,] 2.899529e-01 5.799057e-01 0.71004713
[124,] 2.448599e-01 4.897198e-01 0.75514010
[125,] 3.955029e-01 7.910057e-01 0.60449713
[126,] 3.425627e-01 6.851254e-01 0.65743731
[127,] 4.967909e-01 9.935817e-01 0.50320913
[128,] 9.084758e-01 1.830484e-01 0.09152421
[129,] 9.294813e-01 1.410374e-01 0.07051871
[130,] 8.646208e-01 2.707584e-01 0.13537922
[131,] 7.905478e-01 4.189045e-01 0.20945223
[132,] 6.356147e-01 7.287706e-01 0.36438528
> postscript(file="/var/wessaorg/rcomp/tmp/1zr6u1324134258.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/24sf21324134258.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/3s2e21324134258.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/4u6541324134258.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/5m14f1324134258.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 = 143
Frequency = 1
1 2 3 4 5 6
-1.92813119 -2.92813119 -3.92813119 -3.02981893 -5.02981893 -7.92813119
7 8 9 10 11 12
-3.02981893 -5.02981893 -0.02981893 -2.02981893 -5.02981893 -5.92813119
13 14 15 16 17 18
-2.92813119 -1.21795226 -5.92813119 -5.02981893 -4.02981893 -6.92813119
19 20 21 22 23 24
-2.02981893 -4.92813119 0.07186881 -2.02981893 2.97018107 -1.02981893
25 26 27 28 29 30
-2.02981893 -3.92813119 -2.21795226 -5.02981893 -2.02981893 -2.02981893
31 32 33 34 35 36
-0.02981893 2.78204774 -2.92813119 1.78204774 -1.02981893 -6.02981893
37 38 39 40 41 42
-5.02981893 -2.92813119 -2.21795226 -4.02981893 -0.21795226 -4.92813119
43 44 45 46 47 48
-3.21795226 -3.02981893 0.78204774 -6.92813119 -3.11626451 -1.21795226
49 50 51 52 53 54
-4.02981893 -4.02981893 -2.11626451 -4.11626451 -5.11626451 1.78204774
55 56 57 58 59 60
-4.21795226 -5.11626451 -0.11626451 -4.21795226 3.78204774 1.78204774
61 62 63 64 65 66
-0.11626451 -4.21795226 -1.21795226 -3.11626451 0.78204774 -0.21795226
67 68 69 70 71 72
-3.21795226 -4.11626451 -0.21795226 -1.21795226 0.88373549 1.78204774
73 74 75 76 77 78
2.97018107 2.97018107 -4.02981893 -3.02981893 0.97018107 1.78204774
79 80 81 82 83 84
6.88373549 -0.92813119 3.97018107 3.07186881 2.97018107 1.78204774
85 86 87 88 89 90
-1.11626451 3.97018107 -3.02981893 2.07186881 -0.02981893 4.97018107
91 92 93 94 95 96
-0.92813119 0.97018107 0.07186881 -0.21795226 4.78204774 2.78204774
97 98 99 100 101 102
-2.11626451 0.78204774 -0.11626451 5.78204774 2.97018107 6.07186881
103 104 105 106 107 108
6.97018107 -4.11626451 1.88373549 4.07186881 -1.02981893 0.78204774
109 110 111 112 113 114
5.88373549 -0.11626451 -2.21795226 -1.11626451 -3.11626451 0.78204774
115 116 117 118 119 120
0.78204774 -1.21795226 0.88373549 -0.11626451 -4.11626451 9.07186881
121 122 123 124 125 126
9.97018107 4.07186881 4.07186881 8.97018107 2.97018107 1.88373549
127 128 129 130 131 132
6.97018107 -3.92813119 6.97018107 0.07186881 6.07186881 2.07186881
133 134 135 136 137 138
10.88373549 4.78204774 1.88373549 2.88373549 0.88373549 0.88373549
139 140 141 142 143
11.07186881 10.07186881 5.07186881 6.97018107 11.07186881
> postscript(file="/var/wessaorg/rcomp/tmp/6o21y1324134258.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 = 143
Frequency = 1
lag(myerror, k = 1) myerror
0 -1.92813119 NA
1 -2.92813119 -1.92813119
2 -3.92813119 -2.92813119
3 -3.02981893 -3.92813119
4 -5.02981893 -3.02981893
5 -7.92813119 -5.02981893
6 -3.02981893 -7.92813119
7 -5.02981893 -3.02981893
8 -0.02981893 -5.02981893
9 -2.02981893 -0.02981893
10 -5.02981893 -2.02981893
11 -5.92813119 -5.02981893
12 -2.92813119 -5.92813119
13 -1.21795226 -2.92813119
14 -5.92813119 -1.21795226
15 -5.02981893 -5.92813119
16 -4.02981893 -5.02981893
17 -6.92813119 -4.02981893
18 -2.02981893 -6.92813119
19 -4.92813119 -2.02981893
20 0.07186881 -4.92813119
21 -2.02981893 0.07186881
22 2.97018107 -2.02981893
23 -1.02981893 2.97018107
24 -2.02981893 -1.02981893
25 -3.92813119 -2.02981893
26 -2.21795226 -3.92813119
27 -5.02981893 -2.21795226
28 -2.02981893 -5.02981893
29 -2.02981893 -2.02981893
30 -0.02981893 -2.02981893
31 2.78204774 -0.02981893
32 -2.92813119 2.78204774
33 1.78204774 -2.92813119
34 -1.02981893 1.78204774
35 -6.02981893 -1.02981893
36 -5.02981893 -6.02981893
37 -2.92813119 -5.02981893
38 -2.21795226 -2.92813119
39 -4.02981893 -2.21795226
40 -0.21795226 -4.02981893
41 -4.92813119 -0.21795226
42 -3.21795226 -4.92813119
43 -3.02981893 -3.21795226
44 0.78204774 -3.02981893
45 -6.92813119 0.78204774
46 -3.11626451 -6.92813119
47 -1.21795226 -3.11626451
48 -4.02981893 -1.21795226
49 -4.02981893 -4.02981893
50 -2.11626451 -4.02981893
51 -4.11626451 -2.11626451
52 -5.11626451 -4.11626451
53 1.78204774 -5.11626451
54 -4.21795226 1.78204774
55 -5.11626451 -4.21795226
56 -0.11626451 -5.11626451
57 -4.21795226 -0.11626451
58 3.78204774 -4.21795226
59 1.78204774 3.78204774
60 -0.11626451 1.78204774
61 -4.21795226 -0.11626451
62 -1.21795226 -4.21795226
63 -3.11626451 -1.21795226
64 0.78204774 -3.11626451
65 -0.21795226 0.78204774
66 -3.21795226 -0.21795226
67 -4.11626451 -3.21795226
68 -0.21795226 -4.11626451
69 -1.21795226 -0.21795226
70 0.88373549 -1.21795226
71 1.78204774 0.88373549
72 2.97018107 1.78204774
73 2.97018107 2.97018107
74 -4.02981893 2.97018107
75 -3.02981893 -4.02981893
76 0.97018107 -3.02981893
77 1.78204774 0.97018107
78 6.88373549 1.78204774
79 -0.92813119 6.88373549
80 3.97018107 -0.92813119
81 3.07186881 3.97018107
82 2.97018107 3.07186881
83 1.78204774 2.97018107
84 -1.11626451 1.78204774
85 3.97018107 -1.11626451
86 -3.02981893 3.97018107
87 2.07186881 -3.02981893
88 -0.02981893 2.07186881
89 4.97018107 -0.02981893
90 -0.92813119 4.97018107
91 0.97018107 -0.92813119
92 0.07186881 0.97018107
93 -0.21795226 0.07186881
94 4.78204774 -0.21795226
95 2.78204774 4.78204774
96 -2.11626451 2.78204774
97 0.78204774 -2.11626451
98 -0.11626451 0.78204774
99 5.78204774 -0.11626451
100 2.97018107 5.78204774
101 6.07186881 2.97018107
102 6.97018107 6.07186881
103 -4.11626451 6.97018107
104 1.88373549 -4.11626451
105 4.07186881 1.88373549
106 -1.02981893 4.07186881
107 0.78204774 -1.02981893
108 5.88373549 0.78204774
109 -0.11626451 5.88373549
110 -2.21795226 -0.11626451
111 -1.11626451 -2.21795226
112 -3.11626451 -1.11626451
113 0.78204774 -3.11626451
114 0.78204774 0.78204774
115 -1.21795226 0.78204774
116 0.88373549 -1.21795226
117 -0.11626451 0.88373549
118 -4.11626451 -0.11626451
119 9.07186881 -4.11626451
120 9.97018107 9.07186881
121 4.07186881 9.97018107
122 4.07186881 4.07186881
123 8.97018107 4.07186881
124 2.97018107 8.97018107
125 1.88373549 2.97018107
126 6.97018107 1.88373549
127 -3.92813119 6.97018107
128 6.97018107 -3.92813119
129 0.07186881 6.97018107
130 6.07186881 0.07186881
131 2.07186881 6.07186881
132 10.88373549 2.07186881
133 4.78204774 10.88373549
134 1.88373549 4.78204774
135 2.88373549 1.88373549
136 0.88373549 2.88373549
137 0.88373549 0.88373549
138 11.07186881 0.88373549
139 10.07186881 11.07186881
140 5.07186881 10.07186881
141 6.97018107 5.07186881
142 11.07186881 6.97018107
143 NA 11.07186881
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -2.92813119 -1.92813119
[2,] -3.92813119 -2.92813119
[3,] -3.02981893 -3.92813119
[4,] -5.02981893 -3.02981893
[5,] -7.92813119 -5.02981893
[6,] -3.02981893 -7.92813119
[7,] -5.02981893 -3.02981893
[8,] -0.02981893 -5.02981893
[9,] -2.02981893 -0.02981893
[10,] -5.02981893 -2.02981893
[11,] -5.92813119 -5.02981893
[12,] -2.92813119 -5.92813119
[13,] -1.21795226 -2.92813119
[14,] -5.92813119 -1.21795226
[15,] -5.02981893 -5.92813119
[16,] -4.02981893 -5.02981893
[17,] -6.92813119 -4.02981893
[18,] -2.02981893 -6.92813119
[19,] -4.92813119 -2.02981893
[20,] 0.07186881 -4.92813119
[21,] -2.02981893 0.07186881
[22,] 2.97018107 -2.02981893
[23,] -1.02981893 2.97018107
[24,] -2.02981893 -1.02981893
[25,] -3.92813119 -2.02981893
[26,] -2.21795226 -3.92813119
[27,] -5.02981893 -2.21795226
[28,] -2.02981893 -5.02981893
[29,] -2.02981893 -2.02981893
[30,] -0.02981893 -2.02981893
[31,] 2.78204774 -0.02981893
[32,] -2.92813119 2.78204774
[33,] 1.78204774 -2.92813119
[34,] -1.02981893 1.78204774
[35,] -6.02981893 -1.02981893
[36,] -5.02981893 -6.02981893
[37,] -2.92813119 -5.02981893
[38,] -2.21795226 -2.92813119
[39,] -4.02981893 -2.21795226
[40,] -0.21795226 -4.02981893
[41,] -4.92813119 -0.21795226
[42,] -3.21795226 -4.92813119
[43,] -3.02981893 -3.21795226
[44,] 0.78204774 -3.02981893
[45,] -6.92813119 0.78204774
[46,] -3.11626451 -6.92813119
[47,] -1.21795226 -3.11626451
[48,] -4.02981893 -1.21795226
[49,] -4.02981893 -4.02981893
[50,] -2.11626451 -4.02981893
[51,] -4.11626451 -2.11626451
[52,] -5.11626451 -4.11626451
[53,] 1.78204774 -5.11626451
[54,] -4.21795226 1.78204774
[55,] -5.11626451 -4.21795226
[56,] -0.11626451 -5.11626451
[57,] -4.21795226 -0.11626451
[58,] 3.78204774 -4.21795226
[59,] 1.78204774 3.78204774
[60,] -0.11626451 1.78204774
[61,] -4.21795226 -0.11626451
[62,] -1.21795226 -4.21795226
[63,] -3.11626451 -1.21795226
[64,] 0.78204774 -3.11626451
[65,] -0.21795226 0.78204774
[66,] -3.21795226 -0.21795226
[67,] -4.11626451 -3.21795226
[68,] -0.21795226 -4.11626451
[69,] -1.21795226 -0.21795226
[70,] 0.88373549 -1.21795226
[71,] 1.78204774 0.88373549
[72,] 2.97018107 1.78204774
[73,] 2.97018107 2.97018107
[74,] -4.02981893 2.97018107
[75,] -3.02981893 -4.02981893
[76,] 0.97018107 -3.02981893
[77,] 1.78204774 0.97018107
[78,] 6.88373549 1.78204774
[79,] -0.92813119 6.88373549
[80,] 3.97018107 -0.92813119
[81,] 3.07186881 3.97018107
[82,] 2.97018107 3.07186881
[83,] 1.78204774 2.97018107
[84,] -1.11626451 1.78204774
[85,] 3.97018107 -1.11626451
[86,] -3.02981893 3.97018107
[87,] 2.07186881 -3.02981893
[88,] -0.02981893 2.07186881
[89,] 4.97018107 -0.02981893
[90,] -0.92813119 4.97018107
[91,] 0.97018107 -0.92813119
[92,] 0.07186881 0.97018107
[93,] -0.21795226 0.07186881
[94,] 4.78204774 -0.21795226
[95,] 2.78204774 4.78204774
[96,] -2.11626451 2.78204774
[97,] 0.78204774 -2.11626451
[98,] -0.11626451 0.78204774
[99,] 5.78204774 -0.11626451
[100,] 2.97018107 5.78204774
[101,] 6.07186881 2.97018107
[102,] 6.97018107 6.07186881
[103,] -4.11626451 6.97018107
[104,] 1.88373549 -4.11626451
[105,] 4.07186881 1.88373549
[106,] -1.02981893 4.07186881
[107,] 0.78204774 -1.02981893
[108,] 5.88373549 0.78204774
[109,] -0.11626451 5.88373549
[110,] -2.21795226 -0.11626451
[111,] -1.11626451 -2.21795226
[112,] -3.11626451 -1.11626451
[113,] 0.78204774 -3.11626451
[114,] 0.78204774 0.78204774
[115,] -1.21795226 0.78204774
[116,] 0.88373549 -1.21795226
[117,] -0.11626451 0.88373549
[118,] -4.11626451 -0.11626451
[119,] 9.07186881 -4.11626451
[120,] 9.97018107 9.07186881
[121,] 4.07186881 9.97018107
[122,] 4.07186881 4.07186881
[123,] 8.97018107 4.07186881
[124,] 2.97018107 8.97018107
[125,] 1.88373549 2.97018107
[126,] 6.97018107 1.88373549
[127,] -3.92813119 6.97018107
[128,] 6.97018107 -3.92813119
[129,] 0.07186881 6.97018107
[130,] 6.07186881 0.07186881
[131,] 2.07186881 6.07186881
[132,] 10.88373549 2.07186881
[133,] 4.78204774 10.88373549
[134,] 1.88373549 4.78204774
[135,] 2.88373549 1.88373549
[136,] 0.88373549 2.88373549
[137,] 0.88373549 0.88373549
[138,] 11.07186881 0.88373549
[139,] 10.07186881 11.07186881
[140,] 5.07186881 10.07186881
[141,] 6.97018107 5.07186881
[142,] 11.07186881 6.97018107
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -2.92813119 -1.92813119
2 -3.92813119 -2.92813119
3 -3.02981893 -3.92813119
4 -5.02981893 -3.02981893
5 -7.92813119 -5.02981893
6 -3.02981893 -7.92813119
7 -5.02981893 -3.02981893
8 -0.02981893 -5.02981893
9 -2.02981893 -0.02981893
10 -5.02981893 -2.02981893
11 -5.92813119 -5.02981893
12 -2.92813119 -5.92813119
13 -1.21795226 -2.92813119
14 -5.92813119 -1.21795226
15 -5.02981893 -5.92813119
16 -4.02981893 -5.02981893
17 -6.92813119 -4.02981893
18 -2.02981893 -6.92813119
19 -4.92813119 -2.02981893
20 0.07186881 -4.92813119
21 -2.02981893 0.07186881
22 2.97018107 -2.02981893
23 -1.02981893 2.97018107
24 -2.02981893 -1.02981893
25 -3.92813119 -2.02981893
26 -2.21795226 -3.92813119
27 -5.02981893 -2.21795226
28 -2.02981893 -5.02981893
29 -2.02981893 -2.02981893
30 -0.02981893 -2.02981893
31 2.78204774 -0.02981893
32 -2.92813119 2.78204774
33 1.78204774 -2.92813119
34 -1.02981893 1.78204774
35 -6.02981893 -1.02981893
36 -5.02981893 -6.02981893
37 -2.92813119 -5.02981893
38 -2.21795226 -2.92813119
39 -4.02981893 -2.21795226
40 -0.21795226 -4.02981893
41 -4.92813119 -0.21795226
42 -3.21795226 -4.92813119
43 -3.02981893 -3.21795226
44 0.78204774 -3.02981893
45 -6.92813119 0.78204774
46 -3.11626451 -6.92813119
47 -1.21795226 -3.11626451
48 -4.02981893 -1.21795226
49 -4.02981893 -4.02981893
50 -2.11626451 -4.02981893
51 -4.11626451 -2.11626451
52 -5.11626451 -4.11626451
53 1.78204774 -5.11626451
54 -4.21795226 1.78204774
55 -5.11626451 -4.21795226
56 -0.11626451 -5.11626451
57 -4.21795226 -0.11626451
58 3.78204774 -4.21795226
59 1.78204774 3.78204774
60 -0.11626451 1.78204774
61 -4.21795226 -0.11626451
62 -1.21795226 -4.21795226
63 -3.11626451 -1.21795226
64 0.78204774 -3.11626451
65 -0.21795226 0.78204774
66 -3.21795226 -0.21795226
67 -4.11626451 -3.21795226
68 -0.21795226 -4.11626451
69 -1.21795226 -0.21795226
70 0.88373549 -1.21795226
71 1.78204774 0.88373549
72 2.97018107 1.78204774
73 2.97018107 2.97018107
74 -4.02981893 2.97018107
75 -3.02981893 -4.02981893
76 0.97018107 -3.02981893
77 1.78204774 0.97018107
78 6.88373549 1.78204774
79 -0.92813119 6.88373549
80 3.97018107 -0.92813119
81 3.07186881 3.97018107
82 2.97018107 3.07186881
83 1.78204774 2.97018107
84 -1.11626451 1.78204774
85 3.97018107 -1.11626451
86 -3.02981893 3.97018107
87 2.07186881 -3.02981893
88 -0.02981893 2.07186881
89 4.97018107 -0.02981893
90 -0.92813119 4.97018107
91 0.97018107 -0.92813119
92 0.07186881 0.97018107
93 -0.21795226 0.07186881
94 4.78204774 -0.21795226
95 2.78204774 4.78204774
96 -2.11626451 2.78204774
97 0.78204774 -2.11626451
98 -0.11626451 0.78204774
99 5.78204774 -0.11626451
100 2.97018107 5.78204774
101 6.07186881 2.97018107
102 6.97018107 6.07186881
103 -4.11626451 6.97018107
104 1.88373549 -4.11626451
105 4.07186881 1.88373549
106 -1.02981893 4.07186881
107 0.78204774 -1.02981893
108 5.88373549 0.78204774
109 -0.11626451 5.88373549
110 -2.21795226 -0.11626451
111 -1.11626451 -2.21795226
112 -3.11626451 -1.11626451
113 0.78204774 -3.11626451
114 0.78204774 0.78204774
115 -1.21795226 0.78204774
116 0.88373549 -1.21795226
117 -0.11626451 0.88373549
118 -4.11626451 -0.11626451
119 9.07186881 -4.11626451
120 9.97018107 9.07186881
121 4.07186881 9.97018107
122 4.07186881 4.07186881
123 8.97018107 4.07186881
124 2.97018107 8.97018107
125 1.88373549 2.97018107
126 6.97018107 1.88373549
127 -3.92813119 6.97018107
128 6.97018107 -3.92813119
129 0.07186881 6.97018107
130 6.07186881 0.07186881
131 2.07186881 6.07186881
132 10.88373549 2.07186881
133 4.78204774 10.88373549
134 1.88373549 4.78204774
135 2.88373549 1.88373549
136 0.88373549 2.88373549
137 0.88373549 0.88373549
138 11.07186881 0.88373549
139 10.07186881 11.07186881
140 5.07186881 10.07186881
141 6.97018107 5.07186881
142 11.07186881 6.97018107
> 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/79ve91324134258.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/8vy8u1324134258.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/9peot1324134258.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/1073w01324134258.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/116b201324134258.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/12h8531324134258.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/139ajy1324134258.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/14ckwl1324134258.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/15gbuc1324134258.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/16936y1324134258.tab")
+ }
>
> try(system("convert tmp/1zr6u1324134258.ps tmp/1zr6u1324134258.png",intern=TRUE))
character(0)
> try(system("convert tmp/24sf21324134258.ps tmp/24sf21324134258.png",intern=TRUE))
character(0)
> try(system("convert tmp/3s2e21324134258.ps tmp/3s2e21324134258.png",intern=TRUE))
character(0)
> try(system("convert tmp/4u6541324134258.ps tmp/4u6541324134258.png",intern=TRUE))
character(0)
> try(system("convert tmp/5m14f1324134258.ps tmp/5m14f1324134258.png",intern=TRUE))
character(0)
> try(system("convert tmp/6o21y1324134258.ps tmp/6o21y1324134258.png",intern=TRUE))
character(0)
> try(system("convert tmp/79ve91324134258.ps tmp/79ve91324134258.png",intern=TRUE))
character(0)
> try(system("convert tmp/8vy8u1324134258.ps tmp/8vy8u1324134258.png",intern=TRUE))
character(0)
> try(system("convert tmp/9peot1324134258.ps tmp/9peot1324134258.png",intern=TRUE))
character(0)
> try(system("convert tmp/1073w01324134258.ps tmp/1073w01324134258.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
4.373 0.640 5.056