[R] lsfit result - how to compute t-values for coefficients

From: Christoph Lehmann <christoph.lehmann_at_gmx.ch>
Date: Fri 22 Apr 2005 - 23:40:52 EST

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))

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])

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

R-help@stat.math.ethz.ch mailing list

https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Fri Apr 22 22:55:28 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:31:22 EST