Home » date » 2010 » Nov » 24 »

Multiple Regression interaction effects 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 23:36:51 +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/24/t1290555423c1518buuuc81nf1.htm/, Retrieved Wed, 24 Nov 2010 00:37:13 +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/24/t1290555423c1518buuuc81nf1.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?
No (this computation is public)
 
User-defined keywords:
 
Dataseries X:
» Textbox « » Textfile « » CSV «
7 7 1 7 7 1 7 7 4 5 2 5 6 2 5 6 5 6 1 5 5 1 5 5 7 7 1 7 7 1 7 6 6 6 2 5 6 1 4 5 5 4 1 7 7 1 4 7 5 6 2 5 6 2 5 6 5 6 1 6 7 1 6 7 6 7 1 7 5 1 6 7 5 6 2 5 6 3 6 6 6 7 1 5 6 1 5 7 7 7 1 7 7 1 6 7 6 7 1 3 7 2 7 7 3 7 1 7 7 1 6 7 6 6 1 6 6 1 5 6 3 3 1 5 5 1 4 4 4 6 1 5 6 1 4 5 6 7 1 7 6 1 6 7 6 7 1 3 6 1 6 6 5 5 1 7 6 1 5 6 6 6 1 7 7 1 7 7 6 6 1 7 6 1 6 6 3 4 1 7 7 1 4 7 4 5 3 4 3 3 4 5 5 6 2 6 7 2 6 6 4 4 1 5 5 1 6 7 5 7 1 7 7 0 5 7 6 6 2 6 6 2 5 5 2 5 1 4 5 1 2 6 5 7 1 5 7 1 5 5 3 6 1 7 7 2 5 7 7 7 1 7 7 1 7 7 6 5 1 7 6 1 6 5 6 6 1 7 6 2 7 5 6 5 1 7 6 1 6 5 7 3 1 6 5 1 6 6 5 6 1 3 6 1 5 7 5 5 1 4 6 2 4 5 7 6 1 5 6 1 5 6 5 4 3 7 7 3 6 7 5 5 1 5 5 1 6 6 2 6 3 6 7 2 4 7 5 4 4 5 3 6 5 1 6 7 1 6 7 1 6 6 5 6 1 7 7 1 5 7 1 4 1 7 7 1 6 6 5 7 1 7 6 1 5 6 5 3 2 7 7 1 6 7 5 7 1 6 7 1 5 7 6 4 1 7 6 1 5 4 6 5 1 6 7 1 7 6 6 7 1 7 6 1 5 6 5 6 2 7 6 2 5 6 6 6 1 6 6 2 6 6 5 6 4 6 6 4 3 6 5 6 1 5 7 1 6 7 6 6 2 5 6 2 5 6 6 6 1 6 7 1 6 7 4 6 2 5 6 2 4 5 5 6 1 6 6 2 6 6 4 5 1 3 5 1 6 5 6 7 1 7 7 2 5 6 6 etc...
 
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 time9 seconds
R Server'George Udny Yule' @ 72.249.76.132


Multiple Linear Regression - Estimated Regression Equation
Q1_22[t] = + 1.61968772478699 -0.00918828791935026Q1_2[t] + 0.340656368476894Q1_3[t] + 0.356234894492118Q1_5[t] -0.159352120836570Q1_7[t] + 0.484170885364494Q1_8[t] -0.300030003511608Q1_12[t] + 0.097133273108172Q1_16[t] + 0.0248399368734786Q1_2v[t] -0.0351115015876335Q1_3v[t] + 0.331622895188286Q1_5v[t] -0.128426182123679Q1_7v[t] + 0.142269832219955Q1_8v[t] -0.0451005706686726Q1_12v[t] + 0.0428633491152994Q1_16v[t] -0.141230731472698Q1_22v[t] + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)1.619687724786990.8779041.84490.0685280.034264
Q1_2-0.009188287919350260.104501-0.08790.9301430.465071
Q1_30.3406563684768940.0980873.4730.0008120.000406
Q1_50.3562348944921180.1302622.73480.0075960.003798
Q1_7-0.1593521208365700.082334-1.93540.0562630.028132
Q1_80.4841708853644940.0942735.13582e-061e-06
Q1_12-0.3000300035116080.116909-2.56640.012030.006015
Q1_160.0971332731081720.1149690.84490.400560.20028
Q1_2v0.02483993687347860.1092940.22730.8207540.410377
Q1_3v-0.03511150158763350.107443-0.32680.7446290.372315
Q1_5v0.3316228951882860.2289151.44870.1511080.075554
Q1_7v-0.1284261821236790.125192-1.02580.307880.15394
Q1_8v0.1422698322199550.1579770.90060.3703610.18518
Q1_12v-0.04510057066867260.138402-0.32590.7453270.372663
Q1_16v0.04286334911529940.1556320.27540.7836650.391833
Q1_22v-0.1412307314726980.147537-0.95730.3411530.170577


Multiple Linear Regression - Regression Statistics
Multiple R0.658977147434301
R-squared0.434250880840649
Adjusted R-squared0.334412800988998
F-TEST (value)4.34955160882404
F-TEST (DF numerator)15
F-TEST (DF denominator)85
p-value5.89831236164073e-06
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation0.87092238918393
Sum Squared Residuals64.4729936784568


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
177.02510077115959-0.0251007711595910
255.54783555237797-0.547835552377967
356.0677536234044-1.06775362340440
466.01797505809933-0.0179750580993263
575.956305228974261.04369477102574
676.1793804377120.820619562287998
776.777132359960460.222867640039541
866.0307364032501-0.0307364032501016
955.5928576028722-0.592857602872204
1066.57185863205907-0.571858632059068
1176.20768972310970.792310276890294
1275.834991390422631.16500860957737
1366.32919667972098-0.329196679720977
1477.1766137258019-0.176613725801904
1565.365372872913670.634627127086326
1675.774588922288211.22541107771179
1755.42472270607947-0.42472270607947
1855.40205998770025-0.402059987700248
1976.581802636453110.418197363546885
2066.45823506137093-0.458235061370928
2165.691974897242460.308025102757538
2213.5274586067484-2.5274586067484
2376.110904615840540.889095384159459
2466.29225351175008-0.292253511750077
2576.832441071131540.16755892886846
2665.948410624766450.0515893752335524
2765.677971081883730.322028918116265
2865.905192355131110.0948076448688896
2966.03362670705345-0.0336267070534526
3055.88389040149457-0.883890401494574
3155.47653778082898-0.476537780828981
3276.360425607418580.639574392581419
3334.11480699037853-1.11480699037853
3465.329129017925490.670870982074511
3556.01244033580896-1.01244033580896
3666.51116425693954-0.51116425693954
3775.983172156153261.01682784384674
3866.00779495383096-0.00779495383096274
3955.09821386264445-0.0982138626444483
4055.63048130696828-0.630481306968277
4166.61846262526562-0.618462625265624
4276.154457575788220.845542424211778
4377.16687594170784-0.166875941707837
4455.03574347968164-0.0357434796816424
4576.132402797610860.867597202389142
4655.10009225961324-0.100092259613243
4754.744431569407510.255568430592490
4855.81703059448912-0.817030594489116
4965.987731283700640.0122687162993624
5066.26785516890419-0.267855168904186
5176.023790739558940.976209260441064
5275.183822607287621.81617739271238
5377.26004004461387-0.260040044613874
5475.98958210402131.01041789597870
5524.03936357270476-2.03936357270476
5666.46013827739038-0.460138277390379
5766.86771306664385-0.867713066643847
5866.2500319788534-0.250031978853404
5976.557215051895870.442784948104131
6055.23799128921044-0.237991289210440
6175.556772573371461.44322742662854
6265.910714287917030.0892857120829742
6366.01039560496425-0.0103956049642501
6455.04900426128738-0.0490042612873828
6565.942764565197160.0572354348028417
6677.44626638147139-0.44626638147139
6766.19641332492934-0.196413324929339
6876.968210018961680.0317899810383194
6976.221202085945660.778797914054345
7054.95882232137120.0411776786287946
7165.411253112527390.588746887472612
7276.861888457934160.138111542065842
7375.954569080555711.04543091944429
7476.064621713011280.935378286988723
7576.104633710841720.895366289158283
7674.678420656543892.32157934345611
7765.833205150163480.166794849836516
7856.62405535506921-1.62405535506921
7954.567725318603180.432274681396818
8076.949833443122980.0501665568770206
8166.17138743306102-0.171387433061018
8266.68936991494391-0.689369914943912
8366.09230677154743-0.0923067715474307
8466.27129245407138-0.271292454071381
8577.5988230436906-0.598823043690594
8666.7459773891937-0.745977389193694
8776.455035107494540.544964892505461
8856.83014836372585-1.83014836372585
8956.21007851366726-1.21007851366726
9075.971284397641521.02871560235848
9155.77700025918297-0.777000259182974
9276.451961342429970.548038657570027
9376.730398863178470.269601136821530
9455.6408353039171-0.640835303917097
9566.28937136758725-0.289371367587252
9675.832644055067361.16735594493264
9766.42118057174751-0.421180571747512
9856.36495373368526-1.36495373368526
9955.92716409210019-0.927164092100193
10075.952189983968511.04781001603149
10176.620554068289760.379445931710238


Goldfeld-Quandt test for Heteroskedasticity
p-valuesAlternative Hypothesis
breakpoint indexgreater2-sidedless
190.2988084834435590.5976169668871180.701191516556441
200.2702546441097510.5405092882195010.72974535589025
210.1553929341109840.3107858682219670.844607065889016
220.3486096078403170.6972192156806350.651390392159683
230.2753681274732430.5507362549464870.724631872526757
240.1883068237462880.3766136474925770.811693176253712
250.1461002937046620.2922005874093230.853899706295338
260.09447923921542450.1889584784308490.905520760784576
270.06297225930965120.1259445186193020.93702774069035
280.1003681060222470.2007362120444940.899631893977753
290.06716830075108110.1343366015021620.932831699248919
300.06637047239010640.1327409447802130.933629527609894
310.05093328291011740.1018665658202350.949066717089883
320.03912358033519820.07824716067039650.960876419664802
330.03345858175629250.0669171635125850.966541418243708
340.04225558241439240.08451116482878480.957744417585608
350.06110426971361860.1222085394272370.938895730286381
360.05925873001302890.1185174600260580.940741269986971
370.06058362879926010.121167257598520.93941637120074
380.05465011247566340.1093002249513270.945349887524337
390.04562692393824790.09125384787649580.954373076061752
400.07247855525484190.1449571105096840.927521444745158
410.2148910373142930.4297820746285860.785108962685707
420.19951336423420.39902672846840.8004866357658
430.1742970012388030.3485940024776050.825702998761197
440.1343352898955800.2686705797911590.86566471010442
450.1486280125739510.2972560251479030.851371987426049
460.1166107752033750.233221550406750.883389224796625
470.1317375830265970.2634751660531950.868262416973403
480.1265644646126480.2531289292252970.873435535387352
490.09738043395945810.1947608679189160.902619566040542
500.08728179385363320.1745635877072660.912718206146367
510.09464783158086480.1892956631617300.905352168419135
520.3385242155353180.6770484310706370.661475784464682
530.4086705134859310.8173410269718620.591329486514069
540.3860945274690810.7721890549381620.613905472530919
550.5371222987061110.9257554025877790.462877701293889
560.5036958754391410.9926082491217180.496304124560859
570.4832049207564550.966409841512910.516795079243545
580.4181563091044620.8363126182089240.581843690895538
590.3517467153598010.7034934307196030.648253284640199
600.2887496484097770.5774992968195540.711250351590223
610.2882831355425550.5765662710851090.711716864457445
620.2314832208530610.4629664417061220.768516779146939
630.1800762087758640.3601524175517280.819923791224136
640.1653226766710740.3306453533421480.834677323328926
650.1235454256885930.2470908513771850.876454574311407
660.09283263090443790.1856652618088760.907167369095562
670.06556269332574840.1311253866514970.934437306674252
680.05072637573906040.1014527514781210.94927362426094
690.04720616675728560.09441233351457110.952793833242714
700.0402939015662740.0805878031325480.959706098433726
710.02924037017750570.05848074035501130.970759629822494
720.02675456964014300.05350913928028610.973245430359857
730.04744952505333330.09489905010666650.952550474946667
740.0356318749204690.0712637498409380.964368125079531
750.04112019812266240.08224039624532480.958879801877338
760.1922118826605830.3844237653211660.807788117339417
770.133069110749520.266138221499040.86693088925048
780.1575017438550710.3150034877101430.842498256144929
790.1006451124288220.2012902248576440.899354887571178
800.1011447999525430.2022895999050860.898855200047457
810.06573356478867680.1314671295773540.934266435211323
820.03805565743512260.07611131487024520.961944342564877


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 level120.1875NOK
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Nov/24/t1290555423c1518buuuc81nf1/102ydh1290555401.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/24/t1290555423c1518buuuc81nf1/102ydh1290555401.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/24/t1290555423c1518buuuc81nf1/1dfgn1290555401.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/24/t1290555423c1518buuuc81nf1/1dfgn1290555401.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/24/t1290555423c1518buuuc81nf1/2dfgn1290555401.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/24/t1290555423c1518buuuc81nf1/2dfgn1290555401.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/24/t1290555423c1518buuuc81nf1/3dfgn1290555401.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/24/t1290555423c1518buuuc81nf1/3dfgn1290555401.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/24/t1290555423c1518buuuc81nf1/456fq1290555401.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/24/t1290555423c1518buuuc81nf1/456fq1290555401.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/24/t1290555423c1518buuuc81nf1/556fq1290555401.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/24/t1290555423c1518buuuc81nf1/556fq1290555401.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/24/t1290555423c1518buuuc81nf1/656fq1290555401.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/24/t1290555423c1518buuuc81nf1/656fq1290555401.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/24/t1290555423c1518buuuc81nf1/7ygfb1290555401.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/24/t1290555423c1518buuuc81nf1/7ygfb1290555401.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/24/t1290555423c1518buuuc81nf1/89pee1290555401.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/24/t1290555423c1518buuuc81nf1/89pee1290555401.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Nov/24/t1290555423c1518buuuc81nf1/99pee1290555401.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Nov/24/t1290555423c1518buuuc81nf1/99pee1290555401.ps (open in new window)


 
Parameters (Session):
par1 = 8 ; par2 = Do not include Seasonal Dummies ; par3 = No Linear Trend ;
 
Parameters (R input):
par1 = 8 ; par2 = Do not include Seasonal Dummies ; par3 = No 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