R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-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(8.7
+ ,40
+ ,7
+ ,10.0
+ ,37
+ ,6
+ ,7.7
+ ,31
+ ,6
+ ,8.0
+ ,39
+ ,8
+ ,8.3
+ ,28
+ ,6
+ ,7.7
+ ,25
+ ,7
+ ,6.7
+ ,26
+ ,5
+ ,7.3
+ ,29
+ ,6
+ ,6.0
+ ,24
+ ,8
+ ,7.0
+ ,26
+ ,5
+ ,8.3
+ ,29
+ ,4
+ ,8.0
+ ,28
+ ,7
+ ,8.0
+ ,29
+ ,6
+ ,6.0
+ ,18
+ ,5
+ ,5.7
+ ,15
+ ,6
+ ,4.0
+ ,12
+ ,8
+ ,6.7
+ ,17
+ ,6
+ ,5.0
+ ,8
+ ,5
+ ,4.3
+ ,9
+ ,5
+ ,3.0
+ ,9
+ ,6
+ ,8.0
+ ,32
+ ,7
+ ,9.3
+ ,38
+ ,9
+ ,7.3
+ ,27
+ ,6
+ ,7.7
+ ,28
+ ,7
+ ,7.7
+ ,25
+ ,7
+ ,7.7
+ ,27
+ ,7
+ ,6.0
+ ,13
+ ,6
+ ,6.0
+ ,14
+ ,5
+ ,3.5
+ ,9
+ ,5
+ ,5.3
+ ,8
+ ,4
+ ,8.7
+ ,36
+ ,7
+ ,9.3
+ ,39
+ ,8
+ ,7.3
+ ,36
+ ,7
+ ,8.0
+ ,29
+ ,6
+ ,7.0
+ ,28
+ ,7
+ ,7.0
+ ,23
+ ,7
+ ,7.0
+ ,28
+ ,7
+ ,8.0
+ ,27
+ ,5
+ ,7.3
+ ,28
+ ,7
+ ,5.7
+ ,23
+ ,9
+ ,7.7
+ ,24
+ ,6
+ ,5.7
+ ,14
+ ,6
+ ,4.7
+ ,13
+ ,5
+ ,6.0
+ ,18
+ ,6
+ ,6.3
+ ,19
+ ,5
+ ,4.3
+ ,12
+ ,6
+ ,3.0
+ ,13
+ ,6
+ ,3.0
+ ,12
+ ,5
+ ,5.3
+ ,16
+ ,7
+ ,8.7
+ ,17
+ ,7
+ ,4.7
+ ,15
+ ,6
+ ,3.0
+ ,8
+ ,4
+ ,3.0
+ ,9
+ ,7
+ ,4.0
+ ,7
+ ,3
+ ,8.3
+ ,28
+ ,7
+ ,4.5
+ ,16
+ ,7
+ ,7.0
+ ,18
+ ,6
+ ,6.0
+ ,18
+ ,7
+ ,5.3
+ ,9
+ ,4
+ ,1.0
+ ,5
+ ,6
+ ,8.0
+ ,40
+ ,10
+ ,8.3
+ ,37
+ ,8
+ ,7.7
+ ,34
+ ,7
+ ,8.7
+ ,36
+ ,8
+ ,6.3
+ ,33
+ ,7
+ ,7.7
+ ,25
+ ,7
+ ,9.7
+ ,29
+ ,6
+ ,5.7
+ ,25
+ ,7
+ ,7.0
+ ,26
+ ,5
+ ,7.3
+ ,28
+ ,6
+ ,5.0
+ ,22
+ ,8
+ ,6.0
+ ,17
+ ,5
+ ,3.0
+ ,15
+ ,7
+ ,3.0
+ ,13
+ ,7
+ ,5.7
+ ,18
+ ,7
+ ,6.0
+ ,19
+ ,6
+ ,4.0
+ ,15
+ ,6
+ ,4.7
+ ,16
+ ,6
+ ,1.0
+ ,13
+ ,6
+ ,6.0
+ ,18
+ ,7
+ ,3.0
+ ,5
+ ,6
+ ,5.0
+ ,9
+ ,6
+ ,2.0
+ ,7
+ ,7
+ ,8.0
+ ,32
+ ,8
+ ,6.3
+ ,20
+ ,7
+ ,7.0
+ ,19
+ ,7
+ ,3.0
+ ,13
+ ,6
+ ,5.0
+ ,17
+ ,6
+ ,5.0
+ ,16
+ ,5
+ ,3.0
+ ,8
+ ,5
+ ,9.7
+ ,40
+ ,9
+ ,8.7
+ ,40
+ ,8
+ ,8.0
+ ,37
+ ,6
+ ,7.3
+ ,26
+ ,7
+ ,9.0
+ ,28
+ ,7
+ ,7.7
+ ,26
+ ,7
+ ,7.0
+ ,21
+ ,7
+ ,8.3
+ ,29
+ ,5
+ ,7.3
+ ,25
+ ,6
+ ,6.0
+ ,16
+ ,6
+ ,6.3
+ ,17
+ ,7
+ ,9.0
+ ,14
+ ,7
+ ,6.3
+ ,18
+ ,7
+ ,4.7
+ ,9
+ ,5
+ ,4.0
+ ,7
+ ,7
+ ,8.7
+ ,37
+ ,7
+ ,8.0
+ ,30
+ ,7
+ ,7.0
+ ,20
+ ,7
+ ,7.7
+ ,24
+ ,6
+ ,7.3
+ ,29
+ ,7
+ ,8.3
+ ,27
+ ,6
+ ,6.3
+ ,24
+ ,6
+ ,8.0
+ ,28
+ ,7
+ ,4.5
+ ,14
+ ,6
+ ,5.3
+ ,16
+ ,6
+ ,7.7
+ ,19
+ ,7
+ ,4.7
+ ,15
+ ,6
+ ,5.3
+ ,14
+ ,5
+ ,3.3
+ ,8
+ ,6
+ ,2.0
+ ,6
+ ,5)
+ ,dim=c(3
+ ,120)
+ ,dimnames=list(c('promedio'
+ ,'vocabulario'
+ ,'memoria')
+ ,1:120))
> y <- array(NA,dim=c(3,120),dimnames=list(c('promedio','vocabulario','memoria'),1:120))
> for (i in 1:dim(x)[1])
+ {
+ for (j in 1:dim(x)[2])
+ {
+ y[i,j] <- as.numeric(x[i,j])
+ }
+ }
> par5 = '0'
> par4 = '0'
> par3 = 'Linear Trend'
> par2 = 'Do not include Seasonal Dummies'
> par1 = ''
> par5 <- '0'
> par4 <- '0'
> par3 <- 'Linear Trend'
> par2 <- 'Do not include Seasonal Dummies'
> par1 <- ''
> #'GNU S' R Code compiled by R2WASP v. 1.2.327 (Wed, 08 Jun 2016 16:18:16 +0100)
> #Author: root
> #To cite this work: Wessa P., (2015), Multiple Regression (v1.0.38) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/rwasp_multipleregression.wasp/
> #Source of accompanying publication: Office for Research, Development, and Education
> #
> library(lattice)
> library(lmtest)
Loading required package: zoo
Attaching package: 'zoo'
The following objects are masked from 'package:base':
as.Date, as.Date.numeric
> n25 <- 25 #minimum number of obs. for Goldfeld-Quandt test
> mywarning <- ''
> par1 <- as.numeric(par1)
> if(is.na(par1)) {
+ par1 <- 1
+ mywarning = 'Warning: you did not specify the column number of the endogenous series! The first column was selected by default.'
+ }
> if (par4=='') par4 <- 0
> par4 <- as.numeric(par4)
> if (par5=='') par5 <- 0
> par5 <- as.numeric(par5)
> x <- na.omit(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'){
+ (n <- n -1)
+ x2 <- array(0, dim=c(n,k), dimnames=list(1:n, paste('(1-B)',colnames(x),sep='')))
+ for (i in 1:n) {
+ for (j in 1:k) {
+ x2[i,j] <- x[i+1,j] - x[i,j]
+ }
+ }
+ x <- x2
+ }
> if (par3 == 'Seasonal Differences (s=12)'){
+ (n <- n - 12)
+ x2 <- array(0, dim=c(n,k), dimnames=list(1:n, paste('(1-B12)',colnames(x),sep='')))
+ for (i in 1:n) {
+ for (j in 1:k) {
+ x2[i,j] <- x[i+12,j] - x[i,j]
+ }
+ }
+ x <- x2
+ }
> if (par3 == 'First and Seasonal Differences (s=12)'){
+ (n <- n -1)
+ x2 <- array(0, dim=c(n,k), dimnames=list(1:n, paste('(1-B)',colnames(x),sep='')))
+ for (i in 1:n) {
+ for (j in 1:k) {
+ x2[i,j] <- x[i+1,j] - x[i,j]
+ }
+ }
+ x <- x2
+ (n <- n - 12)
+ x2 <- array(0, dim=c(n,k), dimnames=list(1:n, paste('(1-B12)',colnames(x),sep='')))
+ for (i in 1:n) {
+ for (j in 1:k) {
+ x2[i,j] <- x[i+12,j] - x[i,j]
+ }
+ }
+ x <- x2
+ }
> if(par4 > 0) {
+ x2 <- array(0, dim=c(n-par4,par4), dimnames=list(1:(n-par4), paste(colnames(x)[par1],'(t-',1:par4,')',sep='')))
+ for (i in 1:(n-par4)) {
+ for (j in 1:par4) {
+ x2[i,j] <- x[i+par4-j,par1]
+ }
+ }
+ x <- cbind(x[(par4+1):n,], x2)
+ n <- n - par4
+ }
> if(par5 > 0) {
+ x2 <- array(0, dim=c(n-par5*12,par5), dimnames=list(1:(n-par5*12), paste(colnames(x)[par1],'(t-',1:par5,'s)',sep='')))
+ for (i in 1:(n-par5*12)) {
+ for (j in 1:par5) {
+ x2[i,j] <- x[i+par5*12-j*12,par1]
+ }
+ }
+ x <- cbind(x[(par5*12+1):n,], x2)
+ n <- n - par5*12
+ }
> 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[n,]))
[1] 3
> if (par3 == 'Linear Trend'){
+ x <- cbind(x, c(1:n))
+ colnames(x)[k+1] <- 't'
+ }
> x
promedio vocabulario memoria t
1 8.7 40 7 1
2 10.0 37 6 2
3 7.7 31 6 3
4 8.0 39 8 4
5 8.3 28 6 5
6 7.7 25 7 6
7 6.7 26 5 7
8 7.3 29 6 8
9 6.0 24 8 9
10 7.0 26 5 10
11 8.3 29 4 11
12 8.0 28 7 12
13 8.0 29 6 13
14 6.0 18 5 14
15 5.7 15 6 15
16 4.0 12 8 16
17 6.7 17 6 17
18 5.0 8 5 18
19 4.3 9 5 19
20 3.0 9 6 20
21 8.0 32 7 21
22 9.3 38 9 22
23 7.3 27 6 23
24 7.7 28 7 24
25 7.7 25 7 25
26 7.7 27 7 26
27 6.0 13 6 27
28 6.0 14 5 28
29 3.5 9 5 29
30 5.3 8 4 30
31 8.7 36 7 31
32 9.3 39 8 32
33 7.3 36 7 33
34 8.0 29 6 34
35 7.0 28 7 35
36 7.0 23 7 36
37 7.0 28 7 37
38 8.0 27 5 38
39 7.3 28 7 39
40 5.7 23 9 40
41 7.7 24 6 41
42 5.7 14 6 42
43 4.7 13 5 43
44 6.0 18 6 44
45 6.3 19 5 45
46 4.3 12 6 46
47 3.0 13 6 47
48 3.0 12 5 48
49 5.3 16 7 49
50 8.7 17 7 50
51 4.7 15 6 51
52 3.0 8 4 52
53 3.0 9 7 53
54 4.0 7 3 54
55 8.3 28 7 55
56 4.5 16 7 56
57 7.0 18 6 57
58 6.0 18 7 58
59 5.3 9 4 59
60 1.0 5 6 60
61 8.0 40 10 61
62 8.3 37 8 62
63 7.7 34 7 63
64 8.7 36 8 64
65 6.3 33 7 65
66 7.7 25 7 66
67 9.7 29 6 67
68 5.7 25 7 68
69 7.0 26 5 69
70 7.3 28 6 70
71 5.0 22 8 71
72 6.0 17 5 72
73 3.0 15 7 73
74 3.0 13 7 74
75 5.7 18 7 75
76 6.0 19 6 76
77 4.0 15 6 77
78 4.7 16 6 78
79 1.0 13 6 79
80 6.0 18 7 80
81 3.0 5 6 81
82 5.0 9 6 82
83 2.0 7 7 83
84 8.0 32 8 84
85 6.3 20 7 85
86 7.0 19 7 86
87 3.0 13 6 87
88 5.0 17 6 88
89 5.0 16 5 89
90 3.0 8 5 90
91 9.7 40 9 91
92 8.7 40 8 92
93 8.0 37 6 93
94 7.3 26 7 94
95 9.0 28 7 95
96 7.7 26 7 96
97 7.0 21 7 97
98 8.3 29 5 98
99 7.3 25 6 99
100 6.0 16 6 100
101 6.3 17 7 101
102 9.0 14 7 102
103 6.3 18 7 103
104 4.7 9 5 104
105 4.0 7 7 105
106 8.7 37 7 106
107 8.0 30 7 107
108 7.0 20 7 108
109 7.7 24 6 109
110 7.3 29 7 110
111 8.3 27 6 111
112 6.3 24 6 112
113 8.0 28 7 113
114 4.5 14 6 114
115 5.3 16 6 115
116 7.7 19 7 116
117 4.7 15 6 117
118 5.3 14 5 118
119 3.3 8 6 119
120 2.0 6 5 120
> (k <- length(x[n,]))
[1] 4
> head(x)
promedio vocabulario memoria t
1 8.7 40 7 1
2 10.0 37 6 2
3 7.7 31 6 3
4 8.0 39 8 4
5 8.3 28 6 5
6 7.7 25 7 6
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) vocabulario memoria t
3.323636 0.191620 -0.194239 0.001261
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-3.7488 -0.5554 0.0610 0.6489 4.2248
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 3.323636 0.584504 5.686 9.86e-08 ***
vocabulario 0.191620 0.012560 15.257 < 2e-16 ***
memoria -0.194239 0.104020 -1.867 0.0644 .
t 0.001261 0.002922 0.431 0.6670
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 1.07 on 116 degrees of freedom
Multiple R-squared: 0.7217, Adjusted R-squared: 0.7146
F-statistic: 100.3 on 3 and 116 DF, p-value: < 2.2e-16
> 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,] 4.853138e-01 9.706276e-01 0.5146862
[2,] 3.356453e-01 6.712906e-01 0.6643547
[3,] 2.161008e-01 4.322016e-01 0.7838992
[4,] 1.335595e-01 2.671191e-01 0.8664405
[5,] 1.184294e-01 2.368588e-01 0.8815706
[6,] 1.498090e-01 2.996181e-01 0.8501910
[7,] 9.984209e-02 1.996842e-01 0.9001579
[8,] 6.351244e-02 1.270249e-01 0.9364876
[9,] 3.734358e-02 7.468716e-02 0.9626564
[10,] 2.508287e-02 5.016574e-02 0.9749171
[11,] 2.536293e-02 5.072586e-02 0.9746371
[12,] 1.531727e-02 3.063453e-02 0.9846827
[13,] 1.184812e-02 2.369623e-02 0.9881519
[14,] 2.746692e-02 5.493384e-02 0.9725331
[15,] 1.661639e-02 3.323278e-02 0.9833836
[16,] 1.250780e-02 2.501560e-02 0.9874922
[17,] 7.820347e-03 1.564069e-02 0.9921797
[18,] 4.527665e-03 9.055330e-03 0.9954723
[19,] 3.431569e-03 6.863138e-03 0.9965684
[20,] 1.959291e-03 3.918581e-03 0.9980407
[21,] 1.723637e-03 3.447274e-03 0.9982764
[22,] 1.040310e-03 2.080620e-03 0.9989597
[23,] 2.275717e-03 4.551434e-03 0.9977243
[24,] 1.737741e-03 3.475482e-03 0.9982623
[25,] 1.233642e-03 2.467284e-03 0.9987664
[26,] 7.013807e-04 1.402761e-03 0.9992986
[27,] 2.763579e-03 5.527158e-03 0.9972364
[28,] 1.675528e-03 3.351056e-03 0.9983245
[29,] 1.109329e-03 2.218658e-03 0.9988907
[30,] 7.310044e-04 1.462009e-03 0.9992690
[31,] 4.729411e-04 9.458822e-04 0.9995271
[32,] 2.895750e-04 5.791501e-04 0.9997104
[33,] 1.617718e-04 3.235436e-04 0.9998382
[34,] 9.788798e-05 1.957760e-04 0.9999021
[35,] 8.339546e-05 1.667909e-04 0.9999166
[36,] 5.573299e-05 1.114660e-04 0.9999443
[37,] 4.616317e-05 9.232634e-05 0.9999538
[38,] 2.615756e-05 5.231512e-05 0.9999738
[39,] 1.492928e-05 2.985855e-05 0.9999851
[40,] 1.086235e-05 2.172469e-05 0.9999891
[41,] 9.836676e-05 1.967335e-04 0.9999016
[42,] 4.186362e-04 8.372724e-04 0.9995814
[43,] 2.624519e-04 5.249038e-04 0.9997375
[44,] 3.146060e-02 6.292120e-02 0.9685394
[45,] 2.503314e-02 5.006628e-02 0.9749669
[46,] 2.728693e-02 5.457387e-02 0.9727131
[47,] 2.429869e-02 4.859739e-02 0.9757013
[48,] 1.798828e-02 3.597655e-02 0.9820117
[49,] 1.952194e-02 3.904388e-02 0.9804781
[50,] 1.535095e-02 3.070190e-02 0.9846490
[51,] 2.374065e-02 4.748130e-02 0.9762593
[52,] 2.072859e-02 4.145718e-02 0.9792714
[53,] 2.798573e-02 5.597146e-02 0.9720143
[54,] 6.254418e-02 1.250884e-01 0.9374558
[55,] 6.090792e-02 1.218158e-01 0.9390921
[56,] 4.778312e-02 9.556625e-02 0.9522169
[57,] 3.826438e-02 7.652877e-02 0.9617356
[58,] 2.889810e-02 5.779620e-02 0.9711019
[59,] 4.697393e-02 9.394787e-02 0.9530261
[60,] 5.124509e-02 1.024902e-01 0.9487549
[61,] 1.404669e-01 2.809338e-01 0.8595331
[62,] 1.283448e-01 2.566896e-01 0.8716552
[63,] 1.087303e-01 2.174605e-01 0.8912697
[64,] 8.899598e-02 1.779920e-01 0.9110040
[65,] 8.268355e-02 1.653671e-01 0.9173164
[66,] 9.014745e-02 1.802949e-01 0.9098525
[67,] 1.257176e-01 2.514351e-01 0.8742824
[68,] 1.428277e-01 2.856554e-01 0.8571723
[69,] 1.196701e-01 2.393403e-01 0.8803299
[70,] 1.055846e-01 2.111692e-01 0.8944154
[71,] 9.025806e-02 1.805161e-01 0.9097419
[72,] 7.016254e-02 1.403251e-01 0.9298375
[73,] 4.303219e-01 8.606438e-01 0.5696781
[74,] 3.981834e-01 7.963669e-01 0.6018166
[75,] 3.468530e-01 6.937060e-01 0.6531470
[76,] 3.716156e-01 7.432311e-01 0.6283844
[77,] 4.772319e-01 9.544638e-01 0.5227681
[78,] 4.447354e-01 8.894707e-01 0.5552646
[79,] 4.011097e-01 8.022195e-01 0.5988903
[80,] 4.134353e-01 8.268706e-01 0.5865647
[81,] 5.430341e-01 9.139318e-01 0.4569659
[82,] 5.118617e-01 9.762767e-01 0.4881383
[83,] 4.555457e-01 9.110914e-01 0.5444543
[84,] 5.129960e-01 9.740079e-01 0.4870040
[85,] 4.920637e-01 9.841275e-01 0.5079363
[86,] 5.864336e-01 8.271328e-01 0.4135664
[87,] 6.462261e-01 7.075477e-01 0.3537739
[88,] 6.572066e-01 6.855867e-01 0.3427934
[89,] 6.453844e-01 7.092313e-01 0.3546156
[90,] 6.180921e-01 7.638158e-01 0.3819079
[91,] 5.930809e-01 8.138382e-01 0.4069191
[92,] 5.309671e-01 9.380658e-01 0.4690329
[93,] 4.704560e-01 9.409120e-01 0.5295440
[94,] 4.147774e-01 8.295548e-01 0.5852226
[95,] 3.874408e-01 7.748815e-01 0.6125592
[96,] 9.231602e-01 1.536796e-01 0.0768398
[97,] 8.873112e-01 2.253776e-01 0.1126888
[98,] 8.658162e-01 2.683677e-01 0.1341838
[99,] 8.081474e-01 3.837051e-01 0.1918526
[100,] 8.246510e-01 3.506981e-01 0.1753490
[101,] 7.868212e-01 4.263576e-01 0.2131788
[102,] 7.313487e-01 5.373025e-01 0.2686513
[103,] 7.716152e-01 4.567696e-01 0.2283848
[104,] 7.883634e-01 4.232732e-01 0.2116366
[105,] 7.630840e-01 4.738320e-01 0.2369160
[106,] 6.539054e-01 6.921891e-01 0.3460946
[107,] 8.302778e-01 3.394444e-01 0.1697222
> postscript(file="/var/wessaorg/rcomp/tmp/1y8z81469822938.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/2d0631469822938.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/36aug1469822938.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/4em911469822938.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/5195u1469822938.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 = 120
Frequency = 1
1 2 3 4 5 6
-0.930021300 0.749339122 -0.402202142 -1.247944504 0.770136354 0.937974085
7 8 9 10 11 12
-0.643383691 -0.425265277 -0.379949119 -0.347165436 0.182475670 0.655550937
13 14 15 16 17 18
0.268431815 0.180751328 0.648589059 -0.089334555 1.262828124 1.091907864
19 20 21 22 23 24
0.199027396 -0.907994531 -0.122273841 0.415223569 -0.060934227 0.340423959
25 26 27 28 29 30
0.914023036 0.529522683 1.316701854 0.929582732 -0.613578419 1.182542231
31 32 33 34 35 36
-0.201359201 0.016759214 -1.603880364 0.241959604 -0.373442437 0.583396412
37 38 39 40 41 42
-0.375963600 0.425918396 -0.078484763 -0.333168605 0.891234965 0.806173245
43 44 45 46 47 48
-0.197706105 0.337172537 0.250053415 -0.215629309 -1.708509776 -1.712389126
49 50 51 52 53 54
0.208348056 3.415467589 -0.396791875 -1.145190561 -0.755355066 -0.150330493
55 56 57 58 59 60
0.901345933 -0.600476014 1.320784978 0.513763050 0.954365482 -2.191938246
61 62 63 64 65 66
-1.122940227 -0.637818459 -0.858458036 -0.048719736 -2.069359313 0.862339195
67 68 69 70 71 72
1.900360415 -1.140181968 -0.421539744 -0.311801444 -1.074865399 0.299257487
73 74 75 76 77 78
-1.930286013 -1.548306822 0.192333165 0.105214043 -1.129566994 -0.622447461
79 80 81 82 83 84
-3.748848384 0.486030258 -0.218410458 1.013849416 -1.409932739 -0.007451821
85 86 87 88 89 90
0.396487578 1.286846882 -1.758933036 -0.526673162 -0.530552512 -0.998854004
91 92 93 94 95 96
0.345003674 -0.850495562 -1.365373794 0.235423027 1.550922673 0.632901864
97 98 99 100 101 102
0.889740714 0.267043734 0.226501352 0.649819746 0.951177932 4.224777009
103 104 105 106 107 108
0.757036883 0.491877969 0.562334468 -0.487522699 0.152555923 1.067494203
109 110 111 112 113 114
0.805515423 -0.359605935 0.828134601 -0.598266322 0.528232206 -0.484588623
115 116 117 118 119 120
-0.069088977 1.949029438 -0.479990253 0.116130397 -0.541172213 -1.653431676
> postscript(file="/var/wessaorg/rcomp/tmp/6z90t1469822938.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 = 120
Frequency = 1
lag(myerror, k = 1) myerror
0 -0.930021300 NA
1 0.749339122 -0.930021300
2 -0.402202142 0.749339122
3 -1.247944504 -0.402202142
4 0.770136354 -1.247944504
5 0.937974085 0.770136354
6 -0.643383691 0.937974085
7 -0.425265277 -0.643383691
8 -0.379949119 -0.425265277
9 -0.347165436 -0.379949119
10 0.182475670 -0.347165436
11 0.655550937 0.182475670
12 0.268431815 0.655550937
13 0.180751328 0.268431815
14 0.648589059 0.180751328
15 -0.089334555 0.648589059
16 1.262828124 -0.089334555
17 1.091907864 1.262828124
18 0.199027396 1.091907864
19 -0.907994531 0.199027396
20 -0.122273841 -0.907994531
21 0.415223569 -0.122273841
22 -0.060934227 0.415223569
23 0.340423959 -0.060934227
24 0.914023036 0.340423959
25 0.529522683 0.914023036
26 1.316701854 0.529522683
27 0.929582732 1.316701854
28 -0.613578419 0.929582732
29 1.182542231 -0.613578419
30 -0.201359201 1.182542231
31 0.016759214 -0.201359201
32 -1.603880364 0.016759214
33 0.241959604 -1.603880364
34 -0.373442437 0.241959604
35 0.583396412 -0.373442437
36 -0.375963600 0.583396412
37 0.425918396 -0.375963600
38 -0.078484763 0.425918396
39 -0.333168605 -0.078484763
40 0.891234965 -0.333168605
41 0.806173245 0.891234965
42 -0.197706105 0.806173245
43 0.337172537 -0.197706105
44 0.250053415 0.337172537
45 -0.215629309 0.250053415
46 -1.708509776 -0.215629309
47 -1.712389126 -1.708509776
48 0.208348056 -1.712389126
49 3.415467589 0.208348056
50 -0.396791875 3.415467589
51 -1.145190561 -0.396791875
52 -0.755355066 -1.145190561
53 -0.150330493 -0.755355066
54 0.901345933 -0.150330493
55 -0.600476014 0.901345933
56 1.320784978 -0.600476014
57 0.513763050 1.320784978
58 0.954365482 0.513763050
59 -2.191938246 0.954365482
60 -1.122940227 -2.191938246
61 -0.637818459 -1.122940227
62 -0.858458036 -0.637818459
63 -0.048719736 -0.858458036
64 -2.069359313 -0.048719736
65 0.862339195 -2.069359313
66 1.900360415 0.862339195
67 -1.140181968 1.900360415
68 -0.421539744 -1.140181968
69 -0.311801444 -0.421539744
70 -1.074865399 -0.311801444
71 0.299257487 -1.074865399
72 -1.930286013 0.299257487
73 -1.548306822 -1.930286013
74 0.192333165 -1.548306822
75 0.105214043 0.192333165
76 -1.129566994 0.105214043
77 -0.622447461 -1.129566994
78 -3.748848384 -0.622447461
79 0.486030258 -3.748848384
80 -0.218410458 0.486030258
81 1.013849416 -0.218410458
82 -1.409932739 1.013849416
83 -0.007451821 -1.409932739
84 0.396487578 -0.007451821
85 1.286846882 0.396487578
86 -1.758933036 1.286846882
87 -0.526673162 -1.758933036
88 -0.530552512 -0.526673162
89 -0.998854004 -0.530552512
90 0.345003674 -0.998854004
91 -0.850495562 0.345003674
92 -1.365373794 -0.850495562
93 0.235423027 -1.365373794
94 1.550922673 0.235423027
95 0.632901864 1.550922673
96 0.889740714 0.632901864
97 0.267043734 0.889740714
98 0.226501352 0.267043734
99 0.649819746 0.226501352
100 0.951177932 0.649819746
101 4.224777009 0.951177932
102 0.757036883 4.224777009
103 0.491877969 0.757036883
104 0.562334468 0.491877969
105 -0.487522699 0.562334468
106 0.152555923 -0.487522699
107 1.067494203 0.152555923
108 0.805515423 1.067494203
109 -0.359605935 0.805515423
110 0.828134601 -0.359605935
111 -0.598266322 0.828134601
112 0.528232206 -0.598266322
113 -0.484588623 0.528232206
114 -0.069088977 -0.484588623
115 1.949029438 -0.069088977
116 -0.479990253 1.949029438
117 0.116130397 -0.479990253
118 -0.541172213 0.116130397
119 -1.653431676 -0.541172213
120 NA -1.653431676
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 0.749339122 -0.930021300
[2,] -0.402202142 0.749339122
[3,] -1.247944504 -0.402202142
[4,] 0.770136354 -1.247944504
[5,] 0.937974085 0.770136354
[6,] -0.643383691 0.937974085
[7,] -0.425265277 -0.643383691
[8,] -0.379949119 -0.425265277
[9,] -0.347165436 -0.379949119
[10,] 0.182475670 -0.347165436
[11,] 0.655550937 0.182475670
[12,] 0.268431815 0.655550937
[13,] 0.180751328 0.268431815
[14,] 0.648589059 0.180751328
[15,] -0.089334555 0.648589059
[16,] 1.262828124 -0.089334555
[17,] 1.091907864 1.262828124
[18,] 0.199027396 1.091907864
[19,] -0.907994531 0.199027396
[20,] -0.122273841 -0.907994531
[21,] 0.415223569 -0.122273841
[22,] -0.060934227 0.415223569
[23,] 0.340423959 -0.060934227
[24,] 0.914023036 0.340423959
[25,] 0.529522683 0.914023036
[26,] 1.316701854 0.529522683
[27,] 0.929582732 1.316701854
[28,] -0.613578419 0.929582732
[29,] 1.182542231 -0.613578419
[30,] -0.201359201 1.182542231
[31,] 0.016759214 -0.201359201
[32,] -1.603880364 0.016759214
[33,] 0.241959604 -1.603880364
[34,] -0.373442437 0.241959604
[35,] 0.583396412 -0.373442437
[36,] -0.375963600 0.583396412
[37,] 0.425918396 -0.375963600
[38,] -0.078484763 0.425918396
[39,] -0.333168605 -0.078484763
[40,] 0.891234965 -0.333168605
[41,] 0.806173245 0.891234965
[42,] -0.197706105 0.806173245
[43,] 0.337172537 -0.197706105
[44,] 0.250053415 0.337172537
[45,] -0.215629309 0.250053415
[46,] -1.708509776 -0.215629309
[47,] -1.712389126 -1.708509776
[48,] 0.208348056 -1.712389126
[49,] 3.415467589 0.208348056
[50,] -0.396791875 3.415467589
[51,] -1.145190561 -0.396791875
[52,] -0.755355066 -1.145190561
[53,] -0.150330493 -0.755355066
[54,] 0.901345933 -0.150330493
[55,] -0.600476014 0.901345933
[56,] 1.320784978 -0.600476014
[57,] 0.513763050 1.320784978
[58,] 0.954365482 0.513763050
[59,] -2.191938246 0.954365482
[60,] -1.122940227 -2.191938246
[61,] -0.637818459 -1.122940227
[62,] -0.858458036 -0.637818459
[63,] -0.048719736 -0.858458036
[64,] -2.069359313 -0.048719736
[65,] 0.862339195 -2.069359313
[66,] 1.900360415 0.862339195
[67,] -1.140181968 1.900360415
[68,] -0.421539744 -1.140181968
[69,] -0.311801444 -0.421539744
[70,] -1.074865399 -0.311801444
[71,] 0.299257487 -1.074865399
[72,] -1.930286013 0.299257487
[73,] -1.548306822 -1.930286013
[74,] 0.192333165 -1.548306822
[75,] 0.105214043 0.192333165
[76,] -1.129566994 0.105214043
[77,] -0.622447461 -1.129566994
[78,] -3.748848384 -0.622447461
[79,] 0.486030258 -3.748848384
[80,] -0.218410458 0.486030258
[81,] 1.013849416 -0.218410458
[82,] -1.409932739 1.013849416
[83,] -0.007451821 -1.409932739
[84,] 0.396487578 -0.007451821
[85,] 1.286846882 0.396487578
[86,] -1.758933036 1.286846882
[87,] -0.526673162 -1.758933036
[88,] -0.530552512 -0.526673162
[89,] -0.998854004 -0.530552512
[90,] 0.345003674 -0.998854004
[91,] -0.850495562 0.345003674
[92,] -1.365373794 -0.850495562
[93,] 0.235423027 -1.365373794
[94,] 1.550922673 0.235423027
[95,] 0.632901864 1.550922673
[96,] 0.889740714 0.632901864
[97,] 0.267043734 0.889740714
[98,] 0.226501352 0.267043734
[99,] 0.649819746 0.226501352
[100,] 0.951177932 0.649819746
[101,] 4.224777009 0.951177932
[102,] 0.757036883 4.224777009
[103,] 0.491877969 0.757036883
[104,] 0.562334468 0.491877969
[105,] -0.487522699 0.562334468
[106,] 0.152555923 -0.487522699
[107,] 1.067494203 0.152555923
[108,] 0.805515423 1.067494203
[109,] -0.359605935 0.805515423
[110,] 0.828134601 -0.359605935
[111,] -0.598266322 0.828134601
[112,] 0.528232206 -0.598266322
[113,] -0.484588623 0.528232206
[114,] -0.069088977 -0.484588623
[115,] 1.949029438 -0.069088977
[116,] -0.479990253 1.949029438
[117,] 0.116130397 -0.479990253
[118,] -0.541172213 0.116130397
[119,] -1.653431676 -0.541172213
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 0.749339122 -0.930021300
2 -0.402202142 0.749339122
3 -1.247944504 -0.402202142
4 0.770136354 -1.247944504
5 0.937974085 0.770136354
6 -0.643383691 0.937974085
7 -0.425265277 -0.643383691
8 -0.379949119 -0.425265277
9 -0.347165436 -0.379949119
10 0.182475670 -0.347165436
11 0.655550937 0.182475670
12 0.268431815 0.655550937
13 0.180751328 0.268431815
14 0.648589059 0.180751328
15 -0.089334555 0.648589059
16 1.262828124 -0.089334555
17 1.091907864 1.262828124
18 0.199027396 1.091907864
19 -0.907994531 0.199027396
20 -0.122273841 -0.907994531
21 0.415223569 -0.122273841
22 -0.060934227 0.415223569
23 0.340423959 -0.060934227
24 0.914023036 0.340423959
25 0.529522683 0.914023036
26 1.316701854 0.529522683
27 0.929582732 1.316701854
28 -0.613578419 0.929582732
29 1.182542231 -0.613578419
30 -0.201359201 1.182542231
31 0.016759214 -0.201359201
32 -1.603880364 0.016759214
33 0.241959604 -1.603880364
34 -0.373442437 0.241959604
35 0.583396412 -0.373442437
36 -0.375963600 0.583396412
37 0.425918396 -0.375963600
38 -0.078484763 0.425918396
39 -0.333168605 -0.078484763
40 0.891234965 -0.333168605
41 0.806173245 0.891234965
42 -0.197706105 0.806173245
43 0.337172537 -0.197706105
44 0.250053415 0.337172537
45 -0.215629309 0.250053415
46 -1.708509776 -0.215629309
47 -1.712389126 -1.708509776
48 0.208348056 -1.712389126
49 3.415467589 0.208348056
50 -0.396791875 3.415467589
51 -1.145190561 -0.396791875
52 -0.755355066 -1.145190561
53 -0.150330493 -0.755355066
54 0.901345933 -0.150330493
55 -0.600476014 0.901345933
56 1.320784978 -0.600476014
57 0.513763050 1.320784978
58 0.954365482 0.513763050
59 -2.191938246 0.954365482
60 -1.122940227 -2.191938246
61 -0.637818459 -1.122940227
62 -0.858458036 -0.637818459
63 -0.048719736 -0.858458036
64 -2.069359313 -0.048719736
65 0.862339195 -2.069359313
66 1.900360415 0.862339195
67 -1.140181968 1.900360415
68 -0.421539744 -1.140181968
69 -0.311801444 -0.421539744
70 -1.074865399 -0.311801444
71 0.299257487 -1.074865399
72 -1.930286013 0.299257487
73 -1.548306822 -1.930286013
74 0.192333165 -1.548306822
75 0.105214043 0.192333165
76 -1.129566994 0.105214043
77 -0.622447461 -1.129566994
78 -3.748848384 -0.622447461
79 0.486030258 -3.748848384
80 -0.218410458 0.486030258
81 1.013849416 -0.218410458
82 -1.409932739 1.013849416
83 -0.007451821 -1.409932739
84 0.396487578 -0.007451821
85 1.286846882 0.396487578
86 -1.758933036 1.286846882
87 -0.526673162 -1.758933036
88 -0.530552512 -0.526673162
89 -0.998854004 -0.530552512
90 0.345003674 -0.998854004
91 -0.850495562 0.345003674
92 -1.365373794 -0.850495562
93 0.235423027 -1.365373794
94 1.550922673 0.235423027
95 0.632901864 1.550922673
96 0.889740714 0.632901864
97 0.267043734 0.889740714
98 0.226501352 0.267043734
99 0.649819746 0.226501352
100 0.951177932 0.649819746
101 4.224777009 0.951177932
102 0.757036883 4.224777009
103 0.491877969 0.757036883
104 0.562334468 0.491877969
105 -0.487522699 0.562334468
106 0.152555923 -0.487522699
107 1.067494203 0.152555923
108 0.805515423 1.067494203
109 -0.359605935 0.805515423
110 0.828134601 -0.359605935
111 -0.598266322 0.828134601
112 0.528232206 -0.598266322
113 -0.484588623 0.528232206
114 -0.069088977 -0.484588623
115 1.949029438 -0.069088977
116 -0.479990253 1.949029438
117 0.116130397 -0.479990253
118 -0.541172213 0.116130397
119 -1.653431676 -0.541172213
> 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/7rei01469822938.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/8ghqt1469822938.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/9z27k1469822938.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/10f33i1469822938.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, signif(mysum$coefficients[i,1],6), 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.row.start(a)
> a<-table.element(a, mywarning)
> a<-table.row.end(a)
> a<-table.end(a)
> table.save(a,file="/var/wessaorg/rcomp/tmp/11mr481469822938.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,formatC(signif(mysum$coefficients[i,1],5),format='g',flag='+'))
+ a<-table.element(a,formatC(signif(mysum$coefficients[i,2],5),format='g',flag=' '))
+ a<-table.element(a,formatC(signif(mysum$coefficients[i,3],4),format='e',flag='+'))
+ a<-table.element(a,formatC(signif(mysum$coefficients[i,4],4),format='g',flag=' '))
+ a<-table.element(a,formatC(signif(mysum$coefficients[i,4]/2,4),format='g',flag=' '))
+ a<-table.row.end(a)
+ }
> a<-table.end(a)
> table.save(a,file="/var/wessaorg/rcomp/tmp/12rs7e1469822938.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,formatC(signif(sqrt(mysum$r.squared),6),format='g',flag=' '))
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'R-squared',1,TRUE)
> a<-table.element(a,formatC(signif(mysum$r.squared,6),format='g',flag=' '))
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Adjusted R-squared',1,TRUE)
> a<-table.element(a,formatC(signif(mysum$adj.r.squared,6),format='g',flag=' '))
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (value)',1,TRUE)
> a<-table.element(a,formatC(signif(mysum$fstatistic[1],6),format='g',flag=' '))
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (DF numerator)',1,TRUE)
> a<-table.element(a, signif(mysum$fstatistic[2],6))
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (DF denominator)',1,TRUE)
> a<-table.element(a, signif(mysum$fstatistic[3],6))
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'p-value',1,TRUE)
> a<-table.element(a,formatC(signif(1-pf(mysum$fstatistic[1],mysum$fstatistic[2],mysum$fstatistic[3]),6),format='g',flag=' '))
> 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,formatC(signif(mysum$sigma,6),format='g',flag=' '))
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Sum Squared Residuals',1,TRUE)
> a<-table.element(a,formatC(signif(sum(myerror*myerror),6),format='g',flag=' '))
> a<-table.row.end(a)
> a<-table.end(a)
> table.save(a,file="/var/wessaorg/rcomp/tmp/13vfrw1469822938.tab")
> if(n < 200) {
+ 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,formatC(signif(x[i],6),format='g',flag=' '))
+ a<-table.element(a,formatC(signif(x[i]-mysum$resid[i],6),format='g',flag=' '))
+ a<-table.element(a,formatC(signif(mysum$resid[i],6),format='g',flag=' '))
+ a<-table.row.end(a)
+ }
+ a<-table.end(a)
+ table.save(a,file="/var/wessaorg/rcomp/tmp/14ol7q1469822938.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,formatC(signif(gqarr[mypoint-kp3+1,1],6),format='g',flag=' '))
+ a<-table.element(a,formatC(signif(gqarr[mypoint-kp3+1,2],6),format='g',flag=' '))
+ a<-table.element(a,formatC(signif(gqarr[mypoint-kp3+1,3],6),format='g',flag=' '))
+ a<-table.row.end(a)
+ }
+ a<-table.end(a)
+ table.save(a,file="/var/wessaorg/rcomp/tmp/157lx31469822938.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,signif(numsignificant1,6))
+ a<-table.element(a,formatC(signif(numsignificant1/numgqtests,6),format='g',flag=' '))
+ 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,signif(numsignificant5,6))
+ a<-table.element(a,signif(numsignificant5/numgqtests,6))
+ 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,signif(numsignificant10,6))
+ a<-table.element(a,signif(numsignificant10/numgqtests,6))
+ 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/16ozi91469822938.tab")
+ }
+ }
>
> try(system("convert tmp/1y8z81469822938.ps tmp/1y8z81469822938.png",intern=TRUE))
character(0)
> try(system("convert tmp/2d0631469822938.ps tmp/2d0631469822938.png",intern=TRUE))
character(0)
> try(system("convert tmp/36aug1469822938.ps tmp/36aug1469822938.png",intern=TRUE))
character(0)
> try(system("convert tmp/4em911469822938.ps tmp/4em911469822938.png",intern=TRUE))
character(0)
> try(system("convert tmp/5195u1469822938.ps tmp/5195u1469822938.png",intern=TRUE))
character(0)
> try(system("convert tmp/6z90t1469822938.ps tmp/6z90t1469822938.png",intern=TRUE))
character(0)
> try(system("convert tmp/7rei01469822938.ps tmp/7rei01469822938.png",intern=TRUE))
character(0)
> try(system("convert tmp/8ghqt1469822938.ps tmp/8ghqt1469822938.png",intern=TRUE))
character(0)
> try(system("convert tmp/9z27k1469822938.ps tmp/9z27k1469822938.png",intern=TRUE))
character(0)
> try(system("convert tmp/10f33i1469822938.ps tmp/10f33i1469822938.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
5.156 0.345 5.614