OT: log(0) - NaN, NA, ‘.’, –∞, or empty [General Sta­tis­tics]

posted by Helmut Homepage – Vienna, Austria, 2014-03-12 16:31 (4063 d 14:58 ago) – Posting: # 12607
Views: 10,318

Dear Detlew,

Phoenix:
x = 0
Data Transformation > Functions > LN(x)
Result: empty

No warnings whatsoever. :cool:

R:

>log(0)

[1] -Inf


Cough, if one doesn’t know the answer, improvise! I have some sympathies for R’s approach, since $$\small{\lim_{x \to 0}\log_{e}x=-\infty}$$;-)
R is strong in presenting the limit of a function even if it is undefined for the value in a strict sense:

x <- c(0, 1, 2)
y <- 1 / x
y
# [1] Inf 1.0 0.5
z <- 1 / y
z
# [1] 0 1 2
res <- data.frame(x = x, y = y, z = z)
names(re)[2:3] <-c("y=1/x", "z=1/y")
print(res, row.names = FALSE)
 x   y z
 0 Inf 0
 1 1.0 1
 2 0.5 2

isTRUE(all.equal(res$x, res$z))
# [1] TRUE


Reach for the stars,
even if you have to stand on a cactus.
Susan Longacre


Whether this does make sense in the real world, is another story.

x <- c(rep(10, 23), 0)
y <- mean(log(x))
geo_mean <- exp(y)
geo_mean
# [1] 0

Dif-tor heh smusma 🖖🏼 Довге життя Україна! [image]
Helmut Schütz
[image]

The quality of responses received is directly proportional to the quality of the question asked. 🚮
Science Quotes

Complete thread:

UA Flag
Activity
 Admin contact
23,424 posts in 4,927 threads, 1,667 registered users;
27 visitors (0 registered, 27 guests [including 8 identified bots]).
Forum time: 08:30 CEST (Europe/Vienna)

It is true that many scientists are not philosophically minded
and have hitherto shown much skill and ingenuity
but little wisdom.    Max Born

The Bioequivalence and Bioavailability Forum is hosted by
BEBAC Ing. Helmut Schütz
HTML5