Support for log-transforms (and other arithmetic) in formula?
See original GitHub issueHi all,
I’m a big fan of bambi, thanks for all your great work!
I have a question about more complicated formulas. I’m currently trying to fit models taken from a textbook. One of the formula strings used there is:
log(weight) ~ log(I(diam1 * diam2 * canopy_height)) + log(I(diam1 * diam2)) + log(I(diam1 / diam2)) + log(total_height) + group
In other words, it includes log transformations, and also some other arithmetic operations. What I’m curious about is whether bambi supports this in some way, or whether all such transformations should be done beforehand, e.g. by creating a variable log_total_height = np.log(total_height)
?
Thanks for your help!
Issue Analytics
- State:
- Created 2 years ago
- Comments:5
Top Results From Across the Web
Calculation operators and precedence in Excel
There are four different types of calculation operators: arithmetic, comparison, text concatenation, and reference. Arithmetic operators.
Read more >When (and why) should you take the log of a distribution (of ...
Is it not always true that the second moment and the variance are proportional to one another? We have the classic equation saying:...
Read more >Log-transformation and its implications for data analysis - PMC
The log-transformation is widely used in biomedical and psychosocial research to deal with skewed data. This paper highlights serious problems in this ...
Read more >You should (usually) log transform your positive data
The log transformation is particularly relevant when the data vary a lot on the relative scale. Increasing prices by 2% has a much...
Read more >Calculate values using data in table cells in Numbers on Mac
Type an arithmetic operator (for example, +, -, *, or /), then select another cell to use in your formula, or type a...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
You can also perhaps save the annoyance of defining your own log by importing it explicitly instead with
from numpy import log
— very cool stuff!Terrific, thanks Tomas! This is working very well, so I am closing this issue!