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(13
+ ,13
+ ,14
+ ,13
+ ,3
+ ,13
+ ,0
+ ,12
+ ,8
+ ,13
+ ,5
+ ,18
+ ,0
+ ,15
+ ,12
+ ,16
+ ,6
+ ,13
+ ,12
+ ,12
+ ,7
+ ,12
+ ,6
+ ,17
+ ,10
+ ,10
+ ,10
+ ,11
+ ,5
+ ,13
+ ,12
+ ,12
+ ,7
+ ,12
+ ,3
+ ,17
+ ,0
+ ,9
+ ,11
+ ,11
+ ,4
+ ,13
+ ,12
+ ,12
+ ,14
+ ,14
+ ,4
+ ,13
+ ,0
+ ,11
+ ,6
+ ,9
+ ,4
+ ,18
+ ,0
+ ,11
+ ,16
+ ,14
+ ,6
+ ,13
+ ,0
+ ,11
+ ,11
+ ,12
+ ,6
+ ,13
+ ,15
+ ,15
+ ,16
+ ,11
+ ,5
+ ,13
+ ,7
+ ,7
+ ,12
+ ,12
+ ,4
+ ,13
+ ,11
+ ,11
+ ,7
+ ,13
+ ,6
+ ,14
+ ,0
+ ,11
+ ,13
+ ,11
+ ,4
+ ,13
+ ,10
+ ,10
+ ,11
+ ,12
+ ,6
+ ,17
+ ,0
+ ,14
+ ,15
+ ,16
+ ,6
+ ,14
+ ,10
+ ,10
+ ,7
+ ,9
+ ,4
+ ,12
+ ,6
+ ,6
+ ,9
+ ,11
+ ,4
+ ,13
+ ,11
+ ,11
+ ,7
+ ,13
+ ,2
+ ,17
+ ,15
+ ,15
+ ,14
+ ,15
+ ,7
+ ,13
+ ,14
+ ,14
+ ,15
+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 ,13
+ ,10
+ ,10
+ ,8
+ ,16
+ ,4
+ ,16
+ ,13
+ ,13
+ ,11
+ ,15
+ ,6
+ ,13
+ ,14
+ ,14
+ ,15
+ ,14
+ ,6
+ ,13
+ ,7
+ ,7
+ ,13
+ ,12
+ ,3
+ ,16
+ ,12
+ ,12
+ ,14
+ ,14
+ ,5
+ ,13
+ ,0
+ ,12
+ ,16
+ ,13
+ ,4
+ ,13
+ ,13
+ ,13
+ ,14
+ ,14
+ ,6
+ ,13
+ ,15
+ ,15
+ ,14
+ ,16
+ ,4
+ ,16
+ ,12
+ ,12
+ ,10
+ ,13
+ ,4
+ ,13
+ ,10
+ ,10
+ ,4
+ ,13
+ ,6
+ ,13
+ ,8
+ ,8
+ ,8
+ ,14
+ ,5
+ ,13
+ ,10
+ ,10
+ ,15
+ ,15
+ ,6
+ ,13
+ ,15
+ ,15
+ ,16
+ ,14
+ ,6
+ ,16
+ ,16
+ ,16
+ ,12
+ ,15
+ ,8
+ ,13
+ ,13
+ ,13
+ ,12
+ ,13
+ ,7
+ ,13
+ ,16
+ ,16
+ ,15
+ ,16
+ ,7
+ ,13
+ ,9
+ ,9
+ ,9
+ ,12
+ ,4
+ ,16
+ ,14
+ ,14
+ ,12
+ ,15
+ ,6
+ ,13
+ ,14
+ ,14
+ ,14
+ ,12
+ ,6
+ ,13
+ ,12
+ ,12
+ ,11
+ ,14
+ ,2
+ ,13)
+ ,dim=c(6
+ ,127)
+ ,dimnames=list(c('Pop*geslacht'
+ ,'Popularity'
+ ,'KnowingPeople'
+ ,'Liked'
+ ,'Celebrity'
+ ,'Happiness')
+ ,1:127))
> y <- array(NA,dim=c(6,127),dimnames=list(c('Pop*geslacht','Popularity','KnowingPeople','Liked','Celebrity','Happiness'),1:127))
> 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
Popularity Pop*geslacht KnowingPeople Liked Celebrity Happiness
1 13 13 14 13 3 13
2 12 0 8 13 5 18
3 15 0 12 16 6 13
4 12 12 7 12 6 17
5 10 10 10 11 5 13
6 12 12 7 12 3 17
7 9 0 11 11 4 13
8 12 12 14 14 4 13
9 11 0 6 9 4 18
10 11 0 16 14 6 13
11 11 0 11 12 6 13
12 15 15 16 11 5 13
13 7 7 12 12 4 13
14 11 11 7 13 6 14
15 11 0 13 11 4 13
16 10 10 11 12 6 17
17 14 0 15 16 6 14
18 10 10 7 9 4 12
19 6 6 9 11 4 13
20 11 11 7 13 2 17
21 15 15 14 15 7 13
22 14 14 15 13 6 13
23 9 0 15 15 7 13
24 13 13 14 14 5 14
25 16 16 8 14 4 13
26 13 13 8 8 4 12
27 12 0 14 13 7 16
28 14 0 14 15 7 14
29 11 11 8 13 4 17
30 9 9 11 11 4 13
31 16 16 16 15 6 14
32 12 12 10 15 6 16
33 10 0 8 9 5 14
34 13 13 14 13 6 13
35 16 16 16 16 7 11
36 14 14 13 13 6 12
37 5 0 8 12 3 13
38 8 8 10 12 4 15
39 11 11 8 12 6 13
40 16 16 13 14 7 13
41 17 17 15 14 5 13
42 9 9 6 8 4 14
43 9 9 12 13 5 11
44 13 13 16 16 6 14
45 6 0 15 11 6 14
46 12 12 12 14 5 13
47 8 8 8 13 4 13
48 14 0 13 13 5 13
49 12 12 14 13 5 13
50 11 11 12 12 4 13
51 16 16 16 16 6 13
52 8 8 10 15 2 13
53 15 15 15 15 8 14
54 7 7 8 12 3 13
55 16 0 16 14 6 10
56 14 14 19 12 6 15
57 9 9 6 12 5 13
58 14 14 13 13 5 13
59 11 11 15 12 6 16
60 15 0 13 13 6 13
61 15 15 14 13 5 13
62 13 13 13 13 5 13
63 11 11 11 14 5 13
64 11 0 14 17 6 13
65 12 12 12 13 6 13
66 12 12 15 13 6 13
67 12 12 14 12 5 13
68 12 12 13 13 5 13
69 14 14 8 14 4 13
70 6 6 6 11 2 13
71 7 7 7 12 4 13
72 14 14 13 16 6 13
73 10 10 11 12 5 13
74 13 0 5 12 3 15
75 12 12 12 12 6 13
76 9 9 8 10 4 17
77 12 0 11 15 5 16
78 16 16 14 15 8 14
79 10 10 9 12 4 13
80 16 0 16 16 7 13
81 15 15 16 13 6 13
82 10 0 8 11 4 13
83 8 8 7 10 3 16
84 11 11 14 15 5 13
85 13 13 11 13 6 13
86 16 16 17 16 7 15
87 14 14 17 18 6 15
88 9 9 11 13 3 13
89 8 8 10 14 3 18
90 8 8 9 15 4 11
91 11 11 12 14 5 18
92 12 12 15 13 7 13
93 14 14 13 15 6 15
94 15 15 12 16 7 13
95 16 16 14 14 6 13
96 16 16 14 14 6 13
97 11 11 8 16 6 16
98 14 14 15 14 6 13
99 14 14 12 12 4 13
100 12 12 12 13 4 13
101 13 13 15 14 6 15
102 12 0 6 14 5 13
103 16 16 14 16 8 13
104 12 12 15 13 6 13
105 11 11 10 14 5 15
106 4 4 6 4 4 13
107 16 16 14 16 8 13
108 10 10 8 16 4 16
109 13 13 11 15 6 13
110 14 14 15 14 6 13
111 7 7 13 12 3 16
112 12 12 14 14 5 13
113 12 0 16 13 4 13
114 13 13 14 14 6 13
115 15 15 14 16 4 16
116 12 12 10 13 4 13
117 10 10 4 13 6 13
118 8 8 8 14 5 13
119 10 10 15 15 6 13
120 15 15 16 14 6 16
121 16 16 12 15 8 13
122 13 13 12 13 7 13
123 16 16 15 16 7 13
124 9 9 9 12 4 16
125 14 14 12 15 6 13
126 14 14 14 12 6 13
127 12 12 11 14 2 13
> k <- length(x[1,])
> df <- as.data.frame(x)
> (mylm <- lm(df))
Call:
lm(formula = df)
Coefficients:
(Intercept) `Pop*geslacht` KnowingPeople Liked Celebrity
1.14961 0.14570 0.19235 0.30780 0.62642
Happiness
-0.01498
> (mysum <- summary(mylm))
Call:
lm(formula = df)
Residuals:
Min 1Q Median 3Q Max
-4.96939 -1.25430 0.01091 1.25050 5.54056
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 1.14961 2.01045 0.572 0.568507
`Pop*geslacht` 0.14570 0.03354 4.344 2.93e-05 ***
KnowingPeople 0.19235 0.06818 2.821 0.005594 **
Liked 0.30780 0.10193 3.020 0.003088 **
Celebrity 0.62642 0.15674 3.997 0.000111 ***
Happiness -0.01498 0.11500 -0.130 0.896548
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 1.917 on 121 degrees of freedom
Multiple R-squared: 0.5558, Adjusted R-squared: 0.5375
F-statistic: 30.28 on 5 and 121 DF, p-value: < 2.2e-16
> if (n > n25) {
+ kp3 <- k + 3
+ nmkm3 <- n - k - 3
+ gqarr <- array(NA, dim=c(nmkm3-kp3+1,3))
+ numgqtests <- 0
+ numsignificant1 <- 0
+ numsignificant5 <- 0
+ numsignificant10 <- 0
+ for (mypoint in kp3:nmkm3) {
+ j <- 0
+ numgqtests <- numgqtests + 1
+ for (myalt in c('greater', 'two.sided', 'less')) {
+ j <- j + 1
+ gqarr[mypoint-kp3+1,j] <- gqtest(mylm, point=mypoint, alternative=myalt)$p.value
+ }
+ if (gqarr[mypoint-kp3+1,2] < 0.01) numsignificant1 <- numsignificant1 + 1
+ if (gqarr[mypoint-kp3+1,2] < 0.05) numsignificant5 <- numsignificant5 + 1
+ if (gqarr[mypoint-kp3+1,2] < 0.10) numsignificant10 <- numsignificant10 + 1
+ }
+ gqarr
+ }
[,1] [,2] [,3]
[1,] 0.3712108 7.424217e-01 6.287892e-01
[2,] 0.2380918 4.761836e-01 7.619082e-01
[3,] 0.1377102 2.754203e-01 8.622898e-01
[4,] 0.4514119 9.028238e-01 5.485881e-01
[5,] 0.7589690 4.820620e-01 2.410310e-01
[6,] 0.6700341 6.599317e-01 3.299659e-01
[7,] 0.6109902 7.780196e-01 3.890098e-01
[8,] 0.7314551 5.370898e-01 2.685449e-01
[9,] 0.6620096 6.759808e-01 3.379904e-01
[10,] 0.6132988 7.734023e-01 3.867012e-01
[11,] 0.7983277 4.033446e-01 2.016723e-01
[12,] 0.7525314 4.949372e-01 2.474686e-01
[13,] 0.6990865 6.018270e-01 3.009135e-01
[14,] 0.6365186 7.269627e-01 3.634814e-01
[15,] 0.7946904 4.106192e-01 2.053096e-01
[16,] 0.7403594 5.192812e-01 2.596406e-01
[17,] 0.8663354 2.673292e-01 1.336646e-01
[18,] 0.9259122 1.481756e-01 7.408780e-02
[19,] 0.9016826 1.966348e-01 9.831741e-02
[20,] 0.8930841 2.138318e-01 1.069159e-01
[21,] 0.8752087 2.495827e-01 1.247913e-01
[22,] 0.8672044 2.655911e-01 1.327956e-01
[23,] 0.8454285 3.091430e-01 1.545715e-01
[24,] 0.8307107 3.385785e-01 1.692893e-01
[25,] 0.8125470 3.749060e-01 1.874530e-01
[26,] 0.7691575 4.616851e-01 2.308425e-01
[27,] 0.7278087 5.443827e-01 2.721913e-01
[28,] 0.6822615 6.354770e-01 3.177385e-01
[29,] 0.7935293 4.129414e-01 2.064707e-01
[30,] 0.8241024 3.517953e-01 1.758976e-01
[31,] 0.7904125 4.191749e-01 2.095875e-01
[32,] 0.7689582 4.620837e-01 2.310418e-01
[33,] 0.8189924 3.620152e-01 1.810076e-01
[34,] 0.7886361 4.227277e-01 2.113639e-01
[35,] 0.8260883 3.478234e-01 1.739117e-01
[36,] 0.8240330 3.519340e-01 1.759670e-01
[37,] 0.9553034 8.939324e-02 4.469662e-02
[38,] 0.9425581 1.148838e-01 5.744190e-02
[39,] 0.9481986 1.036028e-01 5.180138e-02
[40,] 0.9728254 5.434926e-02 2.717463e-02
[41,] 0.9643114 7.137712e-02 3.568856e-02
[42,] 0.9525993 9.480142e-02 4.740071e-02
[43,] 0.9406553 1.186894e-01 5.934468e-02
[44,] 0.9418665 1.162671e-01 5.813354e-02
[45,] 0.9277502 1.444996e-01 7.224982e-02
[46,] 0.9301271 1.397459e-01 6.987293e-02
[47,] 0.9688499 6.230014e-02 3.115007e-02
[48,] 0.9587168 8.256637e-02 4.128318e-02
[49,] 0.9507547 9.849068e-02 4.924534e-02
[50,] 0.9435609 1.128782e-01 5.643911e-02
[51,] 0.9426591 1.146818e-01 5.734091e-02
[52,] 0.9729840 5.403210e-02 2.701605e-02
[53,] 0.9741082 5.178368e-02 2.589184e-02
[54,] 0.9659903 6.801938e-02 3.400969e-02
[55,] 0.9588107 8.237861e-02 4.118931e-02
[56,] 0.9590178 8.196434e-02 4.098217e-02
[57,] 0.9480357 1.039287e-01 5.196434e-02
[58,] 0.9404024 1.191951e-01 5.959757e-02
[59,] 0.9231670 1.536661e-01 7.683303e-02
[60,] 0.9026106 1.947788e-01 9.738940e-02
[61,] 0.9284632 1.430736e-01 7.153682e-02
[62,] 0.9202929 1.594142e-01 7.970708e-02
[63,] 0.9325596 1.348807e-01 6.744035e-02
[64,] 0.9132615 1.734770e-01 8.673848e-02
[65,] 0.9014748 1.970503e-01 9.852517e-02
[66,] 0.9924300 1.514000e-02 7.569999e-03
[67,] 0.9891471 2.170586e-02 1.085293e-02
[68,] 0.9856140 2.877198e-02 1.438599e-02
[69,] 0.9840095 3.198109e-02 1.599054e-02
[70,] 0.9779662 4.406757e-02 2.203379e-02
[71,] 0.9695784 6.084318e-02 3.042159e-02
[72,] 0.9820637 3.587268e-02 1.793634e-02
[73,] 0.9766161 4.676773e-02 2.338387e-02
[74,] 0.9852822 2.943555e-02 1.471778e-02
[75,] 0.9800529 3.989412e-02 1.994706e-02
[76,] 0.9814123 3.717545e-02 1.858773e-02
[77,] 0.9740230 5.195409e-02 2.597705e-02
[78,] 0.9637801 7.243979e-02 3.621989e-02
[79,] 0.9612836 7.743289e-02 3.871644e-02
[80,] 0.9542178 9.156450e-02 4.578225e-02
[81,] 0.9480048 1.039904e-01 5.199518e-02
[82,] 0.9819754 3.604911e-02 1.802455e-02
[83,] 0.9754481 4.910385e-02 2.455193e-02
[84,] 0.9739737 5.205262e-02 2.602631e-02
[85,] 0.9638244 7.235122e-02 3.617561e-02
[86,] 0.9486980 1.026040e-01 5.130202e-02
[87,] 0.9454342 1.091317e-01 5.456585e-02
[88,] 0.9438925 1.122150e-01 5.610751e-02
[89,] 0.9280699 1.438602e-01 7.193009e-02
[90,] 0.9010547 1.978906e-01 9.894530e-02
[91,] 0.9237222 1.525556e-01 7.627778e-02
[92,] 0.8965196 2.069608e-01 1.034804e-01
[93,] 0.8609028 2.781944e-01 1.390972e-01
[94,] 0.9644610 7.107791e-02 3.553895e-02
[95,] 0.9463318 1.073364e-01 5.366822e-02
[96,] 0.9362558 1.274884e-01 6.374420e-02
[97,] 0.9072449 1.855101e-01 9.275506e-02
[98,] 0.8779678 2.440643e-01 1.220322e-01
[99,] 0.8296831 3.406337e-01 1.703169e-01
[100,] 0.7716522 4.566956e-01 2.283478e-01
[101,] 0.6981498 6.037004e-01 3.018502e-01
[102,] 0.6163504 7.672991e-01 3.836496e-01
[103,] 0.7325158 5.349685e-01 2.674842e-01
[104,] 0.6880870 6.238259e-01 3.119130e-01
[105,] 1.0000000 1.751386e-124 8.756932e-125
[106,] 1.0000000 1.728525e-107 8.642625e-108
[107,] 1.0000000 2.700342e-93 1.350171e-93
[108,] 1.0000000 2.294703e-81 1.147352e-81
[109,] 1.0000000 7.152181e-64 3.576090e-64
[110,] 1.0000000 3.308684e-49 1.654342e-49
> postscript(file="/var/www/html/freestat/rcomp/tmp/1odkg1291557143.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/2gm2j1291557143.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/3gm2j1291557143.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/4gm2j1291557143.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/54sug1291557143.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 = 127
Frequency = 1
1 2 3 4 5 6
1.57749445 2.44781465 3.05368439 0.55809615 -0.85325143 2.43737037
7 8 9 10 11 12
0.03787198 -0.21102352 3.69012796 -1.10011332 0.47722455 2.26413465
13 14 15 16 17 18
-3.48220731 -0.64894795 1.65317518 -1.91988803 1.49162282 0.95083076
19 20 21 22 23 24
-3.45165947 1.90170188 0.16479020 0.36016713 -3.84198760 0.03183065
25 26 27 28 29 30
4.36024804 3.62916619 0.01090755 1.36534442 0.45650400 -1.27347038
31 32 33 34 35 36
1.27579706 -0.95732649 1.61907193 -0.30177977 0.29662351 0.72988030
37 38 39 40 41 42
-3.06645603 -2.21324798 -0.54848203 1.51923183 3.24167981 0.62664905
43 44 45 46 47 48
-2.73780665 -1.59488677 -4.96938747 -0.45275147 -2.16631637 3.41115456
49 50 51 52 53 54
-0.52965032 -0.06502614 0.95301549 -1.91375957 -0.63899932 -2.08638898
55 56 57 58 59 60
3.85493582 -0.07146128 -1.24595108 1.37128866 -1.84996994 3.78472982
61 62 63 64 65 66
2.03323556 0.51699337 -1.11469836 -1.63881035 -0.77137827 -1.34842346
67 68 69 70 71 72
-0.22185238 -0.33730192 2.65165745 -1.62176480 -2.52046532 -0.17852990
73 74 75 76 77 78
-1.35339777 5.54055640 -0.46358032 -0.32869276 1.22520633 0.40764437
79 80 81 82 83 84
-0.34227624 2.65786606 1.02211402 1.61491717 -0.37919854 -1.99954150
85 86 87 88 89 90
0.27526543 0.16420960 -1.53355213 -1.26264153 -2.15746826 -3.00422789
91 92 93 94 95 96
-1.23212865 -1.97484820 0.15923528 0.24168905 1.95330817 1.95330817
97 98 99 100 101 102
-1.73472293 0.05236919 2.49785974 0.48147121 -0.77195886 2.44979540
103 104 105 106 107 108
0.08486281 -1.34842346 -0.89238272 -2.42861927 0.08486281 -1.33616874
109 110 111 112 113 114
-0.34033046 0.05236919 -3.00318010 -0.83744826 1.46053410 -0.60957771
115 116 117 118 119 120
1.78121734 0.86616801 -0.94118167 -3.10053905 -3.67260993 0.75926695
121 122 123 124 125 126
0.77735754 -0.54350771 0.51893915 -1.15162067 0.32161644 0.86031347
127
1.61887115
> postscript(file="/var/www/html/freestat/rcomp/tmp/64sug1291557143.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 = 127
Frequency = 1
lag(myerror, k = 1) myerror
0 1.57749445 NA
1 2.44781465 1.57749445
2 3.05368439 2.44781465
3 0.55809615 3.05368439
4 -0.85325143 0.55809615
5 2.43737037 -0.85325143
6 0.03787198 2.43737037
7 -0.21102352 0.03787198
8 3.69012796 -0.21102352
9 -1.10011332 3.69012796
10 0.47722455 -1.10011332
11 2.26413465 0.47722455
12 -3.48220731 2.26413465
13 -0.64894795 -3.48220731
14 1.65317518 -0.64894795
15 -1.91988803 1.65317518
16 1.49162282 -1.91988803
17 0.95083076 1.49162282
18 -3.45165947 0.95083076
19 1.90170188 -3.45165947
20 0.16479020 1.90170188
21 0.36016713 0.16479020
22 -3.84198760 0.36016713
23 0.03183065 -3.84198760
24 4.36024804 0.03183065
25 3.62916619 4.36024804
26 0.01090755 3.62916619
27 1.36534442 0.01090755
28 0.45650400 1.36534442
29 -1.27347038 0.45650400
30 1.27579706 -1.27347038
31 -0.95732649 1.27579706
32 1.61907193 -0.95732649
33 -0.30177977 1.61907193
34 0.29662351 -0.30177977
35 0.72988030 0.29662351
36 -3.06645603 0.72988030
37 -2.21324798 -3.06645603
38 -0.54848203 -2.21324798
39 1.51923183 -0.54848203
40 3.24167981 1.51923183
41 0.62664905 3.24167981
42 -2.73780665 0.62664905
43 -1.59488677 -2.73780665
44 -4.96938747 -1.59488677
45 -0.45275147 -4.96938747
46 -2.16631637 -0.45275147
47 3.41115456 -2.16631637
48 -0.52965032 3.41115456
49 -0.06502614 -0.52965032
50 0.95301549 -0.06502614
51 -1.91375957 0.95301549
52 -0.63899932 -1.91375957
53 -2.08638898 -0.63899932
54 3.85493582 -2.08638898
55 -0.07146128 3.85493582
56 -1.24595108 -0.07146128
57 1.37128866 -1.24595108
58 -1.84996994 1.37128866
59 3.78472982 -1.84996994
60 2.03323556 3.78472982
61 0.51699337 2.03323556
62 -1.11469836 0.51699337
63 -1.63881035 -1.11469836
64 -0.77137827 -1.63881035
65 -1.34842346 -0.77137827
66 -0.22185238 -1.34842346
67 -0.33730192 -0.22185238
68 2.65165745 -0.33730192
69 -1.62176480 2.65165745
70 -2.52046532 -1.62176480
71 -0.17852990 -2.52046532
72 -1.35339777 -0.17852990
73 5.54055640 -1.35339777
74 -0.46358032 5.54055640
75 -0.32869276 -0.46358032
76 1.22520633 -0.32869276
77 0.40764437 1.22520633
78 -0.34227624 0.40764437
79 2.65786606 -0.34227624
80 1.02211402 2.65786606
81 1.61491717 1.02211402
82 -0.37919854 1.61491717
83 -1.99954150 -0.37919854
84 0.27526543 -1.99954150
85 0.16420960 0.27526543
86 -1.53355213 0.16420960
87 -1.26264153 -1.53355213
88 -2.15746826 -1.26264153
89 -3.00422789 -2.15746826
90 -1.23212865 -3.00422789
91 -1.97484820 -1.23212865
92 0.15923528 -1.97484820
93 0.24168905 0.15923528
94 1.95330817 0.24168905
95 1.95330817 1.95330817
96 -1.73472293 1.95330817
97 0.05236919 -1.73472293
98 2.49785974 0.05236919
99 0.48147121 2.49785974
100 -0.77195886 0.48147121
101 2.44979540 -0.77195886
102 0.08486281 2.44979540
103 -1.34842346 0.08486281
104 -0.89238272 -1.34842346
105 -2.42861927 -0.89238272
106 0.08486281 -2.42861927
107 -1.33616874 0.08486281
108 -0.34033046 -1.33616874
109 0.05236919 -0.34033046
110 -3.00318010 0.05236919
111 -0.83744826 -3.00318010
112 1.46053410 -0.83744826
113 -0.60957771 1.46053410
114 1.78121734 -0.60957771
115 0.86616801 1.78121734
116 -0.94118167 0.86616801
117 -3.10053905 -0.94118167
118 -3.67260993 -3.10053905
119 0.75926695 -3.67260993
120 0.77735754 0.75926695
121 -0.54350771 0.77735754
122 0.51893915 -0.54350771
123 -1.15162067 0.51893915
124 0.32161644 -1.15162067
125 0.86031347 0.32161644
126 1.61887115 0.86031347
127 NA 1.61887115
> dum1 <- dum[2:length(myerror),]
> dum1
lag(myerror, k = 1) myerror
[1,] 2.44781465 1.57749445
[2,] 3.05368439 2.44781465
[3,] 0.55809615 3.05368439
[4,] -0.85325143 0.55809615
[5,] 2.43737037 -0.85325143
[6,] 0.03787198 2.43737037
[7,] -0.21102352 0.03787198
[8,] 3.69012796 -0.21102352
[9,] -1.10011332 3.69012796
[10,] 0.47722455 -1.10011332
[11,] 2.26413465 0.47722455
[12,] -3.48220731 2.26413465
[13,] -0.64894795 -3.48220731
[14,] 1.65317518 -0.64894795
[15,] -1.91988803 1.65317518
[16,] 1.49162282 -1.91988803
[17,] 0.95083076 1.49162282
[18,] -3.45165947 0.95083076
[19,] 1.90170188 -3.45165947
[20,] 0.16479020 1.90170188
[21,] 0.36016713 0.16479020
[22,] -3.84198760 0.36016713
[23,] 0.03183065 -3.84198760
[24,] 4.36024804 0.03183065
[25,] 3.62916619 4.36024804
[26,] 0.01090755 3.62916619
[27,] 1.36534442 0.01090755
[28,] 0.45650400 1.36534442
[29,] -1.27347038 0.45650400
[30,] 1.27579706 -1.27347038
[31,] -0.95732649 1.27579706
[32,] 1.61907193 -0.95732649
[33,] -0.30177977 1.61907193
[34,] 0.29662351 -0.30177977
[35,] 0.72988030 0.29662351
[36,] -3.06645603 0.72988030
[37,] -2.21324798 -3.06645603
[38,] -0.54848203 -2.21324798
[39,] 1.51923183 -0.54848203
[40,] 3.24167981 1.51923183
[41,] 0.62664905 3.24167981
[42,] -2.73780665 0.62664905
[43,] -1.59488677 -2.73780665
[44,] -4.96938747 -1.59488677
[45,] -0.45275147 -4.96938747
[46,] -2.16631637 -0.45275147
[47,] 3.41115456 -2.16631637
[48,] -0.52965032 3.41115456
[49,] -0.06502614 -0.52965032
[50,] 0.95301549 -0.06502614
[51,] -1.91375957 0.95301549
[52,] -0.63899932 -1.91375957
[53,] -2.08638898 -0.63899932
[54,] 3.85493582 -2.08638898
[55,] -0.07146128 3.85493582
[56,] -1.24595108 -0.07146128
[57,] 1.37128866 -1.24595108
[58,] -1.84996994 1.37128866
[59,] 3.78472982 -1.84996994
[60,] 2.03323556 3.78472982
[61,] 0.51699337 2.03323556
[62,] -1.11469836 0.51699337
[63,] -1.63881035 -1.11469836
[64,] -0.77137827 -1.63881035
[65,] -1.34842346 -0.77137827
[66,] -0.22185238 -1.34842346
[67,] -0.33730192 -0.22185238
[68,] 2.65165745 -0.33730192
[69,] -1.62176480 2.65165745
[70,] -2.52046532 -1.62176480
[71,] -0.17852990 -2.52046532
[72,] -1.35339777 -0.17852990
[73,] 5.54055640 -1.35339777
[74,] -0.46358032 5.54055640
[75,] -0.32869276 -0.46358032
[76,] 1.22520633 -0.32869276
[77,] 0.40764437 1.22520633
[78,] -0.34227624 0.40764437
[79,] 2.65786606 -0.34227624
[80,] 1.02211402 2.65786606
[81,] 1.61491717 1.02211402
[82,] -0.37919854 1.61491717
[83,] -1.99954150 -0.37919854
[84,] 0.27526543 -1.99954150
[85,] 0.16420960 0.27526543
[86,] -1.53355213 0.16420960
[87,] -1.26264153 -1.53355213
[88,] -2.15746826 -1.26264153
[89,] -3.00422789 -2.15746826
[90,] -1.23212865 -3.00422789
[91,] -1.97484820 -1.23212865
[92,] 0.15923528 -1.97484820
[93,] 0.24168905 0.15923528
[94,] 1.95330817 0.24168905
[95,] 1.95330817 1.95330817
[96,] -1.73472293 1.95330817
[97,] 0.05236919 -1.73472293
[98,] 2.49785974 0.05236919
[99,] 0.48147121 2.49785974
[100,] -0.77195886 0.48147121
[101,] 2.44979540 -0.77195886
[102,] 0.08486281 2.44979540
[103,] -1.34842346 0.08486281
[104,] -0.89238272 -1.34842346
[105,] -2.42861927 -0.89238272
[106,] 0.08486281 -2.42861927
[107,] -1.33616874 0.08486281
[108,] -0.34033046 -1.33616874
[109,] 0.05236919 -0.34033046
[110,] -3.00318010 0.05236919
[111,] -0.83744826 -3.00318010
[112,] 1.46053410 -0.83744826
[113,] -0.60957771 1.46053410
[114,] 1.78121734 -0.60957771
[115,] 0.86616801 1.78121734
[116,] -0.94118167 0.86616801
[117,] -3.10053905 -0.94118167
[118,] -3.67260993 -3.10053905
[119,] 0.75926695 -3.67260993
[120,] 0.77735754 0.75926695
[121,] -0.54350771 0.77735754
[122,] 0.51893915 -0.54350771
[123,] -1.15162067 0.51893915
[124,] 0.32161644 -1.15162067
[125,] 0.86031347 0.32161644
[126,] 1.61887115 0.86031347
> z <- as.data.frame(dum1)
> z
lag(myerror, k = 1) myerror
1 2.44781465 1.57749445
2 3.05368439 2.44781465
3 0.55809615 3.05368439
4 -0.85325143 0.55809615
5 2.43737037 -0.85325143
6 0.03787198 2.43737037
7 -0.21102352 0.03787198
8 3.69012796 -0.21102352
9 -1.10011332 3.69012796
10 0.47722455 -1.10011332
11 2.26413465 0.47722455
12 -3.48220731 2.26413465
13 -0.64894795 -3.48220731
14 1.65317518 -0.64894795
15 -1.91988803 1.65317518
16 1.49162282 -1.91988803
17 0.95083076 1.49162282
18 -3.45165947 0.95083076
19 1.90170188 -3.45165947
20 0.16479020 1.90170188
21 0.36016713 0.16479020
22 -3.84198760 0.36016713
23 0.03183065 -3.84198760
24 4.36024804 0.03183065
25 3.62916619 4.36024804
26 0.01090755 3.62916619
27 1.36534442 0.01090755
28 0.45650400 1.36534442
29 -1.27347038 0.45650400
30 1.27579706 -1.27347038
31 -0.95732649 1.27579706
32 1.61907193 -0.95732649
33 -0.30177977 1.61907193
34 0.29662351 -0.30177977
35 0.72988030 0.29662351
36 -3.06645603 0.72988030
37 -2.21324798 -3.06645603
38 -0.54848203 -2.21324798
39 1.51923183 -0.54848203
40 3.24167981 1.51923183
41 0.62664905 3.24167981
42 -2.73780665 0.62664905
43 -1.59488677 -2.73780665
44 -4.96938747 -1.59488677
45 -0.45275147 -4.96938747
46 -2.16631637 -0.45275147
47 3.41115456 -2.16631637
48 -0.52965032 3.41115456
49 -0.06502614 -0.52965032
50 0.95301549 -0.06502614
51 -1.91375957 0.95301549
52 -0.63899932 -1.91375957
53 -2.08638898 -0.63899932
54 3.85493582 -2.08638898
55 -0.07146128 3.85493582
56 -1.24595108 -0.07146128
57 1.37128866 -1.24595108
58 -1.84996994 1.37128866
59 3.78472982 -1.84996994
60 2.03323556 3.78472982
61 0.51699337 2.03323556
62 -1.11469836 0.51699337
63 -1.63881035 -1.11469836
64 -0.77137827 -1.63881035
65 -1.34842346 -0.77137827
66 -0.22185238 -1.34842346
67 -0.33730192 -0.22185238
68 2.65165745 -0.33730192
69 -1.62176480 2.65165745
70 -2.52046532 -1.62176480
71 -0.17852990 -2.52046532
72 -1.35339777 -0.17852990
73 5.54055640 -1.35339777
74 -0.46358032 5.54055640
75 -0.32869276 -0.46358032
76 1.22520633 -0.32869276
77 0.40764437 1.22520633
78 -0.34227624 0.40764437
79 2.65786606 -0.34227624
80 1.02211402 2.65786606
81 1.61491717 1.02211402
82 -0.37919854 1.61491717
83 -1.99954150 -0.37919854
84 0.27526543 -1.99954150
85 0.16420960 0.27526543
86 -1.53355213 0.16420960
87 -1.26264153 -1.53355213
88 -2.15746826 -1.26264153
89 -3.00422789 -2.15746826
90 -1.23212865 -3.00422789
91 -1.97484820 -1.23212865
92 0.15923528 -1.97484820
93 0.24168905 0.15923528
94 1.95330817 0.24168905
95 1.95330817 1.95330817
96 -1.73472293 1.95330817
97 0.05236919 -1.73472293
98 2.49785974 0.05236919
99 0.48147121 2.49785974
100 -0.77195886 0.48147121
101 2.44979540 -0.77195886
102 0.08486281 2.44979540
103 -1.34842346 0.08486281
104 -0.89238272 -1.34842346
105 -2.42861927 -0.89238272
106 0.08486281 -2.42861927
107 -1.33616874 0.08486281
108 -0.34033046 -1.33616874
109 0.05236919 -0.34033046
110 -3.00318010 0.05236919
111 -0.83744826 -3.00318010
112 1.46053410 -0.83744826
113 -0.60957771 1.46053410
114 1.78121734 -0.60957771
115 0.86616801 1.78121734
116 -0.94118167 0.86616801
117 -3.10053905 -0.94118167
118 -3.67260993 -3.10053905
119 0.75926695 -3.67260993
120 0.77735754 0.75926695
121 -0.54350771 0.77735754
122 0.51893915 -0.54350771
123 -1.15162067 0.51893915
124 0.32161644 -1.15162067
125 0.86031347 0.32161644
126 1.61887115 0.86031347
> 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/7fkt11291557143.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/8fkt11291557143.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/9pbal1291557143.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/10pbal1291557143.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/11tt9r1291557143.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/12wcpx1291557143.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/13ld4r1291557143.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/14ov3x1291557143.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/15ae131291557143.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/16deiq1291557143.tab")
+ }
>
> try(system("convert tmp/1odkg1291557143.ps tmp/1odkg1291557143.png",intern=TRUE))
character(0)
> try(system("convert tmp/2gm2j1291557143.ps tmp/2gm2j1291557143.png",intern=TRUE))
character(0)
> try(system("convert tmp/3gm2j1291557143.ps tmp/3gm2j1291557143.png",intern=TRUE))
character(0)
> try(system("convert tmp/4gm2j1291557143.ps tmp/4gm2j1291557143.png",intern=TRUE))
character(0)
> try(system("convert tmp/54sug1291557143.ps tmp/54sug1291557143.png",intern=TRUE))
character(0)
> try(system("convert tmp/64sug1291557143.ps tmp/64sug1291557143.png",intern=TRUE))
character(0)
> try(system("convert tmp/7fkt11291557143.ps tmp/7fkt11291557143.png",intern=TRUE))
character(0)
> try(system("convert tmp/8fkt11291557143.ps tmp/8fkt11291557143.png",intern=TRUE))
character(0)
> try(system("convert tmp/9pbal1291557143.ps tmp/9pbal1291557143.png",intern=TRUE))
character(0)
> try(system("convert tmp/10pbal1291557143.ps tmp/10pbal1291557143.png",intern=TRUE))
character(0)
>
>
> proc.time()
user system elapsed
5.079 2.660 5.542