简体   繁体   中英

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

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.

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)
$$

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM