The mean of natural log of some data I have the following data in natural log:
N = [0.929, -1.745, 1.677, 0.701, 0.128]

O = [2.233, -2.513, 1.204, 1.938, 2.533]

I want to calculate the mean ratio of these two data sets. Since they are in natural log, I took the difference of the data sets, which is equal to
[1.304, -0.768, -0.473, 1.237, 2.405] 

Then I computed the mean, and it was equal to 0.741, however, the correct mean is 1.29.
How is the correct answer is 1.29?
 A: If you have datapoints $x_1, \ldots, x_n$ and $y_1, \ldots, y_n$ and you want to find the mean ratio $\frac{1}{n} \sum_{i=1}^n \frac{x_i}{y_i}$, this is not equal to the exponentiated mean of the log ratios. In other words, this is not the same as computing $\exp\left(\frac{1}{n}\sum_{i=1}^n \log \frac{x_i}{y_i}\right)$, which is what it sounds like you are finding. Your quantity instead equals
$$\exp\left(\frac{1}{n}\sum_{i=1}^n \log \frac{x_i}{y_i}\right) = \exp\left(\frac{1}{n} \log \left(\prod_{i=1}^n \frac{x_i}{y_i}\right)\right) = \left(\prod_{i=1}^n \frac{x_i}{y_i}\right)^{\frac{1}{n}}$$
which is the geometric mean of the ratios.
A: You calculated the mean of logarithms of ratios, not the mean of ratios themselves.
To obtain ratios from their logarithms, you have to raise $e$ to power of them.
In Python and NumPy:
import numpy as np

logs = [1.304, -0.768, -0.473, 1.237, 2.405]     # Logarithms of ratios
ratios = np.exp(logs)                            # You omitted this!

np.mean(ratios)

A: I have known what exactly I have done wrongly.
The exact solution in R is as follows:
dif=(New-Old)
m=mean(dif)
st=sd(dif)
CI=m+c(-1,1)*qt(0.975,4)*st *sqrt(1/5)
ExpCI=exp(CI)                  # equals [0.09 2.49]
MEAN=mean(ExpCI)               # equals 1.29
