R version 3.0.2 (2013-09-25) -- "Frisbee Sailing"
Copyright (C) 2013 The R Foundation for Statistical Computing
Platform: i686-pc-linux-gnu (32-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> x <- array(list(1687
+ ,0
+ ,NA
+ ,1508
+ ,0
+ ,1687
+ ,1507
+ ,0
+ ,1508
+ ,1385
+ ,0
+ ,1507
+ ,1632
+ ,0
+ ,1385
+ ,1511
+ ,0
+ ,1632
+ ,1559
+ ,0
+ ,1511
+ ,1630
+ ,0
+ ,1559
+ ,1579
+ ,0
+ ,1630
+ ,1653
+ ,0
+ ,1579
+ ,2152
+ ,0
+ ,1653
+ ,2148
+ ,0
+ ,2152
+ ,1752
+ ,0
+ ,2148
+ ,1765
+ ,0
+ ,1752
+ ,1717
+ ,0
+ ,1765
+ ,1558
+ ,0
+ ,1717
+ ,1575
+ ,0
+ ,1558
+ ,1520
+ ,0
+ ,1575
+ ,1805
+ ,0
+ ,1520
+ ,1800
+ ,0
+ ,1805
+ ,1719
+ ,0
+ ,1800
+ ,2008
+ ,0
+ ,1719
+ ,2242
+ ,0
+ ,2008
+ ,2478
+ ,0
+ ,2242
+ ,2030
+ ,0
+ ,2478
+ ,1655
+ ,0
+ ,2030
+ ,1693
+ ,0
+ ,1655
+ ,1623
+ ,0
+ ,1693
+ ,1805
+ ,0
+ ,1623
+ ,1746
+ ,0
+ ,1805
+ ,1795
+ ,0
+ ,1746
+ ,1926
+ ,0
+ ,1795
+ ,1619
+ ,0
+ ,1926
+ ,1992
+ ,0
+ ,1619
+ ,2233
+ ,0
+ ,1992
+ ,2192
+ ,0
+ ,2233
+ ,2080
+ ,0
+ ,2192
+ ,1768
+ ,0
+ ,2080
+ ,1835
+ ,0
+ ,1768
+ ,1569
+ ,0
+ ,1835
+ ,1976
+ ,0
+ ,1569
+ ,1853
+ ,0
+ ,1976
+ ,1965
+ ,0
+ ,1853
+ ,1689
+ ,0
+ ,1965
+ ,1778
+ ,0
+ ,1689
+ ,1976
+ ,0
+ ,1778
+ ,2397
+ ,0
+ ,1976
+ ,2654
+ ,0
+ ,2397
+ ,2097
+ ,0
+ ,2654
+ ,1963
+ ,0
+ ,2097
+ ,1677
+ ,0
+ ,1963
+ ,1941
+ ,0
+ ,1677
+ ,2003
+ ,0
+ ,1941
+ ,1813
+ ,0
+ ,2003
+ ,2012
+ ,0
+ ,1813
+ ,1912
+ ,0
+ ,2012
+ ,2084
+ ,0
+ ,1912
+ ,2080
+ ,0
+ ,2084
+ ,2118
+ ,0
+ ,2080
+ ,2150
+ ,0
+ ,2118
+ ,1608
+ ,0
+ ,2150
+ ,1503
+ ,0
+ ,1608
+ ,1548
+ ,0
+ ,1503
+ ,1382
+ ,0
+ ,1548
+ ,1731
+ ,0
+ ,1382
+ ,1798
+ ,0
+ ,1731
+ ,1779
+ ,0
+ ,1798
+ ,1887
+ ,0
+ ,1779
+ ,2004
+ ,0
+ ,1887
+ ,2077
+ ,0
+ ,2004
+ ,2092
+ ,0
+ ,2077
+ ,2051
+ ,0
+ ,2092
+ ,1577
+ ,0
+ ,2051
+ ,1356
+ ,0
+ ,1577
+ ,1652
+ ,0
+ ,1356
+ ,1382
+ ,0
+ ,1652
+ ,1519
+ ,0
+ ,1382
+ ,1421
+ ,0
+ ,1519
+ ,1442
+ ,0
+ ,1421
+ ,1543
+ ,0
+ ,1442
+ ,1656
+ ,0
+ ,1543
+ ,1561
+ ,0
+ ,1656
+ ,1905
+ ,0
+ ,1561
+ ,2199
+ ,0
+ ,1905
+ ,1473
+ ,0
+ ,2199
+ ,1655
+ ,0
+ ,1473
+ ,1407
+ ,0
+ ,1655
+ ,1395
+ ,0
+ ,1407
+ ,1530
+ ,0
+ ,1395
+ ,1309
+ ,0
+ ,1530
+ ,1526
+ ,0
+ ,1309
+ ,1327
+ ,0
+ ,1526
+ ,1627
+ ,0
+ ,1327
+ ,1748
+ ,0
+ ,1627
+ ,1958
+ ,0
+ ,1748
+ ,2274
+ ,0
+ ,1958
+ ,1648
+ ,0
+ ,2274
+ ,1401
+ ,0
+ ,1648
+ ,1411
+ ,0
+ ,1401
+ ,1403
+ ,0
+ ,1411
+ ,1394
+ ,0
+ ,1403
+ ,1520
+ ,0
+ ,1394
+ ,1528
+ ,0
+ ,1520
+ ,1643
+ ,0
+ ,1528
+ ,1515
+ ,0
+ ,1643
+ ,1685
+ ,0
+ ,1515
+ ,2000
+ ,0
+ ,1685
+ ,2215
+ ,0
+ ,2000
+ ,1956
+ ,0
+ ,2215
+ ,1462
+ ,0
+ ,1956
+ ,1563
+ ,0
+ ,1462
+ ,1459
+ ,0
+ ,1563
+ ,1446
+ ,0
+ ,1459
+ ,1622
+ ,0
+ ,1446
+ ,1657
+ ,0
+ ,1622
+ ,1638
+ ,0
+ ,1657
+ ,1643
+ ,0
+ ,1638
+ ,1683
+ ,0
+ ,1643
+ ,2050
+ ,0
+ ,1683
+ ,2262
+ ,0
+ ,2050
+ ,1813
+ ,0
+ ,2262
+ ,1445
+ ,0
+ ,1813
+ ,1762
+ ,0
+ ,1445
+ ,1461
+ ,0
+ ,1762
+ ,1556
+ ,0
+ ,1461
+ ,1431
+ ,0
+ ,1556
+ ,1427
+ ,0
+ ,1431
+ ,1554
+ ,0
+ ,1427
+ ,1645
+ ,0
+ ,1554
+ ,1653
+ ,0
+ ,1645
+ ,2016
+ ,0
+ ,1653
+ ,2207
+ ,0
+ ,2016
+ ,1665
+ ,0
+ ,2207
+ ,1361
+ ,0
+ ,1665
+ ,1506
+ ,0
+ ,1361
+ ,1360
+ ,0
+ ,1506
+ ,1453
+ ,0
+ ,1360
+ ,1522
+ ,0
+ ,1453
+ ,1460
+ ,0
+ ,1522
+ ,1552
+ ,0
+ ,1460
+ ,1548
+ ,0
+ ,1552
+ ,1827
+ ,0
+ ,1548
+ ,1737
+ ,0
+ ,1827
+ ,1941
+ ,0
+ ,1737
+ ,1474
+ ,0
+ ,1941
+ ,1458
+ ,0
+ ,1474
+ ,1542
+ ,0
+ ,1458
+ ,1404
+ ,0
+ ,1542
+ ,1522
+ ,0
+ ,1404
+ ,1385
+ ,0
+ ,1522
+ ,1641
+ ,0
+ ,1385
+ ,1510
+ ,0
+ ,1641
+ ,1681
+ ,0
+ ,1510
+ ,1938
+ ,0
+ ,1681
+ ,1868
+ ,0
+ ,1938
+ ,1726
+ ,0
+ ,1868
+ ,1456
+ ,0
+ ,1726
+ ,1445
+ ,0
+ ,1456
+ ,1456
+ ,0
+ ,1445
+ ,1365
+ ,0
+ ,1456
+ ,1487
+ ,0
+ ,1365
+ ,1558
+ ,0
+ ,1487
+ ,1488
+ ,0
+ ,1558
+ ,1684
+ ,0
+ ,1488
+ ,1594
+ ,0
+ ,1684
+ ,1850
+ ,0
+ ,1594
+ ,1998
+ ,0
+ ,1850
+ ,2079
+ ,0
+ ,1998
+ ,1494
+ ,0
+ ,2079
+ ,1057
+ ,1
+ ,1494
+ ,1218
+ ,1
+ ,1057
+ ,1168
+ ,1
+ ,1218
+ ,1236
+ ,1
+ ,1168
+ ,1076
+ ,1
+ ,1236
+ ,1174
+ ,1
+ ,1076
+ ,1139
+ ,1
+ ,1174
+ ,1427
+ ,1
+ ,1139
+ ,1487
+ ,1
+ ,1427
+ ,1483
+ ,1
+ ,1487
+ ,1513
+ ,1
+ ,1483
+ ,1357
+ ,1
+ ,1513
+ ,1165
+ ,1
+ ,1357
+ ,1282
+ ,1
+ ,1165
+ ,1110
+ ,1
+ ,1282
+ ,1297
+ ,1
+ ,1110
+ ,1185
+ ,1
+ ,1297
+ ,1222
+ ,1
+ ,1185
+ ,1284
+ ,1
+ ,1222
+ ,1444
+ ,1
+ ,1284
+ ,1575
+ ,1
+ ,1444
+ ,1737
+ ,1
+ ,1575
+ ,1763
+ ,1
+ ,1737)
+ ,dim=c(3
+ ,192)
+ ,dimnames=list(c('Accidents'
+ ,'Belt'
+ ,'A1')
+ ,1:192))
> y <- array(NA,dim=c(3,192),dimnames=list(c('Accidents','Belt','A1'),1:192))
> for (i in 1:dim(x)[1])
+ {
+ for (j in 1:dim(x)[2])
+ {
+ y[i,j] <- as.numeric(x[i,j])
+ }
+ }
> par3 = 'Linear Trend'
> par2 = 'Include Monthly Dummies'
> par1 = '1'
> par3 <- 'Linear Trend'
> par2 <- 'Include Monthly Dummies'
> par1 <- '1'
> #'GNU S' R Code compiled by R2WASP v. 1.2.327 ()
> #Author: root
> #To cite this work: Wessa P., (2013), Multiple Regression (v1.0.29) 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
> 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
Accidents Belt A1 M1 M2 M3 M4 M5 M6 M7 M8 M9 M10 M11 t
1 1687 0 NA 1 0 0 0 0 0 0 0 0 0 0 1
2 1508 0 1687 0 1 0 0 0 0 0 0 0 0 0 2
3 1507 0 1508 0 0 1 0 0 0 0 0 0 0 0 3
4 1385 0 1507 0 0 0 1 0 0 0 0 0 0 0 4
5 1632 0 1385 0 0 0 0 1 0 0 0 0 0 0 5
6 1511 0 1632 0 0 0 0 0 1 0 0 0 0 0 6
7 1559 0 1511 0 0 0 0 0 0 1 0 0 0 0 7
8 1630 0 1559 0 0 0 0 0 0 0 1 0 0 0 8
9 1579 0 1630 0 0 0 0 0 0 0 0 1 0 0 9
10 1653 0 1579 0 0 0 0 0 0 0 0 0 1 0 10
11 2152 0 1653 0 0 0 0 0 0 0 0 0 0 1 11
12 2148 0 2152 0 0 0 0 0 0 0 0 0 0 0 12
13 1752 0 2148 1 0 0 0 0 0 0 0 0 0 0 13
14 1765 0 1752 0 1 0 0 0 0 0 0 0 0 0 14
15 1717 0 1765 0 0 1 0 0 0 0 0 0 0 0 15
16 1558 0 1717 0 0 0 1 0 0 0 0 0 0 0 16
17 1575 0 1558 0 0 0 0 1 0 0 0 0 0 0 17
18 1520 0 1575 0 0 0 0 0 1 0 0 0 0 0 18
19 1805 0 1520 0 0 0 0 0 0 1 0 0 0 0 19
20 1800 0 1805 0 0 0 0 0 0 0 1 0 0 0 20
21 1719 0 1800 0 0 0 0 0 0 0 0 1 0 0 21
22 2008 0 1719 0 0 0 0 0 0 0 0 0 1 0 22
23 2242 0 2008 0 0 0 0 0 0 0 0 0 0 1 23
24 2478 0 2242 0 0 0 0 0 0 0 0 0 0 0 24
25 2030 0 2478 1 0 0 0 0 0 0 0 0 0 0 25
26 1655 0 2030 0 1 0 0 0 0 0 0 0 0 0 26
27 1693 0 1655 0 0 1 0 0 0 0 0 0 0 0 27
28 1623 0 1693 0 0 0 1 0 0 0 0 0 0 0 28
29 1805 0 1623 0 0 0 0 1 0 0 0 0 0 0 29
30 1746 0 1805 0 0 0 0 0 1 0 0 0 0 0 30
31 1795 0 1746 0 0 0 0 0 0 1 0 0 0 0 31
32 1926 0 1795 0 0 0 0 0 0 0 1 0 0 0 32
33 1619 0 1926 0 0 0 0 0 0 0 0 1 0 0 33
34 1992 0 1619 0 0 0 0 0 0 0 0 0 1 0 34
35 2233 0 1992 0 0 0 0 0 0 0 0 0 0 1 35
36 2192 0 2233 0 0 0 0 0 0 0 0 0 0 0 36
37 2080 0 2192 1 0 0 0 0 0 0 0 0 0 0 37
38 1768 0 2080 0 1 0 0 0 0 0 0 0 0 0 38
39 1835 0 1768 0 0 1 0 0 0 0 0 0 0 0 39
40 1569 0 1835 0 0 0 1 0 0 0 0 0 0 0 40
41 1976 0 1569 0 0 0 0 1 0 0 0 0 0 0 41
42 1853 0 1976 0 0 0 0 0 1 0 0 0 0 0 42
43 1965 0 1853 0 0 0 0 0 0 1 0 0 0 0 43
44 1689 0 1965 0 0 0 0 0 0 0 1 0 0 0 44
45 1778 0 1689 0 0 0 0 0 0 0 0 1 0 0 45
46 1976 0 1778 0 0 0 0 0 0 0 0 0 1 0 46
47 2397 0 1976 0 0 0 0 0 0 0 0 0 0 1 47
48 2654 0 2397 0 0 0 0 0 0 0 0 0 0 0 48
49 2097 0 2654 1 0 0 0 0 0 0 0 0 0 0 49
50 1963 0 2097 0 1 0 0 0 0 0 0 0 0 0 50
51 1677 0 1963 0 0 1 0 0 0 0 0 0 0 0 51
52 1941 0 1677 0 0 0 1 0 0 0 0 0 0 0 52
53 2003 0 1941 0 0 0 0 1 0 0 0 0 0 0 53
54 1813 0 2003 0 0 0 0 0 1 0 0 0 0 0 54
55 2012 0 1813 0 0 0 0 0 0 1 0 0 0 0 55
56 1912 0 2012 0 0 0 0 0 0 0 1 0 0 0 56
57 2084 0 1912 0 0 0 0 0 0 0 0 1 0 0 57
58 2080 0 2084 0 0 0 0 0 0 0 0 0 1 0 58
59 2118 0 2080 0 0 0 0 0 0 0 0 0 0 1 59
60 2150 0 2118 0 0 0 0 0 0 0 0 0 0 0 60
61 1608 0 2150 1 0 0 0 0 0 0 0 0 0 0 61
62 1503 0 1608 0 1 0 0 0 0 0 0 0 0 0 62
63 1548 0 1503 0 0 1 0 0 0 0 0 0 0 0 63
64 1382 0 1548 0 0 0 1 0 0 0 0 0 0 0 64
65 1731 0 1382 0 0 0 0 1 0 0 0 0 0 0 65
66 1798 0 1731 0 0 0 0 0 1 0 0 0 0 0 66
67 1779 0 1798 0 0 0 0 0 0 1 0 0 0 0 67
68 1887 0 1779 0 0 0 0 0 0 0 1 0 0 0 68
69 2004 0 1887 0 0 0 0 0 0 0 0 1 0 0 69
70 2077 0 2004 0 0 0 0 0 0 0 0 0 1 0 70
71 2092 0 2077 0 0 0 0 0 0 0 0 0 0 1 71
72 2051 0 2092 0 0 0 0 0 0 0 0 0 0 0 72
73 1577 0 2051 1 0 0 0 0 0 0 0 0 0 0 73
74 1356 0 1577 0 1 0 0 0 0 0 0 0 0 0 74
75 1652 0 1356 0 0 1 0 0 0 0 0 0 0 0 75
76 1382 0 1652 0 0 0 1 0 0 0 0 0 0 0 76
77 1519 0 1382 0 0 0 0 1 0 0 0 0 0 0 77
78 1421 0 1519 0 0 0 0 0 1 0 0 0 0 0 78
79 1442 0 1421 0 0 0 0 0 0 1 0 0 0 0 79
80 1543 0 1442 0 0 0 0 0 0 0 1 0 0 0 80
81 1656 0 1543 0 0 0 0 0 0 0 0 1 0 0 81
82 1561 0 1656 0 0 0 0 0 0 0 0 0 1 0 82
83 1905 0 1561 0 0 0 0 0 0 0 0 0 0 1 83
84 2199 0 1905 0 0 0 0 0 0 0 0 0 0 0 84
85 1473 0 2199 1 0 0 0 0 0 0 0 0 0 0 85
86 1655 0 1473 0 1 0 0 0 0 0 0 0 0 0 86
87 1407 0 1655 0 0 1 0 0 0 0 0 0 0 0 87
88 1395 0 1407 0 0 0 1 0 0 0 0 0 0 0 88
89 1530 0 1395 0 0 0 0 1 0 0 0 0 0 0 89
90 1309 0 1530 0 0 0 0 0 1 0 0 0 0 0 90
91 1526 0 1309 0 0 0 0 0 0 1 0 0 0 0 91
92 1327 0 1526 0 0 0 0 0 0 0 1 0 0 0 92
93 1627 0 1327 0 0 0 0 0 0 0 0 1 0 0 93
94 1748 0 1627 0 0 0 0 0 0 0 0 0 1 0 94
95 1958 0 1748 0 0 0 0 0 0 0 0 0 0 1 95
96 2274 0 1958 0 0 0 0 0 0 0 0 0 0 0 96
97 1648 0 2274 1 0 0 0 0 0 0 0 0 0 0 97
98 1401 0 1648 0 1 0 0 0 0 0 0 0 0 0 98
99 1411 0 1401 0 0 1 0 0 0 0 0 0 0 0 99
100 1403 0 1411 0 0 0 1 0 0 0 0 0 0 0 100
101 1394 0 1403 0 0 0 0 1 0 0 0 0 0 0 101
102 1520 0 1394 0 0 0 0 0 1 0 0 0 0 0 102
103 1528 0 1520 0 0 0 0 0 0 1 0 0 0 0 103
104 1643 0 1528 0 0 0 0 0 0 0 1 0 0 0 104
105 1515 0 1643 0 0 0 0 0 0 0 0 1 0 0 105
106 1685 0 1515 0 0 0 0 0 0 0 0 0 1 0 106
107 2000 0 1685 0 0 0 0 0 0 0 0 0 0 1 107
108 2215 0 2000 0 0 0 0 0 0 0 0 0 0 0 108
109 1956 0 2215 1 0 0 0 0 0 0 0 0 0 0 109
110 1462 0 1956 0 1 0 0 0 0 0 0 0 0 0 110
111 1563 0 1462 0 0 1 0 0 0 0 0 0 0 0 111
112 1459 0 1563 0 0 0 1 0 0 0 0 0 0 0 112
113 1446 0 1459 0 0 0 0 1 0 0 0 0 0 0 113
114 1622 0 1446 0 0 0 0 0 1 0 0 0 0 0 114
115 1657 0 1622 0 0 0 0 0 0 1 0 0 0 0 115
116 1638 0 1657 0 0 0 0 0 0 0 1 0 0 0 116
117 1643 0 1638 0 0 0 0 0 0 0 0 1 0 0 117
118 1683 0 1643 0 0 0 0 0 0 0 0 0 1 0 118
119 2050 0 1683 0 0 0 0 0 0 0 0 0 0 1 119
120 2262 0 2050 0 0 0 0 0 0 0 0 0 0 0 120
121 1813 0 2262 1 0 0 0 0 0 0 0 0 0 0 121
122 1445 0 1813 0 1 0 0 0 0 0 0 0 0 0 122
123 1762 0 1445 0 0 1 0 0 0 0 0 0 0 0 123
124 1461 0 1762 0 0 0 1 0 0 0 0 0 0 0 124
125 1556 0 1461 0 0 0 0 1 0 0 0 0 0 0 125
126 1431 0 1556 0 0 0 0 0 1 0 0 0 0 0 126
127 1427 0 1431 0 0 0 0 0 0 1 0 0 0 0 127
128 1554 0 1427 0 0 0 0 0 0 0 1 0 0 0 128
129 1645 0 1554 0 0 0 0 0 0 0 0 1 0 0 129
130 1653 0 1645 0 0 0 0 0 0 0 0 0 1 0 130
131 2016 0 1653 0 0 0 0 0 0 0 0 0 0 1 131
132 2207 0 2016 0 0 0 0 0 0 0 0 0 0 0 132
133 1665 0 2207 1 0 0 0 0 0 0 0 0 0 0 133
134 1361 0 1665 0 1 0 0 0 0 0 0 0 0 0 134
135 1506 0 1361 0 0 1 0 0 0 0 0 0 0 0 135
136 1360 0 1506 0 0 0 1 0 0 0 0 0 0 0 136
137 1453 0 1360 0 0 0 0 1 0 0 0 0 0 0 137
138 1522 0 1453 0 0 0 0 0 1 0 0 0 0 0 138
139 1460 0 1522 0 0 0 0 0 0 1 0 0 0 0 139
140 1552 0 1460 0 0 0 0 0 0 0 1 0 0 0 140
141 1548 0 1552 0 0 0 0 0 0 0 0 1 0 0 141
142 1827 0 1548 0 0 0 0 0 0 0 0 0 1 0 142
143 1737 0 1827 0 0 0 0 0 0 0 0 0 0 1 143
144 1941 0 1737 0 0 0 0 0 0 0 0 0 0 0 144
145 1474 0 1941 1 0 0 0 0 0 0 0 0 0 0 145
146 1458 0 1474 0 1 0 0 0 0 0 0 0 0 0 146
147 1542 0 1458 0 0 1 0 0 0 0 0 0 0 0 147
148 1404 0 1542 0 0 0 1 0 0 0 0 0 0 0 148
149 1522 0 1404 0 0 0 0 1 0 0 0 0 0 0 149
150 1385 0 1522 0 0 0 0 0 1 0 0 0 0 0 150
151 1641 0 1385 0 0 0 0 0 0 1 0 0 0 0 151
152 1510 0 1641 0 0 0 0 0 0 0 1 0 0 0 152
153 1681 0 1510 0 0 0 0 0 0 0 0 1 0 0 153
154 1938 0 1681 0 0 0 0 0 0 0 0 0 1 0 154
155 1868 0 1938 0 0 0 0 0 0 0 0 0 0 1 155
156 1726 0 1868 0 0 0 0 0 0 0 0 0 0 0 156
157 1456 0 1726 1 0 0 0 0 0 0 0 0 0 0 157
158 1445 0 1456 0 1 0 0 0 0 0 0 0 0 0 158
159 1456 0 1445 0 0 1 0 0 0 0 0 0 0 0 159
160 1365 0 1456 0 0 0 1 0 0 0 0 0 0 0 160
161 1487 0 1365 0 0 0 0 1 0 0 0 0 0 0 161
162 1558 0 1487 0 0 0 0 0 1 0 0 0 0 0 162
163 1488 0 1558 0 0 0 0 0 0 1 0 0 0 0 163
164 1684 0 1488 0 0 0 0 0 0 0 1 0 0 0 164
165 1594 0 1684 0 0 0 0 0 0 0 0 1 0 0 165
166 1850 0 1594 0 0 0 0 0 0 0 0 0 1 0 166
167 1998 0 1850 0 0 0 0 0 0 0 0 0 0 1 167
168 2079 0 1998 0 0 0 0 0 0 0 0 0 0 0 168
169 1494 0 2079 1 0 0 0 0 0 0 0 0 0 0 169
170 1057 1 1494 0 1 0 0 0 0 0 0 0 0 0 170
171 1218 1 1057 0 0 1 0 0 0 0 0 0 0 0 171
172 1168 1 1218 0 0 0 1 0 0 0 0 0 0 0 172
173 1236 1 1168 0 0 0 0 1 0 0 0 0 0 0 173
174 1076 1 1236 0 0 0 0 0 1 0 0 0 0 0 174
175 1174 1 1076 0 0 0 0 0 0 1 0 0 0 0 175
176 1139 1 1174 0 0 0 0 0 0 0 1 0 0 0 176
177 1427 1 1139 0 0 0 0 0 0 0 0 1 0 0 177
178 1487 1 1427 0 0 0 0 0 0 0 0 0 1 0 178
179 1483 1 1487 0 0 0 0 0 0 0 0 0 0 1 179
180 1513 1 1483 0 0 0 0 0 0 0 0 0 0 0 180
181 1357 1 1513 1 0 0 0 0 0 0 0 0 0 0 181
182 1165 1 1357 0 1 0 0 0 0 0 0 0 0 0 182
183 1282 1 1165 0 0 1 0 0 0 0 0 0 0 0 183
184 1110 1 1282 0 0 0 1 0 0 0 0 0 0 0 184
185 1297 1 1110 0 0 0 0 1 0 0 0 0 0 0 185
186 1185 1 1297 0 0 0 0 0 1 0 0 0 0 0 186
187 1222 1 1185 0 0 0 0 0 0 1 0 0 0 0 187
188 1284 1 1222 0 0 0 0 0 0 0 1 0 0 0 188
189 1444 1 1284 0 0 0 0 0 0 0 0 1 0 0 189
190 1575 1 1444 0 0 0 0 0 0 0 0 0 1 0 190
191 1737 1 1575 0 0 0 0 0 0 0 0 0 0 1 191
192 1763 1 1737 0 0 0 0 0 0 0 0 0 0 0 192
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Belt A1 M1 M2 M3
1159.5428 -105.2144 0.5298 -501.8695 -467.0447 -309.6414
M4 M5 M6 M7 M8 M9
-448.7368 -250.5770 -378.1953 -272.1536 -296.4647 -250.6528
M10 M11 t
-138.3778 -11.7764 -0.8802
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-285.90 -89.40 0.35 86.31 387.49
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 1159.54281 144.76390 8.010 1.51e-13 ***
Belt -105.21442 37.58564 -2.799 0.005693 **
A1 0.52980 0.06342 8.354 1.91e-14 ***
M1 -501.86951 47.04203 -10.669 < 2e-16 ***
M2 -467.04473 49.96892 -9.347 < 2e-16 ***
M3 -309.64136 56.23447 -5.506 1.28e-07 ***
M4 -448.73680 54.36084 -8.255 3.49e-14 ***
M5 -250.57697 58.48815 -4.284 3.01e-05 ***
M6 -378.19534 53.42057 -7.080 3.32e-11 ***
M7 -272.15357 55.27050 -4.924 1.94e-06 ***
M8 -296.46471 52.65887 -5.630 7.01e-08 ***
M9 -250.65280 52.13892 -4.807 3.27e-06 ***
M10 -138.37779 50.55693 -2.737 0.006835 **
M11 -11.77638 47.40539 -0.248 0.804100
t -0.88023 0.23372 -3.766 0.000226 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 129.1 on 176 degrees of freedom
(1 observation deleted due to missingness)
Multiple R-squared: 0.8168, Adjusted R-squared: 0.8022
F-statistic: 56.05 on 14 and 176 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,] 0.54271876 0.9145624843 4.572812e-01
[2,] 0.37328770 0.7465754033 6.267123e-01
[3,] 0.24241353 0.4848270602 7.575865e-01
[4,] 0.29617851 0.5923570166 7.038215e-01
[5,] 0.21867850 0.4373570083 7.813215e-01
[6,] 0.21534629 0.4306925822 7.846537e-01
[7,] 0.17125835 0.3425166937 8.287417e-01
[8,] 0.28356543 0.5671308595 7.164346e-01
[9,] 0.25988387 0.5197677486 7.401161e-01
[10,] 0.19246265 0.3849252939 8.075374e-01
[11,] 0.13685996 0.2737199291 8.631400e-01
[12,] 0.09603431 0.1920686106 9.039657e-01
[13,] 0.07444008 0.1488801569 9.255599e-01
[14,] 0.05115691 0.1023138204 9.488431e-01
[15,] 0.10208973 0.2041794692 8.979103e-01
[16,] 0.07266492 0.1453298300 9.273351e-01
[17,] 0.06874605 0.1374921012 9.312539e-01
[18,] 0.13789845 0.2757968913 8.621016e-01
[19,] 0.13206758 0.2641351603 8.679324e-01
[20,] 0.10666313 0.2133262650 8.933369e-01
[21,] 0.07905444 0.1581088775 9.209456e-01
[22,] 0.07991224 0.1598244771 9.200878e-01
[23,] 0.09125888 0.1825177549 9.087411e-01
[24,] 0.07222791 0.1444558173 9.277721e-01
[25,] 0.05708654 0.1141730793 9.429135e-01
[26,] 0.14617019 0.2923403860 8.538298e-01
[27,] 0.11528226 0.2305645161 8.847177e-01
[28,] 0.09588543 0.1917708512 9.041146e-01
[29,] 0.08827278 0.1765455601 9.117272e-01
[30,] 0.13893859 0.2778771808 8.610614e-01
[31,] 0.11779974 0.2355994747 8.822003e-01
[32,] 0.11428346 0.2285669245 8.857165e-01
[33,] 0.17983355 0.3596670986 8.201665e-01
[34,] 0.29536319 0.5907263805 7.046368e-01
[35,] 0.27546023 0.5509204510 7.245398e-01
[36,] 0.24407406 0.4881481297 7.559259e-01
[37,] 0.25486716 0.5097343229 7.451328e-01
[38,] 0.23089433 0.4617886626 7.691057e-01
[39,] 0.30069142 0.6013828361 6.993086e-01
[40,] 0.26890774 0.5378154715 7.310923e-01
[41,] 0.51298463 0.9740307475 4.870154e-01
[42,] 0.76244494 0.4751101235 2.375551e-01
[43,] 0.92544703 0.1491059467 7.455297e-02
[44,] 0.92728373 0.1454325418 7.271627e-02
[45,] 0.91573817 0.1685236642 8.426183e-02
[46,] 0.92615640 0.1476872008 7.384360e-02
[47,] 0.92330726 0.1533854816 7.669274e-02
[48,] 0.93054986 0.1389002841 6.945014e-02
[49,] 0.93367991 0.1326401900 6.632009e-02
[50,] 0.94171365 0.1165726961 5.828635e-02
[51,] 0.95877736 0.0824452863 4.122264e-02
[52,] 0.96438301 0.0712339834 3.561699e-02
[53,] 0.97527484 0.0494503290 2.472516e-02
[54,] 0.97983632 0.0403273608 2.016368e-02
[55,] 0.98109035 0.0378192908 1.890965e-02
[56,] 0.98118251 0.0376349783 1.881749e-02
[57,] 0.98342959 0.0331408191 1.657041e-02
[58,] 0.98463662 0.0307267580 1.536338e-02
[59,] 0.98313029 0.0337394253 1.686971e-02
[60,] 0.98029247 0.0394150562 1.970753e-02
[61,] 0.98073724 0.0385255120 1.926276e-02
[62,] 0.97476249 0.0504750286 2.523751e-02
[63,] 0.96779419 0.0644116204 3.220581e-02
[64,] 0.98518439 0.0296312199 1.481561e-02
[65,] 0.98045714 0.0390857246 1.954286e-02
[66,] 0.98025700 0.0394860047 1.974300e-02
[67,] 0.99091426 0.0181714751 9.085738e-03
[68,] 0.99631717 0.0073656624 3.682831e-03
[69,] 0.99790063 0.0041987492 2.099375e-03
[70,] 0.99705362 0.0058927690 2.946385e-03
[71,] 0.99614761 0.0077047845 3.852392e-03
[72,] 0.99740421 0.0051915875 2.595794e-03
[73,] 0.99639493 0.0072101393 3.605070e-03
[74,] 0.99875928 0.0024814437 1.240722e-03
[75,] 0.99860140 0.0027972012 1.398601e-03
[76,] 0.99812453 0.0037509370 1.875468e-03
[77,] 0.99740555 0.0051888937 2.594447e-03
[78,] 0.99825144 0.0034971289 1.748564e-03
[79,] 0.99796558 0.0040688483 2.034424e-03
[80,] 0.99740045 0.0051990962 2.599548e-03
[81,] 0.99752006 0.0049598795 2.479940e-03
[82,] 0.99657785 0.0068443083 3.422154e-03
[83,] 0.99727366 0.0054526885 2.726344e-03
[84,] 0.99674784 0.0065043282 3.252164e-03
[85,] 0.99579675 0.0084064998 4.203250e-03
[86,] 0.99463845 0.0107230945 5.361547e-03
[87,] 0.99621994 0.0075601157 3.780058e-03
[88,] 0.99586338 0.0082732351 4.136618e-03
[89,] 0.99443657 0.0111268594 5.563430e-03
[90,] 0.99415781 0.0116843767 5.842188e-03
[91,] 0.99816216 0.0036756731 1.837837e-03
[92,] 0.99811548 0.0037690437 1.884522e-03
[93,] 0.99750740 0.0049852050 2.492602e-03
[94,] 0.99646350 0.0070730046 3.536502e-03
[95,] 0.99644824 0.0071035263 3.551763e-03
[96,] 0.99722302 0.0055539668 2.776983e-03
[97,] 0.99654086 0.0069182868 3.459143e-03
[98,] 0.99515608 0.0096878399 4.843920e-03
[99,] 0.99346486 0.0130702718 6.535136e-03
[100,] 0.99401903 0.0119619395 5.980970e-03
[101,] 0.99426200 0.0114760034 5.738002e-03
[102,] 0.99713326 0.0057334866 2.866743e-03
[103,] 0.99819342 0.0036131538 1.806577e-03
[104,] 0.99753460 0.0049308037 2.465402e-03
[105,] 0.99942963 0.0011407476 5.703738e-04
[106,] 0.99922552 0.0015489572 7.744786e-04
[107,] 0.99891321 0.0021735721 1.086786e-03
[108,] 0.99838793 0.0032241333 1.612067e-03
[109,] 0.99788867 0.0042226581 2.111329e-03
[110,] 0.99702814 0.0059437247 2.971862e-03
[111,] 0.99573040 0.0085392044 4.269602e-03
[112,] 0.99674661 0.0065067730 3.253387e-03
[113,] 0.99765061 0.0046987780 2.349389e-03
[114,] 0.99976328 0.0004734327 2.367163e-04
[115,] 0.99992801 0.0001439755 7.198775e-05
[116,] 0.99988127 0.0002374620 1.187310e-04
[117,] 0.99981826 0.0003634798 1.817399e-04
[118,] 0.99969780 0.0006044072 3.022036e-04
[119,] 0.99950575 0.0009885094 4.942547e-04
[120,] 0.99959787 0.0008042614 4.021307e-04
[121,] 0.99938121 0.0012375832 6.187916e-04
[122,] 0.99918517 0.0016296620 8.148310e-04
[123,] 0.99875801 0.0024839775 1.241989e-03
[124,] 0.99827586 0.0034482704 1.724135e-03
[125,] 0.99857298 0.0028540431 1.427022e-03
[126,] 0.99824204 0.0035159111 1.757956e-03
[127,] 0.99724840 0.0055032095 2.751605e-03
[128,] 0.99649140 0.0070171942 3.508597e-03
[129,] 0.99535639 0.0092872247 4.643612e-03
[130,] 0.99315517 0.0136896695 6.844835e-03
[131,] 0.98988692 0.0202261660 1.011308e-02
[132,] 0.98503465 0.0299306974 1.496535e-02
[133,] 0.99323980 0.0135203927 6.760196e-03
[134,] 0.98969979 0.0206004294 1.030021e-02
[135,] 0.98687360 0.0262528071 1.312640e-02
[136,] 0.99432337 0.0113532656 5.676633e-03
[137,] 0.99250179 0.0149964246 7.498212e-03
[138,] 0.99541723 0.0091655391 4.582770e-03
[139,] 0.99330794 0.0133841251 6.692063e-03
[140,] 0.98906558 0.0218688371 1.093442e-02
[141,] 0.98592165 0.0281566998 1.407835e-02
[142,] 0.98341321 0.0331735888 1.658679e-02
[143,] 0.98351449 0.0329710221 1.648551e-02
[144,] 0.97636596 0.0472680786 2.363404e-02
[145,] 0.96152005 0.0769598968 3.847995e-02
[146,] 0.96846582 0.0630683629 3.153418e-02
[147,] 0.96888676 0.0622264769 3.111324e-02
[148,] 0.94897510 0.1020497960 5.102490e-02
[149,] 0.92534860 0.1493028050 7.465140e-02
[150,] 0.98572881 0.0285423716 1.427119e-02
[151,] 0.97040739 0.0591852279 2.959261e-02
[152,] 0.95191337 0.0961732628 4.808663e-02
[153,] 0.91452378 0.1709524399 8.547622e-02
[154,] 0.93356688 0.1328662496 6.643312e-02
[155,] 0.85851086 0.2829782779 1.414891e-01
[156,] 0.72503898 0.5499220462 2.749610e-01
[157,] 0.58535222 0.8292955614 4.146478e-01
> postscript(file="/var/wessaorg/rcomp/tmp/1rypm1383550854.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)
Warning message:
In x[, 1] - mysum$resid :
longer object length is not a multiple of shorter object length
> grid()
> dev.off()
null device
1
> postscript(file="/var/wessaorg/rcomp/tmp/2hf0c1383550854.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/3bph21383550854.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/4axfo1383550854.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/5bmts1383550854.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 = 191
Frequency = 1
2 3 4 5 6 7
-76.5156196 -139.2039870 -120.6985092 -6.3421184 -129.7049076 -122.7602484
8 9 10 11 12 13
-51.9994348 -185.5471398 -195.9219444 138.1514402 -141.1165074 -32.2475463
14 15 16 17 18 19
156.6099772 -54.8006057 -48.3943772 -144.4352678 -79.9433196 129.0343280
20 21 22 23 24 25
-1.7682183 -125.0508796 95.4684120 50.6341072 151.7640093 81.4802009
26 27 28 29 30 31
-90.1125089 -9.9594478 39.8837050 61.6903290 34.7647482 9.8616087
32 33 34 35 36 37
140.0926190 -281.2432783 143.0115379 60.6737638 -118.9049566 293.5667231
38 39 40 41 42 43
6.9601361 82.7355952 -78.7855450 271.8625074 61.7312052 133.7354709
44 45 46 47 48 49
-176.4111208 13.8828869 53.3356333 243.7134204 266.7701229 76.3604471
50 51 52 53 54 55
203.5162868 -168.0132248 387.4861668 112.3385200 17.9893239 212.4904044
56 57 58 59 60 61
32.2509338 212.2995771 5.7786575 -79.8233078 -78.8519773 -135.0559317
62 63 64 65 66 67
13.1528600 -42.7409446 -92.6064143 147.0613176 157.6586013 -1.9997423
68 69 70 71 72 73
141.2578861 156.1074626 55.7257192 -93.6710929 -153.5142887 -103.0426090
74 75 76 77 78 79
-106.8604354 149.7029320 -137.1431425 -54.3758772 -96.4603137 -128.7011282
80 81 82 83 84 85
-13.6356281 0.9225708 -265.3399597 3.2701668 104.1217162 -274.8906782
86 87 88 89 90 91
257.8019034 -243.1454214 16.2214483 -39.7005136 -203.7253437 25.1996362
92 93 94 95 96 97
-263.5762921 96.9228686 -52.4128614 -32.2402275 161.6049515 -129.0631134
98 99 100 101 102 103
-78.3508525 -94.0126018 32.6650408 -169.3761340 89.8906976 -74.0260351
104 105 106 107 108 109
61.9269067 -171.9321393 -45.5120971 53.7001797 90.9160221 220.7580810
110 111 112 113 114 115
-169.9674347 36.2322079 18.6977587 -136.4823083 174.9037362 11.4968431
116 117 118 119 120 121
-0.8549016 -30.7203180 -104.7641022 115.3225914 121.9886671 63.4201356
122 123 124 125 126 127
-100.6427710 254.8016677 -74.1702741 -16.9791094 -63.8118112 -106.7479392
128 129 130 131 132 133
47.5626411 26.3459566 -125.2609034 107.7794929 95.5647813 -44.8778828
134 135 136 137 138 139
-95.6690912 53.8679423 -28.9778480 -55.9061803 92.3207243 -111.3972257
140 141 142 143 144 145
38.6419405 -59.0316317 110.6928129 -252.8434598 -12.0573188 -84.3874247
146 147 148 149 150 151
113.0861265 49.0398365 6.5120418 0.3452839 -70.6728917 152.7486188
152 153 154 155 156 157
-88.6896345 106.7829082 161.7917917 -170.0888104 -285.8987336 22.0830699
158 159 160 161 162 163
120.1853895 -19.5099165 23.6379228 -3.4295858 131.4330258 -81.3445306
164 165 166 167 168 169
176.9330613 -61.8400444 130.4474760 17.0966770 8.7896549 -116.3746566
170 171 172 173 174 175
-172.1699053 63.8309545 68.5083130 -34.2811271 -101.8091424 -24.2021582
176 177 178 179 180 181
-85.9315049 175.6799300 -28.2981616 -189.8075321 -168.5844669 162.2711852
182 183 184 185 186 187
18.9759392 81.1750135 -12.8362870 68.0102641 -14.5643327 -23.3879024
188 189 190 191 192
44.2007465 126.4212704 61.2579892 28.1325910 -42.5916760
> postscript(file="/var/wessaorg/rcomp/tmp/6sxxq1383550854.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 = 191
Frequency = 1
lag(myerror, k = 1) myerror
0 -76.5156196 NA
1 -139.2039870 -76.5156196
2 -120.6985092 -139.2039870
3 -6.3421184 -120.6985092
4 -129.7049076 -6.3421184
5 -122.7602484 -129.7049076
6 -51.9994348 -122.7602484
7 -185.5471398 -51.9994348
8 -195.9219444 -185.5471398
9 138.1514402 -195.9219444
10 -141.1165074 138.1514402
11 -32.2475463 -141.1165074
12 156.6099772 -32.2475463
13 -54.8006057 156.6099772
14 -48.3943772 -54.8006057
15 -144.4352678 -48.3943772
16 -79.9433196 -144.4352678
17 129.0343280 -79.9433196
18 -1.7682183 129.0343280
19 -125.0508796 -1.7682183
20 95.4684120 -125.0508796
21 50.6341072 95.4684120
22 151.7640093 50.6341072
23 81.4802009 151.7640093
24 -90.1125089 81.4802009
25 -9.9594478 -90.1125089
26 39.8837050 -9.9594478
27 61.6903290 39.8837050
28 34.7647482 61.6903290
29 9.8616087 34.7647482
30 140.0926190 9.8616087
31 -281.2432783 140.0926190
32 143.0115379 -281.2432783
33 60.6737638 143.0115379
34 -118.9049566 60.6737638
35 293.5667231 -118.9049566
36 6.9601361 293.5667231
37 82.7355952 6.9601361
38 -78.7855450 82.7355952
39 271.8625074 -78.7855450
40 61.7312052 271.8625074
41 133.7354709 61.7312052
42 -176.4111208 133.7354709
43 13.8828869 -176.4111208
44 53.3356333 13.8828869
45 243.7134204 53.3356333
46 266.7701229 243.7134204
47 76.3604471 266.7701229
48 203.5162868 76.3604471
49 -168.0132248 203.5162868
50 387.4861668 -168.0132248
51 112.3385200 387.4861668
52 17.9893239 112.3385200
53 212.4904044 17.9893239
54 32.2509338 212.4904044
55 212.2995771 32.2509338
56 5.7786575 212.2995771
57 -79.8233078 5.7786575
58 -78.8519773 -79.8233078
59 -135.0559317 -78.8519773
60 13.1528600 -135.0559317
61 -42.7409446 13.1528600
62 -92.6064143 -42.7409446
63 147.0613176 -92.6064143
64 157.6586013 147.0613176
65 -1.9997423 157.6586013
66 141.2578861 -1.9997423
67 156.1074626 141.2578861
68 55.7257192 156.1074626
69 -93.6710929 55.7257192
70 -153.5142887 -93.6710929
71 -103.0426090 -153.5142887
72 -106.8604354 -103.0426090
73 149.7029320 -106.8604354
74 -137.1431425 149.7029320
75 -54.3758772 -137.1431425
76 -96.4603137 -54.3758772
77 -128.7011282 -96.4603137
78 -13.6356281 -128.7011282
79 0.9225708 -13.6356281
80 -265.3399597 0.9225708
81 3.2701668 -265.3399597
82 104.1217162 3.2701668
83 -274.8906782 104.1217162
84 257.8019034 -274.8906782
85 -243.1454214 257.8019034
86 16.2214483 -243.1454214
87 -39.7005136 16.2214483
88 -203.7253437 -39.7005136
89 25.1996362 -203.7253437
90 -263.5762921 25.1996362
91 96.9228686 -263.5762921
92 -52.4128614 96.9228686
93 -32.2402275 -52.4128614
94 161.6049515 -32.2402275
95 -129.0631134 161.6049515
96 -78.3508525 -129.0631134
97 -94.0126018 -78.3508525
98 32.6650408 -94.0126018
99 -169.3761340 32.6650408
100 89.8906976 -169.3761340
101 -74.0260351 89.8906976
102 61.9269067 -74.0260351
103 -171.9321393 61.9269067
104 -45.5120971 -171.9321393
105 53.7001797 -45.5120971
106 90.9160221 53.7001797
107 220.7580810 90.9160221
108 -169.9674347 220.7580810
109 36.2322079 -169.9674347
110 18.6977587 36.2322079
111 -136.4823083 18.6977587
112 174.9037362 -136.4823083
113 11.4968431 174.9037362
114 -0.8549016 11.4968431
115 -30.7203180 -0.8549016
116 -104.7641022 -30.7203180
117 115.3225914 -104.7641022
118 121.9886671 115.3225914
119 63.4201356 121.9886671
120 -100.6427710 63.4201356
121 254.8016677 -100.6427710
122 -74.1702741 254.8016677
123 -16.9791094 -74.1702741
124 -63.8118112 -16.9791094
125 -106.7479392 -63.8118112
126 47.5626411 -106.7479392
127 26.3459566 47.5626411
128 -125.2609034 26.3459566
129 107.7794929 -125.2609034
130 95.5647813 107.7794929
131 -44.8778828 95.5647813
132 -95.6690912 -44.8778828
133 53.8679423 -95.6690912
134 -28.9778480 53.8679423
135 -55.9061803 -28.9778480
136 92.3207243 -55.9061803
137 -111.3972257 92.3207243
138 38.6419405 -111.3972257
139 -59.0316317 38.6419405
140 110.6928129 -59.0316317
141 -252.8434598 110.6928129
142 -12.0573188 -252.8434598
143 -84.3874247 -12.0573188
144 113.0861265 -84.3874247
145 49.0398365 113.0861265
146 6.5120418 49.0398365
147 0.3452839 6.5120418
148 -70.6728917 0.3452839
149 152.7486188 -70.6728917
150 -88.6896345 152.7486188
151 106.7829082 -88.6896345
152 161.7917917 106.7829082
153 -170.0888104 161.7917917
154 -285.8987336 -170.0888104
155 22.0830699 -285.8987336
156 120.1853895 22.0830699
157 -19.5099165 120.1853895
158 23.6379228 -19.5099165
159 -3.4295858 23.6379228
160 131.4330258 -3.4295858
161 -81.3445306 131.4330258
162 176.9330613 -81.3445306
163 -61.8400444 176.9330613
164 130.4474760 -61.8400444
165 17.0966770 130.4474760
166 8.7896549 17.0966770
167 -116.3746566 8.7896549
168 -172.1699053 -116.3746566
169 63.8309545 -172.1699053
170 68.5083130 63.8309545
171 -34.2811271 68.5083130
172 -101.8091424 -34.2811271
173 -24.2021582 -101.8091424
174 -85.9315049 -24.2021582
175 175.6799300 -85.9315049
176 -28.2981616 175.6799300
177 -189.8075321 -28.2981616
178 -168.5844669 -189.8075321
179 162.2711852 -168.5844669
180 18.9759392 162.2711852
181 81.1750135 18.9759392
182 -12.8362870 81.1750135
183 68.0102641 -12.8362870
184 -14.5643327 68.0102641
185 -23.3879024 -14.5643327
186 44.2007465 -23.3879024
187 126.4212704 44.2007465
188 61.2579892 126.4212704
189 28.1325910 61.2579892
190 -42.5916760 28.1325910
191 NA -42.5916760
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -139.2039870 -76.5156196
[2,] -120.6985092 -139.2039870
[3,] -6.3421184 -120.6985092
[4,] -129.7049076 -6.3421184
[5,] -122.7602484 -129.7049076
[6,] -51.9994348 -122.7602484
[7,] -185.5471398 -51.9994348
[8,] -195.9219444 -185.5471398
[9,] 138.1514402 -195.9219444
[10,] -141.1165074 138.1514402
[11,] -32.2475463 -141.1165074
[12,] 156.6099772 -32.2475463
[13,] -54.8006057 156.6099772
[14,] -48.3943772 -54.8006057
[15,] -144.4352678 -48.3943772
[16,] -79.9433196 -144.4352678
[17,] 129.0343280 -79.9433196
[18,] -1.7682183 129.0343280
[19,] -125.0508796 -1.7682183
[20,] 95.4684120 -125.0508796
[21,] 50.6341072 95.4684120
[22,] 151.7640093 50.6341072
[23,] 81.4802009 151.7640093
[24,] -90.1125089 81.4802009
[25,] -9.9594478 -90.1125089
[26,] 39.8837050 -9.9594478
[27,] 61.6903290 39.8837050
[28,] 34.7647482 61.6903290
[29,] 9.8616087 34.7647482
[30,] 140.0926190 9.8616087
[31,] -281.2432783 140.0926190
[32,] 143.0115379 -281.2432783
[33,] 60.6737638 143.0115379
[34,] -118.9049566 60.6737638
[35,] 293.5667231 -118.9049566
[36,] 6.9601361 293.5667231
[37,] 82.7355952 6.9601361
[38,] -78.7855450 82.7355952
[39,] 271.8625074 -78.7855450
[40,] 61.7312052 271.8625074
[41,] 133.7354709 61.7312052
[42,] -176.4111208 133.7354709
[43,] 13.8828869 -176.4111208
[44,] 53.3356333 13.8828869
[45,] 243.7134204 53.3356333
[46,] 266.7701229 243.7134204
[47,] 76.3604471 266.7701229
[48,] 203.5162868 76.3604471
[49,] -168.0132248 203.5162868
[50,] 387.4861668 -168.0132248
[51,] 112.3385200 387.4861668
[52,] 17.9893239 112.3385200
[53,] 212.4904044 17.9893239
[54,] 32.2509338 212.4904044
[55,] 212.2995771 32.2509338
[56,] 5.7786575 212.2995771
[57,] -79.8233078 5.7786575
[58,] -78.8519773 -79.8233078
[59,] -135.0559317 -78.8519773
[60,] 13.1528600 -135.0559317
[61,] -42.7409446 13.1528600
[62,] -92.6064143 -42.7409446
[63,] 147.0613176 -92.6064143
[64,] 157.6586013 147.0613176
[65,] -1.9997423 157.6586013
[66,] 141.2578861 -1.9997423
[67,] 156.1074626 141.2578861
[68,] 55.7257192 156.1074626
[69,] -93.6710929 55.7257192
[70,] -153.5142887 -93.6710929
[71,] -103.0426090 -153.5142887
[72,] -106.8604354 -103.0426090
[73,] 149.7029320 -106.8604354
[74,] -137.1431425 149.7029320
[75,] -54.3758772 -137.1431425
[76,] -96.4603137 -54.3758772
[77,] -128.7011282 -96.4603137
[78,] -13.6356281 -128.7011282
[79,] 0.9225708 -13.6356281
[80,] -265.3399597 0.9225708
[81,] 3.2701668 -265.3399597
[82,] 104.1217162 3.2701668
[83,] -274.8906782 104.1217162
[84,] 257.8019034 -274.8906782
[85,] -243.1454214 257.8019034
[86,] 16.2214483 -243.1454214
[87,] -39.7005136 16.2214483
[88,] -203.7253437 -39.7005136
[89,] 25.1996362 -203.7253437
[90,] -263.5762921 25.1996362
[91,] 96.9228686 -263.5762921
[92,] -52.4128614 96.9228686
[93,] -32.2402275 -52.4128614
[94,] 161.6049515 -32.2402275
[95,] -129.0631134 161.6049515
[96,] -78.3508525 -129.0631134
[97,] -94.0126018 -78.3508525
[98,] 32.6650408 -94.0126018
[99,] -169.3761340 32.6650408
[100,] 89.8906976 -169.3761340
[101,] -74.0260351 89.8906976
[102,] 61.9269067 -74.0260351
[103,] -171.9321393 61.9269067
[104,] -45.5120971 -171.9321393
[105,] 53.7001797 -45.5120971
[106,] 90.9160221 53.7001797
[107,] 220.7580810 90.9160221
[108,] -169.9674347 220.7580810
[109,] 36.2322079 -169.9674347
[110,] 18.6977587 36.2322079
[111,] -136.4823083 18.6977587
[112,] 174.9037362 -136.4823083
[113,] 11.4968431 174.9037362
[114,] -0.8549016 11.4968431
[115,] -30.7203180 -0.8549016
[116,] -104.7641022 -30.7203180
[117,] 115.3225914 -104.7641022
[118,] 121.9886671 115.3225914
[119,] 63.4201356 121.9886671
[120,] -100.6427710 63.4201356
[121,] 254.8016677 -100.6427710
[122,] -74.1702741 254.8016677
[123,] -16.9791094 -74.1702741
[124,] -63.8118112 -16.9791094
[125,] -106.7479392 -63.8118112
[126,] 47.5626411 -106.7479392
[127,] 26.3459566 47.5626411
[128,] -125.2609034 26.3459566
[129,] 107.7794929 -125.2609034
[130,] 95.5647813 107.7794929
[131,] -44.8778828 95.5647813
[132,] -95.6690912 -44.8778828
[133,] 53.8679423 -95.6690912
[134,] -28.9778480 53.8679423
[135,] -55.9061803 -28.9778480
[136,] 92.3207243 -55.9061803
[137,] -111.3972257 92.3207243
[138,] 38.6419405 -111.3972257
[139,] -59.0316317 38.6419405
[140,] 110.6928129 -59.0316317
[141,] -252.8434598 110.6928129
[142,] -12.0573188 -252.8434598
[143,] -84.3874247 -12.0573188
[144,] 113.0861265 -84.3874247
[145,] 49.0398365 113.0861265
[146,] 6.5120418 49.0398365
[147,] 0.3452839 6.5120418
[148,] -70.6728917 0.3452839
[149,] 152.7486188 -70.6728917
[150,] -88.6896345 152.7486188
[151,] 106.7829082 -88.6896345
[152,] 161.7917917 106.7829082
[153,] -170.0888104 161.7917917
[154,] -285.8987336 -170.0888104
[155,] 22.0830699 -285.8987336
[156,] 120.1853895 22.0830699
[157,] -19.5099165 120.1853895
[158,] 23.6379228 -19.5099165
[159,] -3.4295858 23.6379228
[160,] 131.4330258 -3.4295858
[161,] -81.3445306 131.4330258
[162,] 176.9330613 -81.3445306
[163,] -61.8400444 176.9330613
[164,] 130.4474760 -61.8400444
[165,] 17.0966770 130.4474760
[166,] 8.7896549 17.0966770
[167,] -116.3746566 8.7896549
[168,] -172.1699053 -116.3746566
[169,] 63.8309545 -172.1699053
[170,] 68.5083130 63.8309545
[171,] -34.2811271 68.5083130
[172,] -101.8091424 -34.2811271
[173,] -24.2021582 -101.8091424
[174,] -85.9315049 -24.2021582
[175,] 175.6799300 -85.9315049
[176,] -28.2981616 175.6799300
[177,] -189.8075321 -28.2981616
[178,] -168.5844669 -189.8075321
[179,] 162.2711852 -168.5844669
[180,] 18.9759392 162.2711852
[181,] 81.1750135 18.9759392
[182,] -12.8362870 81.1750135
[183,] 68.0102641 -12.8362870
[184,] -14.5643327 68.0102641
[185,] -23.3879024 -14.5643327
[186,] 44.2007465 -23.3879024
[187,] 126.4212704 44.2007465
[188,] 61.2579892 126.4212704
[189,] 28.1325910 61.2579892
[190,] -42.5916760 28.1325910
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -139.2039870 -76.5156196
2 -120.6985092 -139.2039870
3 -6.3421184 -120.6985092
4 -129.7049076 -6.3421184
5 -122.7602484 -129.7049076
6 -51.9994348 -122.7602484
7 -185.5471398 -51.9994348
8 -195.9219444 -185.5471398
9 138.1514402 -195.9219444
10 -141.1165074 138.1514402
11 -32.2475463 -141.1165074
12 156.6099772 -32.2475463
13 -54.8006057 156.6099772
14 -48.3943772 -54.8006057
15 -144.4352678 -48.3943772
16 -79.9433196 -144.4352678
17 129.0343280 -79.9433196
18 -1.7682183 129.0343280
19 -125.0508796 -1.7682183
20 95.4684120 -125.0508796
21 50.6341072 95.4684120
22 151.7640093 50.6341072
23 81.4802009 151.7640093
24 -90.1125089 81.4802009
25 -9.9594478 -90.1125089
26 39.8837050 -9.9594478
27 61.6903290 39.8837050
28 34.7647482 61.6903290
29 9.8616087 34.7647482
30 140.0926190 9.8616087
31 -281.2432783 140.0926190
32 143.0115379 -281.2432783
33 60.6737638 143.0115379
34 -118.9049566 60.6737638
35 293.5667231 -118.9049566
36 6.9601361 293.5667231
37 82.7355952 6.9601361
38 -78.7855450 82.7355952
39 271.8625074 -78.7855450
40 61.7312052 271.8625074
41 133.7354709 61.7312052
42 -176.4111208 133.7354709
43 13.8828869 -176.4111208
44 53.3356333 13.8828869
45 243.7134204 53.3356333
46 266.7701229 243.7134204
47 76.3604471 266.7701229
48 203.5162868 76.3604471
49 -168.0132248 203.5162868
50 387.4861668 -168.0132248
51 112.3385200 387.4861668
52 17.9893239 112.3385200
53 212.4904044 17.9893239
54 32.2509338 212.4904044
55 212.2995771 32.2509338
56 5.7786575 212.2995771
57 -79.8233078 5.7786575
58 -78.8519773 -79.8233078
59 -135.0559317 -78.8519773
60 13.1528600 -135.0559317
61 -42.7409446 13.1528600
62 -92.6064143 -42.7409446
63 147.0613176 -92.6064143
64 157.6586013 147.0613176
65 -1.9997423 157.6586013
66 141.2578861 -1.9997423
67 156.1074626 141.2578861
68 55.7257192 156.1074626
69 -93.6710929 55.7257192
70 -153.5142887 -93.6710929
71 -103.0426090 -153.5142887
72 -106.8604354 -103.0426090
73 149.7029320 -106.8604354
74 -137.1431425 149.7029320
75 -54.3758772 -137.1431425
76 -96.4603137 -54.3758772
77 -128.7011282 -96.4603137
78 -13.6356281 -128.7011282
79 0.9225708 -13.6356281
80 -265.3399597 0.9225708
81 3.2701668 -265.3399597
82 104.1217162 3.2701668
83 -274.8906782 104.1217162
84 257.8019034 -274.8906782
85 -243.1454214 257.8019034
86 16.2214483 -243.1454214
87 -39.7005136 16.2214483
88 -203.7253437 -39.7005136
89 25.1996362 -203.7253437
90 -263.5762921 25.1996362
91 96.9228686 -263.5762921
92 -52.4128614 96.9228686
93 -32.2402275 -52.4128614
94 161.6049515 -32.2402275
95 -129.0631134 161.6049515
96 -78.3508525 -129.0631134
97 -94.0126018 -78.3508525
98 32.6650408 -94.0126018
99 -169.3761340 32.6650408
100 89.8906976 -169.3761340
101 -74.0260351 89.8906976
102 61.9269067 -74.0260351
103 -171.9321393 61.9269067
104 -45.5120971 -171.9321393
105 53.7001797 -45.5120971
106 90.9160221 53.7001797
107 220.7580810 90.9160221
108 -169.9674347 220.7580810
109 36.2322079 -169.9674347
110 18.6977587 36.2322079
111 -136.4823083 18.6977587
112 174.9037362 -136.4823083
113 11.4968431 174.9037362
114 -0.8549016 11.4968431
115 -30.7203180 -0.8549016
116 -104.7641022 -30.7203180
117 115.3225914 -104.7641022
118 121.9886671 115.3225914
119 63.4201356 121.9886671
120 -100.6427710 63.4201356
121 254.8016677 -100.6427710
122 -74.1702741 254.8016677
123 -16.9791094 -74.1702741
124 -63.8118112 -16.9791094
125 -106.7479392 -63.8118112
126 47.5626411 -106.7479392
127 26.3459566 47.5626411
128 -125.2609034 26.3459566
129 107.7794929 -125.2609034
130 95.5647813 107.7794929
131 -44.8778828 95.5647813
132 -95.6690912 -44.8778828
133 53.8679423 -95.6690912
134 -28.9778480 53.8679423
135 -55.9061803 -28.9778480
136 92.3207243 -55.9061803
137 -111.3972257 92.3207243
138 38.6419405 -111.3972257
139 -59.0316317 38.6419405
140 110.6928129 -59.0316317
141 -252.8434598 110.6928129
142 -12.0573188 -252.8434598
143 -84.3874247 -12.0573188
144 113.0861265 -84.3874247
145 49.0398365 113.0861265
146 6.5120418 49.0398365
147 0.3452839 6.5120418
148 -70.6728917 0.3452839
149 152.7486188 -70.6728917
150 -88.6896345 152.7486188
151 106.7829082 -88.6896345
152 161.7917917 106.7829082
153 -170.0888104 161.7917917
154 -285.8987336 -170.0888104
155 22.0830699 -285.8987336
156 120.1853895 22.0830699
157 -19.5099165 120.1853895
158 23.6379228 -19.5099165
159 -3.4295858 23.6379228
160 131.4330258 -3.4295858
161 -81.3445306 131.4330258
162 176.9330613 -81.3445306
163 -61.8400444 176.9330613
164 130.4474760 -61.8400444
165 17.0966770 130.4474760
166 8.7896549 17.0966770
167 -116.3746566 8.7896549
168 -172.1699053 -116.3746566
169 63.8309545 -172.1699053
170 68.5083130 63.8309545
171 -34.2811271 68.5083130
172 -101.8091424 -34.2811271
173 -24.2021582 -101.8091424
174 -85.9315049 -24.2021582
175 175.6799300 -85.9315049
176 -28.2981616 175.6799300
177 -189.8075321 -28.2981616
178 -168.5844669 -189.8075321
179 162.2711852 -168.5844669
180 18.9759392 162.2711852
181 81.1750135 18.9759392
182 -12.8362870 81.1750135
183 68.0102641 -12.8362870
184 -14.5643327 68.0102641
185 -23.3879024 -14.5643327
186 44.2007465 -23.3879024
187 126.4212704 44.2007465
188 61.2579892 126.4212704
189 28.1325910 61.2579892
190 -42.5916760 28.1325910
> 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/7p0pj1383550854.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/8bvz61383550854.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/9jgrf1383550854.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/10wbaf1383550854.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.end(a)
> table.save(a,file="/var/wessaorg/rcomp/tmp/11ky6a1383550854.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,signif(mysum$coefficients[i,1],6))
+ a<-table.element(a, signif(mysum$coefficients[i,2],6))
+ a<-table.element(a, signif(mysum$coefficients[i,3],4))
+ a<-table.element(a, signif(mysum$coefficients[i,4],6))
+ a<-table.element(a, signif(mysum$coefficients[i,4]/2,6))
+ a<-table.row.end(a)
+ }
> a<-table.end(a)
> table.save(a,file="/var/wessaorg/rcomp/tmp/12rgy91383550854.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, signif(sqrt(mysum$r.squared),6))
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'R-squared',1,TRUE)
> a<-table.element(a, signif(mysum$r.squared,6))
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Adjusted R-squared',1,TRUE)
> a<-table.element(a, signif(mysum$adj.r.squared,6))
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'F-TEST (value)',1,TRUE)
> a<-table.element(a, signif(mysum$fstatistic[1],6))
> 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, signif(1-pf(mysum$fstatistic[1],mysum$fstatistic[2],mysum$fstatistic[3]),6))
> 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, signif(mysum$sigma,6))
> a<-table.row.end(a)
> a<-table.row.start(a)
> a<-table.element(a, 'Sum Squared Residuals',1,TRUE)
> a<-table.element(a, signif(sum(myerror*myerror),6))
> a<-table.row.end(a)
> a<-table.end(a)
> table.save(a,file="/var/wessaorg/rcomp/tmp/13j63s1383550854.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,signif(x[i],6))
+ a<-table.element(a,signif(x[i]-mysum$resid[i],6))
+ a<-table.element(a,signif(mysum$resid[i],6))
+ a<-table.row.end(a)
+ }
> a<-table.end(a)
> table.save(a,file="/var/wessaorg/rcomp/tmp/14efwa1383550854.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,signif(gqarr[mypoint-kp3+1,1],6))
+ a<-table.element(a,signif(gqarr[mypoint-kp3+1,2],6))
+ a<-table.element(a,signif(gqarr[mypoint-kp3+1,3],6))
+ a<-table.row.end(a)
+ }
+ a<-table.end(a)
+ table.save(a,file="/var/wessaorg/rcomp/tmp/153yet1383550854.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,signif(numsignificant1/numgqtests,6))
+ 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/16g3h61383550854.tab")
+ }
>
> try(system("convert tmp/1rypm1383550854.ps tmp/1rypm1383550854.png",intern=TRUE))
character(0)
> try(system("convert tmp/2hf0c1383550854.ps tmp/2hf0c1383550854.png",intern=TRUE))
character(0)
> try(system("convert tmp/3bph21383550854.ps tmp/3bph21383550854.png",intern=TRUE))
character(0)
> try(system("convert tmp/4axfo1383550854.ps tmp/4axfo1383550854.png",intern=TRUE))
character(0)
> try(system("convert tmp/5bmts1383550854.ps tmp/5bmts1383550854.png",intern=TRUE))
character(0)
> try(system("convert tmp/6sxxq1383550854.ps tmp/6sxxq1383550854.png",intern=TRUE))
character(0)
> try(system("convert tmp/7p0pj1383550854.ps tmp/7p0pj1383550854.png",intern=TRUE))
character(0)
> try(system("convert tmp/8bvz61383550854.ps tmp/8bvz61383550854.png",intern=TRUE))
character(0)
> try(system("convert tmp/9jgrf1383550854.ps tmp/9jgrf1383550854.png",intern=TRUE))
character(0)
> try(system("convert tmp/10wbaf1383550854.ps tmp/10wbaf1383550854.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
14.145 2.374 16.527