1×1000 adjoint(::Vector{Float64}) with eltype Float64:
-1.04197 -1.37758 -3.74249 -1.89776 … -3.3449 -0.295085 -1.06768
A lightweight package with nice extensions
2024-07-12
\[ \begin{cases} \frac{x^{\lambda} - 1}{\lambda} &\quad \lambda \neq 0 \\ \log x &\quad \lambda = 0 \end{cases} \]
The denominator serves to normalize the transformation and preserve the original direction of the effect (the sign is flipped when \(\lambda < 0\)). In application, we may only care about the numerator (e.g. when it suggests using “speed” instead of “time”.)
Makie extension
If an appropriate Makie backend is loaded, then you can also do diagnostic plots.
Row | variable | mean | min | median | max | nmissing | eltype |
---|---|---|---|---|---|---|---|
Symbol | Float64 | Real | Float64 | Real | Int64 | DataType | |
1 | Girth | 13.2484 | 8.3 | 12.9 | 20.6 | 0 | Float64 |
2 | Height | 76.0 | 63 | 76.0 | 87 | 0 | Int64 |
3 | Volume | 30.171 | 10.2 | 24.2 | 77.0 | 0 | Float64 |
Diagnostics matter!
\(\lambda=0\) is well within the 95% CI and log fits in well with the rest of the model.
Box-Cox transformation
estimated λ: -0.0673
resultant transformation:
y^-0.1 - 1
------------
-0.1
StatsModels extension
If StatsModels.jl is loaded (even indirectly via e.g. GLM.jl), then you can also use the @formula
macro to specify the regression model.
Diagnostics matter!
\(\text{time}^{-1}\) has a natural interpretation as speed and -1 is nearly as good as the “optimal” transformation. We thus use our domain expertise and use speed (as responses per second) instead of the fitted result.
Note
We use 1000 in the numerator to scale things back to seconds from milliseconds.
Est. | SE | z | p | σ_subj | |
(Intercept) | 3.9658 | 0.1056 | 37.55 | <1e-99 | 0.4190 |
days | -0.1110 | 0.0151 | -7.37 | <1e-12 | 0.0566 |
Residual | 0.2698 |
Julia Version 1.10.4
Commit 48d4fd48430 (2024-06-04 10:41 UTC)
Build Info:
Official https://julialang.org/ release
Platform Info:
OS: Linux (x86_64-linux-gnu)
CPU: 8 × 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-15.0.7 (ORCJIT, tigerlake)
Threads: 8 default, 0 interactive, 4 GC (on 8 virtual cores)
Environment:
JULIA_LOAD_PATH = @:@stdlib
This page was rendered from git revision 8c549ca .
Phillip Alday | JuliaCon 2024 | https://palday.github.io/juliacon2024