Send output to:
Browser Blue - Charts White
Browser Black/White
CSV
Data X:
15 15 14 10 10 12 18 12 14 18 9 11 11 17 8 16 21 24 21 14 7 18 18 13 11 13 13 18 14 12 9 12 8 5 10 11 11 12 12 15 12 16 14 17 13 10 17 12 13 13 11 13 12 12 12 9 7 17 12 12 9 9 13 10 11 12 10 13 6 7 13 11 18 9 9 11 11 15 8 11 14 14 12 12 8 11 10 17 16 13 15 11 12 16 20 16 11 15 15 12 9 24 15 18 17 12 15 11 11 15 12 14 11 20 11 12 17 12 11 10 11 12 9 8 6 12 15 13 17 14 16 15 16 11 11 16 15 14 9 13 11 14 11 12 8 7 11 13 9 12 10 12
Data Y:
69 53 43 60 49 62 45 50 75 82 60 59 21 62 54 47 59 37 43 48 79 62 16 38 58 60 67 55 47 59 49 47 57 39 49 26 53 75 65 49 48 45 31 61 49 69 54 80 57 34 69 44 70 51 66 18 74 59 48 55 44 56 65 77 46 70 39 55 44 45 45 49 65 45 71 48 41 40 64 56 52 41 42 54 40 40 51 48 80 38 57 28 51 46 58 67 72 26 54 53 64 47 43 66 54 62 52 64 55 57 74 32 38 66 37 26 64 28 66 65 48 44 64 39 50 66 48 70 66 61 31 61 54 34 62 47 52 37 46 38 63 34 46 40 30 35 51 56 68 39 44 58
Sample Range:
(leave blank to include all observations)
From:
To:
bandwidth of density plot
(?)
Chart options
Label y-axis:
Label x-axis:
R Code
par1 <- as.numeric(par1) library(lattice) z <- as.data.frame(cbind(x,y)) m <- lm(y~x) summary(m) bitmap(file='test1.png') plot(z,main='Scatterplot, lowess, and regression line') lines(lowess(z),col='red') abline(m) grid() dev.off() bitmap(file='test2.png') m2 <- lm(m$fitted.values ~ x) summary(m2) z2 <- as.data.frame(cbind(x,m$fitted.values)) names(z2) <- list('x','Fitted') plot(z2,main='Scatterplot, lowess, and regression line') lines(lowess(z2),col='red') abline(m2) grid() dev.off() bitmap(file='test3.png') m3 <- lm(m$residuals ~ x) summary(m3) z3 <- as.data.frame(cbind(x,m$residuals)) names(z3) <- list('x','Residuals') plot(z3,main='Scatterplot, lowess, and regression line') lines(lowess(z3),col='red') abline(m3) grid() dev.off() bitmap(file='test4.png') m4 <- lm(m$fitted.values ~ m$residuals) summary(m4) z4 <- as.data.frame(cbind(m$residuals,m$fitted.values)) names(z4) <- list('Residuals','Fitted') plot(z4,main='Scatterplot, lowess, and regression line') lines(lowess(z4),col='red') abline(m4) grid() dev.off() bitmap(file='test5.png') myr <- as.ts(m$residuals) z5 <- as.data.frame(cbind(lag(myr,1),myr)) names(z5) <- list('Lagged Residuals','Residuals') plot(z5,main='Lag plot') m5 <- lm(z5) summary(m5) abline(m5) grid() dev.off() bitmap(file='test6.png') hist(m$residuals,main='Residual Histogram',xlab='Residuals') dev.off() bitmap(file='test7.png') if (par1 > 0) { densityplot(~m$residuals,col='black',main=paste('Density Plot bw = ',par1),bw=par1) } else { densityplot(~m$residuals,col='black',main='Density Plot') } dev.off() bitmap(file='test8.png') acf(m$residuals,main='Residual Autocorrelation Function') dev.off() bitmap(file='test9.png') qqnorm(x) qqline(x) grid() dev.off() load(file='createtable') a<-table.start() a<-table.row.start(a) a<-table.element(a,'Simple Linear Regression',5,TRUE) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a,'Statistics',1,TRUE) a<-table.element(a,'Estimate',1,TRUE) a<-table.element(a,'S.D.',1,TRUE) a<-table.element(a,'T-STAT (H0: coeff=0)',1,TRUE) a<-table.element(a,'P-value (two-sided)',1,TRUE) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a,'constant term',header=TRUE) a<-table.element(a,m$coefficients[[1]]) sd <- sqrt(vcov(m)[1,1]) a<-table.element(a,sd) tstat <- m$coefficients[[1]]/sd a<-table.element(a,tstat) pval <- 2*(1-pt(abs(tstat),length(x)-2)) a<-table.element(a,pval) a<-table.row.end(a) a<-table.row.start(a) a<-table.element(a,'slope',header=TRUE) a<-table.element(a,m$coefficients[[2]]) sd <- sqrt(vcov(m)[2,2]) a<-table.element(a,sd) tstat <- m$coefficients[[2]]/sd a<-table.element(a,tstat) pval <- 2*(1-pt(abs(tstat),length(x)-2)) a<-table.element(a,pval) a<-table.row.end(a) a<-table.end(a) table.save(a,file='mytable.tab')
Compute
Summary of computational transaction
Raw Input
view raw input (R code)
Raw Output
view raw output of R engine
Computing time
0 seconds
R Server
Big Analytics Cloud Computing Center
Click here to blog (archive) this computation