x <- array(list(1418
,210907
,869
,120982
,1530
,176508
,2172
,179321
,901
,123185
,463
,52746
,3201
,385534
,371
,33170
,1192
,101645
,1583
,149061
,1439
,165446
,1764
,237213
,1495
,173326
,1373
,133131
,2187
,258873
,1491
,180083
,4041
,324799
,1706
,230964
,2152
,236785
,1036
,135473
,1882
,202925
,1929
,215147
,2242
,344297
,1220
,153935
,1289
,132943
,2515
,174724
,2147
,174415
,2352
,225548
,1638
,223632
,1222
,124817
,1812
,221698
,1677
,210767
,1579
,170266
,1731
,260561
,807
,84853
,2452
,294424
,829
,101011
,1940
,215641
,2662
,325107
,186
,7176
,1499
,167542
,865
,106408
,1793
,96560
,2527
,265769
,2747
,269651
,1324
,149112
,2702
,175824
,1383
,152871
,1179
,111665
,2099
,116408
,4308
,362301
,918
,78800
,1831
,183167
,3373
,277965
,1713
,150629
,1438
,168809
,496
,24188
,2253
,329267
,744
,65029
,1161
,101097
,2352
,218946
,2144
,244052
,4691
,341570
,1112
,103597
,2694
,233328
,1973
,256462
,1769
,206161
,3148
,311473
,2474
,235800
,2084
,177939
,1954
,207176
,1226
,196553
,1389
,174184
,1496
,143246
,2269
,187559
,1833
,187681
,1268
,119016
,1943
,182192
,893
,73566
,1762
,194979
,1403
,167488
,1425
,143756
,1857
,275541
,1840
,243199
,1502
,182999
,1441
,135649
,1420
,152299
,1416
,120221
,2970
,346485
,1317
,145790
,1644
,193339
,870
,80953
,1654
,122774
,1054
,130585
,937
,112611
,3004
,286468
,2008
,241066
,2547
,148446
,1885
,204713
,1626
,182079
,1468
,140344
,2445
,220516
,1964
,243060
,1381
,162765
,1369
,182613
,1659
,232138
,2888
,265318
,1290
,85574
,2845
,310839
,1982
,225060
,1904
,232317
,1391
,144966
,602
,43287
,1743
,155754
,1559
,164709
,2014
,201940
,2143
,235454
,2146
,220801
,874
,99466
,1590
,92661
,1590
,133328
,1210
,61361
,2072
,125930
,1281
,100750
,1401
,224549
,834
,82316
,1105
,102010
,1272
,101523
,1944
,243511
,391
,22938
,761
,41566
,1605
,152474
,530
,61857
,1988
,99923
,1386
,132487
,2395
,317394
,387
,21054
,1742
,209641
,620
,22648
,449
,31414
,800
,46698
,1684
,131698
,1050
,91735
,2699
,244749
,1606
,184510
,1502
,79863
,1204
,128423
,1138
,97839
,568
,38214
,1459
,151101
,2158
,272458
,1111
,172494
,1421
,108043
,2833
,328107
,1955
,250579
,2922
,351067
,1002
,158015
,1060
,98866
,956
,85439
,2186
,229242
,3604
,351619
,1035
,84207
,1417
,120445
,3261
,324598
,1587
,131069
,1424
,204271
,1701
,165543
,1249
,141722
,946
,116048
,1926
,250047
,3352
,299775
,1641
,195838
,2035
,173260
,2312
,254488
,1369
,104389
,1577
,136084
,2201
,199476
,961
,92499
,1900
,224330
,1254
,135781
,1335
,74408
,1597
,81240
,207
,14688
,1645
,181633
,2429
,271856
,151
,7199
,474
,46660
,141
,17547
,1639
,133368
,872
,95227
,1318
,152601
,1018
,98146
,1383
,79619
,1314
,59194
,1335
,139942
,1403
,118612
,910
,72880
,616
,65475
,1407
,99643
,771
,71965
,766
,77272
,473
,49289
,1376
,135131
,1232
,108446
,1521
,89746
,572
,44296
,1059
,77648
,1544
,181528
,1230
,134019
,1206
,124064
,1205
,92630
,1255
,121848
,613
,52915
,721
,81872
,1109
,58981
,740
,53515
,1126
,60812
,728
,56375
,689
,65490
,592
,80949
,995
,76302
,1613
,104011
,2048
,98104
,705
,67989
,301
,30989
,1803
,135458
,799
,73504
,861
,63123
,1186
,61254
,1451
,74914
,628
,31774
,1161
,81437
,1463
,87186
,742
,50090
,979
,65745
,675
,56653
,1241
,158399
,676
,46455
,1049
,73624
,620
,38395
,1081
,91899
,1688
,139526
,736
,52164
,617
,51567
,812
,70551
,1051
,84856
,1656
,102538
,705
,86678
,945
,85709
,554
,34662
,1597
,150580
,982
,99611
,222
,19349
,1212
,99373
,1143
,86230
,435
,30837
,532
,31706
,882
,89806
,608
,62088
,459
,40151
,578
,27634
,826
,76990
,509
,37460
,717
,54157
,637
,49862
,857
,84337
,830
,64175
,652
,59382
,707
,119308
,954
,76702
,1461
,103425
,672
,70344
,778
,43410
,1141
,104838
,680
,62215
,1090
,69304
,616
,53117
,285
,19764
,1145
,86680
,733
,84105
,888
,77945
,849
,89113
,1182
,91005
,528
,40248
,642
,64187
,947
,50857
,819
,56613
,757
,62792
,894
,72535)
,dim=c(2
,289)
,dimnames=list(c('pageviews'
,'time')
,1:289))
 y <- array(NA,dim=c(2,289),dimnames=list(c('pageviews','time'),1:289))
 for (i in 1:dim(x)[1])
 {
 	for (j in 1:dim(x)[2])
 	{
 		y[i,j] <- as.numeric(x[i,j])
 	}
 }
par3 = 'TRUE'
par2 = '2'
par1 = '1'
ylab = 'Y Variable Name'
xlab = 'X Variable Name'
main = 'Title Goes Here'
par3 <- 'TRUE'
par2 <- '2'
par1 <- '1'
#'GNU S' R Code compiled by R2WASP v. 1.2.291 ()
#Author: aston2
#To cite this work: Ian E. Holliday, 2012, Simple Linear Regression (v1.0.5) in Free Statistics Software (v$_version), Office for Research Development and Education, URL http://www.wessa.net/Ian.Holliday/rwasp_Simple%20Regression%20Y%20~%20X.wasp/
#Source of accompanying publication: 
#
cat1 <- as.numeric(par1)
cat2<- as.numeric(par2)
intercept<-as.logical(par3)
x <- t(x)
xdf<-data.frame(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) )
sumlmxdf<-summary(lmxdf)
(aov.xdf<-aov(lmxdf) )
(anova.xdf<-anova(lmxdf) )

#Note: the /var/fisher/rcomp/createtable file can be downloaded at http://www.wessa.net/cretab
load(file="/var/fisher/rcomp/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, '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="/var/fisher/rcomp/tmp/1a9ga1355333487.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="/var/fisher/rcomp/tmp/21srd1355333487.tab") 
postscript(file="/var/fisher/rcomp/tmp/3xkh01355333487.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) 
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)
postscript(file="/var/fisher/rcomp/tmp/470x91355333487.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) 
qq.plot(resid(lmxdf), main='QQplot of Residuals of Fit')
dev.off()
postscript(file="/var/fisher/rcomp/tmp/5wig41355333487.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) 
plot(xdf$X, resid(lmxdf), main='Scatterplot of Residuals of Model Fit')
dev.off()
postscript(file="/var/fisher/rcomp/tmp/64jpw1355333487.ps",horizontal=F,onefile=F,pagecentre=F,paper="special",width=8.3333333333333,height=5.5555555555556) 
plot.lm(lmxdf, which=4)
dev.off()

try(system("convert tmp/3xkh01355333487.ps tmp/3xkh01355333487.png",intern=TRUE))
try(system("convert tmp/470x91355333487.ps tmp/470x91355333487.png",intern=TRUE))
try(system("convert tmp/5wig41355333487.ps tmp/5wig41355333487.png",intern=TRUE))
try(system("convert tmp/64jpw1355333487.ps tmp/64jpw1355333487.png",intern=TRUE))

