[R] decimal value for p-value

Uwe Ligges ligges at statistik.tu-dortmund.de
Wed Jan 6 10:44:50 CET 2010



On 06.01.2010 09:16, Roslina Zakaria wrote:
> Dear r-users,
>
> I conducted a chi-square test using chi.test code and found that my p-value = 1.  My question is, is it possible to get the decimals form of the p-value?  Maybe the p-value is actually 0.9999 before rounding the value.
>
> thank you so much for any help given.


Access the p value returned from chisq.test (see?chisq.test) directly as in:

testresult <- chisq.test(.....)
testresult[["p.value"]]

or even more digits:

print(chisq.test(InsectSprays$count > 7, 
InsectSprays$spray)[["p.value"]], digits=20)

Best,
Uwe Ligges

>
>
>
>
>
> 	[[alternative HTML version deleted]]
>
>
>
>
> ______________________________________________
> R-help at r-project.org 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.



More information about the R-help mailing list