Home » date » 2010 » Dec » 28 »

Multiple Regression Seasonal & Linear

*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, 28 Dec 2010 17:17:53 +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/Dec/28/t1293556546t54nsjzosmxm85i.htm/, Retrieved Tue, 28 Dec 2010 18:15:58 +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/Dec/28/t1293556546t54nsjzosmxm85i.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 «
621 0 0 587 0 0 655 0 0 517 0 0 646 0 0 657 0 0 382 0 0 345 0 0 625 0 0 654 0 0 606 0 0 510 0 0 614 0 0 647 0 0 580 0 0 614 0 0 636 0 0 388 0 0 356 0 0 639 0 0 753 0 0 611 0 0 639 0 0 630 0 0 586 0 0 695 0 0 552 0 0 619 0 0 681 0 0 421 0 0 307 0 0 754 0 0 690 0 0 644 0 0 643 0 0 608 0 0 651 0 0 691 0 0 627 0 0 634 0 0 731 0 0 475 0 0 337 0 0 803 0 0 722 0 0 590 0 0 724 0 0 627 0 0 696 0 0 825 0 0 677 0 0 656 0 0 785 0 0 412 0 0 352 0 0 839 0 0 729 0 0 696 0 0 641 0 0 695 0 0 638 0 0 762 0 0 635 0 0 721 0 0 854 0 0 418 0 0 367 0 0 824 0 0 687 0 0 601 0 0 676 0 0 740 0 0 691 0 0 683 0 0 594 0 0 729 0 0 731 0 0 386 0 0 331 0 0 706 0 0 715 0 0 657 0 0 653 0 0 642 0 0 643 0 0 718 0 0 654 0 0 632 0 0 731 0 0 392 0 0 344 0 0 792 0 0 852 0 0 649 0 0 629 0 0 685 0 0 617 0 0 715 0 0 715 0 0 629 0 0 916 0 0 531 1 0 357 1 0 917 1 0 828 1 0 708 1 0 858 1 0 775 1 0 785 1 0 1006 1 0 789 1 0 734 1 0 906 1 0 532 1 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 time12 seconds
R Server'George Udny Yule' @ 72.249.76.132


Multiple Linear Regression - Estimated Regression Equation
Y[t] = + 592.912200071315 + 79.5171987934752X1[t] + 36.6461688935752X2[t] + 0.644046307447164M1[t] + 88.0982926213765M2[t] -8.62927924651185M3[t] -6.9023056598549M4[t] + 108.642849744984M5[t] -204.677194740493M6[t] -319.041130244745M7[t] + 101.627100715224M8[t] + 71.4449833927896M9[t] -3.37349756600782M10[t] + 13.5093900497066M11[t] + 0.909390049706563t + e[t]


Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STAT
H0: parameter = 0
2-tail p-value1-tail p-value
(Intercept)592.91220007131524.93532623.77800
X179.517198793475223.6512933.36210.0010510.000526
X236.646168893575225.6840381.42680.1563450.078172
M10.64404630744716429.7285120.02170.9827530.491377
M288.098292621376529.7225132.9640.0036920.001846
M3-8.6292792465118529.718321-0.29040.7720570.386028
M4-6.902305659854929.715935-0.23230.8167360.408368
M5108.64284974498429.7153573.65610.0003880.000194
M6-204.67719474049329.771283-6.87500
M7-319.04113024474529.764845-10.718700
M8101.62710071522429.7642643.41440.0008840.000442
M971.444983392789629.759082.40080.0179640.008982
M10-3.3734975660078229.7557-0.11340.9099320.454966
M1113.509390049706630.4143080.44420.6577480.328874
t0.9093900497065630.2317513.9240.0001497.4e-05


Multiple Linear Regression - Regression Statistics
Multiple R0.909827481322315
R-squared0.827786045769308
Adjusted R-squared0.806820868732528
F-TEST (value)39.4838566980424
F-TEST (DF numerator)14
F-TEST (DF denominator)115
p-value0
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation68.0064865853553
Sum Squared Residuals531861.455033673


Multiple Linear Regression - Actuals, Interpolation, and Residuals
Time or IndexActualsInterpolation
Forecast
Residuals
Prediction Error
1621594.46563642846326.534363571537
2587682.829272792104-95.8292727921036
3655587.01109097392267.9889090260779
4517589.647454610286-72.6474546102858
5646706.102000064831-60.102000064831
6657393.691345629061263.308654370939
7382280.236800174515101.763199825485
8345701.81442118419-356.81442118419
9625672.541693911463-47.5416939114627
10654598.63260300237255.3673969976278
11606616.424880667793-10.4248806677933
12510603.824880667793-93.8248806677929
13614605.3783170249478.62168297505329
14647693.741953388583-46.7419533885827
15580597.9237715704-17.9237715704007
16614600.56013520676413.4398647932356
17636717.01468066131-81.01468066131
18388404.604026225539-16.6040262255394
19356291.14948077099464.850519229006
20639712.727101780669-73.7271017806691
21753683.45437450794269.5456254920583
22611609.5452835988511.45471640114920
23639627.33756126427211.6624387357282
24630614.73756126427215.2624387357283
25586616.290997621426-30.2909976214254
26695704.654633985062-9.6546339850615
27552608.83645216688-56.8364521668795
28619611.4728158032437.52718419675683
29681727.927361257789-46.9273612577886
30421415.5167068220185.48329317798185
31307302.0621613674734.93783863252729
32754723.63978237714830.3602176228522
33690694.36705510442-4.36705510442049
34644620.4579641953323.5420358046704
35643638.250241860754.74975813924948
36608625.65024186075-17.6502418607505
37651627.20367821790423.7963217820958
38691715.56731458154-24.5673145815402
39627619.7491327633587.25086723664173
40634622.38549639972211.6145036002781
41731738.840041854267-7.84004185426742
42475426.42938741849748.5706125815031
43337312.97484196395124.0251580360485
44803734.55246297362768.4475370263734
45722705.27973570089916.7202642991008
46590631.370644791808-41.3706447918083
47724649.1629224572374.8370775427707
48627636.56292245723-9.56292245722924
49696638.11635881438357.883641185617
50825726.47999517801998.520004821981
51677630.66181335983746.338186640163
52656633.29817699620122.7018230037993
53785749.75272245074635.2472775492538
54412437.342068014976-25.3420680149757
55352323.8875225604328.1124774395697
56839745.46514357010593.5348564298947
57729716.19241629737812.807583702622
58696642.28332538828753.716674611713
59641660.075603053708-19.0756030537080
60695647.47560305370847.524396946292
61638649.029039410862-11.0290394108617
62762737.39267577449824.6073242255023
63635641.574493956316-6.57449395631577
64721644.2108575926876.7891424073205
65854760.66540304722593.334596952775
66418448.254748611454-30.2547486114544
67367334.80020315690932.199796843091
68824756.37782416658467.622175833416
69687727.105096893857-40.1050968938568
70601653.196005984766-52.1960059847658
71676670.9882836501875.01171634981322
72740658.38828365018781.6117163498132
73691659.9417200073431.0582799926595
74683748.305356370976-65.3053563709765
75594652.487174552794-58.4871745527945
76729655.12353818915873.8764618108418
77731771.578083643704-40.5780836437036
78386459.167429207933-73.1674292079332
79331345.712883753388-14.7128837533877
80706767.290504763063-61.2905047630628
81715738.017777490335-23.0177774903355
82657664.108686581245-7.10868658124455
83653681.900964246666-28.9009642466655
84642669.300964246666-27.3009642466655
85643670.854400603819-27.8544006038192
86718759.218036967455-41.2180369674552
87654663.399855149273-9.39985514927324
88632666.036218785637-34.0362187856370
89731782.490764240182-51.4907642401824
90392470.080109804412-78.080109804412
91344356.625564349866-12.6255643498665
92792778.20318535954213.7968146404584
93852748.930458086814103.069541913186
94649675.021367177723-26.0213671777233
95629692.813644843144-63.8136448431443
96685680.2136448431444.78635515685576
97617681.767081200298-64.767081200298
98715770.130717563934-55.130717563934
99715674.31253574575240.687464254248
100629676.948899382116-47.9488993821157
101916793.403444836661122.596555163339
102531560.509989194366-29.509989194366
103357447.055443739821-90.0554437398206
104917868.63306474949648.3669352505043
105828839.360337476768-11.3603374767683
106708765.451246567677-57.4512465676774
107858783.24352423309874.7564757669016
108775770.6435242330984.35647576690166
109785772.19696059025212.8030394097479
1101006860.560596953888145.439403046112
111789764.74241513570624.2575848642939
112734767.37877877207-33.3787787720698
113906883.83332422661522.1666757733847
114532571.422669790845-39.4226697908447
115387457.968124336299-70.9681243362994
116991916.1919142395574.8080857604505
117841886.919186966822-45.9191869668222
118892813.01009605773178.9899039422687
119782830.802373723152-48.8023737231523
120813818.202373723152-5.20237372315224
121793819.755810080306-26.755810080306
122978908.11944644394269.880553556058
123775812.30126462576-37.30126462576
124797814.937628262124-17.9376282621237
125946931.39217371666914.6078262833309
126594618.981519280899-24.9815192808986
127438505.526973826353-67.5269738263534
1281022927.10459483602894.8954051639717
129868897.831867563301-29.831867563301
130795823.92277665421-28.9227766542100


Goldfeld-Quandt test for Heteroskedasticity
p-valuesAlternative Hypothesis
breakpoint indexgreater2-sidedless
180.9985883665827170.002823266834565500.00141163341728275
190.9965766971956530.006846605608694930.00342330280434747
200.9999950938466489.81230670393486e-064.90615335196743e-06
210.999994719470961.05610580800388e-055.28052904001939e-06
220.9999884615615072.30768769867344e-051.15384384933672e-05
230.9999707226518595.85546962824801e-052.92773481412401e-05
240.999961216465647.75670687168802e-053.87835343584401e-05
250.999940431911730.0001191361765392985.9568088269649e-05
260.9999023238280370.0001953523439256399.76761719628195e-05
270.9999179424295830.0001641151408337038.20575704168513e-05
280.9998458712664760.0003082574670483220.000154128733524161
290.9998149444541060.0003701110917881940.000185055545894097
300.9998642727252440.0002714545495110010.000135727274755501
310.9998090936261450.0003818127477094860.000190906373854743
320.9999921654500111.56690999775414e-057.83454998877072e-06
330.9999851194501472.97610997067743e-051.48805498533871e-05
340.999970082540245.98349195218359e-052.99174597609179e-05
350.9999430147853920.0001139704292169515.69852146084754e-05
360.999914305651270.0001713886974615368.56943487307682e-05
370.999841201314880.0003175973702413550.000158798685120678
380.9998111788224740.0003776423550531030.000188821177526551
390.9996793240871120.0006413518257759510.000320675912887976
400.999480040100150.001039919799699270.000519959899849637
410.9994206024235380.001158795152924240.000579397576462118
420.9992789752534870.001442049493025820.000721024746512908
430.9989323493845360.002135301230928350.00106765061546417
440.999670341653130.0006593166937384040.000329658346869202
450.999445738410250.001108523179499470.000554261589749734
460.9995250426889160.0009499146221687680.000474957311084384
470.9994102008423840.001179598315231870.000589799157615933
480.9992316993844430.001536601231114850.000768300615557424
490.998865542680580.002268914638840870.00113445731942043
500.9990961924274670.001807615145065720.000903807572532859
510.9985862976114940.002827404777012900.00141370238850645
520.9977699855623650.004460028875269710.00223001443763486
530.9969124155482390.006175168903522630.00308758445176131
540.9976204934616650.004759013076669460.00237950653833473
550.9969256175894310.006148764821137550.00307438241056878
560.9978589729422680.004282054115463190.00214102705773160
570.9967721018133990.006455796373202140.00322789818660107
580.9957340519974780.008531896005044090.00426594800252204
590.9946758214631870.01064835707362640.00532417853681321
600.9925917322921460.01481653541570820.0074082677078541
610.9904905632669720.01901887346605610.00950943673302805
620.986181208248430.02763758350314140.0138187917515707
630.9817861412288450.03642771754231070.0182138587711553
640.9809662285479780.03806754290404330.0190337714520216
650.9827848246126970.03443035077460540.0172151753873027
660.9836329550586180.03273408988276480.0163670449413824
670.9854313169124630.02913736617507450.0145686830875373
680.9841080237157550.03178395256849040.0158919762842452
690.9812676723236110.03746465535277710.0187323276763885
700.9798771544978760.04024569100424730.0201228455021237
710.9736326747369290.05273465052614290.0263673252630715
720.9796997820246930.04060043595061460.0203002179753073
730.9797247035860030.04055059282799320.0202752964139966
740.9809266110842430.03814677783151310.0190733889157565
750.9793554579445320.04128908411093640.0206445420554682
760.989687232356450.02062553528709900.0103127676435495
770.9867551043099320.02648979138013670.0132448956900684
780.9866017827674560.02679643446508770.0133982172325439
790.988411517389130.02317696522173850.0115884826108693
800.9906270010297220.01874599794055560.00937299897027782
810.9862578983160710.02748420336785770.0137421016839288
820.9807602234964220.03847955300715650.0192397765035783
830.9732665318138640.0534669363722720.026733468186136
840.9627524588446090.0744950823107820.037247541155391
850.9510665226426620.0978669547146760.048933477357338
860.9489217760921980.1021564478156050.0510782239078023
870.9293413573957720.1413172852084570.0706586426042283
880.9093013057221730.1813973885556540.0906986942778272
890.9201682155615630.1596635688768740.079831784438437
900.9123011659093820.1753976681812370.0876988340906183
910.9091402550873950.1817194898252110.0908597449126053
920.8947302846857060.2105394306285870.105269715314294
930.9636530972173110.07269380556537710.0363469027826885
940.9468189294085510.1063621411828970.0531810705914486
950.9400761518733390.1198476962533220.059923848126661
960.9157550717313320.1684898565373370.0842449282686683
970.8980957489532660.2038085020934670.101904251046734
980.9882395579097610.02352088418047700.0117604420902385
990.9802974355093860.03940512898122810.0197025644906141
1000.9875319818082820.02493603638343700.0124680181917185
1010.9819950594224070.03600988115518710.0180049405775936
1020.9685787479598570.06284250408028680.0314212520401434
1030.9503126539178430.09937469216431370.0496873460821569
1040.9438083242860660.1123833514278680.0561916757139342
1050.9078394565206420.1843210869587170.0921605434793584
1060.9633501439664140.07329971206717190.0366498560335860
1070.9811213509361220.03775729812775530.0188786490638777
1080.9602392023082370.07952159538352510.0397607976917626
1090.923166435874660.1536671282506790.0768335641253393
1100.9155922326407570.1688155347184860.0844077673592428
1110.8923225912108480.2153548175783040.107677408789152
1120.7765772937860.4468454124280.223422706214


Meta Analysis of Goldfeld-Quandt test for Heteroskedasticity
Description# significant tests% significant testsOK/NOK
1% type I error level410.431578947368421NOK
5% type I error level690.726315789473684NOK
10% type I error level780.821052631578947NOK
 
Charts produced by software:
http://www.freestatistics.org/blog/date/2010/Dec/28/t1293556546t54nsjzosmxm85i/10v7xh1293556659.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/28/t1293556546t54nsjzosmxm85i/10v7xh1293556659.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/28/t1293556546t54nsjzosmxm85i/16o0n1293556659.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/28/t1293556546t54nsjzosmxm85i/16o0n1293556659.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/28/t1293556546t54nsjzosmxm85i/26o0n1293556659.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/28/t1293556546t54nsjzosmxm85i/26o0n1293556659.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/28/t1293556546t54nsjzosmxm85i/3zfz81293556659.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/28/t1293556546t54nsjzosmxm85i/3zfz81293556659.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/28/t1293556546t54nsjzosmxm85i/4zfz81293556659.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/28/t1293556546t54nsjzosmxm85i/4zfz81293556659.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/28/t1293556546t54nsjzosmxm85i/5zfz81293556659.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/28/t1293556546t54nsjzosmxm85i/5zfz81293556659.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/28/t1293556546t54nsjzosmxm85i/6zfz81293556659.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/28/t1293556546t54nsjzosmxm85i/6zfz81293556659.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/28/t1293556546t54nsjzosmxm85i/7rogt1293556659.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/28/t1293556546t54nsjzosmxm85i/7rogt1293556659.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/28/t1293556546t54nsjzosmxm85i/8kgxe1293556659.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/28/t1293556546t54nsjzosmxm85i/8kgxe1293556659.ps (open in new window)


http://www.freestatistics.org/blog/date/2010/Dec/28/t1293556546t54nsjzosmxm85i/9kgxe1293556659.png (open in new window)
http://www.freestatistics.org/blog/date/2010/Dec/28/t1293556546t54nsjzosmxm85i/9kgxe1293556659.ps (open in new window)


 
Parameters (Session):
par1 = 12 ; par2 = Triple ; par3 = multiplicative ;
 
Parameters (R input):
par1 = 1 ; par2 = Include Monthly 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