R version 2.9.0 (2009-04-17)
Copyright (C) 2009 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.
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(1
+ ,12
+ ,3
+ ,7
+ ,13
+ ,5
+ ,2
+ ,0
+ ,15
+ ,3
+ ,10
+ ,16
+ ,6
+ ,1
+ ,3
+ ,12
+ ,4
+ ,9
+ ,12
+ ,6
+ ,1
+ ,3
+ ,10
+ ,3
+ ,10
+ ,11
+ ,5
+ ,1
+ ,1
+ ,12
+ ,2
+ ,6
+ ,12
+ ,3
+ ,2
+ ,3
+ ,15
+ ,3
+ ,15
+ ,18
+ ,8
+ ,2
+ ,1
+ ,9
+ ,4
+ ,10
+ ,11
+ ,4
+ ,1
+ ,4
+ ,12
+ ,2
+ ,14
+ ,14
+ ,4
+ ,1
+ ,0
+ ,11
+ ,3
+ ,5
+ ,9
+ ,4
+ ,1
+ ,3
+ ,11
+ ,4
+ ,15
+ ,14
+ ,6
+ ,1
+ ,2
+ ,11
+ ,3
+ ,10
+ ,12
+ ,6
+ ,2
+ ,4
+ ,15
+ ,3
+ ,16
+ ,11
+ ,5
+ ,1
+ ,3
+ ,7
+ ,4
+ ,13
+ ,12
+ ,4
+ ,1
+ ,1
+ ,11
+ ,2
+ ,6
+ ,13
+ ,6
+ ,2
+ ,1
+ ,11
+ ,2
+ ,12
+ ,11
+ ,4
+ ,2
+ ,2
+ ,10
+ ,3
+ ,10
+ ,12
+ ,6
+ ,1
+ ,3
+ ,14
+ ,2
+ ,15
+ ,16
+ ,6
+ ,1
+ ,1
+ ,10
+ ,4
+ ,6
+ ,9
+ ,4
+ ,2
+ ,1
+ ,6
+ ,2
+ ,8
+ ,11
+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14
+ ,6
+ ,2
+ ,0
+ ,15
+ ,3
+ ,11
+ ,16
+ ,4
+ ,2
+ ,5
+ ,8
+ ,4
+ ,13
+ ,6
+ ,4
+ ,1
+ ,2
+ ,12
+ ,2
+ ,10
+ ,13
+ ,4
+ ,2
+ ,1
+ ,10
+ ,3
+ ,4
+ ,13
+ ,6
+ ,1
+ ,1
+ ,8
+ ,3
+ ,7
+ ,14
+ ,5
+ ,1
+ ,4
+ ,10
+ ,2
+ ,16
+ ,15
+ ,6
+ ,2
+ ,3
+ ,15
+ ,NA
+ ,15
+ ,14
+ ,6
+ ,2
+ ,0
+ ,16
+ ,4
+ ,9
+ ,15
+ ,8
+ ,2
+ ,3
+ ,13
+ ,4
+ ,12
+ ,13
+ ,7
+ ,1
+ ,3
+ ,16
+ ,3
+ ,14
+ ,16
+ ,7
+ ,1
+ ,0
+ ,9
+ ,4
+ ,7
+ ,12
+ ,4
+ ,1
+ ,2
+ ,14
+ ,2
+ ,10
+ ,15
+ ,6
+ ,1
+ ,5
+ ,14
+ ,4
+ ,16
+ ,12
+ ,6
+ ,2
+ ,2
+ ,12
+ ,4
+ ,11
+ ,14
+ ,2
+ ,2
+ ,0
+ ,6
+ ,3
+ ,0
+ ,0
+ ,0
+ ,1)
+ ,dim=c(7
+ ,156)
+ ,dimnames=list(c('sum'
+ ,'Popularity'
+ ,'IHaveManyFriends'
+ ,'KnowingPeople'
+ ,'Liked'
+ ,'Celebrity'
+ ,'Gender')
+ ,1:156))
> y <- array(NA,dim=c(7,156),dimnames=list(c('sum','Popularity','IHaveManyFriends','KnowingPeople','Liked','Celebrity','Gender'),1:156))
> 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 = '3'
> #'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
IHaveManyFriends sum Popularity KnowingPeople Liked Celebrity Gender
1 3 1 12 7 13 5 2
2 3 0 15 10 16 6 1
3 4 3 12 9 12 6 1
4 3 3 10 10 11 5 1
5 2 1 12 6 12 3 2
6 3 3 15 15 18 8 2
7 4 1 9 10 11 4 1
8 2 4 12 14 14 4 1
9 3 0 11 5 9 4 1
10 4 3 11 15 14 6 1
11 3 2 11 10 12 6 2
12 3 4 15 16 11 5 1
13 4 3 7 13 12 4 1
14 2 1 11 6 13 6 2
15 2 1 11 12 11 4 2
16 3 2 10 10 12 6 1
17 2 3 14 15 16 6 1
18 4 1 10 6 9 4 2
19 2 1 6 8 11 4 1
20 1 2 11 8 13 2 2
21 3 3 15 13 15 7 1
22 4 4 11 15 10 5 2
23 2 2 12 7 11 4 1
24 3 1 14 12 13 6 2
25 3 2 15 15 16 6 1
26 4 2 9 13 15 7 2
27 3 4 13 15 14 5 2
28 3 2 13 13 14 6 1
29 4 3 16 9 14 4 2
30 4 3 13 9 8 4 1
31 4 3 12 15 13 7 1
32 3 4 14 14 15 7 2
33 4 2 11 9 13 4 1
34 3 2 9 9 11 4 2
35 2 4 16 16 15 6 1
36 4 3 12 12 15 6 2
37 3 4 10 10 9 5 1
38 2 2 13 13 13 6 2
39 4 5 16 17 16 7 1
40 4 3 14 13 13 6 1
41 4 1 15 5 11 3 2
42 4 1 5 6 12 3 1
43 2 1 8 9 12 4 1
44 2 2 11 9 12 6 2
45 3 3 16 13 14 7 1
46 4 9 17 20 14 5 2
47 5 0 9 5 8 4 1
48 2 0 9 8 13 5 2
49 3 2 13 14 16 6 1
50 3 2 10 6 13 6 1
51 2 3 6 14 11 6 1
52 2 1 12 9 14 5 2
53 3 2 8 8 13 4 2
54 2 0 14 9 13 5 2
55 4 5 12 16 13 5 2
56 3 2 11 12 12 4 1
57 3 4 16 16 16 6 1
58 4 3 8 11 15 2 1
59 1 0 15 11 15 8 2
60 4 0 7 6 12 3 1
61 2 4 16 16 14 6 2
62 4 1 14 15 12 6 2
63 4 1 16 11 15 6 1
64 4 4 9 9 12 5 1
65 2 2 14 12 13 5 1
66 4 4 11 15 12 6 1
67 2 1 13 7 12 5 2
68 4 4 15 14 13 6 2
69 4 2 5 5 5 2 1
70 1 5 15 15 13 5 2
71 4 4 13 13 13 5 1
72 4 4 11 13 14 5 1
73 3 4 11 14 17 6 2
74 3 4 12 13 13 6 2
75 3 3 12 14 13 6 1
76 3 3 12 13 12 5 1
77 3 3 12 12 13 5 1
78 3 2 14 9 14 4 1
79 4 1 6 5 11 2 1
80 1 1 7 7 12 4 1
81 3 5 14 15 12 6 2
82 4 4 14 14 16 6 1
83 3 2 10 10 12 5 1
84 3 3 13 7 12 3 1
85 4 2 12 11 12 6 2
86 3 2 9 8 10 4 2
87 2 2 12 10 15 5 2
88 3 2 16 12 15 8 1
89 4 3 10 10 12 4 1
90 3 2 14 10 16 6 2
91 4 3 10 13 15 6 1
92 3 4 16 16 16 7 1
93 4 3 15 15 13 6 1
94 4 3 12 10 12 5 1
95 3 0 10 6 11 4 2
96 2 1 8 4 13 6 1
97 1 2 8 7 10 3 1
98 2 2 11 12 15 5 2
99 2 3 13 11 13 6 2
100 3 4 16 17 16 7 1
101 4 4 16 15 15 7 1
102 4 1 14 15 18 6 1
103 3 2 11 5 13 3 2
104 3 2 4 5 10 2 1
105 1 3 14 11 16 8 2
106 3 3 9 12 13 3 1
107 3 3 14 14 15 8 1
108 4 1 8 9 14 3 1
109 2 1 8 9 15 4 1
110 2 1 11 11 14 5 1
111 3 1 12 12 13 7 1
112 3 0 11 5 13 6 1
113 3 1 14 11 15 6 1
114 4 3 15 12 16 7 1
115 4 3 16 14 14 6 2
116 4 0 16 10 14 6 1
117 4 2 11 8 16 6 1
118 2 5 14 16 14 6 2
119 3 2 14 10 12 4 2
120 4 3 12 12 13 4 2
121 3 3 14 15 12 5 1
122 4 5 8 11 12 4 2
123 2 4 13 15 14 6 2
124 4 4 16 16 14 6 2
125 4 0 12 4 14 5 2
126 3 3 16 14 16 8 1
127 4 0 12 11 13 6 1
128 3 2 11 10 14 5 1
129 3 0 4 5 4 4 1
130 1 6 16 18 16 8 1
131 4 3 15 11 13 6 1
132 4 1 10 7 16 4 1
133 2 6 13 15 15 6 1
134 3 2 15 12 14 6 1
135 4 1 12 8 13 4 2
136 3 3 14 14 14 6 1
137 4 1 7 11 12 3 2
138 2 2 19 13 15 6 1
139 5 4 12 15 14 5 1
140 3 1 12 13 13 4 1
141 4 2 13 12 14 6 2
142 3 0 15 11 16 4 2
143 4 5 8 13 6 4 1
144 2 2 12 10 13 4 2
145 3 1 10 4 13 6 1
146 3 1 8 7 14 5 1
147 2 4 10 16 15 6 2
148 NA 3 15 15 14 6 2
149 4 0 16 9 15 8 2
150 4 3 13 12 13 7 1
151 3 3 16 14 16 7 1
152 4 0 9 7 12 4 1
153 2 2 14 10 15 6 1
154 4 5 14 16 12 6 2
155 4 2 12 11 14 2 2
156 3 0 6 0 0 0 1
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) sum Popularity KnowingPeople Liked
3.86541 0.01373 0.01171 0.02482 -0.03779
Celebrity Gender
-0.06573 -0.26518
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-2.32005 -0.57707 -0.02371 0.79763 1.73549
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 3.86541 0.43954 8.794 3.41e-15 ***
sum 0.01373 0.07135 0.192 0.8477
Popularity 0.01171 0.03465 0.338 0.7359
KnowingPeople 0.02482 0.03749 0.662 0.5089
Liked -0.03779 0.04024 -0.939 0.3492
Celebrity -0.06573 0.07079 -0.929 0.3546
Gender -0.26518 0.14971 -1.771 0.0786 .
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 0.8931 on 148 degrees of freedom
(1 observation deleted due to missingness)
Multiple R-squared: 0.04134, Adjusted R-squared: 0.002479
F-statistic: 1.064 on 6 and 148 DF, p-value: 0.387
> 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.19438667 0.3887733 0.8056133
[2,] 0.10031098 0.2006220 0.8996890
[3,] 0.11768984 0.2353797 0.8823102
[4,] 0.06741015 0.1348203 0.9325898
[5,] 0.12243152 0.2448630 0.8775685
[6,] 0.11508890 0.2301778 0.8849111
[7,] 0.12627739 0.2525548 0.8737226
[8,] 0.16813667 0.3362733 0.8318633
[9,] 0.23534199 0.4706840 0.7646580
[10,] 0.37893110 0.7578622 0.6210689
[11,] 0.35074058 0.7014812 0.6492594
[12,] 0.27811926 0.5562385 0.7218807
[13,] 0.23622539 0.4724508 0.7637746
[14,] 0.21752908 0.4350582 0.7824709
[15,] 0.16526540 0.3305308 0.8347346
[16,] 0.12733643 0.2546729 0.8726636
[17,] 0.11134330 0.2226866 0.8886567
[18,] 0.08526984 0.1705397 0.9147302
[19,] 0.06101442 0.1220288 0.9389856
[20,] 0.24257758 0.4851552 0.7574224
[21,] 0.20861039 0.4172208 0.7913896
[22,] 0.17241516 0.3448303 0.8275848
[23,] 0.14302712 0.2860542 0.8569729
[24,] 0.20796297 0.4159259 0.7920370
[25,] 0.16553804 0.3310761 0.8344620
[26,] 0.19697971 0.3939594 0.8030203
[27,] 0.21940997 0.4388199 0.7805900
[28,] 0.20642001 0.4128400 0.7935800
[29,] 0.23934665 0.4786933 0.7606533
[30,] 0.22546704 0.4509341 0.7745330
[31,] 0.21180934 0.4236187 0.7881907
[32,] 0.27774259 0.5554852 0.7222574
[33,] 0.31076358 0.6215272 0.6892364
[34,] 0.32767762 0.6553552 0.6723224
[35,] 0.36864617 0.7372923 0.6313538
[36,] 0.32399790 0.6479958 0.6760021
[37,] 0.29072425 0.5814485 0.7092757
[38,] 0.42955876 0.8591175 0.5704412
[39,] 0.41118757 0.8223751 0.5888124
[40,] 0.36369702 0.7273940 0.6363030
[41,] 0.32205239 0.6441048 0.6779476
[42,] 0.38842126 0.7768425 0.6115787
[43,] 0.37300217 0.7460043 0.6269978
[44,] 0.32934252 0.6586850 0.6706575
[45,] 0.31742742 0.6348548 0.6825726
[46,] 0.31301274 0.6260255 0.6869873
[47,] 0.27350075 0.5470015 0.7264992
[48,] 0.23438508 0.4687702 0.7656149
[49,] 0.25121963 0.5024393 0.7487804
[50,] 0.33941837 0.6788367 0.6605816
[51,] 0.34692037 0.6938407 0.6530796
[52,] 0.35629847 0.7125969 0.6437015
[53,] 0.39979124 0.7995825 0.6002088
[54,] 0.41632151 0.8326430 0.5836785
[55,] 0.40005241 0.8001048 0.5999476
[56,] 0.44085777 0.8817155 0.5591422
[57,] 0.41656868 0.8331374 0.5834313
[58,] 0.41686636 0.8337327 0.5831336
[59,] 0.42055274 0.8411055 0.5794473
[60,] 0.38830405 0.7766081 0.6116959
[61,] 0.61569178 0.7686164 0.3843082
[62,] 0.59733586 0.8053283 0.4026641
[63,] 0.58623708 0.8275258 0.4137629
[64,] 0.54089164 0.9182167 0.4591084
[65,] 0.49367570 0.9873514 0.5063243
[66,] 0.44981964 0.8996393 0.5501804
[67,] 0.40860630 0.8172126 0.5913937
[68,] 0.36642747 0.7328549 0.6335725
[69,] 0.32507960 0.6501592 0.6749204
[70,] 0.31417091 0.6283418 0.6858291
[71,] 0.53476460 0.9304708 0.4652354
[72,] 0.48889260 0.9777852 0.5111074
[73,] 0.48785319 0.9757064 0.5121468
[74,] 0.44284045 0.8856809 0.5571595
[75,] 0.40066343 0.8013269 0.5993366
[76,] 0.41550182 0.8310036 0.5844982
[77,] 0.36939783 0.7387957 0.6306022
[78,] 0.36839926 0.7367985 0.6316007
[79,] 0.32401715 0.6480343 0.6759828
[80,] 0.31249857 0.6249971 0.6875014
[81,] 0.27492542 0.5498508 0.7250746
[82,] 0.27912149 0.5582430 0.7208785
[83,] 0.24075900 0.4815180 0.7592410
[84,] 0.22790558 0.4558112 0.7720944
[85,] 0.22243747 0.4448749 0.7775625
[86,] 0.19239181 0.3847836 0.8076082
[87,] 0.19603618 0.3920724 0.8039638
[88,] 0.42724564 0.8544913 0.5727544
[89,] 0.44285810 0.8857162 0.5571419
[90,] 0.45895006 0.9179001 0.5410499
[91,] 0.41070980 0.8214196 0.5892902
[92,] 0.41811337 0.8362267 0.5818866
[93,] 0.42418018 0.8483604 0.5758198
[94,] 0.38380046 0.7676009 0.6161995
[95,] 0.34202664 0.6840533 0.6579734
[96,] 0.53942163 0.9211567 0.4605784
[97,] 0.49024831 0.9804966 0.5097517
[98,] 0.43862960 0.8772592 0.5613704
[99,] 0.43303878 0.8660776 0.5669612
[100,] 0.47053927 0.9410785 0.5294607
[101,] 0.52409309 0.9518138 0.4759069
[102,] 0.47448558 0.9489712 0.5255144
[103,] 0.43435851 0.8687170 0.5656415
[104,] 0.38666359 0.7733272 0.6133364
[105,] 0.39678224 0.7935645 0.6032178
[106,] 0.39844468 0.7968894 0.6015553
[107,] 0.38975104 0.7795021 0.6102490
[108,] 0.38656157 0.7731231 0.6134384
[109,] 0.41270784 0.8254157 0.5872922
[110,] 0.36862434 0.7372487 0.6313757
[111,] 0.34729565 0.6945913 0.6527044
[112,] 0.29692883 0.5938577 0.7030712
[113,] 0.28506599 0.5701320 0.7149340
[114,] 0.32749143 0.6549829 0.6725086
[115,] 0.31711789 0.6342358 0.6828821
[116,] 0.30526676 0.6105335 0.6947332
[117,] 0.25195255 0.5039051 0.7480475
[118,] 0.22552416 0.4510483 0.7744758
[119,] 0.17997490 0.3599498 0.8200251
[120,] 0.17787222 0.3557444 0.8221278
[121,] 0.34099120 0.6819824 0.6590088
[122,] 0.35303778 0.7060756 0.6469622
[123,] 0.38326885 0.7665377 0.6167311
[124,] 0.37648365 0.7529673 0.6235164
[125,] 0.30558942 0.6111788 0.6944106
[126,] 0.29460018 0.5892004 0.7053998
[127,] 0.23395727 0.4679145 0.7660427
[128,] 0.18376578 0.3675316 0.8162342
[129,] 0.22700995 0.4540199 0.7729900
[130,] 0.40197666 0.8039533 0.5980233
[131,] 0.33748340 0.6749668 0.6625166
[132,] 0.28929066 0.5785813 0.7107093
[133,] 0.21371536 0.4274307 0.7862846
[134,] 0.16517757 0.3303551 0.8348224
[135,] 0.20759363 0.4151873 0.7924064
[136,] 0.12883609 0.2576722 0.8711639
[137,] 0.11371207 0.2274241 0.8862879
> postscript(file="/var/www/html/rcomp/tmp/1nn011291394578.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/www/html/rcomp/tmp/2nn011291394578.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/rcomp/tmp/3ffz41291394578.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/rcomp/tmp/4ffz41291394578.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/rcomp/tmp/5ffz41291394578.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 = 155
Frequency = 1
1 2 3 4 5 6
0.15683437 -0.02511898 0.84249809 -0.26242167 -0.98759343 0.28180012
7 8 9 10 11 12
0.71101492 -1.35122737 -0.25014348 0.78085126 0.10829228 -0.48363970
13 14 15 16 17 18
0.67030155 -0.74090124 -1.09687464 -0.14517409 -1.17870494 0.98819423
19 20 21 22 23 24
-1.20420712 -2.06719803 -0.11282857 0.81541578 -1.26337902 0.07503099
25 26 27 28 29 30
-0.17668771 1.23634317 -0.05685254 -0.17919764 1.00494644 0.54817153
31 32 33 34 35 36
0.79708272 0.12550915 0.77426395 -0.01271348 -1.27846609 1.14657341
37 38 39 40 41 42
-0.35172676 -0.95180868 0.78650256 0.75757468 0.96430754 0.82920632
43 44 45 46 47 48
-1.21466318 -0.86688527 -0.16232802 0.70354993 1.73549012 -0.81912678
49 50 51 52 53 54
-0.12844323 -0.00809585 -1.24913649 -0.85502210 0.09939685 -0.90250433
55 56 57 58 59 60
0.87851936 -0.33799183 -0.24067766 0.69013890 -1.69109065 0.81951252
61 62 63 64 65 66
-1.05107714 0.96277521 0.88683088 0.79817200 -1.26960554 0.69154616
67 68 69 70 71 72
-0.89266507 0.97249036 0.51005061 -2.13179125 0.68982655 0.75103701
73 74 75 76 77 78
0.17048815 0.03244586 -0.24382574 -0.32252263 -0.25991175 -0.22308067
79 80 81 82 83 84
0.73879841 -2.15330726 -0.09213775 0.83238928 -0.21090500 -0.31676076
85 86 87 88 89 90
1.07175881 -0.02567946 -0.85578436 -0.02025799 0.70963585 0.22431295
91 92 93 94 95 96
0.87999561 -0.17494675 0.69621876 0.75194473 0.07749933 -0.92130067
97 98 99 100 101 102
-2.32005429 -0.89371824 -0.91589201 -0.19976920 0.81208727 0.92432840
103 104 105 106 107 108
0.07300023 -0.28929622 -1.68277592 -0.35624051 -0.06020909 0.79518277
109 110 111 112 113 114
-1.10129789 -1.15813337 -0.10099344 0.03247206 -0.08974708 0.94978231
115 116 117 118 119 120
1.01229601 0.88759314 1.04391352 -1.04138334 -0.05830260 0.93953473
121 122 123 124 125 126
-0.39558957 0.94595635 -0.99112163 0.94892286 1.28281840 -0.04584270
127 128 129 130 131 132
0.87182633 -0.14703916 -0.35710850 -2.18631722 0.79550856 0.96271340
133 134 135 136 137 138
-1.24596706 -0.17779722 1.06628101 -0.22945934 0.94684941 -1.21167532
139 140 141 142 143 144
1.68968109 -0.32300863 1.11080220 0.08377413 0.40440348 -0.99709213
145 146 147 149 150 151
0.05527729 -0.02371051 -0.94302260 1.34684323 0.85983906 -0.11157361
152 153 154 155 156
0.83699894 -1.07865287 0.88303980 0.88441202 -0.67049565
> postscript(file="/var/www/html/rcomp/tmp/686hp1291394578.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 = 155
Frequency = 1
lag(myerror, k = 1) myerror
0 0.15683437 NA
1 -0.02511898 0.15683437
2 0.84249809 -0.02511898
3 -0.26242167 0.84249809
4 -0.98759343 -0.26242167
5 0.28180012 -0.98759343
6 0.71101492 0.28180012
7 -1.35122737 0.71101492
8 -0.25014348 -1.35122737
9 0.78085126 -0.25014348
10 0.10829228 0.78085126
11 -0.48363970 0.10829228
12 0.67030155 -0.48363970
13 -0.74090124 0.67030155
14 -1.09687464 -0.74090124
15 -0.14517409 -1.09687464
16 -1.17870494 -0.14517409
17 0.98819423 -1.17870494
18 -1.20420712 0.98819423
19 -2.06719803 -1.20420712
20 -0.11282857 -2.06719803
21 0.81541578 -0.11282857
22 -1.26337902 0.81541578
23 0.07503099 -1.26337902
24 -0.17668771 0.07503099
25 1.23634317 -0.17668771
26 -0.05685254 1.23634317
27 -0.17919764 -0.05685254
28 1.00494644 -0.17919764
29 0.54817153 1.00494644
30 0.79708272 0.54817153
31 0.12550915 0.79708272
32 0.77426395 0.12550915
33 -0.01271348 0.77426395
34 -1.27846609 -0.01271348
35 1.14657341 -1.27846609
36 -0.35172676 1.14657341
37 -0.95180868 -0.35172676
38 0.78650256 -0.95180868
39 0.75757468 0.78650256
40 0.96430754 0.75757468
41 0.82920632 0.96430754
42 -1.21466318 0.82920632
43 -0.86688527 -1.21466318
44 -0.16232802 -0.86688527
45 0.70354993 -0.16232802
46 1.73549012 0.70354993
47 -0.81912678 1.73549012
48 -0.12844323 -0.81912678
49 -0.00809585 -0.12844323
50 -1.24913649 -0.00809585
51 -0.85502210 -1.24913649
52 0.09939685 -0.85502210
53 -0.90250433 0.09939685
54 0.87851936 -0.90250433
55 -0.33799183 0.87851936
56 -0.24067766 -0.33799183
57 0.69013890 -0.24067766
58 -1.69109065 0.69013890
59 0.81951252 -1.69109065
60 -1.05107714 0.81951252
61 0.96277521 -1.05107714
62 0.88683088 0.96277521
63 0.79817200 0.88683088
64 -1.26960554 0.79817200
65 0.69154616 -1.26960554
66 -0.89266507 0.69154616
67 0.97249036 -0.89266507
68 0.51005061 0.97249036
69 -2.13179125 0.51005061
70 0.68982655 -2.13179125
71 0.75103701 0.68982655
72 0.17048815 0.75103701
73 0.03244586 0.17048815
74 -0.24382574 0.03244586
75 -0.32252263 -0.24382574
76 -0.25991175 -0.32252263
77 -0.22308067 -0.25991175
78 0.73879841 -0.22308067
79 -2.15330726 0.73879841
80 -0.09213775 -2.15330726
81 0.83238928 -0.09213775
82 -0.21090500 0.83238928
83 -0.31676076 -0.21090500
84 1.07175881 -0.31676076
85 -0.02567946 1.07175881
86 -0.85578436 -0.02567946
87 -0.02025799 -0.85578436
88 0.70963585 -0.02025799
89 0.22431295 0.70963585
90 0.87999561 0.22431295
91 -0.17494675 0.87999561
92 0.69621876 -0.17494675
93 0.75194473 0.69621876
94 0.07749933 0.75194473
95 -0.92130067 0.07749933
96 -2.32005429 -0.92130067
97 -0.89371824 -2.32005429
98 -0.91589201 -0.89371824
99 -0.19976920 -0.91589201
100 0.81208727 -0.19976920
101 0.92432840 0.81208727
102 0.07300023 0.92432840
103 -0.28929622 0.07300023
104 -1.68277592 -0.28929622
105 -0.35624051 -1.68277592
106 -0.06020909 -0.35624051
107 0.79518277 -0.06020909
108 -1.10129789 0.79518277
109 -1.15813337 -1.10129789
110 -0.10099344 -1.15813337
111 0.03247206 -0.10099344
112 -0.08974708 0.03247206
113 0.94978231 -0.08974708
114 1.01229601 0.94978231
115 0.88759314 1.01229601
116 1.04391352 0.88759314
117 -1.04138334 1.04391352
118 -0.05830260 -1.04138334
119 0.93953473 -0.05830260
120 -0.39558957 0.93953473
121 0.94595635 -0.39558957
122 -0.99112163 0.94595635
123 0.94892286 -0.99112163
124 1.28281840 0.94892286
125 -0.04584270 1.28281840
126 0.87182633 -0.04584270
127 -0.14703916 0.87182633
128 -0.35710850 -0.14703916
129 -2.18631722 -0.35710850
130 0.79550856 -2.18631722
131 0.96271340 0.79550856
132 -1.24596706 0.96271340
133 -0.17779722 -1.24596706
134 1.06628101 -0.17779722
135 -0.22945934 1.06628101
136 0.94684941 -0.22945934
137 -1.21167532 0.94684941
138 1.68968109 -1.21167532
139 -0.32300863 1.68968109
140 1.11080220 -0.32300863
141 0.08377413 1.11080220
142 0.40440348 0.08377413
143 -0.99709213 0.40440348
144 0.05527729 -0.99709213
145 -0.02371051 0.05527729
146 -0.94302260 -0.02371051
147 1.34684323 -0.94302260
148 0.85983906 1.34684323
149 -0.11157361 0.85983906
150 0.83699894 -0.11157361
151 -1.07865287 0.83699894
152 0.88303980 -1.07865287
153 0.88441202 0.88303980
154 -0.67049565 0.88441202
155 NA -0.67049565
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] -0.02511898 0.15683437
[2,] 0.84249809 -0.02511898
[3,] -0.26242167 0.84249809
[4,] -0.98759343 -0.26242167
[5,] 0.28180012 -0.98759343
[6,] 0.71101492 0.28180012
[7,] -1.35122737 0.71101492
[8,] -0.25014348 -1.35122737
[9,] 0.78085126 -0.25014348
[10,] 0.10829228 0.78085126
[11,] -0.48363970 0.10829228
[12,] 0.67030155 -0.48363970
[13,] -0.74090124 0.67030155
[14,] -1.09687464 -0.74090124
[15,] -0.14517409 -1.09687464
[16,] -1.17870494 -0.14517409
[17,] 0.98819423 -1.17870494
[18,] -1.20420712 0.98819423
[19,] -2.06719803 -1.20420712
[20,] -0.11282857 -2.06719803
[21,] 0.81541578 -0.11282857
[22,] -1.26337902 0.81541578
[23,] 0.07503099 -1.26337902
[24,] -0.17668771 0.07503099
[25,] 1.23634317 -0.17668771
[26,] -0.05685254 1.23634317
[27,] -0.17919764 -0.05685254
[28,] 1.00494644 -0.17919764
[29,] 0.54817153 1.00494644
[30,] 0.79708272 0.54817153
[31,] 0.12550915 0.79708272
[32,] 0.77426395 0.12550915
[33,] -0.01271348 0.77426395
[34,] -1.27846609 -0.01271348
[35,] 1.14657341 -1.27846609
[36,] -0.35172676 1.14657341
[37,] -0.95180868 -0.35172676
[38,] 0.78650256 -0.95180868
[39,] 0.75757468 0.78650256
[40,] 0.96430754 0.75757468
[41,] 0.82920632 0.96430754
[42,] -1.21466318 0.82920632
[43,] -0.86688527 -1.21466318
[44,] -0.16232802 -0.86688527
[45,] 0.70354993 -0.16232802
[46,] 1.73549012 0.70354993
[47,] -0.81912678 1.73549012
[48,] -0.12844323 -0.81912678
[49,] -0.00809585 -0.12844323
[50,] -1.24913649 -0.00809585
[51,] -0.85502210 -1.24913649
[52,] 0.09939685 -0.85502210
[53,] -0.90250433 0.09939685
[54,] 0.87851936 -0.90250433
[55,] -0.33799183 0.87851936
[56,] -0.24067766 -0.33799183
[57,] 0.69013890 -0.24067766
[58,] -1.69109065 0.69013890
[59,] 0.81951252 -1.69109065
[60,] -1.05107714 0.81951252
[61,] 0.96277521 -1.05107714
[62,] 0.88683088 0.96277521
[63,] 0.79817200 0.88683088
[64,] -1.26960554 0.79817200
[65,] 0.69154616 -1.26960554
[66,] -0.89266507 0.69154616
[67,] 0.97249036 -0.89266507
[68,] 0.51005061 0.97249036
[69,] -2.13179125 0.51005061
[70,] 0.68982655 -2.13179125
[71,] 0.75103701 0.68982655
[72,] 0.17048815 0.75103701
[73,] 0.03244586 0.17048815
[74,] -0.24382574 0.03244586
[75,] -0.32252263 -0.24382574
[76,] -0.25991175 -0.32252263
[77,] -0.22308067 -0.25991175
[78,] 0.73879841 -0.22308067
[79,] -2.15330726 0.73879841
[80,] -0.09213775 -2.15330726
[81,] 0.83238928 -0.09213775
[82,] -0.21090500 0.83238928
[83,] -0.31676076 -0.21090500
[84,] 1.07175881 -0.31676076
[85,] -0.02567946 1.07175881
[86,] -0.85578436 -0.02567946
[87,] -0.02025799 -0.85578436
[88,] 0.70963585 -0.02025799
[89,] 0.22431295 0.70963585
[90,] 0.87999561 0.22431295
[91,] -0.17494675 0.87999561
[92,] 0.69621876 -0.17494675
[93,] 0.75194473 0.69621876
[94,] 0.07749933 0.75194473
[95,] -0.92130067 0.07749933
[96,] -2.32005429 -0.92130067
[97,] -0.89371824 -2.32005429
[98,] -0.91589201 -0.89371824
[99,] -0.19976920 -0.91589201
[100,] 0.81208727 -0.19976920
[101,] 0.92432840 0.81208727
[102,] 0.07300023 0.92432840
[103,] -0.28929622 0.07300023
[104,] -1.68277592 -0.28929622
[105,] -0.35624051 -1.68277592
[106,] -0.06020909 -0.35624051
[107,] 0.79518277 -0.06020909
[108,] -1.10129789 0.79518277
[109,] -1.15813337 -1.10129789
[110,] -0.10099344 -1.15813337
[111,] 0.03247206 -0.10099344
[112,] -0.08974708 0.03247206
[113,] 0.94978231 -0.08974708
[114,] 1.01229601 0.94978231
[115,] 0.88759314 1.01229601
[116,] 1.04391352 0.88759314
[117,] -1.04138334 1.04391352
[118,] -0.05830260 -1.04138334
[119,] 0.93953473 -0.05830260
[120,] -0.39558957 0.93953473
[121,] 0.94595635 -0.39558957
[122,] -0.99112163 0.94595635
[123,] 0.94892286 -0.99112163
[124,] 1.28281840 0.94892286
[125,] -0.04584270 1.28281840
[126,] 0.87182633 -0.04584270
[127,] -0.14703916 0.87182633
[128,] -0.35710850 -0.14703916
[129,] -2.18631722 -0.35710850
[130,] 0.79550856 -2.18631722
[131,] 0.96271340 0.79550856
[132,] -1.24596706 0.96271340
[133,] -0.17779722 -1.24596706
[134,] 1.06628101 -0.17779722
[135,] -0.22945934 1.06628101
[136,] 0.94684941 -0.22945934
[137,] -1.21167532 0.94684941
[138,] 1.68968109 -1.21167532
[139,] -0.32300863 1.68968109
[140,] 1.11080220 -0.32300863
[141,] 0.08377413 1.11080220
[142,] 0.40440348 0.08377413
[143,] -0.99709213 0.40440348
[144,] 0.05527729 -0.99709213
[145,] -0.02371051 0.05527729
[146,] -0.94302260 -0.02371051
[147,] 1.34684323 -0.94302260
[148,] 0.85983906 1.34684323
[149,] -0.11157361 0.85983906
[150,] 0.83699894 -0.11157361
[151,] -1.07865287 0.83699894
[152,] 0.88303980 -1.07865287
[153,] 0.88441202 0.88303980
[154,] -0.67049565 0.88441202
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 -0.02511898 0.15683437
2 0.84249809 -0.02511898
3 -0.26242167 0.84249809
4 -0.98759343 -0.26242167
5 0.28180012 -0.98759343
6 0.71101492 0.28180012
7 -1.35122737 0.71101492
8 -0.25014348 -1.35122737
9 0.78085126 -0.25014348
10 0.10829228 0.78085126
11 -0.48363970 0.10829228
12 0.67030155 -0.48363970
13 -0.74090124 0.67030155
14 -1.09687464 -0.74090124
15 -0.14517409 -1.09687464
16 -1.17870494 -0.14517409
17 0.98819423 -1.17870494
18 -1.20420712 0.98819423
19 -2.06719803 -1.20420712
20 -0.11282857 -2.06719803
21 0.81541578 -0.11282857
22 -1.26337902 0.81541578
23 0.07503099 -1.26337902
24 -0.17668771 0.07503099
25 1.23634317 -0.17668771
26 -0.05685254 1.23634317
27 -0.17919764 -0.05685254
28 1.00494644 -0.17919764
29 0.54817153 1.00494644
30 0.79708272 0.54817153
31 0.12550915 0.79708272
32 0.77426395 0.12550915
33 -0.01271348 0.77426395
34 -1.27846609 -0.01271348
35 1.14657341 -1.27846609
36 -0.35172676 1.14657341
37 -0.95180868 -0.35172676
38 0.78650256 -0.95180868
39 0.75757468 0.78650256
40 0.96430754 0.75757468
41 0.82920632 0.96430754
42 -1.21466318 0.82920632
43 -0.86688527 -1.21466318
44 -0.16232802 -0.86688527
45 0.70354993 -0.16232802
46 1.73549012 0.70354993
47 -0.81912678 1.73549012
48 -0.12844323 -0.81912678
49 -0.00809585 -0.12844323
50 -1.24913649 -0.00809585
51 -0.85502210 -1.24913649
52 0.09939685 -0.85502210
53 -0.90250433 0.09939685
54 0.87851936 -0.90250433
55 -0.33799183 0.87851936
56 -0.24067766 -0.33799183
57 0.69013890 -0.24067766
58 -1.69109065 0.69013890
59 0.81951252 -1.69109065
60 -1.05107714 0.81951252
61 0.96277521 -1.05107714
62 0.88683088 0.96277521
63 0.79817200 0.88683088
64 -1.26960554 0.79817200
65 0.69154616 -1.26960554
66 -0.89266507 0.69154616
67 0.97249036 -0.89266507
68 0.51005061 0.97249036
69 -2.13179125 0.51005061
70 0.68982655 -2.13179125
71 0.75103701 0.68982655
72 0.17048815 0.75103701
73 0.03244586 0.17048815
74 -0.24382574 0.03244586
75 -0.32252263 -0.24382574
76 -0.25991175 -0.32252263
77 -0.22308067 -0.25991175
78 0.73879841 -0.22308067
79 -2.15330726 0.73879841
80 -0.09213775 -2.15330726
81 0.83238928 -0.09213775
82 -0.21090500 0.83238928
83 -0.31676076 -0.21090500
84 1.07175881 -0.31676076
85 -0.02567946 1.07175881
86 -0.85578436 -0.02567946
87 -0.02025799 -0.85578436
88 0.70963585 -0.02025799
89 0.22431295 0.70963585
90 0.87999561 0.22431295
91 -0.17494675 0.87999561
92 0.69621876 -0.17494675
93 0.75194473 0.69621876
94 0.07749933 0.75194473
95 -0.92130067 0.07749933
96 -2.32005429 -0.92130067
97 -0.89371824 -2.32005429
98 -0.91589201 -0.89371824
99 -0.19976920 -0.91589201
100 0.81208727 -0.19976920
101 0.92432840 0.81208727
102 0.07300023 0.92432840
103 -0.28929622 0.07300023
104 -1.68277592 -0.28929622
105 -0.35624051 -1.68277592
106 -0.06020909 -0.35624051
107 0.79518277 -0.06020909
108 -1.10129789 0.79518277
109 -1.15813337 -1.10129789
110 -0.10099344 -1.15813337
111 0.03247206 -0.10099344
112 -0.08974708 0.03247206
113 0.94978231 -0.08974708
114 1.01229601 0.94978231
115 0.88759314 1.01229601
116 1.04391352 0.88759314
117 -1.04138334 1.04391352
118 -0.05830260 -1.04138334
119 0.93953473 -0.05830260
120 -0.39558957 0.93953473
121 0.94595635 -0.39558957
122 -0.99112163 0.94595635
123 0.94892286 -0.99112163
124 1.28281840 0.94892286
125 -0.04584270 1.28281840
126 0.87182633 -0.04584270
127 -0.14703916 0.87182633
128 -0.35710850 -0.14703916
129 -2.18631722 -0.35710850
130 0.79550856 -2.18631722
131 0.96271340 0.79550856
132 -1.24596706 0.96271340
133 -0.17779722 -1.24596706
134 1.06628101 -0.17779722
135 -0.22945934 1.06628101
136 0.94684941 -0.22945934
137 -1.21167532 0.94684941
138 1.68968109 -1.21167532
139 -0.32300863 1.68968109
140 1.11080220 -0.32300863
141 0.08377413 1.11080220
142 0.40440348 0.08377413
143 -0.99709213 0.40440348
144 0.05527729 -0.99709213
145 -0.02371051 0.05527729
146 -0.94302260 -0.02371051
147 1.34684323 -0.94302260
148 0.85983906 1.34684323
149 -0.11157361 0.85983906
150 0.83699894 -0.11157361
151 -1.07865287 0.83699894
152 0.88303980 -1.07865287
153 0.88441202 0.88303980
154 -0.67049565 0.88441202
> 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/rcomp/tmp/786hp1291394578.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/rcomp/tmp/8jfgs1291394578.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/rcomp/tmp/9jfgs1291394578.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/rcomp/tmp/10coxd1291394578.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/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
> load(file="/var/www/html/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/rcomp/tmp/11x7d11291394578.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/rcomp/tmp/121qcp1291394578.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/rcomp/tmp/13ezaf1291394578.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/rcomp/tmp/14iiq31291394578.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/rcomp/tmp/1530p91291394578.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/rcomp/tmp/16pj5f1291394578.tab")
+ }
>
> try(system("convert tmp/1nn011291394578.ps tmp/1nn011291394578.png",intern=TRUE))
character(0)
> try(system("convert tmp/2nn011291394578.ps tmp/2nn011291394578.png",intern=TRUE))
character(0)
> try(system("convert tmp/3ffz41291394578.ps tmp/3ffz41291394578.png",intern=TRUE))
character(0)
> try(system("convert tmp/4ffz41291394578.ps tmp/4ffz41291394578.png",intern=TRUE))
character(0)
> try(system("convert tmp/5ffz41291394578.ps tmp/5ffz41291394578.png",intern=TRUE))
character(0)
> try(system("convert tmp/686hp1291394578.ps tmp/686hp1291394578.png",intern=TRUE))
character(0)
> try(system("convert tmp/786hp1291394578.ps tmp/786hp1291394578.png",intern=TRUE))
character(0)
> try(system("convert tmp/8jfgs1291394578.ps tmp/8jfgs1291394578.png",intern=TRUE))
character(0)
> try(system("convert tmp/9jfgs1291394578.ps tmp/9jfgs1291394578.png",intern=TRUE))
character(0)
> try(system("convert tmp/10coxd1291394578.ps tmp/10coxd1291394578.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
4.033 1.717 8.836