# What is the difference between a log of a price and a log of two prices?

So I understand that to calculate the continuously compounded return between 2 prices, all you have to do is log the fraction of the 2 prices. For example:

log(price1/price2)


What I don't get is how come if you take a log of just one price, it gives you a return or percent change as well? I don't know how the interpret the 2.

I am confused because let's say I am working with the CAPM model, which is:

(Excess Stock Return) = Beta0 + Beta1 * (Excess Market Return)


and am given a series of 100 stock prices and want to regress it against the market returns so I can get the Betas. To get the stock returns, I would take the log(price1/price2) and end up with 99 observations. Cool everything makes sense so far.

Now let's say I had two vectors of data, which are price and sales of a product. If I want the elasticity of sales with respect to price, that is, if I want to calculate how much a 1% change in price would affect a ?% change in sales, I would do the log-log regression, i.e. take the log of both price and sales and do a regression. My Beta1 would be the elasticity.

Let's say I have 100 observations of price and 100 observations of sales and I take the log of vectors. I still end up with 100 observations of each.

I don't get how log(price1) and log(price1/price2) both give me a return or % change? What's the difference between these 2? I get that that log(price1/price2) tells me the continuously compounded return going from price 2 to price 1. So log(3/2) = .405 means that the continuously compounded return is 40.5%. So what does log(price1) tell me aka just log(3)?

Let's suppose you have two prices $\$P_1$and$\$P_2$ and two quantities $Q_1$ and $Q_2$
In you first example, you are looking at $\log\left(\frac{P_2}{P_1}\right)$ which can also be written as $\log\left({P_2}\right)-\log\left({P_1}\right)$ - note I have reversed your order to make $P_2$ the later price
This is not quite the percentage change, but if $P_1$ and $P_2$ are close then this calculation will be close to the percentage change and may be useful in other calculations. For example if $\$P_1=\$297$ and $\$P_2 = \$303$, it gives about $0.02$ which is between the percentage differences calculated as $\frac{303-297}{297}\approx 2.02\%$ and $\frac{303-297}{303}\approx 1.98\%$
Now take your second example. You may see price changing from $\$P_1=\$297$ to $\$P_2 = \$303$ causing a change in demand from $Q_1=21$ to $Q_2=19$ items. The formula for elasticity is something like $e_p=\dfrac{dQ/dP}{Q/P}$ which can be approximated by $\dfrac{\log(Q_2/Q_1)}{\log(P_2/P_1)}$ i.e. $\dfrac{\log(Q_2)-\log(Q_1)}{\log(P_2)- \log(P_1)} \approx -5$ in this example, not far away from saying a $2\%$ price increase causes a roughly $10\%$ demand reduction.
Multiply this out and you get $\log(Q_2)-\log(Q_1) = e_p\log(P_2)- e_p\log(P_1)$. If price elasticity is constant, this leads to the conclusion that $\log(Q) = e_p\log(P)+k$ where the constant $k$ rather notionally corresponds to the logarithm of the quantity demanded when the price is $1$. With many observations, you can then estimate $e_p$ and $k$ by linear regression, but this gives no special meaning to $\log(P)$ except to the extent that it is the logarithm of the multiple of $\$1$that$\$P$ represents.
If prices were stated in cents rather than dollars then presumably $P$ would be $100$ times as big and $\log(P)$ would have about $4.605$ added to it, but this would not change $\log\left({P_2}\right)-\log\left({P_1}\right)$ or $\log\left(\frac{P_2}{P_1}\right)$ or your regression estimates of $e_p$