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, 11 Feb 2016 14:21:03 +0000
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2016/Feb/11/t1455200495o1ucwsvsvtsg8o1.htm/, Retrieved Thu, 02 May 2024 23:22:13 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=291979, Retrieved Thu, 02 May 2024 23:22:13 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact171
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [Simple Linear Regression] [Hope and Personal...] [2016-02-11 14:21:03] [8230fbefbda45aa75caed06cc6e9aab6] [Current]
- R P     [Simple Linear Regression] [mdn] [2016-02-11 14:24:03] [417b1a633cff72ad8e845abe56302095]
-           [Simple Linear Regression] [hh] [2016-02-11 14:27:06] [417b1a633cff72ad8e845abe56302095]
Feedback Forum

Post a new message
Dataseries X:
49	24	25	3.2	3.21	3.89	4	3
34	15	19	3.5	3	2.63	4.23	3.38
50	24	26	3	4	2.75	4.56	3.5
43	19	24	2.8	2.78	3	3.44	3.5
54	27	27	4.1	3.89	4.5	4.56	1.75
52	27	25	3.9	3.56	2.88	3.22	2.75
51	25	26	3.2	4.22	4	4.67	2.38
52	24	28	3.7	3.1	3.62	4	2.87
42	20	22	3.2	3.4	2.5	3.89	2.12
25	15	10	3.5	2.3	2	4	4.8
50	27	23	3.2	3.78	3	3.22	2.75
26	15	11	3.5	4.32	2.37	4.33	4
60	29	31	4.3	3.33	4.88	3.89	2.12
33	18	15	2.8	3.89	2.38	3.44	3
44	19	25	3.2	2.44	2.87	3.56	3.25
55	31	24	3.4	4.44	2.25	4.67	3
59	32	27	3.7	3.89	3.38	3.56	3.88
56	29	27	2.8	3.89	3.63	3.88	2.63
58	29	29	4	3	3.63	3.56	3.88
50	28	22	3.1	3.88	3.87	3.89	3.37
38	22	16	2.4	3.89	2.5	3.56	3.88
41	19	22	2.6	3.67	2.88	1.56	3.38
29	15	14	3	4	2.12	4.22	3.88
40	20	20	3	3.56	2.75	3.89	3.38
43	24	19	3	3.56	2.75	2.89	2.88
54	28	26	3.2	4	4.75	4.56	2.38
58	32	26	3	4.67	3	4.78	1.88
50	27	23	3.5	4.22	2.88	4.33	3.75
45	24	21	3.6	4.78	2.13	3.56	4.5
53	25	28	3.5	3.78	3.63	4	2.13
51	27	24	2.7	4.22	2.87	3.78	3.75
58	28	30	3.4	4.33	2.75	3.78	2.62
42	17	25	3.2	2.44	3.5	3.89	2.5
23	19	4	3.2	3	3.75	4.78	4.5
40	22	18	2.9	3.33	4.12	3.78	3.38
33	13	20	3.5	2.77	3.13	2.78	4.38
42	22	20	3.9	3.44	3.37	3.89	2.88
38	18	20	2.9	2.67	3.5	4.11	3
43	23	20	2.9	2.89	2.75	3.89	2.88
33	17	16	3	2.22	3.25	3.56	3.5
54	27	27	2.9	3.67	3.87	3.88	3.62
43	20	23	3.5	4	2.5	4.44	3.25
54	27	27	4	3.67	3.88	3.66	3
37	18	19	3.7	3.44	2.38	3.67	3.88
40	22	18	3.1	4.22	2.87	4.33	3.75
61	29	32	2.7	4.9	3.25	4.67	2.12
52	27	25	3.9	3.78	2.63	4.44	2.12
40	22	18	3.8	4.44	2.63	3.33	3.63
50	26	24	3.2	3.44	2.12	4.11	3
37	19	18	3.2	4	1.87	4.11	3.88
47	28	19	3.8	3.67	3.25	4.1	2
56	29	27	3.9	4.44	3.62	4.67	1.87
50	26	24	3	3.56	2.75	4.44	2.25
58	28	30	3.2	4.22	4.12	3.44	1.75
39	20	19	2.4	3.22	2.38	3.44	3.13
49	23	26	3.9	3.44	3.75	3.89	3.11
55	26	29	3	3.88	4	4.22	3..38
55	26	29	3.8	4.22	3.5	4.67	2.75
49	22	27	3.4	3.11	2.63	4.67	4.38
42	22	20	4.3	4	2	3.78	4.38





Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time0 seconds
R Server'Gertrude Mary Cox' @ cox.wessa.net
R Framework error message
Warning: there are blank lines in the 'Data X' field.
Please, use NA for missing data - blank lines are simply
 deleted and are NOT treated as missing values.

\begin{tabular}{lllllllll}
\hline
Summary of computational transaction \tabularnewline
Raw Input & view raw input (R code)  \tabularnewline
Raw Output & view raw output of R engine  \tabularnewline
Computing time & 0 seconds \tabularnewline
R Server & 'Gertrude Mary Cox' @ cox.wessa.net \tabularnewline
R Framework error message & 
Warning: there are blank lines in the 'Data X' field.
Please, use NA for missing data - blank lines are simply
 deleted and are NOT treated as missing values.
\tabularnewline \hline \end{tabular} %Source: https://freestatistics.org/blog/index.php?pk=291979&T=0

[TABLE]
[ROW][C]Summary of computational 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]0 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]'Gertrude Mary Cox' @ cox.wessa.net[/C][/ROW]
[ROW][C]R Framework error message[/C][C]
Warning: there are blank lines in the 'Data X' field.
Please, use NA for missing data - blank lines are simply
 deleted and are NOT treated as missing values.
[/C][/ROW] [/TABLE] Source: https://freestatistics.org/blog/index.php?pk=291979&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=291979&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 Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time0 seconds
R Server'Gertrude Mary Cox' @ cox.wessa.net
R Framework error message
Warning: there are blank lines in the 'Data X' field.
Please, use NA for missing data - blank lines are simply
 deleted and are NOT treated as missing values.



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):
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()