In regression analysis what does taking the log of a variable do? I keep seeing this in class and I don't understand why we add the log in there from time to time. For example we have regression model 1: $$1:\hat Y=-14.37+.321X_1+.043X_2-.0051X_3+.0035X_4$$ and then it says that we reestimate the model using the log form of $X_3$ and $X_4$ to get model 2: $$2:\hat Y=-36.30+.327X_1+.069X_2-4.74\log(X_3)+7.24\log(X_4)$$ what does the $\log$ do? In terms of affecting the regression and in terms of affecting the variables.
 A: Taking logs will make certain forms of relationship that look curved look linear or more nearly linear. Think of introducing new variables, $X_5 = \log(X_3)$ and $X_6 = \log(X_4)$ and then your model is linear in $X_1, X_2, X_5$ and $X_6$.  
Sometimes these transformations are obvious from subject-matter considerations. Sometimes they're just chosen empirically.
A: This is an old question, but I often found myself looking for this specific interpretation in the past so I will add it here.
Another substantive example is in the field of econometrics, when regression analysis is used to calculate the elasticities (relative percentage change of one variable with respect to another). In this case, the log-log functional form, where both the dependent and independent variables are log-transformed, is very convenient because the coefficients obtained directly give the respective elasticities instead of having to take the partial derivatives. For the mathematical formulation, I refer to @Charlie's answer here Interpretation of log transformed predictor
A: There are two sorts of reasons for taking the log of a variable in a regression, one statistical, one substantive.
Statistically, OLS regression assumes that the errors, as estimated by the residuals, are normally distributed. When they are positively skewed (long right tail) taking logs can sometimes help. Sometimes logs are taken of the dependent variable, sometimes of one or more independent variables.
Substantively, sometimes the meaning of a change in a variable is more multiplicative than additive. For example, income. If you make \$20,000 a year, a \$5,000 raise is huge. If you make \$200,000 a year, it is small.  Taking logs reflects this: 
log(20,000) = 9.90
log(25,000) = 10.12
log(200,000) = 12.20
log(205,000) = 12.23

The gaps are then 0.22 and 0.03. 
In terms of interpretation, you are now saying that each change of 1 unit on the log scale has the same effect on the DV, rather than each change of 1 unit on the raw scale. 
