Introduction

Let's simulate some data

x <- rnorm(100)
y <- x + rnorm(100, sd = 0.5)

Here is a scatter plot of the above data

par(mar = c(5, 4, 1, 1), las = 1)
plot(x, y, main = "My Simulated Data")

plot of chunk scatterplot

Making Tables with xtable

library(datasets)
data(airquality)
fit <- lm(Ozone ~ Wind + Temp + Solar.R, data = airquality)

Here is table of regression coefficients

library(xtable)
xt <- xtable(summary(fit))
print(xt, type = "html")
Estimate Std. Error t value Pr(> |t|)
(Intercept) -64.3421 23.0547 -2.79 0.0062
Wind -3.3336 0.6544 -5.09 0.0000
Temp 1.6521 0.2535 6.52 0.0000
Solar.R 0.0598 0.0232 2.58 0.0112