[R] lsfit result - how to compute t-values for coefficients
Christoph Lehmann
christoph.lehmann at gmx.ch
Fri Apr 22 15:40:52 CEST 2005
Hi
I used lsfit instead of lm since I have a huge Y data-set (X being
constant for all Y).
Since I require the t-values for all coefficients: which would be the
fastest way to compute them, eg for the example:
## using lsfit with a matrix response:
t.length <- 5
d.dim <- c(t.length,7,8,9) # dimesions: time, x, y, z
Y <- array( rep(1:t.length, prod(d.dim)) + rnorm(prod(d.dim), 0, 0.1),
d.dim)
X <- cbind(c(1,3,2,4,5), c(1,1,1,5,5))
date()
rsq <-lsfit(X, array(c(Y), dim = c(t.length,
prod(d.dim[2:4]))))$coef[2,] #coef for first non-const pred
names(rsq) <- prod(d.dim[2:4])
rsq <- array(rsq, dim = d.dim[2:4])
date()
what would be the best way to get the t-value for all coef,
not only (as above illustrated for the beta value) for one predefined coef?
##-----
many thanks
christoph
More information about the R-help
mailing list