On Wed, 21 Feb 2007, Ranjan Maitra wrote: > I was wondering if it is possible to get the p-values for one-sided > tests on the parameters of a linear regression. > > For instance, I use lm() and store the result in an object. lm() gives > me a matrix, using summary() and coef() on which gives me a matrix > containing the coefficients, the standard errors, the t-statistics and > the two-sided p-values by default. Can I get it to provide me with > one-sided p-values (something like alternative less than or greater > than)?
Not 'it', but you can easily do the calculation yourself from the output. E.g. example(lm) s <- summary(lm.D90) pt(coef(s)[, 2], s$df[2], lower=FALSE) # or TRUE -- Brian D. Ripley, [EMAIL PROTECTED] 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 ______________________________________________ [email protected] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.
