Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_multipleregression.wasp
Title produced by softwareMultiple Regression
Date of computationTue, 13 Nov 2007 16:39:38 -0700
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2007/Nov/14/t1194996868vs7oacac70da8mb.htm/, Retrieved Mon, 06 May 2024 21:30:07 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=5386, Retrieved Mon, 06 May 2024 21:30:07 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact260
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [Multiple Regression] [test] [2007-11-13 23:39:38] [d41d8cd98f00b204e9800998ecf8427e] [Current]
Feedback Forum

Post a new message
Dataseries X:
99.2	96.7	101.0
99.0	98.1	100.1
100.0	100.0	100.0
111.6	104.9	90.6
122.2	104.9	86.5
117.6	109.5	89.7
121.1	110.8	90.6
136.0	112.3	82.8
154.2	109.3	70.1
153.6	105.3	65.4
158.5	101.7	61.3
140.6	95.4	62.5
136.2	96.4	63.6
168.0	97.6	52.6
154.3	102.4	59.7
149.0	101.6	59.5
165.5	103.8	61.3




Summary of compuational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time5 seconds
R Server'Herman Ole Andreas Wold' @ 193.190.124.10:1001

\begin{tabular}{lllllllll}
\hline
Summary of compuational transaction \tabularnewline
Raw Input & view raw input (R code)  \tabularnewline
Raw Output & view raw output of R engine  \tabularnewline
Computing time & 5 seconds \tabularnewline
R Server & 'Herman Ole Andreas Wold' @ 193.190.124.10:1001 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=5386&T=0

[TABLE]
[ROW][C]Summary of compuational transaction[/C][/ROW]
[ROW][C]Raw Input[/C][C]view raw input (R code) [/C][/ROW]
[ROW][C]Raw Output[/C][C]view raw output of R engine [/C][/ROW]
[ROW][C]Computing time[/C][C]5 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]'Herman Ole Andreas Wold' @ 193.190.124.10:1001[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=5386&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=5386&T=0

As an alternative you can also use a QR Code:  

The GUIDs for individual cells are displayed in the table below:

Summary of compuational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time5 seconds
R Server'Herman Ole Andreas Wold' @ 193.190.124.10:1001







Multiple Linear Regression - Estimated Regression Equation
Cons [t] = + 132.451174047719 + 1.13575109398718 Inc -1.51244497290197 Price + 6.27211427506502 Q1 + 5.17632146167801 Q2 + 4.69523184067709 Q3 -0.406413858128117 t + e[t]

\begin{tabular}{lllllllll}
\hline
Multiple Linear Regression - Estimated Regression Equation \tabularnewline
Cons [t] =   +  132.451174047719   +  1.13575109398718   Inc  -1.51244497290197   Price  +  6.27211427506502   Q1  +  5.17632146167801   Q2  +  4.69523184067709   Q3  -0.406413858128117   t   + e[t] \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=5386&T=1

[TABLE]
[ROW][C]Multiple Linear Regression - Estimated Regression Equation[/C][/ROW]
[ROW][C]Cons [t] =   +  132.451174047719   +  1.13575109398718   Inc  -1.51244497290197   Price  +  6.27211427506502   Q1  +  5.17632146167801   Q2  +  4.69523184067709   Q3  -0.406413858128117   t   + e[t][/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=5386&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=5386&T=1

As an alternative you can also use a QR Code:  

The GUIDs for individual cells are displayed in the table below:

Multiple Linear Regression - Estimated Regression Equation
Cons [t] = + 132.451174047719 + 1.13575109398718 Inc -1.51244497290197 Price + 6.27211427506502 Q1 + 5.17632146167801 Q2 + 4.69523184067709 Q3 -0.406413858128117 t + e[t]







Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STATH0: parameter = 02-tail p-value1-tail p-value
(Intercept)132.45117404771935.79419852417493.700353116113590.004106104724295730.00205305236214787
Inc1.135751093987180.2816289327312244.032792664349910.002388753066927560.00119437653346378
Price-1.512444972901970.268677292906985-5.629225144179070.0002186466537801610.000109323326890080
Q16.272114275065023.861976271645031.624068568498320.1354242084435820.0677121042217909
Q25.176321461678014.1668640231381.242258310550720.2424842481581980.121242124079099
Q34.695231840677094.054821654824391.157937941633200.2737968723275760.136898436163788
t-0.4064138581281170.892862206447003-0.455180939671950.658701710113550.329350855056775

\begin{tabular}{lllllllll}
\hline
Multiple Linear Regression - Ordinary Least Squares \tabularnewline
Variable & Parameter & S.D. & T-STATH0: parameter = 0 & 2-tail p-value & 1-tail p-value \tabularnewline
(Intercept) & 132.451174047719 & 35.7941985241749 & 3.70035311611359 & 0.00410610472429573 & 0.00205305236214787 \tabularnewline
Inc & 1.13575109398718 & 0.281628932731224 & 4.03279266434991 & 0.00238875306692756 & 0.00119437653346378 \tabularnewline
Price & -1.51244497290197 & 0.268677292906985 & -5.62922514417907 & 0.000218646653780161 & 0.000109323326890080 \tabularnewline
Q1 & 6.27211427506502 & 3.86197627164503 & 1.62406856849832 & 0.135424208443582 & 0.0677121042217909 \tabularnewline
Q2 & 5.17632146167801 & 4.166864023138 & 1.24225831055072 & 0.242484248158198 & 0.121242124079099 \tabularnewline
Q3 & 4.69523184067709 & 4.05482165482439 & 1.15793794163320 & 0.273796872327576 & 0.136898436163788 \tabularnewline
t & -0.406413858128117 & 0.892862206447003 & -0.45518093967195 & 0.65870171011355 & 0.329350855056775 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=5386&T=2

[TABLE]
[ROW][C]Multiple Linear Regression - Ordinary Least Squares[/C][/ROW]
[ROW][C]Variable[/C][C]Parameter[/C][C]S.D.[/C][C]T-STATH0: parameter = 0[/C][C]2-tail p-value[/C][C]1-tail p-value[/C][/ROW]
[ROW][C](Intercept)[/C][C]132.451174047719[/C][C]35.7941985241749[/C][C]3.70035311611359[/C][C]0.00410610472429573[/C][C]0.00205305236214787[/C][/ROW]
[ROW][C]Inc[/C][C]1.13575109398718[/C][C]0.281628932731224[/C][C]4.03279266434991[/C][C]0.00238875306692756[/C][C]0.00119437653346378[/C][/ROW]
[ROW][C]Price[/C][C]-1.51244497290197[/C][C]0.268677292906985[/C][C]-5.62922514417907[/C][C]0.000218646653780161[/C][C]0.000109323326890080[/C][/ROW]
[ROW][C]Q1[/C][C]6.27211427506502[/C][C]3.86197627164503[/C][C]1.62406856849832[/C][C]0.135424208443582[/C][C]0.0677121042217909[/C][/ROW]
[ROW][C]Q2[/C][C]5.17632146167801[/C][C]4.166864023138[/C][C]1.24225831055072[/C][C]0.242484248158198[/C][C]0.121242124079099[/C][/ROW]
[ROW][C]Q3[/C][C]4.69523184067709[/C][C]4.05482165482439[/C][C]1.15793794163320[/C][C]0.273796872327576[/C][C]0.136898436163788[/C][/ROW]
[ROW][C]t[/C][C]-0.406413858128117[/C][C]0.892862206447003[/C][C]-0.45518093967195[/C][C]0.65870171011355[/C][C]0.329350855056775[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=5386&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=5386&T=2

As an alternative you can also use a QR Code:  

The GUIDs for individual cells are displayed in the table below:

Multiple Linear Regression - Ordinary Least Squares
VariableParameterS.D.T-STATH0: parameter = 02-tail p-value1-tail p-value
(Intercept)132.45117404771935.79419852417493.700353116113590.004106104724295730.00205305236214787
Inc1.135751093987180.2816289327312244.032792664349910.002388753066927560.00119437653346378
Price-1.512444972901970.268677292906985-5.629225144179070.0002186466537801610.000109323326890080
Q16.272114275065023.861976271645031.624068568498320.1354242084435820.0677121042217909
Q25.176321461678014.1668640231381.242258310550720.2424842481581980.121242124079099
Q34.695231840677094.054821654824391.157937941633200.2737968723275760.136898436163788
t-0.4064138581281170.892862206447003-0.455180939671950.658701710113550.329350855056775







Multiple Linear Regression - Regression Statistics
Multiple R0.981494957001541
R-squared0.963332350619458
Adjusted R-squared0.941331760991132
F-TEST (value)43.7866605801867
F-TEST (DF numerator)6
F-TEST (DF denominator)10
p-value1.30825405753043e-06
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation5.71078995353254
Sum Squared Residuals326.131218933682

\begin{tabular}{lllllllll}
\hline
Multiple Linear Regression - Regression Statistics \tabularnewline
Multiple R & 0.981494957001541 \tabularnewline
R-squared & 0.963332350619458 \tabularnewline
Adjusted R-squared & 0.941331760991132 \tabularnewline
F-TEST (value) & 43.7866605801867 \tabularnewline
F-TEST (DF numerator) & 6 \tabularnewline
F-TEST (DF denominator) & 10 \tabularnewline
p-value & 1.30825405753043e-06 \tabularnewline
Multiple Linear Regression - Residual Statistics \tabularnewline
Residual Standard Deviation & 5.71078995353254 \tabularnewline
Sum Squared Residuals & 326.131218933682 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=5386&T=3

[TABLE]
[ROW][C]Multiple Linear Regression - Regression Statistics[/C][/ROW]
[ROW][C]Multiple R[/C][C]0.981494957001541[/C][/ROW]
[ROW][C]R-squared[/C][C]0.963332350619458[/C][/ROW]
[ROW][C]Adjusted R-squared[/C][C]0.941331760991132[/C][/ROW]
[ROW][C]F-TEST (value)[/C][C]43.7866605801867[/C][/ROW]
[ROW][C]F-TEST (DF numerator)[/C][C]6[/C][/ROW]
[ROW][C]F-TEST (DF denominator)[/C][C]10[/C][/ROW]
[ROW][C]p-value[/C][C]1.30825405753043e-06[/C][/ROW]
[ROW][C]Multiple Linear Regression - Residual Statistics[/C][/ROW]
[ROW][C]Residual Standard Deviation[/C][C]5.71078995353254[/C][/ROW]
[ROW][C]Sum Squared Residuals[/C][C]326.131218933682[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=5386&T=3

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=5386&T=3

As an alternative you can also use a QR Code:  

The GUIDs for individual cells are displayed in the table below:

Multiple Linear Regression - Regression Statistics
Multiple R0.981494957001541
R-squared0.963332350619458
Adjusted R-squared0.941331760991132
F-TEST (value)43.7866605801867
F-TEST (DF numerator)6
F-TEST (DF denominator)10
p-value1.30825405753043e-06
Multiple Linear Regression - Residual Statistics
Residual Standard Deviation5.71078995353254
Sum Squared Residuals326.131218933682



Parameters (Session):
par1 = 1 ; par2 = Include Quarterly Dummies ; par3 = Linear Trend ;
Parameters (R input):
par1 = 1 ; par2 = Include Quarterly Dummies ; par3 = Linear Trend ;
R code (references can be found in the software module):
library(lattice)
par1 <- as.numeric(par1)
x <- t(y)
k <- length(x[1,])
n <- length(x[,1])
x1 <- cbind(x[,par1], x[,1:k!=par1])
colnames(x1)[1] <- 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))
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, 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')
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()
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] = ', '')
for (i in 1:k){
if (mysum$coefficients[i,1] > 0) myeq <- paste(myeq, '+', '')
myeq <- paste(myeq, mysum$coefficients[i,1], ' ')
if (rownames(mysum$coefficients)[i] != '(Intercept)') myeq <- paste(myeq, rownames(mysum$coefficients)[i], '')
}
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('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,mysum$coefficients[i,2])
a<-table.element(a,mysum$coefficients[i,3])
a<-table.element(a,mysum$coefficients[i,4])
a<-table.element(a,mysum$coefficients[i,4]/2)
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')