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 computationFri, 11 Dec 2015 09:07:43 +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/2015/Dec/11/t1449824878r7ge08a64c2lvwp.htm/, Retrieved Thu, 16 May 2024 07:32:21 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=285862, Retrieved Thu, 16 May 2024 07:32:21 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact118
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [Simple Linear Regression] [Error SR] [2015-12-11 09:07:43] [b6628d6ea1d7803ffc2dc825d38ead4a] [Current]
Feedback Forum

Post a new message
Dataseries X:
439 0.453
488 0.708
517 0.709
569 0.832
353 0.504
416 0.778
587 0.799
464 0.72
596 0.926
576 0.877
505 0.743
445 0.788
433 0.812
487 0.539
511 0.779
583 0.779
581 0.877
468 0.714
417 0.467
NA 0.467
484 0.569
500 0.569
497 0.726
427 0.672
554 0.739
439 0.844
591 0.773
421 0.367
419 0.381
461 0.571
435 0.493
568 0.896
NA 0.622
NA 0.355
NA 0.349
575 0.808
596 0.701
505 0.706
NA 0.479
402 0.565
529 0.75
504 0.806
457 0.824
527 0.848
562 0.858
558 0.898
NA 0.452
433 0.717
438 0.691
NA 0.691
470 0.701
468 0.678
524 0.652
NA 0.559
445 0.373
567 0.83
436 0.409
524 0.721
510 0.877
556 0.879
417 0.662
412 0.44
525 0.733
568 0.904
450 0.556
521 0.856
402 0.746
508 0.613
395 0.38
NA 0.401
429 0.626
417 0.462
458 0.612
568 0.817
549 0.886
578 0.57
517 0.671
518 0.671
393 0.638
561 0.899
483 0.881
555 0.869
439 0.869
444 0.712
545 0.884
447 0.744
481 0.747
434 0.522
NA 0.599
NA 0.882
576 0.882
388 0.807
539 0.614
372 0.614
557 0.809
466 0.759
NA 0.472
332 0.393
337 0.799
NA 0.882
562 0.829
561 0.881
498 0.881
489 0.494
469 0.406
536 0.766
507 0.688
386 0.398
498 0.821
NA 0.821
463 0.475
550 0.753
502 0.748
NA 0.748
531 0.627
515 0.652
476 0.671
NA 0.784
507 0.603
399 0.38
477 0.514
371 0.61
NA 0.61
462 0.527
524 0.904
604 0.903
477 0.604
390 0.323
456 0.492
529 0.939
421 0.78
503 0.526
NA 0.768
415 0.671
456 0.759
NA 0.479
459 0.669
543 0.722
534 0.651
541 0.826
538 0.816
439 0.847
476 0.847
578 0.779
553 0.779
351 0.453
420 0.747
409 0.717
NA 0.688
NA 0.688
355 0.815
462 0.483
NA 0.743
529 0.743
NA 0.763
395 0.353
595 0.894
547 0.826
552 0.873
483 0.489
473 0.638
NA 0.638
579 0.864
518 0.736
438 0.736
395 0.463
412 0.698
460 0.527
532 0.895
560 0.915
457 0.662
534 0.662
416 0.596
403 0.596
498 0.715
429 0.46
NA 0.701
478 0.764
509 0.715
547 0.738
485 0.687
411 0.472
535 0.726
387 0.824
585 0.895
533 0.908
567 0.779
523 0.648
NA 0.617
500 0.617
519 0.629
381 0.484
417 0.53
495 0.459




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time0 seconds
R Server'George Udny Yule' @ yule.wessa.net
R Engine error message
Error in names(xdf) <- c("Y", "X") : 
  'names' attribute [2] must be the same length as the vector [0]
Execution halted

\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 & 'George Udny Yule' @ yule.wessa.net \tabularnewline
R Engine error message & 
Error in names(xdf) <- c("Y", "X") : 
  'names' attribute [2] must be the same length as the vector [0]
Execution halted
\tabularnewline \hline \end{tabular} %Source: https://freestatistics.org/blog/index.php?pk=285862&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]'George Udny Yule' @ yule.wessa.net[/C][/ROW]
[ROW][C]R Engine error message[/C][C]
Error in names(xdf) <- c("Y", "X") : 
  'names' attribute [2] must be the same length as the vector [0]
Execution halted
[/C][/ROW] [/TABLE] Source: https://freestatistics.org/blog/index.php?pk=285862&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=285862&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'George Udny Yule' @ yule.wessa.net
R Engine error message
Error in names(xdf) <- c("Y", "X") : 
  'names' attribute [2] must be the same length as the vector [0]
Execution halted



Parameters (Session):
par3 = TRUE ;
Parameters (R input):
par1 = ; par2 = ; 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()