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(41
+ ,38
+ ,12
+ ,14
+ ,12
+ ,39
+ ,32
+ ,11
+ ,18
+ ,11
+ ,30
+ ,35
+ ,15
+ ,11
+ ,14
+ ,31
+ ,33
+ ,6
+ ,12
+ ,12
+ ,34
+ ,37
+ ,13
+ ,16
+ ,21
+ ,35
+ ,29
+ ,10
+ ,18
+ ,12
+ ,39
+ ,31
+ ,12
+ ,14
+ ,22
+ ,34
+ ,36
+ ,14
+ ,14
+ ,11
+ ,36
+ ,35
+ ,12
+ ,15
+ ,10
+ ,37
+ ,38
+ ,6
+ ,15
+ ,13
+ ,38
+ ,31
+ ,10
+ ,17
+ ,10
+ ,36
+ ,34
+ ,12
+ ,19
+ ,8
+ ,38
+ ,35
+ ,12
+ ,10
+ ,15
+ ,39
+ ,38
+ ,11
+ ,16
+ ,14
+ ,33
+ ,37
+ ,15
+ ,18
+ ,10
+ ,32
+ ,33
+ ,12
+ ,14
+ ,14
+ ,36
+ ,32
+ ,10
+ ,14
+ ,14
+ ,38
+ ,38
+ ,12
+ ,17
+ ,11
+ ,39
+ ,38
+ ,11
+ ,14
+ ,10
+ ,32
+ ,32
+ ,12
+ ,16
+ ,13
+ ,32
+ ,33
+ ,11
+ ,18
+ ,7
+ ,31
+ ,31
+ ,12
+ ,11
+ ,14
+ ,39
+ ,38
+ ,13
+ ,14
+ ,12
+ ,37
+ ,39
+ ,11
+ ,12
+ ,14
+ ,39
+ ,32
+ ,9
+ ,17
+ ,11
+ ,41
+ ,32
+ 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+ ,dim=c(5
+ ,162)
+ ,dimnames=list(c('connected'
+ ,'separate'
+ ,'software'
+ ,'happiness'
+ ,'depression
')
+ ,1:162))
> y <- array(NA,dim=c(5,162),dimnames=list(c('connected','separate','software','happiness','depression
'),1:162))
> for (i in 1:dim(x)[1])
+ {
+ for (j in 1:dim(x)[2])
+ {
+ y[i,j] <- as.numeric(x[i,j])
+ }
+ }
> par3 = 'No Linear Trend'
> par2 = 'Do not include Seasonal Dummies'
> par1 = '5'
> #'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\r connected separate software happiness
1 12 41 38 12 14
2 11 39 32 11 18
3 14 30 35 15 11
4 12 31 33 6 12
5 21 34 37 13 16
6 12 35 29 10 18
7 22 39 31 12 14
8 11 34 36 14 14
9 10 36 35 12 15
10 13 37 38 6 15
11 10 38 31 10 17
12 8 36 34 12 19
13 15 38 35 12 10
14 14 39 38 11 16
15 10 33 37 15 18
16 14 32 33 12 14
17 14 36 32 10 14
18 11 38 38 12 17
19 10 39 38 11 14
20 13 32 32 12 16
21 7 32 33 11 18
22 14 31 31 12 11
23 12 39 38 13 14
24 14 37 39 11 12
25 11 39 32 9 17
26 9 41 32 13 9
27 11 36 35 10 16
28 15 33 37 14 14
29 14 33 33 12 15
30 13 34 33 10 11
31 9 31 28 12 16
32 15 27 32 8 13
33 10 37 31 10 17
34 11 34 37 12 15
35 13 34 30 12 14
36 8 32 33 7 16
37 20 29 31 6 9
38 12 36 33 12 15
39 10 29 31 10 17
40 10 35 33 10 13
41 9 37 32 10 15
42 14 34 33 12 16
43 8 38 32 15 16
44 14 35 33 10 12
45 11 38 28 10 12
46 13 37 35 12 11
47 9 38 39 13 15
48 11 33 34 11 15
49 15 36 38 11 17
50 11 38 32 12 13
51 10 32 38 14 16
52 14 32 30 10 14
53 18 32 33 12 11
54 14 34 38 13 12
55 11 32 32 5 12
56 12 37 32 6 15
57 13 39 34 12 16
58 9 29 34 12 15
59 10 37 36 11 12
60 15 35 34 10 12
61 20 30 28 7 8
62 12 38 34 12 13
63 12 34 35 14 11
64 14 31 35 11 14
65 13 34 31 12 15
66 11 35 37 13 10
67 17 36 35 14 11
68 12 30 27 11 12
69 13 39 40 12 15
70 14 35 37 12 15
71 13 38 36 8 14
72 15 31 38 11 16
73 13 34 39 14 15
74 10 38 41 14 15
75 11 34 27 12 13
76 19 39 30 9 12
77 13 37 37 13 17
78 17 34 31 11 13
79 13 28 31 12 15
80 9 37 27 12 13
81 11 33 36 12 15
82 10 37 38 12 16
83 9 35 37 12 15
84 12 37 33 12 16
85 12 32 34 11 15
86 13 33 31 10 14
87 13 38 39 9 15
88 12 33 34 12 14
89 15 29 32 12 13
90 22 33 33 12 7
91 13 31 36 9 17
92 15 36 32 15 13
93 13 35 41 12 15
94 15 32 28 12 14
95 10 29 30 12 13
96 11 39 36 10 16
97 16 37 35 13 12
98 11 35 31 9 14
99 11 37 34 12 17
100 10 32 36 10 15
101 10 38 36 14 17
102 16 37 35 11 12
103 12 36 37 15 16
104 11 32 28 11 11
105 16 33 39 11 15
106 19 40 32 12 9
107 11 38 35 12 16
108 16 41 39 12 15
109 15 36 35 11 10
110 24 43 42 7 10
111 14 30 34 12 15
112 15 31 33 14 11
113 11 32 41 11 13
114 15 32 33 11 14
115 12 37 34 10 18
116 10 37 32 13 16
117 14 33 40 13 14
118 13 34 40 8 14
119 9 33 35 11 14
120 15 38 36 12 14
121 15 33 37 11 12
122 14 31 27 13 14
123 11 38 39 12 15
124 8 37 38 14 15
125 11 33 31 13 15
126 11 31 33 15 13
127 8 39 32 10 17
128 10 44 39 11 17
129 11 33 36 9 19
130 13 35 33 11 15
131 11 32 33 10 13
132 20 28 32 11 9
133 10 40 37 8 15
134 15 27 30 11 15
135 12 37 38 12 15
136 14 32 29 12 16
137 23 28 22 9 11
138 14 34 35 11 14
139 16 30 35 10 11
140 11 35 34 8 15
141 12 31 35 9 13
142 10 32 34 8 15
143 14 30 34 9 16
144 12 30 35 15 14
145 12 31 23 11 15
146 11 40 31 8 16
147 12 32 27 13 16
148 13 36 36 12 11
149 11 32 31 12 12
150 19 35 32 9 9
151 12 38 39 7 16
152 17 42 37 13 13
153 9 34 38 9 16
154 12 35 39 6 12
155 19 35 34 8 9
156 18 33 31 8 13
157 15 36 32 15 13
158 14 32 37 6 14
159 11 33 36 9 19
160 9 34 32 11 13
161 18 32 35 8 12
162 16 34 36 8 13
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) connected separate software happiness
25.34476 -0.04544 0.02503 -0.13928 -0.72418
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-6.9545 -1.9551 -0.0853 1.8025 9.6715
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 25.34476 2.79660 9.063 4.84e-16 ***
connected -0.04544 0.06735 -0.675 0.501
separate 0.02503 0.06412 0.390 0.697
software -0.13928 0.09868 -1.411 0.160
happiness -0.72418 0.09162 -7.904 4.46e-13 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 2.668 on 157 degrees of freedom
Multiple R-squared: 0.3073, Adjusted R-squared: 0.2897
F-statistic: 17.41 on 4 and 157 DF, p-value: 7.616e-12
> 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.99981613 0.0003677454 0.0001838727
[2,] 0.99980608 0.0003878472 0.0001939236
[3,] 0.99958839 0.0008232261 0.0004116130
[4,] 0.99948694 0.0010261294 0.0005130647
[5,] 0.99938624 0.0012275191 0.0006137595
[6,] 0.99888992 0.0022201698 0.0011100849
[7,] 0.99812531 0.0037493845 0.0018746922
[8,] 0.99675061 0.0064987808 0.0032493904
[9,] 0.99440725 0.0111854981 0.0055927490
[10,] 0.99052891 0.0189421839 0.0094710920
[11,] 0.98505840 0.0298832043 0.0149416022
[12,] 0.98586142 0.0282771596 0.0141385798
[13,] 0.97871337 0.0425732641 0.0212866320
[14,] 0.98119134 0.0376173173 0.0188086586
[15,] 0.97349547 0.0530090548 0.0265045274
[16,] 0.96453748 0.0709250497 0.0354625249
[17,] 0.94973968 0.1005206327 0.0502603164
[18,] 0.93265654 0.1346869253 0.0673434627
[19,] 0.98815310 0.0236937968 0.0118468984
[20,] 0.98297117 0.0340576663 0.0170288331
[21,] 0.97941389 0.0411722212 0.0205861106
[22,] 0.97347240 0.0530552100 0.0265276050
[23,] 0.96579871 0.0684025791 0.0342012896
[24,] 0.96533228 0.0693354468 0.0346677234
[25,] 0.95688495 0.0862300982 0.0431150491
[26,] 0.94404866 0.1119026789 0.0559513394
[27,] 0.93204538 0.1359092437 0.0679546219
[28,] 0.91214983 0.1757003462 0.0878501731
[29,] 0.92771841 0.1445631746 0.0722815873
[30,] 0.95075953 0.0984809481 0.0492404740
[31,] 0.93532426 0.1293514890 0.0646757445
[32,] 0.92140417 0.1571916667 0.0785958334
[33,] 0.93029042 0.1394191581 0.0697095791
[34,] 0.93192139 0.1361572141 0.0680786070
[35,] 0.92806954 0.1438609274 0.0719304637
[36,] 0.92995830 0.1400833974 0.0700416987
[37,] 0.91176580 0.1764683988 0.0882341994
[38,] 0.90762734 0.1847453173 0.0923726586
[39,] 0.89200825 0.2159834910 0.1079917455
[40,] 0.89743880 0.2051223986 0.1025611993
[41,] 0.87870860 0.2425828012 0.1212914006
[42,] 0.90268774 0.1946245133 0.0973122567
[43,] 0.89161751 0.2167649757 0.1083824878
[44,] 0.87978885 0.2404223069 0.1202111534
[45,] 0.85931395 0.2813721038 0.1406860519
[46,] 0.87287401 0.2542519804 0.1271259902
[47,] 0.84581948 0.3083610330 0.1541805165
[48,] 0.87329820 0.2534036051 0.1267018026
[49,] 0.85100911 0.2979817776 0.1489908888
[50,] 0.83666949 0.3266610126 0.1633305063
[51,] 0.85524479 0.2895104242 0.1447552121
[52,] 0.88685044 0.2262991216 0.1131495608
[53,] 0.86777409 0.2644518146 0.1322259073
[54,] 0.87683333 0.2463333308 0.1231666654
[55,] 0.85751235 0.2849752983 0.1424876492
[56,] 0.85558357 0.2888328625 0.1444164313
[57,] 0.83060705 0.3387859071 0.1693929536
[58,] 0.80378050 0.3924389940 0.1962194970
[59,] 0.85642112 0.2871577674 0.1435788837
[60,] 0.85627061 0.2874587743 0.1437293871
[61,] 0.85262704 0.2947459298 0.1473729649
[62,] 0.82885901 0.3422819791 0.1711409895
[63,] 0.81354793 0.3729041342 0.1864520671
[64,] 0.78336739 0.4332652273 0.2166326136
[65,] 0.79914685 0.4017063070 0.2008531535
[66,] 0.77168253 0.4566349473 0.2283174737
[67,] 0.75316690 0.4936661935 0.2468330967
[68,] 0.74913489 0.5017302116 0.2508651058
[69,] 0.82538989 0.3492202170 0.1746101085
[70,] 0.82474070 0.3505186009 0.1752593005
[71,] 0.84262267 0.3147546693 0.1573773346
[72,] 0.81615766 0.3676846736 0.1838423368
[73,] 0.87084700 0.2583060028 0.1291530014
[74,] 0.85012027 0.2997594504 0.1498797252
[75,] 0.82911384 0.3417723219 0.1708861610
[76,] 0.83994484 0.3201103136 0.1600551568
[77,] 0.81242419 0.3751516233 0.1875758117
[78,] 0.78015884 0.4396823235 0.2198411618
[79,] 0.74550132 0.5089973650 0.2544986825
[80,] 0.70840059 0.5831988223 0.2915994112
[81,] 0.67229377 0.6554124690 0.3277062345
[82,] 0.64013792 0.7197241686 0.3598620843
[83,] 0.69511613 0.6097677444 0.3048838722
[84,] 0.67816194 0.6436761188 0.3218380594
[85,] 0.65660597 0.6867880601 0.3433940301
[86,] 0.62023899 0.7595220290 0.3797610145
[87,] 0.60199900 0.7960020065 0.3980010033
[88,] 0.64666506 0.7066698711 0.3533349356
[89,] 0.60409114 0.7918177229 0.3959088615
[90,] 0.57950131 0.8409973804 0.4204986902
[91,] 0.57488426 0.8502314768 0.4251157384
[92,] 0.52964006 0.9407198858 0.4703599429
[93,] 0.52091203 0.9581759416 0.4790879708
[94,] 0.47414408 0.9482881646 0.5258559177
[95,] 0.44202232 0.8840446305 0.5579776847
[96,] 0.40906723 0.8181344584 0.5909327708
[97,] 0.52246330 0.9550733945 0.4775366972
[98,] 0.59132962 0.8173407647 0.4086703823
[99,] 0.57837958 0.8432408324 0.4216204162
[100,] 0.53011419 0.9397716189 0.4698858094
[101,] 0.61374634 0.7725073275 0.3862536638
[102,] 0.58446324 0.8310735263 0.4155367631
[103,] 0.87467019 0.2506596194 0.1253298097
[104,] 0.86167403 0.2766519471 0.1383259736
[105,] 0.83181360 0.3363728098 0.1681864049
[106,] 0.82591304 0.3481739209 0.1740869605
[107,] 0.80867255 0.3826549077 0.1913274539
[108,] 0.80235706 0.3952858841 0.1976429421
[109,] 0.76815940 0.4636812031 0.2318406016
[110,] 0.76110545 0.4777890999 0.2388945499
[111,] 0.72143110 0.5571378032 0.2785689016
[112,] 0.77367775 0.4526444989 0.2263222494
[113,] 0.78268855 0.4346229025 0.2173114513
[114,] 0.74465662 0.5106867678 0.2553433839
[115,] 0.70539622 0.5892075544 0.2946037772
[116,] 0.66243856 0.6751228900 0.3375614450
[117,] 0.66587012 0.6682597593 0.3341298797
[118,] 0.62373492 0.7525301585 0.3762650793
[119,] 0.61826728 0.7634654415 0.3817327208
[120,] 0.62531871 0.7493625880 0.3746812940
[121,] 0.57806062 0.8438787681 0.4219393841
[122,] 0.55792826 0.8841434785 0.4420717393
[123,] 0.50261824 0.9947635220 0.4973817610
[124,] 0.54456463 0.9108707426 0.4554353713
[125,] 0.51893506 0.9621298766 0.4810649383
[126,] 0.49374636 0.9874927279 0.5062536360
[127,] 0.46688111 0.9337622253 0.5331188874
[128,] 0.40931079 0.8186215721 0.5906892139
[129,] 0.38459670 0.7691934081 0.6154032959
[130,] 0.63625003 0.7274999355 0.3637499677
[131,] 0.57971922 0.8405615686 0.4202807843
[132,] 0.51661436 0.9667712714 0.4833856357
[133,] 0.47264972 0.9452994348 0.5273502826
[134,] 0.42992853 0.8598570646 0.5700714677
[135,] 0.42710079 0.8542015881 0.5728992060
[136,] 0.41264141 0.8252828273 0.5873585863
[137,] 0.33971481 0.6794296180 0.6602851910
[138,] 0.27296983 0.5459396644 0.7270301678
[139,] 0.37088891 0.7417778284 0.6291110858
[140,] 0.29646940 0.5929387917 0.7035306042
[141,] 0.22733602 0.4546720467 0.7726639766
[142,] 0.25370205 0.5074041061 0.7462979469
[143,] 0.18102186 0.3620437133 0.8189781433
[144,] 0.12658153 0.2531630604 0.8734184698
[145,] 0.15848938 0.3169787629 0.8415106185
[146,] 0.10979429 0.2195885857 0.8902057072
[147,] 0.09988603 0.1997720568 0.9001139716
> postscript(file="/var/wessaorg/rcomp/tmp/1pi9n1321957323.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/2slve1321957323.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/3m0pz1321957323.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/4rm0a1321957323.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/551sw1321957323.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> qqnorm(mysum$resid, main='Residual Normal Q-Q Plot')
> qqline(mysum$resid)
> grid()
> dev.off()
null device
1
> (myerror <- as.ts(mysum$resid))
Time Series:
Start = 1
End = 162
Frequency = 1
1 2 3 4 5 6
-0.623092428 1.193647806 -0.802511660 -3.236383907 9.671497150 1.947702868
7 8 9 10 11 12
9.461258754 -1.612538919 -2.051017046 0.083620642 -0.690219565 -1.129278043
13 14 15 16 17 18
-0.581019410 2.595096590 0.352977834 1.093112360 1.021337833 0.413116910
19 20 21 22 23 24
-2.853256391 1.566498381 -3.149465549 -1.074791080 -0.574688645 -0.417522503
25 26 27 28 29 30
0.190903568 -6.954492776 -0.605408302 2.316987997 1.862728896 -2.267104769
31 32 33 34 35 36
-2.378809508 0.609633189 -0.735659610 -1.191963214 0.259091567 -4.154954025
37 38 39 40 41 42
2.550272608 -0.000950968 -1.099179971 -3.773311742 -3.209045631 2.632345433
43 44 45 46 47 48
-2.743009728 -0.497488233 -3.236002903 -1.902282964 -2.920985238 -1.301588016
49 50 51 52 53 54
4.182952946 -2.333390821 -1.305132106 0.889643730 2.920582888 -0.250241852
55 56 57 58 59 60
-4.305194696 -0.766181124 1.834512619 -3.344064323 -4.342423386 0.477478728
61 62 63 64 65 66
2.085919152 -1.383456898 -2.760035353 0.858322364 0.958235019 -4.628121750
67 68 69 70 71 72
2.330844737 -2.435206352 0.960137895 1.853476831 -0.266481979 3.231576229
73 74 75 76 77 78
1.036538455 -1.831767442 -2.389985807 4.620087191 2.531993777 3.370598164
79 80 81 82 83 84
0.685594748 -4.253665671 -1.212370220 -1.356499626 -3.146523169 0.768665568
85 86 87 88 89 90
-0.347028061 -0.089949263 0.521879269 -0.886480633 1.257648773 4.069316969
91 92 93 94 95 96
1.727251051 1.993580709 0.753344676 2.218277555 -3.692285149 -0.494121205
97 98 99 100 101 102
1.961177400 -2.138353047 0.467809020 -2.536378012 -0.258249266 1.682609653
103 104 105 106 107 108
1.040944987 -4.093535791 3.573246790 2.860783306 -0.235960465 4.076051024
109 110 111 112 113 114
-0.811183374 7.774530176 1.701375722 0.153710589 -2.970612315 1.953828487
115 116 117 118 119 120
1.913417764 -1.067017520 1.102605007 -0.548374315 -4.050797546 2.290653515
121 122 123 124 125 126
0.450783395 1.337154422 -1.060269111 -3.802108371 -0.947921152 -2.258652556
127 128 129 130 131 132
-2.669812559 -0.478559732 1.266484123 0.814325113 -2.909631877 3.176218890
133 134 135 136 137 138
-2.476458437 2.525903869 -0.080676117 2.641597498 7.596334515 0.994642499
139 140 141 142 143 144
0.501068973 -1.628559546 -2.144421874 -2.764879681 2.007700593 -0.629982188
145 146 147 148 149 150
-0.117104678 -0.602083712 0.830947449 -1.972756049 -3.305174544 2.215731460
151 152 153 154 155 156
-0.032511987 3.862488039 -2.910671382 -3.204821960 2.026381509 3.907306499
157 158 159 160 161 162
1.993580709 0.157276964 1.266484123 -4.654434875 3.037557807 1.827581349
> postscript(file="/var/wessaorg/rcomp/tmp/6qgid1321957323.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556)
> dum <- cbind(lag(myerror,k=1),myerror)
> dum
Time Series:
Start = 0
End = 162
Frequency = 1
lag(myerror, k = 1) myerror
0 -0.623092428 NA
1 1.193647806 -0.623092428
2 -0.802511660 1.193647806
3 -3.236383907 -0.802511660
4 9.671497150 -3.236383907
5 1.947702868 9.671497150
6 9.461258754 1.947702868
7 -1.612538919 9.461258754
8 -2.051017046 -1.612538919
9 0.083620642 -2.051017046
10 -0.690219565 0.083620642
11 -1.129278043 -0.690219565
12 -0.581019410 -1.129278043
13 2.595096590 -0.581019410
14 0.352977834 2.595096590
15 1.093112360 0.352977834
16 1.021337833 1.093112360
17 0.413116910 1.021337833
18 -2.853256391 0.413116910
19 1.566498381 -2.853256391
20 -3.149465549 1.566498381
21 -1.074791080 -3.149465549
22 -0.574688645 -1.074791080
23 -0.417522503 -0.574688645
24 0.190903568 -0.417522503
25 -6.954492776 0.190903568
26 -0.605408302 -6.954492776
27 2.316987997 -0.605408302
28 1.862728896 2.316987997
29 -2.267104769 1.862728896
30 -2.378809508 -2.267104769
31 0.609633189 -2.378809508
32 -0.735659610 0.609633189
33 -1.191963214 -0.735659610
34 0.259091567 -1.191963214
35 -4.154954025 0.259091567
36 2.550272608 -4.154954025
37 -0.000950968 2.550272608
38 -1.099179971 -0.000950968
39 -3.773311742 -1.099179971
40 -3.209045631 -3.773311742
41 2.632345433 -3.209045631
42 -2.743009728 2.632345433
43 -0.497488233 -2.743009728
44 -3.236002903 -0.497488233
45 -1.902282964 -3.236002903
46 -2.920985238 -1.902282964
47 -1.301588016 -2.920985238
48 4.182952946 -1.301588016
49 -2.333390821 4.182952946
50 -1.305132106 -2.333390821
51 0.889643730 -1.305132106
52 2.920582888 0.889643730
53 -0.250241852 2.920582888
54 -4.305194696 -0.250241852
55 -0.766181124 -4.305194696
56 1.834512619 -0.766181124
57 -3.344064323 1.834512619
58 -4.342423386 -3.344064323
59 0.477478728 -4.342423386
60 2.085919152 0.477478728
61 -1.383456898 2.085919152
62 -2.760035353 -1.383456898
63 0.858322364 -2.760035353
64 0.958235019 0.858322364
65 -4.628121750 0.958235019
66 2.330844737 -4.628121750
67 -2.435206352 2.330844737
68 0.960137895 -2.435206352
69 1.853476831 0.960137895
70 -0.266481979 1.853476831
71 3.231576229 -0.266481979
72 1.036538455 3.231576229
73 -1.831767442 1.036538455
74 -2.389985807 -1.831767442
75 4.620087191 -2.389985807
76 2.531993777 4.620087191
77 3.370598164 2.531993777
78 0.685594748 3.370598164
79 -4.253665671 0.685594748
80 -1.212370220 -4.253665671
81 -1.356499626 -1.212370220
82 -3.146523169 -1.356499626
83 0.768665568 -3.146523169
84 -0.347028061 0.768665568
85 -0.089949263 -0.347028061
86 0.521879269 -0.089949263
87 -0.886480633 0.521879269
88 1.257648773 -0.886480633
89 4.069316969 1.257648773
90 1.727251051 4.069316969
91 1.993580709 1.727251051
92 0.753344676 1.993580709
93 2.218277555 0.753344676
94 -3.692285149 2.218277555
95 -0.494121205 -3.692285149
96 1.961177400 -0.494121205
97 -2.138353047 1.961177400
98 0.467809020 -2.138353047
99 -2.536378012 0.467809020
100 -0.258249266 -2.536378012
101 1.682609653 -0.258249266
102 1.040944987 1.682609653
103 -4.093535791 1.040944987
104 3.573246790 -4.093535791
105 2.860783306 3.573246790
106 -0.235960465 2.860783306
107 4.076051024 -0.235960465
108 -0.811183374 4.076051024
109 7.774530176 -0.811183374
110 1.701375722 7.774530176
111 0.153710589 1.701375722
112 -2.970612315 0.153710589
113 1.953828487 -2.970612315
114 1.913417764 1.953828487
115 -1.067017520 1.913417764
116 1.102605007 -1.067017520
117 -0.548374315 1.102605007
118 -4.050797546 -0.548374315
119 2.290653515 -4.050797546
120 0.450783395 2.290653515
121 1.337154422 0.450783395
122 -1.060269111 1.337154422
123 -3.802108371 -1.060269111
124 -0.947921152 -3.802108371
125 -2.258652556 -0.947921152
126 -2.669812559 -2.258652556
127 -0.478559732 -2.669812559
128 1.266484123 -0.478559732
129 0.814325113 1.266484123
130 -2.909631877 0.814325113
131 3.176218890 -2.909631877
132 -2.476458437 3.176218890
133 2.525903869 -2.476458437
134 -0.080676117 2.525903869
135 2.641597498 -0.080676117
136 7.596334515 2.641597498
137 0.994642499 7.596334515
138 0.501068973 0.994642499
139 -1.628559546 0.501068973
140 -2.144421874 -1.628559546
141 -2.764879681 -2.144421874
142 2.007700593 -2.764879681
143 -0.629982188 2.007700593
144 -0.117104678 -0.629982188
145 -0.602083712 -0.117104678
146 0.830947449 -0.602083712
147 -1.972756049 0.830947449
148 -3.305174544 -1.972756049
149 2.215731460 -3.305174544
150 -0.032511987 2.215731460
151 3.862488039 -0.032511987
152 -2.910671382 3.862488039
153 -3.204821960 -2.910671382
154 2.026381509 -3.204821960
155 3.907306499 2.026381509
156 1.993580709 3.907306499
157 0.157276964 1.993580709
158 1.266484123 0.157276964
159 -4.654434875 1.266484123
160 3.037557807 -4.654434875
161 1.827581349 3.037557807
162 NA 1.827581349
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 1.193647806 -0.623092428
[2,] -0.802511660 1.193647806
[3,] -3.236383907 -0.802511660
[4,] 9.671497150 -3.236383907
[5,] 1.947702868 9.671497150
[6,] 9.461258754 1.947702868
[7,] -1.612538919 9.461258754
[8,] -2.051017046 -1.612538919
[9,] 0.083620642 -2.051017046
[10,] -0.690219565 0.083620642
[11,] -1.129278043 -0.690219565
[12,] -0.581019410 -1.129278043
[13,] 2.595096590 -0.581019410
[14,] 0.352977834 2.595096590
[15,] 1.093112360 0.352977834
[16,] 1.021337833 1.093112360
[17,] 0.413116910 1.021337833
[18,] -2.853256391 0.413116910
[19,] 1.566498381 -2.853256391
[20,] -3.149465549 1.566498381
[21,] -1.074791080 -3.149465549
[22,] -0.574688645 -1.074791080
[23,] -0.417522503 -0.574688645
[24,] 0.190903568 -0.417522503
[25,] -6.954492776 0.190903568
[26,] -0.605408302 -6.954492776
[27,] 2.316987997 -0.605408302
[28,] 1.862728896 2.316987997
[29,] -2.267104769 1.862728896
[30,] -2.378809508 -2.267104769
[31,] 0.609633189 -2.378809508
[32,] -0.735659610 0.609633189
[33,] -1.191963214 -0.735659610
[34,] 0.259091567 -1.191963214
[35,] -4.154954025 0.259091567
[36,] 2.550272608 -4.154954025
[37,] -0.000950968 2.550272608
[38,] -1.099179971 -0.000950968
[39,] -3.773311742 -1.099179971
[40,] -3.209045631 -3.773311742
[41,] 2.632345433 -3.209045631
[42,] -2.743009728 2.632345433
[43,] -0.497488233 -2.743009728
[44,] -3.236002903 -0.497488233
[45,] -1.902282964 -3.236002903
[46,] -2.920985238 -1.902282964
[47,] -1.301588016 -2.920985238
[48,] 4.182952946 -1.301588016
[49,] -2.333390821 4.182952946
[50,] -1.305132106 -2.333390821
[51,] 0.889643730 -1.305132106
[52,] 2.920582888 0.889643730
[53,] -0.250241852 2.920582888
[54,] -4.305194696 -0.250241852
[55,] -0.766181124 -4.305194696
[56,] 1.834512619 -0.766181124
[57,] -3.344064323 1.834512619
[58,] -4.342423386 -3.344064323
[59,] 0.477478728 -4.342423386
[60,] 2.085919152 0.477478728
[61,] -1.383456898 2.085919152
[62,] -2.760035353 -1.383456898
[63,] 0.858322364 -2.760035353
[64,] 0.958235019 0.858322364
[65,] -4.628121750 0.958235019
[66,] 2.330844737 -4.628121750
[67,] -2.435206352 2.330844737
[68,] 0.960137895 -2.435206352
[69,] 1.853476831 0.960137895
[70,] -0.266481979 1.853476831
[71,] 3.231576229 -0.266481979
[72,] 1.036538455 3.231576229
[73,] -1.831767442 1.036538455
[74,] -2.389985807 -1.831767442
[75,] 4.620087191 -2.389985807
[76,] 2.531993777 4.620087191
[77,] 3.370598164 2.531993777
[78,] 0.685594748 3.370598164
[79,] -4.253665671 0.685594748
[80,] -1.212370220 -4.253665671
[81,] -1.356499626 -1.212370220
[82,] -3.146523169 -1.356499626
[83,] 0.768665568 -3.146523169
[84,] -0.347028061 0.768665568
[85,] -0.089949263 -0.347028061
[86,] 0.521879269 -0.089949263
[87,] -0.886480633 0.521879269
[88,] 1.257648773 -0.886480633
[89,] 4.069316969 1.257648773
[90,] 1.727251051 4.069316969
[91,] 1.993580709 1.727251051
[92,] 0.753344676 1.993580709
[93,] 2.218277555 0.753344676
[94,] -3.692285149 2.218277555
[95,] -0.494121205 -3.692285149
[96,] 1.961177400 -0.494121205
[97,] -2.138353047 1.961177400
[98,] 0.467809020 -2.138353047
[99,] -2.536378012 0.467809020
[100,] -0.258249266 -2.536378012
[101,] 1.682609653 -0.258249266
[102,] 1.040944987 1.682609653
[103,] -4.093535791 1.040944987
[104,] 3.573246790 -4.093535791
[105,] 2.860783306 3.573246790
[106,] -0.235960465 2.860783306
[107,] 4.076051024 -0.235960465
[108,] -0.811183374 4.076051024
[109,] 7.774530176 -0.811183374
[110,] 1.701375722 7.774530176
[111,] 0.153710589 1.701375722
[112,] -2.970612315 0.153710589
[113,] 1.953828487 -2.970612315
[114,] 1.913417764 1.953828487
[115,] -1.067017520 1.913417764
[116,] 1.102605007 -1.067017520
[117,] -0.548374315 1.102605007
[118,] -4.050797546 -0.548374315
[119,] 2.290653515 -4.050797546
[120,] 0.450783395 2.290653515
[121,] 1.337154422 0.450783395
[122,] -1.060269111 1.337154422
[123,] -3.802108371 -1.060269111
[124,] -0.947921152 -3.802108371
[125,] -2.258652556 -0.947921152
[126,] -2.669812559 -2.258652556
[127,] -0.478559732 -2.669812559
[128,] 1.266484123 -0.478559732
[129,] 0.814325113 1.266484123
[130,] -2.909631877 0.814325113
[131,] 3.176218890 -2.909631877
[132,] -2.476458437 3.176218890
[133,] 2.525903869 -2.476458437
[134,] -0.080676117 2.525903869
[135,] 2.641597498 -0.080676117
[136,] 7.596334515 2.641597498
[137,] 0.994642499 7.596334515
[138,] 0.501068973 0.994642499
[139,] -1.628559546 0.501068973
[140,] -2.144421874 -1.628559546
[141,] -2.764879681 -2.144421874
[142,] 2.007700593 -2.764879681
[143,] -0.629982188 2.007700593
[144,] -0.117104678 -0.629982188
[145,] -0.602083712 -0.117104678
[146,] 0.830947449 -0.602083712
[147,] -1.972756049 0.830947449
[148,] -3.305174544 -1.972756049
[149,] 2.215731460 -3.305174544
[150,] -0.032511987 2.215731460
[151,] 3.862488039 -0.032511987
[152,] -2.910671382 3.862488039
[153,] -3.204821960 -2.910671382
[154,] 2.026381509 -3.204821960
[155,] 3.907306499 2.026381509
[156,] 1.993580709 3.907306499
[157,] 0.157276964 1.993580709
[158,] 1.266484123 0.157276964
[159,] -4.654434875 1.266484123
[160,] 3.037557807 -4.654434875
[161,] 1.827581349 3.037557807
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 1.193647806 -0.623092428
2 -0.802511660 1.193647806
3 -3.236383907 -0.802511660
4 9.671497150 -3.236383907
5 1.947702868 9.671497150
6 9.461258754 1.947702868
7 -1.612538919 9.461258754
8 -2.051017046 -1.612538919
9 0.083620642 -2.051017046
10 -0.690219565 0.083620642
11 -1.129278043 -0.690219565
12 -0.581019410 -1.129278043
13 2.595096590 -0.581019410
14 0.352977834 2.595096590
15 1.093112360 0.352977834
16 1.021337833 1.093112360
17 0.413116910 1.021337833
18 -2.853256391 0.413116910
19 1.566498381 -2.853256391
20 -3.149465549 1.566498381
21 -1.074791080 -3.149465549
22 -0.574688645 -1.074791080
23 -0.417522503 -0.574688645
24 0.190903568 -0.417522503
25 -6.954492776 0.190903568
26 -0.605408302 -6.954492776
27 2.316987997 -0.605408302
28 1.862728896 2.316987997
29 -2.267104769 1.862728896
30 -2.378809508 -2.267104769
31 0.609633189 -2.378809508
32 -0.735659610 0.609633189
33 -1.191963214 -0.735659610
34 0.259091567 -1.191963214
35 -4.154954025 0.259091567
36 2.550272608 -4.154954025
37 -0.000950968 2.550272608
38 -1.099179971 -0.000950968
39 -3.773311742 -1.099179971
40 -3.209045631 -3.773311742
41 2.632345433 -3.209045631
42 -2.743009728 2.632345433
43 -0.497488233 -2.743009728
44 -3.236002903 -0.497488233
45 -1.902282964 -3.236002903
46 -2.920985238 -1.902282964
47 -1.301588016 -2.920985238
48 4.182952946 -1.301588016
49 -2.333390821 4.182952946
50 -1.305132106 -2.333390821
51 0.889643730 -1.305132106
52 2.920582888 0.889643730
53 -0.250241852 2.920582888
54 -4.305194696 -0.250241852
55 -0.766181124 -4.305194696
56 1.834512619 -0.766181124
57 -3.344064323 1.834512619
58 -4.342423386 -3.344064323
59 0.477478728 -4.342423386
60 2.085919152 0.477478728
61 -1.383456898 2.085919152
62 -2.760035353 -1.383456898
63 0.858322364 -2.760035353
64 0.958235019 0.858322364
65 -4.628121750 0.958235019
66 2.330844737 -4.628121750
67 -2.435206352 2.330844737
68 0.960137895 -2.435206352
69 1.853476831 0.960137895
70 -0.266481979 1.853476831
71 3.231576229 -0.266481979
72 1.036538455 3.231576229
73 -1.831767442 1.036538455
74 -2.389985807 -1.831767442
75 4.620087191 -2.389985807
76 2.531993777 4.620087191
77 3.370598164 2.531993777
78 0.685594748 3.370598164
79 -4.253665671 0.685594748
80 -1.212370220 -4.253665671
81 -1.356499626 -1.212370220
82 -3.146523169 -1.356499626
83 0.768665568 -3.146523169
84 -0.347028061 0.768665568
85 -0.089949263 -0.347028061
86 0.521879269 -0.089949263
87 -0.886480633 0.521879269
88 1.257648773 -0.886480633
89 4.069316969 1.257648773
90 1.727251051 4.069316969
91 1.993580709 1.727251051
92 0.753344676 1.993580709
93 2.218277555 0.753344676
94 -3.692285149 2.218277555
95 -0.494121205 -3.692285149
96 1.961177400 -0.494121205
97 -2.138353047 1.961177400
98 0.467809020 -2.138353047
99 -2.536378012 0.467809020
100 -0.258249266 -2.536378012
101 1.682609653 -0.258249266
102 1.040944987 1.682609653
103 -4.093535791 1.040944987
104 3.573246790 -4.093535791
105 2.860783306 3.573246790
106 -0.235960465 2.860783306
107 4.076051024 -0.235960465
108 -0.811183374 4.076051024
109 7.774530176 -0.811183374
110 1.701375722 7.774530176
111 0.153710589 1.701375722
112 -2.970612315 0.153710589
113 1.953828487 -2.970612315
114 1.913417764 1.953828487
115 -1.067017520 1.913417764
116 1.102605007 -1.067017520
117 -0.548374315 1.102605007
118 -4.050797546 -0.548374315
119 2.290653515 -4.050797546
120 0.450783395 2.290653515
121 1.337154422 0.450783395
122 -1.060269111 1.337154422
123 -3.802108371 -1.060269111
124 -0.947921152 -3.802108371
125 -2.258652556 -0.947921152
126 -2.669812559 -2.258652556
127 -0.478559732 -2.669812559
128 1.266484123 -0.478559732
129 0.814325113 1.266484123
130 -2.909631877 0.814325113
131 3.176218890 -2.909631877
132 -2.476458437 3.176218890
133 2.525903869 -2.476458437
134 -0.080676117 2.525903869
135 2.641597498 -0.080676117
136 7.596334515 2.641597498
137 0.994642499 7.596334515
138 0.501068973 0.994642499
139 -1.628559546 0.501068973
140 -2.144421874 -1.628559546
141 -2.764879681 -2.144421874
142 2.007700593 -2.764879681
143 -0.629982188 2.007700593
144 -0.117104678 -0.629982188
145 -0.602083712 -0.117104678
146 0.830947449 -0.602083712
147 -1.972756049 0.830947449
148 -3.305174544 -1.972756049
149 2.215731460 -3.305174544
150 -0.032511987 2.215731460
151 3.862488039 -0.032511987
152 -2.910671382 3.862488039
153 -3.204821960 -2.910671382
154 2.026381509 -3.204821960
155 3.907306499 2.026381509
156 1.993580709 3.907306499
157 0.157276964 1.993580709
158 1.266484123 0.157276964
159 -4.654434875 1.266484123
160 3.037557807 -4.654434875
161 1.827581349 3.037557807
> 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/7ln3l1321957323.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/8dhz31321957323.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/908rs1321957323.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/10tm7g1321957323.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/11nwge1321957323.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/12jgpo1321957323.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/13hil81321957323.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/14y4mk1321957323.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/15rp551321957323.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/1675881321957323.tab")
+ }
>
> try(system("convert tmp/1pi9n1321957323.ps tmp/1pi9n1321957323.png",intern=TRUE))
character(0)
> try(system("convert tmp/2slve1321957323.ps tmp/2slve1321957323.png",intern=TRUE))
character(0)
> try(system("convert tmp/3m0pz1321957323.ps tmp/3m0pz1321957323.png",intern=TRUE))
character(0)
> try(system("convert tmp/4rm0a1321957323.ps tmp/4rm0a1321957323.png",intern=TRUE))
character(0)
> try(system("convert tmp/551sw1321957323.ps tmp/551sw1321957323.png",intern=TRUE))
character(0)
> try(system("convert tmp/6qgid1321957323.ps tmp/6qgid1321957323.png",intern=TRUE))
character(0)
> try(system("convert tmp/7ln3l1321957323.ps tmp/7ln3l1321957323.png",intern=TRUE))
character(0)
> try(system("convert tmp/8dhz31321957323.ps tmp/8dhz31321957323.png",intern=TRUE))
character(0)
> try(system("convert tmp/908rs1321957323.ps tmp/908rs1321957323.png",intern=TRUE))
character(0)
> try(system("convert tmp/10tm7g1321957323.ps tmp/10tm7g1321957323.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
4.688 0.512 5.221