Free Statistics

of Irreproducible Research!

Author's title

Author*The author of this computation has been verified*
R Software Modulerwasp_Simple Regression Y ~ X.wasp
Title produced by softwareSimple Linear Regression
Date of computationThu, 21 Dec 2017 21:08:17 +0100
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2017/Dec/21/t1513887306b32xov53j9hhcnv.htm/, Retrieved Tue, 14 May 2024 06:22:22 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=310708, Retrieved Tue, 14 May 2024 06:22:22 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact59
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [Simple Linear Regression] [simple regression] [2017-12-21 20:08:17] [d2f3f1c36efc482093437f9590ab82ed] [Current]
Feedback Forum

Post a new message
Dataseries X:
342185	24
1500000	0
121448	10
65000	4
10714	45
13383	2
15101	4
94420	9
30000	3
30657	10
45835	7
68267	40
35250	5
25302	4
14250	8
28232	6
13731	1
16000	2
10879	0
36000	3
526837	44
34837	5
3370	0
17101	14
11242	37
91945	3
326	4
28161	0
14534	8
52515	11
18816	6
15848	4
100000	26
138135	0
86750	37
600	5
30000	0
17859	4
20050	39
52000	8
168	0
31730	3
10182	5
51840	5
20000	45
12000	2
1500	0
52000	15
12051	5
26067	4
39466	7
113	0
21000	7
250	0
147368	19
20900	1
51366	3
18450	4
12745	57
9441	4
136647	47
45702	8
25109	42
46500	0
0	52
16362	5
90000	5
1074611	29
72495	5
42066	10
41400	10
24000	7
20000	79
1025	38
70000	5
0	0
3449547	43
10614	3
10882	60
40378	7
1000	79
12544	0
18269	8
710	3
46231	4
293770	9
12759	4
11159	9
9901	2
29657	0
6333	2
2689175	26
73467	40
23000	35
10393	79
300	0
11164	5
23300	0
23000	10
25000	10
54213	2
6541	4
5280	0
9964	44
80471	41
6986	43
3963	0
39700	6
10501	5
18515	55
86507	11
69910	3
61092	0
9841	5
10000	76
150	0
41214	0
877	2
202000	20
18000	0
28467	15
13877	5
12500	18
5000	20
12558	6
25000	23
45250	0
18127	0
25856	14
37000	12
18513	3
17504	0
3353	6
48124	17
637957	47
13104	32
10000	0
28607	0
18736	0
337	3
15869	0
0	4
22123	2
85791	0
17660	6
9233	1
2676	8
10572	0
21634	5
10000	5
10000	3
24659	9
9695	45
20000	8
11325	5
56670	4
913564	47
50959	10
95100	32
1536426	46
75000	5
28747	5
22200	9
142000	34
53779	0
3800	3
9573	38
16897	0
500	2
18463	30
13670	3
20833	70
0	0
24880	5
31253	4
123441	22
16725	54
0	0
127299	3
10477	3
13986	50
0	0
18352	50
3600	0
70000	15
31100	9
63989	5
14548	40
33673	5
79780	7
20400	5
3807	0
22253	6
153210	24
37240	0
9740	3
11322	45
731320	45
56175	6
9866	5




Summary of computational transaction
Raw Input view raw input (R code)
Raw Outputview raw output of R engine
Computing time7 seconds
R ServerBig Analytics Cloud Computing Center

\begin{tabular}{lllllllll}
\hline
Summary of computational transaction \tabularnewline
Raw Input view raw input (R code)  \tabularnewline
Raw Outputview raw output of R engine  \tabularnewline
Computing time7 seconds \tabularnewline
R ServerBig Analytics Cloud Computing Center \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=310708&T=0

[TABLE]
[ROW]
Summary of computational transaction[/C][/ROW] [ROW]Raw Input[/C] view raw input (R code) [/C][/ROW] [ROW]Raw Output[/C]view raw output of R engine [/C][/ROW] [ROW]Computing time[/C]7 seconds[/C][/ROW] [ROW]R Server[/C]Big Analytics Cloud Computing Center[/C][/ROW] [/TABLE] Source: https://freestatistics.org/blog/index.php?pk=310708&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=310708&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 computational transaction
Raw Input view raw input (R code)
Raw Outputview raw output of R engine
Computing time7 seconds
R ServerBig Analytics Cloud Computing Center







Linear Regression Model
Y ~ X
coefficients:
EstimateStd. Errort valuePr(>|t|)
(Intercept)43841.71531205.9621.4050.162
X3894.7761343.6622.8990.004
- - -
Residual Std. Err. 352408.399 on 198 df
Multiple R-sq. 0.041
95% CI Multiple R-sq. [0.005, 0.101]
Adjusted R-sq. 0.036

\begin{tabular}{lllllllll}
\hline
Linear Regression Model \tabularnewline
Y ~ X \tabularnewline
coefficients: &   \tabularnewline
  & Estimate & Std. Error & t value & Pr(>|t|) \tabularnewline
(Intercept) & 43841.715 & 31205.962 & 1.405 & 0.162 \tabularnewline
X & 3894.776 & 1343.662 & 2.899 & 0.004 \tabularnewline
- - -  &   \tabularnewline
Residual Std. Err.  & 352408.399  on  198 df \tabularnewline
Multiple R-sq.  & 0.041 \tabularnewline
95% CI Multiple R-sq.  & [0.005, 0.101] \tabularnewline
Adjusted R-sq.  & 0.036 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=310708&T=1

[TABLE]
[ROW][C]Linear Regression Model[/C][/ROW]
[ROW][C]Y ~ X[/C][/ROW]
[ROW][C]coefficients:[/C][C] [/C][/ROW]
[ROW][C] [/C][C]Estimate[/C][C]Std. Error[/C][C]t value[/C][C]Pr(>|t|)[/C][/ROW]
[C](Intercept)[/C][C]43841.715[/C][C]31205.962[/C][C]1.405[/C][C]0.162[/C][/ROW]
[C]X[/C][C]3894.776[/C][C]1343.662[/C][C]2.899[/C][C]0.004[/C][/ROW]
[ROW][C]- - - [/C][C] [/C][/ROW]
[ROW][C]Residual Std. Err. [/C][C]352408.399  on  198 df[/C][/ROW]
[ROW][C]Multiple R-sq. [/C][C]0.041[/C][/ROW]
[ROW][C]95% CI Multiple R-sq. [/C][C][0.005, 0.101][/C][/ROW]
[ROW][C]Adjusted R-sq. [/C][C]0.036[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=310708&T=1

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

As an alternative you can also use a QR Code:  

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

Linear Regression Model
Y ~ X
coefficients:
EstimateStd. Errort valuePr(>|t|)
(Intercept)43841.71531205.9621.4050.162
X3894.7761343.6622.8990.004
- - -
Residual Std. Err. 352408.399 on 198 df
Multiple R-sq. 0.041
95% CI Multiple R-sq. [0.005, 0.101]
Adjusted R-sq. 0.036







ANOVA Statistics
DfSum SqMean SqF valuePr(>F)
V211043463075850.911043463075850.918.4020.004
Residuals19824589952636422.6124191679981.932

\begin{tabular}{lllllllll}
\hline
ANOVA Statistics \tabularnewline
  & Df & Sum Sq & Mean Sq & F value & Pr(>F) \tabularnewline
V2 & 1 & 1043463075850.91 & 1043463075850.91 & 8.402 & 0.004 \tabularnewline
Residuals & 198 & 24589952636422.6 & 124191679981.932 &   &   \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=310708&T=2

[TABLE]
[ROW][C]ANOVA Statistics[/C][/ROW]
[ROW][C] [/C][C]Df[/C][C]Sum Sq[/C][C]Mean Sq[/C][C]F value[/C][C]Pr(>F)[/C][/ROW]
[ROW][C]V2[/C][C]1[/C][C]1043463075850.91[/C][C]1043463075850.91[/C][C]8.402[/C][C]0.004[/C][/ROW]
[ROW][C]Residuals[/C][C]198[/C][C]24589952636422.6[/C][C]124191679981.932[/C][C] [/C][C] [/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=310708&T=2

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

As an alternative you can also use a QR Code:  

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

ANOVA Statistics
DfSum SqMean SqF valuePr(>F)
V211043463075850.911043463075850.918.4020.004
Residuals19824589952636422.6124191679981.932



Parameters (Session):
par1 = 1 ; par2 = 2 ; par3 = TRUE ;
Parameters (R input):
par1 = 1 ; par2 = 2 ; par3 = TRUE ;
R code (references can be found in the software module):
par3 <- 'FALSE'
par2 <- '2'
par1 <- '1'
library(boot)
cat1 <- as.numeric(par1)
cat2<- as.numeric(par2)
intercept<-as.logical(par3)
x <- na.omit(t(x))
rsq <- function(formula, data, indices) {
d <- data[indices,] # allows boot to select sample
fit <- lm(formula, data=d)
return(summary(fit)$r.square)
}
xdf<-data.frame(na.omit(t(y)))
(V1<-dimnames(y)[[1]][cat1])
(V2<-dimnames(y)[[1]][cat2])
xdf <- data.frame(xdf[[cat1]], xdf[[cat2]])
names(xdf)<-c('Y', 'X')
if(intercept == FALSE) (lmxdf<-lm(Y~ X - 1, data = xdf) ) else (lmxdf<-lm(Y~ X, data = xdf) )
(results <- boot(data=xdf, statistic=rsq, R=1000, formula=Y~X))
sumlmxdf<-summary(lmxdf)
(aov.xdf<-aov(lmxdf) )
(anova.xdf<-anova(lmxdf) )
load(file='createtable')
a<-table.start()
nc <- ncol(sumlmxdf$'coefficients')
nr <- nrow(sumlmxdf$'coefficients')
a<-table.row.start(a)
a<-table.element(a,'Linear Regression Model', nc+1,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, lmxdf$call['formula'],nc+1)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'coefficients:',1,TRUE)
a<-table.element(a, ' ',nc,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, ' ',1,TRUE)
for(i in 1 : nc){
a<-table.element(a, dimnames(sumlmxdf$'coefficients')[[2]][i],1,TRUE)
}#end header
a<-table.row.end(a)
for(i in 1: nr){
a<-table.element(a,dimnames(sumlmxdf$'coefficients')[[1]][i] ,1,TRUE)
for(j in 1 : nc){
a<-table.element(a, round(sumlmxdf$coefficients[i, j], digits=3), 1 ,FALSE)
}
a<-table.row.end(a)
}
a<-table.row.start(a)
a<-table.element(a, '- - - ',1,TRUE)
a<-table.element(a, ' ',nc,FALSE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'Residual Std. Err. ',1,TRUE)
a<-table.element(a, paste(round(sumlmxdf$'sigma', digits=3), ' on ', sumlmxdf$'df'[2], 'df') ,nc, FALSE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'Multiple R-sq. ',1,TRUE)
a<-table.element(a, round(sumlmxdf$'r.squared', digits=3) ,nc, FALSE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, '95% CI Multiple R-sq. ',1,TRUE)
a<-table.element(a, paste('[',round(boot.ci(results,type='bca')$bca[1,4], digits=3),', ', round(boot.ci(results,type='bca')$bca[1,5], digits=3), ']',sep='') ,nc, FALSE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'Adjusted R-sq. ',1,TRUE)
a<-table.element(a, round(sumlmxdf$'adj.r.squared', digits=3) ,nc, FALSE)
a<-table.row.end(a)
a<-table.end(a)
table.save(a,file='mytable.tab')
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,'ANOVA Statistics', 5+1,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, ' ',1,TRUE)
a<-table.element(a, 'Df',1,TRUE)
a<-table.element(a, 'Sum Sq',1,TRUE)
a<-table.element(a, 'Mean Sq',1,TRUE)
a<-table.element(a, 'F value',1,TRUE)
a<-table.element(a, 'Pr(>F)',1,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, V2,1,TRUE)
a<-table.element(a, anova.xdf$Df[1])
a<-table.element(a, round(anova.xdf$'Sum Sq'[1], digits=3))
a<-table.element(a, round(anova.xdf$'Mean Sq'[1], digits=3))
a<-table.element(a, round(anova.xdf$'F value'[1], digits=3))
a<-table.element(a, round(anova.xdf$'Pr(>F)'[1], digits=3))
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a, 'Residuals',1,TRUE)
a<-table.element(a, anova.xdf$Df[2])
a<-table.element(a, round(anova.xdf$'Sum Sq'[2], digits=3))
a<-table.element(a, round(anova.xdf$'Mean Sq'[2], digits=3))
a<-table.element(a, ' ')
a<-table.element(a, ' ')
a<-table.row.end(a)
a<-table.end(a)
table.save(a,file='mytable1.tab')
bitmap(file='regressionplot.png')
plot(Y~ X, data=xdf, xlab=V2, ylab=V1, main='Regression Solution')
if(intercept == TRUE) abline(coef(lmxdf), col='red')
if(intercept == FALSE) abline(0.0, coef(lmxdf), col='red')
dev.off()
library(car)
bitmap(file='residualsQQplot.png')
qqPlot(resid(lmxdf), main='QQplot of Residuals of Fit')
dev.off()
bitmap(file='residualsplot.png')
plot(xdf$X, resid(lmxdf), main='Scatterplot of Residuals of Model Fit')
dev.off()
bitmap(file='cooksDistanceLmplot.png')
plot(lmxdf, which=4)
dev.off()