When we fit the statistical model into R, let's say
lm(y ~ x, data=dat)
We use the special formula syntax: "y ~ x"
Is there something that can be converted from such a formula to the corresponding equation? In this case, it can be written as:
y = B0 + B1*x
That would be very helpful! Firstly, because with more complex formulas, I do not trust my translation. Secondly, in scientific articles written using R / Sweave / knitr, sometimes the model must be presented in the form of an equation and for fully reproducible studies, we would like to do this in an automatic way.
source share