equatiomatic: Regression Model with hat on dependent variable and no epsilon

93 views Asked by At

The following code provides the Regression Model Equation to be used in knitr.

library(equatiomatic)
fm1 <- lm(bill_length_mm ~ bill_depth_mm, penguins)
extract_eq(model = fm1, ital_vars = TRUE, use_coefs = TRUE)

$$
bill\_length\_mm = 55.07 - 0.65(bill\_depth\_mm) + \epsilon
$$

However, I want to get the Regression Model Equation with hat sign on dependent variance and without epsilon sign in the end. Any thoughts.

1

There are 1 answers

0
MYaseen208 On BEST ANSWER

In the latest version of equatiomatic (0.2.0.9000), the function extract_eq along with use_coefs = TRUE argument gives the desired output.

library(equatiomatic)
packageVersion("equatiomatic")
[1] ‘0.2.0.9000’
fm1 <- lm(bill_length_mm ~ bill_depth_mm, penguins)
extract_eq(model = fm1, ital_vars = TRUE, use_coefs = TRUE)
$$
\widehat{bill\_length\_mm} = 55.07 - 0.65(bill\_depth\_mm)
$$