0

I'm using the latest version of the MDMR package in R to analyze whether there is a significant relationship between a set of independent and dependent variables. However, when I execute something like the following:

library(MDMR)
results<-mdmr(X=predictor_variable,D=distance_matrix)

I get 0.00199799899899874826986 as the output p-value. However, when I try display it later with summary(results), it displays <0.002, and if I try to assign the value to a variable, 0 is assigned instead. I presume this is a floating point error in a calculation within R, but am clueless regarding how to fix it.

AldehydeDeva
  • 158
  • 3
  • 10
  • Floating point arithmetic is not exact in R (or really any other programming language). – Tim Biegeleisen Jul 04 '19 at 01:40
  • 1
    @TimBiegeleisen: The symptoms stated in the problem do not make a *prime facie* case for floating-point errors. The first complaint, that one output is “0.0019979…” but `summary(results)` shows “<0.002”, appears to be a display issue and not a complaint that a different numerical value was expected. The second complaint, the assigning to a variable produces zero, is not an error caused by floating-point imprecision (.002 does not get changed to 0 by floating-point rounding) but could be some conversion to an integer type (common in C with assignment, but I do not know how this arises in R). – Eric Postpischil Jul 04 '19 at 09:58

0 Answers0