Home » date » 2010 » Nov » 23 »

Linear Regression Minitutorial

*The author of this computation has been verified*
R Software Module: /rwasp_multipleregression.wasp (opens new window with default values)
Title produced by software: Multiple Regression
Date of computation: Tue, 23 Nov 2010 10:33:31 +0000
 
Cite this page as follows:
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL http://www.freestatistics.org/blog/date/2010/Nov/23/t1290508356mn4zal2ap5paxzf.htm/, Retrieved Tue, 23 Nov 2010 11:32:37 +0100
 
BibTeX entries for LaTeX users:
@Manual{KEY,
    author = {{YOUR NAME}},
    publisher = {Office for Research Development and Education},
    title = {Statistical Computations at FreeStatistics.org, URL http://www.freestatistics.org/blog/date/2010/Nov/23/t1290508356mn4zal2ap5paxzf.htm/},
    year = {2010},
}
@Manual{R,
    title = {R: A Language and Environment for Statistical Computing},
    author = {{R Development Core Team}},
    organization = {R Foundation for Statistical Computing},
    address = {Vienna, Austria},
    year = {2010},
    note = {{ISBN} 3-900051-07-0},
    url = {http://www.R-project.org},
}
 
Original text written by user:
 
IsPrivate?
This computation is/was private until 2010-11-24
 
User-defined keywords:
 
Dataseries X:
» Textbox « » Textfile « » CSV «
55 1 20 0 80 0 52 0 75 1 30 1 90 1 68 1 24 0 60 0 65 1 60 0 80 1 65 1 90 0 65 1 76 1 70 1 38 0 60 1 10 0 5 0 93 1 70 0 61 1 72 1 40 0 75 1 100 1 29 0 70 1 25 0 70 1 82 0 40 0 50 1 70 1 91 1 10 0 25 0 56 0 30 0 74 0 60 0 80 0 80 1 60 1 64 1 40 1 80 1 71 1 65 1 90 0 68 1 76 1 25 1 79 1 40 0 61 1 27 1 70 0 40 0 13 0 15 0 38 1 47 0 65 1 62 1 50 0 80 1 87 1 40 1 80 1 20 0 60 1 48 1 70 1 91 1 10 0 50 0 70 0 45 1 20 1 10 0 90 1 80 1 74 0 71 0 40 0 29 1 60 1 31 0 67 0 82 0 40 1 30 1 70 0 63 0 35 0 35 1 70 0 60 1 80 1 70 1 71 1
 
Output produced by software:

Enter (or paste) a matrix (table) containing all data (time) series. Every column represents a different variable and must be delimited by a space or Tab. Every row represents a period in time (or category) and must be delimited by hard returns. The easiest way to enter data is to copy and paste a block of spreadsheet cells. Please, do not use commas or spaces to seperate groups of digits!


Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time8 seconds
R Server'Sir Ronald Aylmer Fisher' @ 193.190.124.24


Multiple Linear Regression - Estimated Regression Equation
Q1[t] = + 50.0313369097804 + 16.4922088057442gender[t] -0.0467799991133598t + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)50.03133690978044.9190210.17100
gender16.49220880574424.3034113.83240.000220.00011
t-0.04677999911335980.070445-0.66410.5081470.254073


Multiple Linear Regression - Regression Statistics
Multiple R0.358961497027954
R-squared0.128853356348550
Adjusted R-squared0.111772049610286
F-TEST (value)7.54353038224565
F-TEST (DF numerator)2
F-TEST (DF denominator)102
p-value0.000880348550419296
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation21.8780400356169
Sum Squared Residuals48822.1608516056


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
15566.476765716411-11.4767657164110
22049.9377769115537-29.9377769115537
38049.890996912440330.1090030875597
45249.84421691332692.15578308667306
57566.28964571995788.71035428004222
63066.2428657208444-36.2428657208444
79066.19608572173123.8039142782689
86866.14930572261771.85069427738230
92449.6103169177601-25.6103169177601
106049.563536918646810.4364630813532
116566.0089657252776-1.00896572527762
126049.469976920420110.5300230795799
138065.915405727050914.0845942729491
146565.8686257279375-0.868625727937538
159049.3296369230840.67036307692
166565.7750657297108-0.775065729710819
177665.728285730597510.2717142694025
187065.68150573148414.3184942685159
193849.1425169266265-11.1425169266265
206065.5879457332574-5.58794573325738
211049.0489569283998-39.0489569283998
22549.0021769292865-44.0021769292865
239365.447605735917327.5523942640827
247048.908616931059721.0913830689403
256165.3540457376906-4.35404573769058
267265.30726573857726.69273426142278
274048.7682769337197-8.76827693371967
287565.21370574035059.7862942596495
2910065.166925741237234.8330742587629
302948.6279369363796-19.6279369363796
317065.07336574301044.92663425698958
322548.5343769381529-23.5343769381529
337064.97980574478375.0201942552163
348248.440816939926233.5591830600738
354048.3940369408128-8.39403694081279
365064.8394657474436-14.8394657474436
377064.79268574833035.20731425166974
389164.745905749216926.2540942507831
391048.2069169443594-38.2069169443594
402548.160136945246-23.160136945246
415648.11335694613267.88664305386737
423048.0665769470193-18.0665769470193
437448.019796947905925.9802030520941
446047.973016948792512.0269830512074
458047.926236949679232.0737630503208
468064.3716657563115.6283342436900
476064.3248857571967-4.32488575719667
486464.2781057580833-0.278105758083305
494064.23132575897-24.2313257589699
508064.184545759856615.8154542401434
517164.13776576074326.86223423925677
526564.09098576162990.909014238370135
539047.551996956772342.4480030432277
546863.99742576340314.00257423659685
557663.950645764289812.0493542357102
562563.9038657651764-38.9038657651764
577963.857085766063115.1429142339369
584047.3180969612055-7.31809696120551
596163.7635257678363-2.76352576783635
602763.716745768723-36.716745768723
617047.177756963865422.8222430361346
624047.1309769647521-7.13097696475207
631347.0841969656387-34.0841969656387
641547.0374169665254-32.0374169665254
653863.4828457731562-25.4828457731562
664746.94385696829860.0561430317013662
676563.38928577492951.61071422507053
686263.3425057758161-1.34250577581611
695046.80351697095863.19648302904144
708063.248945777589416.7510542224106
718763.20216577847623.7978342215240
724063.1553857793627-23.1553857793627
738063.108605780249316.8913942197507
742046.5696169753918-26.5696169753918
756063.0150457820226-3.01504578202259
764862.9682657829092-14.9682657829092
777062.92148578379597.07851421620413
789162.874705784682528.1252942153175
791046.335716979825-36.3357169798250
805046.28893698071163.7110630192884
817046.242156981598223.7578430184018
824562.6875857882291-17.6875857882291
832062.6408057891157-42.6408057891157
841046.1018169842582-36.1018169842582
859062.54724579088927.452754209111
868062.500465791775617.4995342082244
877445.961476986918128.0385230130819
887145.914696987804725.0853030121953
894045.8679169886914-5.86791698869136
902962.3133457953222-33.3133457953222
916062.2665657962088-2.26656579620883
923145.7275769913513-14.7275769913513
936745.680796992237921.3192030077621
948245.634016993124636.3659830068754
954062.0794457997554-22.0794457997554
963062.032665800642-32.032665800642
977045.493676995784524.5063230042155
986345.446896996671117.5531030033289
993545.4001169975578-10.4001169975578
1003561.8455458041886-26.8455458041886
1017045.30655699933124.6934430006690
1026061.7519858059619-1.75198580596188
1038061.705205806848518.2947941931515
1047061.65842580773528.34157419226484
1057161.61164580862189.3883541913782


Goldfeld-Quandt test for Heteroskedasticity
p-valuesAlternative Hypothesis
breakpoint indexgreater2-sidedless
60.8787957974612670.2424084050774660.121204202538733
70.8757827299085690.2484345401828620.124217270091431
80.7967264033285590.4065471933428820.203273596671441
90.8246227699742330.3507544600515340.175377230025767
100.7675834149417720.4648331701164550.232416585058228
110.6780790326507120.6438419346985750.321920967349287
120.592112324297180.815775351405640.40788767570282
130.5099203066970480.9801593866059050.490079693302952
140.425277711644380.850555423288760.57472228835562
150.4908356009382140.9816712018764280.509164399061786
160.4303284407047810.8606568814095620.569671559295219
170.350850710943320.701701421886640.64914928905668
180.2852787751612030.5705575503224050.714721224838797
190.3124818262245070.6249636524490150.687518173775493
200.2657218969298030.5314437938596050.734278103070197
210.4620451740218860.9240903480437730.537954825978114
220.609057525507160.781884948985680.39094247449284
230.6558848506259710.6882302987480580.344115149374029
240.6676184668332350.664763066333530.332381533166765
250.6084026690714490.7831946618571010.391597330928551
260.5447921928946750.910415614210650.455207807105325
270.4838754394110120.9677508788220250.516124560588988
280.4258783529017070.8517567058034130.574121647098293
290.4901354624427460.9802709248854930.509864537557254
300.472029680027730.944059360055460.52797031997227
310.4109056666727760.8218113333455510.589094333327224
320.4048237869773010.8096475739546010.595176213022699
330.346761186123320.693522372246640.65323881387668
340.4451414822189270.8902829644378530.554858517781073
350.3927787250368480.7855574500736960.607221274963152
360.3767372191856250.753474438371250.623262780814375
370.3227153970103650.6454307940207290.677284602989635
380.3335557982418350.667111596483670.666444201758165
390.4347312250520950.869462450104190.565268774947905
400.4285809085990560.8571618171981120.571419091400944
410.3890185159533990.7780370319067970.610981484046601
420.3667135978141660.7334271956283330.633286402185834
430.4037373815700180.8074747631400370.596262618429982
440.3672814197438420.7345628394876840.632718580256158
450.4277053146769180.8554106293538360.572294685323082
460.3943091296347310.7886182592694620.605690870365269
470.3530197941115700.7060395882231390.64698020588843
480.3073171962697440.6146343925394880.692682803730256
490.3301937788730950.660387557746190.669806221126905
500.3061097959302230.6122195918604470.693890204069777
510.2656495377022380.5312990754044760.734350462297762
520.2249531699874470.4499063399748940.775046830012553
530.3700888392769160.7401776785538320.629911160723084
540.3299584798740970.6599169597481930.670041520125903
550.3109071885379790.6218143770759580.689092811462021
560.4142637916015450.828527583203090.585736208398455
570.4071799896409920.8143599792819830.592820010359008
580.3565581502496020.7131163004992040.643441849750398
590.3131525675295030.6263051350590060.686847432470497
600.377681783793880.755363567587760.62231821620612
610.4035806403868800.8071612807737590.59641935961312
620.3513171678945950.702634335789190.648682832105405
630.3994031843021140.7988063686042270.600596815697886
640.4441216209005210.8882432418010430.555878379099479
650.4425109869491660.8850219738983320.557489013050834
660.386801140448670.773602280897340.61319885955133
670.3339162010152470.6678324020304950.666083798984753
680.2820327321631450.564065464326290.717967267836855
690.2362748916827980.4725497833655950.763725108317202
700.2301784413082290.4603568826164570.769821558691771
710.2681341408920070.5362682817840140.731865859107993
720.2484053633027910.4968107266055820.75159463669721
730.2588922366234650.5177844732469310.741107763376535
740.2709133407736410.5418266815472820.729086659226359
750.2248214272647560.4496428545295110.775178572735244
760.1864267373075740.3728534746151490.813573262692426
770.1650580101328990.3301160202657980.834941989867101
780.2786888643764400.5573777287528810.72131113562356
790.3686411875915060.7372823751830130.631358812408494
800.3102255493294490.6204510986588990.68977445067055
810.3198876021987210.6397752043974420.680112397801279
820.2686972541347730.5373945082695470.731302745865227
830.3375065916882120.6750131833764240.662493408311788
840.556601528139870.886796943720260.44339847186013
850.6694412340057330.6611175319885350.330558765994267
860.7799729279892750.440054144021450.220027072010725
870.8183886641196350.3632226717607300.181611335880365
880.8576006312409440.2847987375181120.142399368759056
890.8046088607228440.3907822785543130.195391139277156
900.7658253590772050.468349281845590.234174640922795
910.790415408461360.4191691830772810.209584591538640
920.7850156839395360.4299686321209280.214984316060464
930.746794800804590.506410398390820.25320519919541
940.9042903416208810.1914193167582380.0957096583791188
950.8655015495078160.2689969009843690.134498450492185
960.7893795456088820.4212409087822370.210620454391118
970.8456794027557690.3086411944884630.154320597244231
980.890310482953670.2193790340926600.109689517046330
990.857518995316260.2849620093674820.142481004683741


Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity
Description# significant tests% significant testsOK/NOK
1% type I error level00OK
5% type I error level00OK
10% type I error level00OK
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290508356mn4zal2ap5paxzf/10qjv41290508399.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290508356mn4zal2ap5paxzf/10qjv41290508399.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/23/t1290508356mn4zal2ap5paxzf/11igb1290508399.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290508356mn4zal2ap5paxzf/11igb1290508399.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/23/t1290508356mn4zal2ap5paxzf/21igb1290508399.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290508356mn4zal2ap5paxzf/21igb1290508399.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/23/t1290508356mn4zal2ap5paxzf/3uafe1290508399.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290508356mn4zal2ap5paxzf/3uafe1290508399.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/23/t1290508356mn4zal2ap5paxzf/4uafe1290508399.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290508356mn4zal2ap5paxzf/4uafe1290508399.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/23/t1290508356mn4zal2ap5paxzf/5uafe1290508399.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290508356mn4zal2ap5paxzf/5uafe1290508399.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/23/t1290508356mn4zal2ap5paxzf/6mjfy1290508399.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290508356mn4zal2ap5paxzf/6mjfy1290508399.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/23/t1290508356mn4zal2ap5paxzf/7xsw11290508399.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290508356mn4zal2ap5paxzf/7xsw11290508399.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/23/t1290508356mn4zal2ap5paxzf/8xsw11290508399.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290508356mn4zal2ap5paxzf/8xsw11290508399.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/23/t1290508356mn4zal2ap5paxzf/9xsw11290508399.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/23/t1290508356mn4zal2ap5paxzf/9xsw11290508399.ps (open in new window)


 
Parameters (Session):
par1 = 1 ; par2 = Do not include Seasonal Dummies ; par3 = Linear Trend ;
 
Parameters (R input):
par1 = 1 ; par2 = Do not include Seasonal Dummies ; par3 = Linear Trend ;
 
R code (references can be found in the software module):
library(lattice)
library(lmtest)
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
k <- length(x[1,])
df <- as.data.frame(x)
(mylm <- lm(df))
(mysum <- summary(mylm))
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
}
bitmap(file='test0.png')
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()
bitmap(file='test1.png')
plot(mysum$resid, type='b', pch=19, main='Residuals', ylab='value of Residuals', xlab='time or index')
grid()
dev.off()
bitmap(file='test2.png')
hist(mysum$resid, main='Residual Histogram', xlab='values of Residuals')
grid()
dev.off()
bitmap(file='test3.png')
densityplot(~mysum$resid,col='black',main='Residual Density Plot', xlab='values of Residuals')
dev.off()
bitmap(file='test4.png')
qqnorm(mysum$resid, main='Residual Normal Q-Q Plot')
qqline(mysum$resid)
grid()
dev.off()
(myerror <- as.ts(mysum$resid))
bitmap(file='test5.png')
dum <- cbind(lag(myerror,k=1),myerror)
dum
dum1 <- dum[2:length(myerror),]
dum1
z <- as.data.frame(dum1)
z
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()
bitmap(file='test6.png')
acf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Autocorrelation Function')
grid()
dev.off()
bitmap(file='test7.png')
pacf(mysum$resid, lag.max=length(mysum$resid)/2, main='Residual Partial Autocorrelation Function')
grid()
dev.off()
bitmap(file='test8.png')
opar <- par(mfrow = c(2,2), oma = c(0, 0, 1.1, 0))
plot(mylm, las = 1, sub='Residual Diagnostics')
par(opar)
dev.off()
if (n > n25) {
bitmap(file='test9.png')
plot(kp3:nmkm3,gqarr[,2], main='Goldfeld-Quandt test',ylab='2-sided p-value',xlab='breakpoint')
grid()
dev.off()
}
load(file='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='mytable1.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<br />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='mytable2.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='mytable3.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<br />Forecast', 1, TRUE)
a<-table.element(a, 'Residuals<br />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='mytable4.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='mytable5.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='mytable6.tab')
}
 





Copyright

Creative Commons License

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 License.

Software written by Ed van Stee & Patrick Wessa


Disclaimer

Information provided on this web site is provided "AS IS" without warranty of any kind, either express or implied, including, without limitation, warranties of merchantability, fitness for a particular purpose, and noninfringement. We use reasonable efforts to include accurate and timely information and periodically update the information, and software without notice. However, we make no warranties or representations as to the accuracy or completeness of such information (or software), and we assume no liability or responsibility for errors or omissions in the content of this web site, or any software bugs in online applications. Your use of this web site is AT YOUR OWN RISK. Under no circumstances and under no legal theory shall we be liable to you or any other person for any direct, indirect, special, incidental, exemplary, or consequential damages arising from your access to, or use of, this web site.


Privacy Policy

We may request personal information to be submitted to our servers in order to be able to:

  • personalize online software applications according to your needs
  • enforce strict security rules with respect to the data that you upload (e.g. statistical data)
  • manage user sessions of online applications
  • alert you about important changes or upgrades in resources or applications

We NEVER allow other companies to directly offer registered users information about their products and services. Banner references and hyperlinks of third parties NEVER contain any personal data of the visitor.

We do NOT sell, nor transmit by any means, personal information, nor statistical data series uploaded by you to third parties.

We carefully protect your data from loss, misuse, alteration, and destruction. However, at any time, and under any circumstance you are solely responsible for managing your passwords, and keeping them secret.

We store a unique ANONYMOUS USER ID in the form of a small 'Cookie' on your computer. This allows us to track your progress when using this website which is necessary to create state-dependent features. The cookie is used for NO OTHER PURPOSE. At any time you may opt to disallow cookies from this website - this will not affect other features of this website.

We examine cookies that are used by third-parties (banner and online ads) very closely: abuse from third-parties automatically results in termination of the advertising contract without refund. We have very good reason to believe that the cookies that are produced by third parties (banner ads) do NOT cause any privacy or security risk.

FreeStatistics.org is safe. There is no need to download any software to use the applications and services contained in this website. Hence, your system's security is not compromised by their use, and your personal data - other than data you submit in the account application form, and the user-agent information that is transmitted by your browser - is never transmitted to our servers.

As a general rule, we do not log on-line behavior of individuals (other than normal logging of webserver 'hits'). However, in cases of abuse, hacking, unauthorized access, Denial of Service attacks, illegal copying, hotlinking, non-compliance with international webstandards (such as robots.txt), or any other harmful behavior, our system engineers are empowered to log, track, identify, publish, and ban misbehaving individuals - even if this leads to ban entire blocks of IP addresses, or disclosing user's identity.


FreeStatistics.org is powered by