Do you want to take the natural logarithm of a variable (log transformation) and create a new variable?
Practical example
| Dataset |
| StataData1.dta |
| Variable name | gpa |
| Variable label | Grade point average (Age 15, Year 1985) |
| Value labels | N/A |
gen gpa_log=ln(gpa) |
In Stata, it works exactly the same if you replace “ln” with “log”.
| Note The command is ln (lower-case L, not upper-case i). |
browse gpa gpa_log |
