R version 2.8.0 (2008-10-20)
Copyright (C) 2008 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
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.
Natural language support but running in an English locale
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(4
+ ,4
+ ,4
+ ,4
+ ,4
+ ,3
+ ,5
+ ,5
+ ,4
+ ,2
+ ,3
+ ,4
+ ,2
+ ,4
+ ,4
+ ,4
+ ,3
+ ,4
+ ,4
+ ,4
+ ,4
+ ,4
+ ,3
+ ,4
+ ,4
+ ,2
+ ,2
+ ,2
+ ,4
+ ,4
+ ,3
+ ,2
+ ,3
+ ,4
+ ,2
+ ,2
+ ,3
+ ,2
+ ,2
+ ,4
+ ,1
+ ,3
+ ,4
+ ,4
+ ,4
+ ,4
+ ,4
+ ,5
+ ,4
+ ,2
+ ,4
+ ,2
+ ,2
+ ,2
+ ,4
+ ,3
+ ,4
+ ,4
+ ,3
+ ,3
+ ,4
+ ,3
+ ,4
+ ,3
+ ,4
+ ,2
+ ,2
+ ,3
+ ,2
+ ,4
+ ,2
+ ,4
+ ,2
+ ,2
+ ,4
+ ,3
+ ,4
+ ,4
+ ,4
+ ,4
+ ,4
+ ,3
+ ,3
+ ,3
+ ,4
+ ,4
+ ,4
+ ,4
+ ,2
+ ,5
+ ,4
+ ,4
+ ,4
+ ,4
+ ,4
+ ,4
+ ,4
+ ,5
+ ,4
+ ,4
+ ,5
+ ,4
+ ,4
+ ,4
+ ,4
+ ,5
+ ,4
+ ,4
+ ,4
+ ,4
+ ,4
+ ,2
+ ,2
+ ,4
+ ,4
+ ,4
+ ,4
+ ,4
+ ,4
+ ,5
+ ,5
+ ,4
+ ,4
+ ,4
+ ,3
+ ,4
+ ,2
+ ,2
+ ,2
+ ,4
+ ,3
+ ,4
+ ,4
+ ,4
+ ,4
+ ,4
+ ,3
+ ,4
+ ,2
+ ,2
+ ,4
+ ,5
+ ,4
+ ,4
+ ,4
+ ,4
+ ,4
+ ,4
+ ,3
+ ,4
+ ,4
+ ,4
+ ,3
+ ,4
+ ,3
+ ,4
+ ,4
+ ,4
+ ,4
+ ,3
+ ,2
+ ,4
+ ,5
+ ,4
+ ,3
+ ,4
+ ,4
+ ,3
+ ,4
+ ,4
+ ,4
+ ,4
+ ,4
+ ,4
+ ,4
+ ,3
+ ,5
+ ,2
+ ,1
+ ,3
+ ,4
+ ,3
+ ,4
+ ,4
+ ,3
+ ,4
+ ,4
+ ,4
+ ,4
+ ,4
+ ,2
+ ,4
+ ,3
+ ,3
+ ,4
+ ,4
+ ,5
+ ,4
+ ,2
+ ,4
+ ,4
+ ,4
+ ,4
+ ,4
+ ,4
+ ,3
+ ,4
+ ,4
+ ,4
+ ,4
+ ,4
+ ,2
+ ,4
+ ,4
+ ,3
+ ,4
+ ,4
+ ,4
+ ,4
+ ,3
+ ,3
+ ,3
+ ,4
+ ,4
+ ,4
+ ,4
+ ,4
+ ,4
+ ,4
+ ,3
+ ,3
+ ,4
+ ,3
+ ,4
+ ,4
+ ,2
+ ,4
+ ,4
+ ,4
+ ,4
+ ,4
+ ,3
+ ,4
+ ,2
+ ,2
+ ,4
+ ,3
+ ,2
+ ,2
+ ,5
+ ,3
+ ,4
+ ,3
+ ,2
+ ,3
+ ,3
+ ,2
+ ,3
+ ,4
+ ,4
+ ,4
+ ,4
+ ,4
+ ,4
+ ,4
+ ,4
+ ,4
+ ,4
+ ,2
+ ,3
+ ,4
+ ,2
+ ,2
+ ,3
+ ,4
+ ,5
+ ,4
+ ,2
+ ,2
+ ,4
+ ,3
+ ,4
+ ,4
+ ,3
+ ,4
+ ,5
+ ,5
+ ,4
+ ,4
+ ,3
+ ,3
+ ,4
+ ,4
+ ,4
+ ,2
+ ,3
+ ,3
+ ,3
+ ,2
+ ,4
+ ,3
+ ,4
+ ,4
+ ,3
+ ,3
+ ,3
+ ,4
+ ,3
+ ,2
+ ,4
+ ,3
+ ,4
+ ,2
+ ,4
+ ,3
+ ,3
+ ,1
+ ,2
+ ,3
+ ,3
+ ,3
+ ,4
+ ,2
+ ,4
+ ,4
+ ,3
+ ,4
+ ,2
+ ,2
+ ,4
+ ,3
+ ,2
+ ,2
+ ,4
+ ,2
+ ,2
+ ,4
+ ,4
+ ,3
+ ,5
+ ,5
+ ,5
+ ,3
+ ,5
+ ,4
+ ,3
+ ,3
+ ,4
+ ,4
+ ,4
+ ,4
+ ,3
+ ,4
+ ,4
+ ,3
+ ,3
+ ,4
+ ,2
+ ,2
+ ,3
+ ,4
+ ,4
+ ,4
+ ,3
+ ,2
+ ,4
+ ,4
+ ,3
+ ,3
+ ,5
+ ,2
+ ,4
+ ,4
+ ,2
+ ,3
+ ,3
+ ,2
+ ,4
+ ,3
+ ,4
+ ,4
+ ,3
+ ,4
+ ,4
+ ,3
+ ,4
+ ,4
+ ,4
+ ,4
+ ,4
+ ,4
+ ,3
+ ,4
+ ,3
+ ,2
+ ,4
+ ,2
+ ,4
+ ,5
+ ,3
+ ,3
+ ,2
+ ,2
+ ,2
+ ,4
+ ,4
+ ,4
+ ,4
+ ,4
+ ,3
+ ,3
+ ,4
+ ,3
+ ,3
+ ,4
+ ,3
+ ,4
+ ,4
+ ,3
+ ,4
+ ,4
+ ,3
+ ,3
+ ,5
+ ,4
+ ,4
+ ,3
+ ,5
+ ,1
+ ,4
+ ,2
+ ,3
+ ,4
+ ,2
+ ,4
+ ,4
+ ,4
+ ,4
+ ,5
+ ,3
+ ,4
+ ,3
+ ,3
+ ,4
+ ,2
+ ,1
+ ,3
+ ,4
+ ,2
+ ,4
+ ,3
+ ,4
+ ,4
+ ,4
+ ,4
+ ,4
+ ,5
+ ,5
+ ,4
+ ,3
+ ,2
+ ,4
+ ,3
+ ,4
+ ,3
+ ,3
+ ,3
+ ,4
+ ,5
+ ,2
+ ,4
+ ,4
+ ,4
+ ,3
+ ,2
+ ,2
+ ,3)
+ ,dim=c(3
+ ,159)
+ ,dimnames=list(c('Competent'
+ ,'Goals'
+ ,'Focus')
+ ,1:159))
> y <- array(NA,dim=c(3,159),dimnames=list(c('Competent','Goals','Focus'),1:159))
> 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 = '2'
> #'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
Attaching package: 'zoo'
The following object(s) are masked from package:base :
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
Goals Competent Focus
1 4 4 4
2 4 4 3
3 5 5 4
4 3 2 4
5 4 2 4
6 3 4 4
7 4 4 4
8 3 4 4
9 2 4 2
10 4 2 4
11 2 3 3
12 2 4 2
13 2 3 2
14 1 4 3
15 4 4 4
16 4 4 5
17 2 4 4
18 2 2 2
19 3 4 4
20 3 4 3
21 3 4 4
22 4 3 2
23 3 2 2
24 2 4 4
25 2 2 4
26 4 3 4
27 4 4 4
28 3 3 3
29 4 4 4
30 2 4 5
31 4 4 4
32 4 4 4
33 5 4 4
34 5 4 4
35 4 4 4
36 4 5 4
37 4 4 4
38 2 2 4
39 4 4 4
40 4 4 5
41 4 5 4
42 3 4 4
43 2 2 2
44 3 4 4
45 4 4 4
46 3 4 4
47 2 2 4
48 4 5 4
49 4 4 4
50 3 4 4
51 4 4 3
52 3 4 4
53 4 4 4
54 2 3 4
55 4 5 3
56 4 4 3
57 4 4 4
58 4 4 4
59 3 4 5
60 1 2 3
61 3 4 4
62 3 4 4
63 4 4 4
64 2 4 4
65 3 3 4
66 5 4 4
67 4 2 4
68 4 4 4
69 3 4 4
70 4 4 4
71 2 4 4
72 3 4 4
73 4 4 4
74 3 3 3
75 4 4 4
76 4 4 4
77 3 4 3
78 3 4 4
79 2 4 4
80 4 4 4
81 3 4 4
82 2 2 4
83 2 3 2
84 3 5 4
85 2 3 3
86 2 3 3
87 4 4 4
88 4 4 4
89 4 4 4
90 2 4 3
91 2 4 2
92 4 3 5
93 2 4 2
94 3 4 4
95 3 4 4
96 5 5 4
97 3 4 3
98 4 4 4
99 3 2 3
100 2 3 4
101 4 3 4
102 3 3 3
103 3 4 2
104 3 4 4
105 4 2 3
106 1 3 2
107 3 3 3
108 2 4 4
109 3 4 4
110 2 2 4
111 2 3 2
112 2 4 2
113 4 4 3
114 5 5 5
115 5 3 4
116 3 3 4
117 4 4 4
118 4 3 4
119 3 3 4
120 2 2 3
121 4 4 4
122 2 3 4
123 3 4 3
124 2 5 4
125 2 4 3
126 2 3 4
127 4 3 4
128 4 3 4
129 4 3 4
130 4 4 4
131 3 4 4
132 2 3 4
133 4 2 5
134 3 3 2
135 2 2 4
136 4 4 4
137 3 4 3
138 3 4 3
139 3 4 4
140 3 4 4
141 3 4 3
142 4 5 4
143 5 3 1
144 2 4 3
145 2 4 4
146 4 4 4
147 3 5 4
148 3 3 4
149 1 2 3
150 2 4 4
151 4 3 4
152 4 4 4
153 5 5 4
154 2 3 4
155 4 3 3
156 3 3 4
157 2 5 4
158 4 4 3
159 2 2 3
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) Competent Focus
0.7797 0.3112 0.3496
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-2.07317 -0.72358 -0.07317 0.57724 2.93717
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.77974 0.42660 1.828 0.069488 .
Competent 0.31117 0.08906 3.494 0.000620 ***
Focus 0.34959 0.09754 3.584 0.000452 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 0.8832 on 156 degrees of freedom
Multiple R-squared: 0.1725, Adjusted R-squared: 0.1619
F-statistic: 16.26 on 2 and 156 DF, p-value: 3.855e-07
> 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.53324526 0.93350947 0.4667547
[2,] 0.36375549 0.72751098 0.6362445
[3,] 0.38991309 0.77982619 0.6100869
[4,] 0.42058217 0.84116435 0.5794178
[5,] 0.36368159 0.72736318 0.6363184
[6,] 0.36597645 0.73195289 0.6340236
[7,] 0.27411480 0.54822959 0.7258852
[8,] 0.19851492 0.39702985 0.8014851
[9,] 0.55999377 0.88001247 0.4400062
[10,] 0.47870990 0.95741980 0.5212901
[11,] 0.44125547 0.88251095 0.5587445
[12,] 0.62370124 0.75259752 0.3762988
[13,] 0.55131721 0.89736557 0.4486828
[14,] 0.49857455 0.99714911 0.5014254
[15,] 0.43060252 0.86120503 0.5693975
[16,] 0.38015603 0.76031207 0.6198440
[17,] 0.62075826 0.75848347 0.3792417
[18,] 0.59466470 0.81067060 0.4053353
[19,] 0.67877394 0.64245211 0.3212261
[20,] 0.72705497 0.54589006 0.2729450
[21,] 0.71105850 0.57788300 0.2889415
[22,] 0.68317114 0.63365771 0.3168289
[23,] 0.62803881 0.74392238 0.3719612
[24,] 0.59584954 0.80830091 0.4041505
[25,] 0.74626970 0.50746060 0.2537303
[26,] 0.72456630 0.55086741 0.2754337
[27,] 0.70017303 0.59965394 0.2998270
[28,] 0.79539360 0.40921281 0.2046064
[29,] 0.86115334 0.27769332 0.1388467
[30,] 0.83942292 0.32115416 0.1605771
[31,] 0.80811053 0.38377893 0.1918895
[32,] 0.78111701 0.43776599 0.2188830
[33,] 0.79272012 0.41455976 0.2072799
[34,] 0.76509770 0.46980461 0.2349023
[35,] 0.72352312 0.55295375 0.2764769
[36,] 0.68049314 0.63901373 0.3195069
[37,] 0.64765549 0.70468902 0.3523445
[38,] 0.60004352 0.79991296 0.3999565
[39,] 0.56478954 0.87042092 0.4352105
[40,] 0.53048788 0.93902425 0.4695121
[41,] 0.49490275 0.98980551 0.5050972
[42,] 0.49617553 0.99235106 0.5038245
[43,] 0.44874828 0.89749656 0.5512517
[44,] 0.41616282 0.83232563 0.5838372
[45,] 0.38225466 0.76450931 0.6177453
[46,] 0.38147324 0.76294647 0.6185268
[47,] 0.34883965 0.69767930 0.6511603
[48,] 0.31972410 0.63944821 0.6802759
[49,] 0.35085616 0.70171232 0.6491438
[50,] 0.32283988 0.64567977 0.6771601
[51,] 0.32042809 0.64085619 0.6795719
[52,] 0.29314277 0.58628555 0.7068572
[53,] 0.26705346 0.53410692 0.7329465
[54,] 0.26001850 0.52003700 0.7399815
[55,] 0.32921175 0.65842351 0.6707882
[56,] 0.29889009 0.59778018 0.7011099
[57,] 0.26968660 0.53937321 0.7303134
[58,] 0.24632047 0.49264094 0.7536795
[59,] 0.31402852 0.62805704 0.6859715
[60,] 0.27395622 0.54791244 0.7260438
[61,] 0.36133674 0.72267348 0.6386633
[62,] 0.40386282 0.80772564 0.5961372
[63,] 0.37687105 0.75374211 0.6231289
[64,] 0.34490409 0.68980819 0.6550959
[65,] 0.31975024 0.63950048 0.6802498
[66,] 0.39056298 0.78112595 0.6094370
[67,] 0.35751166 0.71502331 0.6424883
[68,] 0.33254447 0.66508894 0.6674555
[69,] 0.29418345 0.58836690 0.7058166
[70,] 0.27150207 0.54300415 0.7284979
[71,] 0.24994258 0.49988517 0.7500574
[72,] 0.21593677 0.43187354 0.7840632
[73,] 0.19135258 0.38270517 0.8086474
[74,] 0.24466427 0.48932854 0.7553357
[75,] 0.22457875 0.44915751 0.7754212
[76,] 0.19894415 0.39788831 0.8010558
[77,] 0.19200616 0.38401232 0.8079938
[78,] 0.16938879 0.33877759 0.8306112
[79,] 0.16074410 0.32148819 0.8392559
[80,] 0.15352731 0.30705462 0.8464727
[81,] 0.14642725 0.29285449 0.8535728
[82,] 0.13207490 0.26414979 0.8679251
[83,] 0.11886403 0.23772807 0.8811360
[84,] 0.10677062 0.21354125 0.8932294
[85,] 0.11613824 0.23227648 0.8838618
[86,] 0.10851188 0.21702376 0.8914881
[87,] 0.09610799 0.19221597 0.9038920
[88,] 0.09004372 0.18008745 0.9099563
[89,] 0.07593659 0.15187318 0.9240634
[90,] 0.06354770 0.12709539 0.9364523
[91,] 0.08236996 0.16473992 0.9176300
[92,] 0.06609464 0.13218929 0.9339054
[93,] 0.05884793 0.11769587 0.9411521
[94,] 0.05044158 0.10088317 0.9495584
[95,] 0.05648882 0.11297764 0.9435112
[96,] 0.05664160 0.11328319 0.9433584
[97,] 0.04513238 0.09026476 0.9548676
[98,] 0.03575407 0.07150813 0.9642459
[99,] 0.02873027 0.05746055 0.9712697
[100,] 0.04571472 0.09142944 0.9542853
[101,] 0.06867331 0.13734661 0.9313267
[102,] 0.05480802 0.10961605 0.9451920
[103,] 0.07397448 0.14794895 0.9260255
[104,] 0.06089538 0.12179076 0.9391046
[105,] 0.05764569 0.11529137 0.9423543
[106,] 0.04988365 0.09976730 0.9501163
[107,] 0.05031583 0.10063166 0.9496842
[108,] 0.04855834 0.09711668 0.9514417
[109,] 0.05978383 0.11956766 0.9402162
[110,] 0.13512674 0.27025347 0.8648733
[111,] 0.10956528 0.21913055 0.8904347
[112,] 0.10147646 0.20295291 0.8985235
[113,] 0.10657846 0.21315693 0.8934215
[114,] 0.08490831 0.16981663 0.9150917
[115,] 0.07583060 0.15166119 0.9241694
[116,] 0.07112200 0.14224400 0.9288780
[117,] 0.07519740 0.15039481 0.9248026
[118,] 0.05838372 0.11676744 0.9416163
[119,] 0.09025088 0.18050175 0.9097491
[120,] 0.10922537 0.21845075 0.8907746
[121,] 0.11643465 0.23286930 0.8835653
[122,] 0.11980233 0.23960467 0.8801977
[123,] 0.12641663 0.25283326 0.8735834
[124,] 0.13764213 0.27528426 0.8623579
[125,] 0.12961028 0.25922056 0.8703897
[126,] 0.10263563 0.20527127 0.8973644
[127,] 0.10220256 0.20440513 0.8977974
[128,] 0.19528346 0.39056691 0.8047165
[129,] 0.16538833 0.33077665 0.8346117
[130,] 0.13439718 0.26879435 0.8656028
[131,] 0.13418038 0.26836076 0.8658196
[132,] 0.10817623 0.21635247 0.8918238
[133,] 0.08676470 0.17352940 0.9132353
[134,] 0.06355133 0.12710267 0.9364487
[135,] 0.04517886 0.09035773 0.9548211
[136,] 0.03454291 0.06908583 0.9654571
[137,] 0.02469962 0.04939924 0.9753004
[138,] 0.06297071 0.12594142 0.9370293
[139,] 0.07161017 0.14322035 0.9283898
[140,] 0.08718507 0.17437014 0.9128149
[141,] 0.07392379 0.14784759 0.9260762
[142,] 0.06131483 0.12262965 0.9386852
[143,] 0.04007560 0.08015121 0.9599244
[144,] 0.07176841 0.14353681 0.9282316
[145,] 0.09696926 0.19393853 0.9030307
[146,] 0.11968486 0.23936972 0.8803151
[147,] 0.10132976 0.20265952 0.8986702
[148,] 0.28131506 0.56263013 0.7186849
> postscript(file="/var/www/html/freestat/rcomp/tmp/1fn6g1291304774.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/www/html/freestat/rcomp/tmp/2fn6g1291304774.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/www/html/freestat/rcomp/tmp/38w5i1291304774.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/www/html/freestat/rcomp/tmp/48w5i1291304774.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/www/html/freestat/rcomp/tmp/58w5i1291304774.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 = 159
Frequency = 1
1 2 3 4 5 6
0.57723994 0.92682905 1.26607429 0.19957123 1.19957123 -0.42276006
7 8 9 10 11 12
0.57723994 -0.42276006 -0.72358184 1.19957123 -0.76200530 -0.72358184
13 14 15 16 17 18
-0.41241619 -2.07317095 0.57723994 0.22765083 -1.42276006 -0.10125054
19 20 21 22 23 24
-0.42276006 -0.07317095 -0.42276006 1.58758381 0.89874946 -1.42276006
25 26 27 28 29 30
-0.80042877 0.88840559 0.57723994 0.23799470 0.57723994 -1.77234917
31 32 33 34 35 36
0.57723994 0.57723994 1.57723994 1.57723994 0.57723994 0.26607429
37 38 39 40 41 42
0.57723994 -0.80042877 0.57723994 0.22765083 0.26607429 -0.42276006
43 44 45 46 47 48
-0.10125054 -0.42276006 0.57723994 -0.42276006 -0.80042877 0.26607429
49 50 51 52 53 54
0.57723994 -0.42276006 0.92682905 -0.42276006 0.57723994 -1.11159441
55 56 57 58 59 60
0.61566341 0.92682905 0.57723994 0.57723994 -0.77234917 -1.45083965
61 62 63 64 65 66
-0.42276006 -0.42276006 0.57723994 -1.42276006 -0.11159441 1.57723994
67 68 69 70 71 72
1.19957123 0.57723994 -0.42276006 0.57723994 -1.42276006 -0.42276006
73 74 75 76 77 78
0.57723994 0.23799470 0.57723994 0.57723994 -0.07317095 -0.42276006
79 80 81 82 83 84
-1.42276006 0.57723994 -0.42276006 -0.80042877 -0.41241619 -0.73392571
85 86 87 88 89 90
-0.76200530 -0.76200530 0.57723994 0.57723994 0.57723994 -1.07317095
91 92 93 94 95 96
-0.72358184 0.53881648 -0.72358184 -0.42276006 -0.42276006 1.26607429
97 98 99 100 101 102
-0.07317095 0.57723994 0.54916035 -1.11159441 0.88840559 0.23799470
103 104 105 106 107 108
0.27641816 -0.42276006 1.54916035 -1.41241619 0.23799470 -1.42276006
109 110 111 112 113 114
-0.42276006 -0.80042877 -0.41241619 -0.72358184 0.92682905 0.91648518
115 116 117 118 119 120
1.88840559 -0.11159441 0.57723994 0.88840559 -0.11159441 -0.45083965
121 122 123 124 125 126
0.57723994 -1.11159441 -0.07317095 -1.73392571 -1.07317095 -1.11159441
127 128 129 130 131 132
0.88840559 0.88840559 0.88840559 0.57723994 -0.42276006 -1.11159441
133 134 135 136 137 138
0.84998212 0.58758381 -0.80042877 0.57723994 -0.07317095 -0.07317095
139 140 141 142 143 144
-0.42276006 -0.42276006 -0.07317095 0.26607429 2.93717292 -1.07317095
145 146 147 148 149 150
-1.42276006 0.57723994 -0.73392571 -0.11159441 -1.45083965 -1.42276006
151 152 153 154 155 156
0.88840559 0.57723994 1.26607429 -1.11159441 1.23799470 -0.11159441
157 158 159
-1.73392571 0.92682905 -0.45083965
> postscript(file="/var/www/html/freestat/rcomp/tmp/60o531291304774.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 = 159
Frequency = 1
lag(myerror, k = 1) myerror
0 0.57723994 NA
1 0.92682905 0.57723994
2 1.26607429 0.92682905
3 0.19957123 1.26607429
4 1.19957123 0.19957123
5 -0.42276006 1.19957123
6 0.57723994 -0.42276006
7 -0.42276006 0.57723994
8 -0.72358184 -0.42276006
9 1.19957123 -0.72358184
10 -0.76200530 1.19957123
11 -0.72358184 -0.76200530
12 -0.41241619 -0.72358184
13 -2.07317095 -0.41241619
14 0.57723994 -2.07317095
15 0.22765083 0.57723994
16 -1.42276006 0.22765083
17 -0.10125054 -1.42276006
18 -0.42276006 -0.10125054
19 -0.07317095 -0.42276006
20 -0.42276006 -0.07317095
21 1.58758381 -0.42276006
22 0.89874946 1.58758381
23 -1.42276006 0.89874946
24 -0.80042877 -1.42276006
25 0.88840559 -0.80042877
26 0.57723994 0.88840559
27 0.23799470 0.57723994
28 0.57723994 0.23799470
29 -1.77234917 0.57723994
30 0.57723994 -1.77234917
31 0.57723994 0.57723994
32 1.57723994 0.57723994
33 1.57723994 1.57723994
34 0.57723994 1.57723994
35 0.26607429 0.57723994
36 0.57723994 0.26607429
37 -0.80042877 0.57723994
38 0.57723994 -0.80042877
39 0.22765083 0.57723994
40 0.26607429 0.22765083
41 -0.42276006 0.26607429
42 -0.10125054 -0.42276006
43 -0.42276006 -0.10125054
44 0.57723994 -0.42276006
45 -0.42276006 0.57723994
46 -0.80042877 -0.42276006
47 0.26607429 -0.80042877
48 0.57723994 0.26607429
49 -0.42276006 0.57723994
50 0.92682905 -0.42276006
51 -0.42276006 0.92682905
52 0.57723994 -0.42276006
53 -1.11159441 0.57723994
54 0.61566341 -1.11159441
55 0.92682905 0.61566341
56 0.57723994 0.92682905
57 0.57723994 0.57723994
58 -0.77234917 0.57723994
59 -1.45083965 -0.77234917
60 -0.42276006 -1.45083965
61 -0.42276006 -0.42276006
62 0.57723994 -0.42276006
63 -1.42276006 0.57723994
64 -0.11159441 -1.42276006
65 1.57723994 -0.11159441
66 1.19957123 1.57723994
67 0.57723994 1.19957123
68 -0.42276006 0.57723994
69 0.57723994 -0.42276006
70 -1.42276006 0.57723994
71 -0.42276006 -1.42276006
72 0.57723994 -0.42276006
73 0.23799470 0.57723994
74 0.57723994 0.23799470
75 0.57723994 0.57723994
76 -0.07317095 0.57723994
77 -0.42276006 -0.07317095
78 -1.42276006 -0.42276006
79 0.57723994 -1.42276006
80 -0.42276006 0.57723994
81 -0.80042877 -0.42276006
82 -0.41241619 -0.80042877
83 -0.73392571 -0.41241619
84 -0.76200530 -0.73392571
85 -0.76200530 -0.76200530
86 0.57723994 -0.76200530
87 0.57723994 0.57723994
88 0.57723994 0.57723994
89 -1.07317095 0.57723994
90 -0.72358184 -1.07317095
91 0.53881648 -0.72358184
92 -0.72358184 0.53881648
93 -0.42276006 -0.72358184
94 -0.42276006 -0.42276006
95 1.26607429 -0.42276006
96 -0.07317095 1.26607429
97 0.57723994 -0.07317095
98 0.54916035 0.57723994
99 -1.11159441 0.54916035
100 0.88840559 -1.11159441
101 0.23799470 0.88840559
102 0.27641816 0.23799470
103 -0.42276006 0.27641816
104 1.54916035 -0.42276006
105 -1.41241619 1.54916035
106 0.23799470 -1.41241619
107 -1.42276006 0.23799470
108 -0.42276006 -1.42276006
109 -0.80042877 -0.42276006
110 -0.41241619 -0.80042877
111 -0.72358184 -0.41241619
112 0.92682905 -0.72358184
113 0.91648518 0.92682905
114 1.88840559 0.91648518
115 -0.11159441 1.88840559
116 0.57723994 -0.11159441
117 0.88840559 0.57723994
118 -0.11159441 0.88840559
119 -0.45083965 -0.11159441
120 0.57723994 -0.45083965
121 -1.11159441 0.57723994
122 -0.07317095 -1.11159441
123 -1.73392571 -0.07317095
124 -1.07317095 -1.73392571
125 -1.11159441 -1.07317095
126 0.88840559 -1.11159441
127 0.88840559 0.88840559
128 0.88840559 0.88840559
129 0.57723994 0.88840559
130 -0.42276006 0.57723994
131 -1.11159441 -0.42276006
132 0.84998212 -1.11159441
133 0.58758381 0.84998212
134 -0.80042877 0.58758381
135 0.57723994 -0.80042877
136 -0.07317095 0.57723994
137 -0.07317095 -0.07317095
138 -0.42276006 -0.07317095
139 -0.42276006 -0.42276006
140 -0.07317095 -0.42276006
141 0.26607429 -0.07317095
142 2.93717292 0.26607429
143 -1.07317095 2.93717292
144 -1.42276006 -1.07317095
145 0.57723994 -1.42276006
146 -0.73392571 0.57723994
147 -0.11159441 -0.73392571
148 -1.45083965 -0.11159441
149 -1.42276006 -1.45083965
150 0.88840559 -1.42276006
151 0.57723994 0.88840559
152 1.26607429 0.57723994
153 -1.11159441 1.26607429
154 1.23799470 -1.11159441
155 -0.11159441 1.23799470
156 -1.73392571 -0.11159441
157 0.92682905 -1.73392571
158 -0.45083965 0.92682905
159 NA -0.45083965
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 0.92682905 0.57723994
[2,] 1.26607429 0.92682905
[3,] 0.19957123 1.26607429
[4,] 1.19957123 0.19957123
[5,] -0.42276006 1.19957123
[6,] 0.57723994 -0.42276006
[7,] -0.42276006 0.57723994
[8,] -0.72358184 -0.42276006
[9,] 1.19957123 -0.72358184
[10,] -0.76200530 1.19957123
[11,] -0.72358184 -0.76200530
[12,] -0.41241619 -0.72358184
[13,] -2.07317095 -0.41241619
[14,] 0.57723994 -2.07317095
[15,] 0.22765083 0.57723994
[16,] -1.42276006 0.22765083
[17,] -0.10125054 -1.42276006
[18,] -0.42276006 -0.10125054
[19,] -0.07317095 -0.42276006
[20,] -0.42276006 -0.07317095
[21,] 1.58758381 -0.42276006
[22,] 0.89874946 1.58758381
[23,] -1.42276006 0.89874946
[24,] -0.80042877 -1.42276006
[25,] 0.88840559 -0.80042877
[26,] 0.57723994 0.88840559
[27,] 0.23799470 0.57723994
[28,] 0.57723994 0.23799470
[29,] -1.77234917 0.57723994
[30,] 0.57723994 -1.77234917
[31,] 0.57723994 0.57723994
[32,] 1.57723994 0.57723994
[33,] 1.57723994 1.57723994
[34,] 0.57723994 1.57723994
[35,] 0.26607429 0.57723994
[36,] 0.57723994 0.26607429
[37,] -0.80042877 0.57723994
[38,] 0.57723994 -0.80042877
[39,] 0.22765083 0.57723994
[40,] 0.26607429 0.22765083
[41,] -0.42276006 0.26607429
[42,] -0.10125054 -0.42276006
[43,] -0.42276006 -0.10125054
[44,] 0.57723994 -0.42276006
[45,] -0.42276006 0.57723994
[46,] -0.80042877 -0.42276006
[47,] 0.26607429 -0.80042877
[48,] 0.57723994 0.26607429
[49,] -0.42276006 0.57723994
[50,] 0.92682905 -0.42276006
[51,] -0.42276006 0.92682905
[52,] 0.57723994 -0.42276006
[53,] -1.11159441 0.57723994
[54,] 0.61566341 -1.11159441
[55,] 0.92682905 0.61566341
[56,] 0.57723994 0.92682905
[57,] 0.57723994 0.57723994
[58,] -0.77234917 0.57723994
[59,] -1.45083965 -0.77234917
[60,] -0.42276006 -1.45083965
[61,] -0.42276006 -0.42276006
[62,] 0.57723994 -0.42276006
[63,] -1.42276006 0.57723994
[64,] -0.11159441 -1.42276006
[65,] 1.57723994 -0.11159441
[66,] 1.19957123 1.57723994
[67,] 0.57723994 1.19957123
[68,] -0.42276006 0.57723994
[69,] 0.57723994 -0.42276006
[70,] -1.42276006 0.57723994
[71,] -0.42276006 -1.42276006
[72,] 0.57723994 -0.42276006
[73,] 0.23799470 0.57723994
[74,] 0.57723994 0.23799470
[75,] 0.57723994 0.57723994
[76,] -0.07317095 0.57723994
[77,] -0.42276006 -0.07317095
[78,] -1.42276006 -0.42276006
[79,] 0.57723994 -1.42276006
[80,] -0.42276006 0.57723994
[81,] -0.80042877 -0.42276006
[82,] -0.41241619 -0.80042877
[83,] -0.73392571 -0.41241619
[84,] -0.76200530 -0.73392571
[85,] -0.76200530 -0.76200530
[86,] 0.57723994 -0.76200530
[87,] 0.57723994 0.57723994
[88,] 0.57723994 0.57723994
[89,] -1.07317095 0.57723994
[90,] -0.72358184 -1.07317095
[91,] 0.53881648 -0.72358184
[92,] -0.72358184 0.53881648
[93,] -0.42276006 -0.72358184
[94,] -0.42276006 -0.42276006
[95,] 1.26607429 -0.42276006
[96,] -0.07317095 1.26607429
[97,] 0.57723994 -0.07317095
[98,] 0.54916035 0.57723994
[99,] -1.11159441 0.54916035
[100,] 0.88840559 -1.11159441
[101,] 0.23799470 0.88840559
[102,] 0.27641816 0.23799470
[103,] -0.42276006 0.27641816
[104,] 1.54916035 -0.42276006
[105,] -1.41241619 1.54916035
[106,] 0.23799470 -1.41241619
[107,] -1.42276006 0.23799470
[108,] -0.42276006 -1.42276006
[109,] -0.80042877 -0.42276006
[110,] -0.41241619 -0.80042877
[111,] -0.72358184 -0.41241619
[112,] 0.92682905 -0.72358184
[113,] 0.91648518 0.92682905
[114,] 1.88840559 0.91648518
[115,] -0.11159441 1.88840559
[116,] 0.57723994 -0.11159441
[117,] 0.88840559 0.57723994
[118,] -0.11159441 0.88840559
[119,] -0.45083965 -0.11159441
[120,] 0.57723994 -0.45083965
[121,] -1.11159441 0.57723994
[122,] -0.07317095 -1.11159441
[123,] -1.73392571 -0.07317095
[124,] -1.07317095 -1.73392571
[125,] -1.11159441 -1.07317095
[126,] 0.88840559 -1.11159441
[127,] 0.88840559 0.88840559
[128,] 0.88840559 0.88840559
[129,] 0.57723994 0.88840559
[130,] -0.42276006 0.57723994
[131,] -1.11159441 -0.42276006
[132,] 0.84998212 -1.11159441
[133,] 0.58758381 0.84998212
[134,] -0.80042877 0.58758381
[135,] 0.57723994 -0.80042877
[136,] -0.07317095 0.57723994
[137,] -0.07317095 -0.07317095
[138,] -0.42276006 -0.07317095
[139,] -0.42276006 -0.42276006
[140,] -0.07317095 -0.42276006
[141,] 0.26607429 -0.07317095
[142,] 2.93717292 0.26607429
[143,] -1.07317095 2.93717292
[144,] -1.42276006 -1.07317095
[145,] 0.57723994 -1.42276006
[146,] -0.73392571 0.57723994
[147,] -0.11159441 -0.73392571
[148,] -1.45083965 -0.11159441
[149,] -1.42276006 -1.45083965
[150,] 0.88840559 -1.42276006
[151,] 0.57723994 0.88840559
[152,] 1.26607429 0.57723994
[153,] -1.11159441 1.26607429
[154,] 1.23799470 -1.11159441
[155,] -0.11159441 1.23799470
[156,] -1.73392571 -0.11159441
[157,] 0.92682905 -1.73392571
[158,] -0.45083965 0.92682905
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 0.92682905 0.57723994
2 1.26607429 0.92682905
3 0.19957123 1.26607429
4 1.19957123 0.19957123
5 -0.42276006 1.19957123
6 0.57723994 -0.42276006
7 -0.42276006 0.57723994
8 -0.72358184 -0.42276006
9 1.19957123 -0.72358184
10 -0.76200530 1.19957123
11 -0.72358184 -0.76200530
12 -0.41241619 -0.72358184
13 -2.07317095 -0.41241619
14 0.57723994 -2.07317095
15 0.22765083 0.57723994
16 -1.42276006 0.22765083
17 -0.10125054 -1.42276006
18 -0.42276006 -0.10125054
19 -0.07317095 -0.42276006
20 -0.42276006 -0.07317095
21 1.58758381 -0.42276006
22 0.89874946 1.58758381
23 -1.42276006 0.89874946
24 -0.80042877 -1.42276006
25 0.88840559 -0.80042877
26 0.57723994 0.88840559
27 0.23799470 0.57723994
28 0.57723994 0.23799470
29 -1.77234917 0.57723994
30 0.57723994 -1.77234917
31 0.57723994 0.57723994
32 1.57723994 0.57723994
33 1.57723994 1.57723994
34 0.57723994 1.57723994
35 0.26607429 0.57723994
36 0.57723994 0.26607429
37 -0.80042877 0.57723994
38 0.57723994 -0.80042877
39 0.22765083 0.57723994
40 0.26607429 0.22765083
41 -0.42276006 0.26607429
42 -0.10125054 -0.42276006
43 -0.42276006 -0.10125054
44 0.57723994 -0.42276006
45 -0.42276006 0.57723994
46 -0.80042877 -0.42276006
47 0.26607429 -0.80042877
48 0.57723994 0.26607429
49 -0.42276006 0.57723994
50 0.92682905 -0.42276006
51 -0.42276006 0.92682905
52 0.57723994 -0.42276006
53 -1.11159441 0.57723994
54 0.61566341 -1.11159441
55 0.92682905 0.61566341
56 0.57723994 0.92682905
57 0.57723994 0.57723994
58 -0.77234917 0.57723994
59 -1.45083965 -0.77234917
60 -0.42276006 -1.45083965
61 -0.42276006 -0.42276006
62 0.57723994 -0.42276006
63 -1.42276006 0.57723994
64 -0.11159441 -1.42276006
65 1.57723994 -0.11159441
66 1.19957123 1.57723994
67 0.57723994 1.19957123
68 -0.42276006 0.57723994
69 0.57723994 -0.42276006
70 -1.42276006 0.57723994
71 -0.42276006 -1.42276006
72 0.57723994 -0.42276006
73 0.23799470 0.57723994
74 0.57723994 0.23799470
75 0.57723994 0.57723994
76 -0.07317095 0.57723994
77 -0.42276006 -0.07317095
78 -1.42276006 -0.42276006
79 0.57723994 -1.42276006
80 -0.42276006 0.57723994
81 -0.80042877 -0.42276006
82 -0.41241619 -0.80042877
83 -0.73392571 -0.41241619
84 -0.76200530 -0.73392571
85 -0.76200530 -0.76200530
86 0.57723994 -0.76200530
87 0.57723994 0.57723994
88 0.57723994 0.57723994
89 -1.07317095 0.57723994
90 -0.72358184 -1.07317095
91 0.53881648 -0.72358184
92 -0.72358184 0.53881648
93 -0.42276006 -0.72358184
94 -0.42276006 -0.42276006
95 1.26607429 -0.42276006
96 -0.07317095 1.26607429
97 0.57723994 -0.07317095
98 0.54916035 0.57723994
99 -1.11159441 0.54916035
100 0.88840559 -1.11159441
101 0.23799470 0.88840559
102 0.27641816 0.23799470
103 -0.42276006 0.27641816
104 1.54916035 -0.42276006
105 -1.41241619 1.54916035
106 0.23799470 -1.41241619
107 -1.42276006 0.23799470
108 -0.42276006 -1.42276006
109 -0.80042877 -0.42276006
110 -0.41241619 -0.80042877
111 -0.72358184 -0.41241619
112 0.92682905 -0.72358184
113 0.91648518 0.92682905
114 1.88840559 0.91648518
115 -0.11159441 1.88840559
116 0.57723994 -0.11159441
117 0.88840559 0.57723994
118 -0.11159441 0.88840559
119 -0.45083965 -0.11159441
120 0.57723994 -0.45083965
121 -1.11159441 0.57723994
122 -0.07317095 -1.11159441
123 -1.73392571 -0.07317095
124 -1.07317095 -1.73392571
125 -1.11159441 -1.07317095
126 0.88840559 -1.11159441
127 0.88840559 0.88840559
128 0.88840559 0.88840559
129 0.57723994 0.88840559
130 -0.42276006 0.57723994
131 -1.11159441 -0.42276006
132 0.84998212 -1.11159441
133 0.58758381 0.84998212
134 -0.80042877 0.58758381
135 0.57723994 -0.80042877
136 -0.07317095 0.57723994
137 -0.07317095 -0.07317095
138 -0.42276006 -0.07317095
139 -0.42276006 -0.42276006
140 -0.07317095 -0.42276006
141 0.26607429 -0.07317095
142 2.93717292 0.26607429
143 -1.07317095 2.93717292
144 -1.42276006 -1.07317095
145 0.57723994 -1.42276006
146 -0.73392571 0.57723994
147 -0.11159441 -0.73392571
148 -1.45083965 -0.11159441
149 -1.42276006 -1.45083965
150 0.88840559 -1.42276006
151 0.57723994 0.88840559
152 1.26607429 0.57723994
153 -1.11159441 1.26607429
154 1.23799470 -1.11159441
155 -0.11159441 1.23799470
156 -1.73392571 -0.11159441
157 0.92682905 -1.73392571
158 -0.45083965 0.92682905
> 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/www/html/freestat/rcomp/tmp/7bxm61291304774.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/www/html/freestat/rcomp/tmp/8bxm61291304774.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/www/html/freestat/rcomp/tmp/9bxm61291304774.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/www/html/freestat/rcomp/tmp/104olr1291304774.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/www/html/freestat/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/www/html/freestat/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/www/html/freestat/rcomp/tmp/1177kf1291304774.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/www/html/freestat/rcomp/tmp/12t8i31291304774.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/www/html/freestat/rcomp/tmp/137zyu1291304774.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/www/html/freestat/rcomp/tmp/14aiwi1291304774.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/www/html/freestat/rcomp/tmp/1539wl1291304774.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/www/html/freestat/rcomp/tmp/16h1bt1291304774.tab")
+ }
>
> try(system("convert tmp/1fn6g1291304774.ps tmp/1fn6g1291304774.png",intern=TRUE))
character(0)
> try(system("convert tmp/2fn6g1291304774.ps tmp/2fn6g1291304774.png",intern=TRUE))
character(0)
> try(system("convert tmp/38w5i1291304774.ps tmp/38w5i1291304774.png",intern=TRUE))
character(0)
> try(system("convert tmp/48w5i1291304774.ps tmp/48w5i1291304774.png",intern=TRUE))
character(0)
> try(system("convert tmp/58w5i1291304774.ps tmp/58w5i1291304774.png",intern=TRUE))
character(0)
> try(system("convert tmp/60o531291304774.ps tmp/60o531291304774.png",intern=TRUE))
character(0)
> try(system("convert tmp/7bxm61291304774.ps tmp/7bxm61291304774.png",intern=TRUE))
character(0)
> try(system("convert tmp/8bxm61291304774.ps tmp/8bxm61291304774.png",intern=TRUE))
character(0)
> try(system("convert tmp/9bxm61291304774.ps tmp/9bxm61291304774.png",intern=TRUE))
character(0)
> try(system("convert tmp/104olr1291304774.ps tmp/104olr1291304774.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
5.360 2.624 5.685