Hi! I'm doing Monte Carlo analyses of the distribution of the t-statistics of the parameters of models evaluated with the lm( ) function. Is there an easy way to recover the t-statistics (similarly to using coef to recover the coefficients)? Thanks, joseph --------------------------------- [[alternative HTML version deleted]]
Joseph J. Gazaille wrote:> Hi! > > I'm doing Monte Carlo analyses of the distribution > of the t-statistics of the parameters of models evaluated > with the lm( ) function. > > Is there an easy way to recover the t-statistics > (similarly to using coef to recover the coefficients)? > > Thanks, > > josephTry tstat <- summary(fit)$coef[, "t value"] or tstat <- coef(fit)/sqrt(diag(vcov(fit))) -sundar
On Fri, 27 Feb 2004, Joseph J. Gazaille wrote:> Hi! > > I'm doing Monte Carlo analyses of the distribution > of the t-statistics of the parameters of models evaluated > with the lm( ) function. > > Is there an easy way to recover the t-statistics > (similarly to using coef to recover the coefficients)?Try coef(summary(myfit)) and see what you get ... ?summary.lm may help you. -- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
Joseph J. Gazaille wrote:> Hi! > > I'm doing Monte Carlo analyses of the distribution > of the t-statistics of the parameters of models evaluated > with the lm( ) function. > > Is there an easy way to recover the t-statistics > (similarly to using coef to recover the coefficients)? > > Thanks, > > josephJoseph One option is out <- lm(y~x) summary(out)$coef # Estimate Std. Error t value Pr(>|t|) # (Intercept) ? ? ? ? # x ? ? ? ? # now you want the 3rd column summary(out)$coef[,3] Richard -- Richard E. Remington III Statistician KERN Statistical Services, Inc. PO Box 1046 Boise, ID 83701 Tel: 208.426.0113 KernStat.com