I am trying to get a latex table of a condition index table. The minimum working example is below. It prints, but it gives a huge number of digits (whether I write to the screen or to a file, and even if I set the options(digits = 3).
library(perturb)
library(Hmisc)
set.seed(1234)
x1 <- rnorm(1000)
x2 <- x1 + rnorm(1000,0,0.1)
x3 <- x1 + rnorm(1000,0,0.1)
x4 <- x1 + rnorm(1000,0,0.1)
x5 <- x1 + rnorm(1000,0,0.1)
y <- x1 + 2*x2 + 3*x3 + 4*x4 + 5*x5 + rnorm(1000,0, 10)
m1 <- lm(y~x1+x2+x3+x4+x5)
m1
options(digits = 3)
latex(colldiag(m1), file = "") #c:/writing/nonfiction/glm book/CondIndexEx")
colldiag(m1) by itself gives a table with three significant figures, which seems appropriate.
How can I get latex to do that?