1

When I run the below code several times, the p-value will display more than two digits only when above 0.01. When below 0.01, I cannot access the digits.

How can I get more digits ?

library(fUnitRoots)
x = rnorm(13)
y = rnorm(13)
m <- lm(y ~ x + 0)
adfTest(coredata(resid(m)), type="nc")@test$p.value

Running several times the above prints:

0.01290496626
0.01 (with warning: "p-value smaller than printed p-value")
0.01 (with warning: "p-value smaller than printed p-value")
0.08404833863
4
  • unclass your P-value.
    – Hong Ooi
    Jul 19, 2013 at 17:28
  • @HongOoi Doesn't work. Looks like the warning comes from the adfTest call, and this value in the warning is stored as a numeric (with no further warnings)
    – James
    Jul 19, 2013 at 17:39
  • @Metrics, He may need to correct for multiple testing first. Papers doing GWAS (genome wide association studies) routinely report p-values of less than 5e-08. Jul 19, 2013 at 18:03
  • For GWAS, you're scanning the genome for markers which are significantly associated with a disease. So maybe you have 1 million markers, and you're fitting a linear model for each one. With a p-value of 0.01, you will still get 1% false positives, so 10,000. Multiple testing correction deals with this by adjusting the p-value so you still only get your desired false positive rate. For example Bonferroni corrected p-value becomes alpha/n -> 0.05/1000000 = 5e-08. This is a common strategy in life sciences due to the large volumes of data and tests being run. Jul 19, 2013 at 18:11

1 Answer 1

3

I don't know much about the command you're running, but I looked through the adfTest function and it looks like the do approximation of the p-value based on the approx function and a table of critical values, which means that they can't report P-Values < 0.01.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.