[R] R-square n p-value

Dirk Eddelbuettel edd at debian.org
Sun Sep 4 01:19:23 CEST 2005


On 3 September 2005 at 17:59, Justin Rhodes wrote:
| Dear R-help,
| 
| Can someone please help me discover what function or code will give 
| me a p-value from the input: 1) R-square statistic from a simple 
| linear regression, and 2) sample size, n
| 
| This would be greatly appreciated.  I need this because I am using a 
| database that gives me R-square and sample size for multiple 
| comparisons, and I wish to determine the false discovery rate using 
| q-value.  Thanks again,

Do
	> example(lm)			# just to get an lm object
	> str(summary(lm.D9))		# to examine summary of an object

and you'll see that the object returned from summary has the two common R^2
measures, as well as things like residuals from which can compute n quite
easily -- which you could obviously also from your regressors and regressand.

	> length(summary(lm.D9)$residuals)

Hth, Dirk

-- 
Statistics: The (futile) attempt to offer certainty about uncertainty.
         -- Roger Koenker, 'Dictionary of Received Ideas of Statistics'




More information about the R-help mailing list