user14212134
user14212134

Reputation:

Print equation of linear regression model using RMarkdown

I currently have some rather long inline code for producing an equation of just a simple linear regression:

lm(var1 ~ var2 + var3)

But I could have sworn at some point recently I saw some very succinct inline code to produce an equation of that model, but I seem to not have saved it. Any ideas?

Upvotes: 1

Views: 1342

Answers (3)

Eduardo Zanette
Eduardo Zanette

Reputation: 140

Complementing @Daniel_j_iii answer:

$lm(Y \sim x)$

Upvotes: 1

Daniel_j_iii
Daniel_j_iii

Reputation: 3242

You don’t need need a package for inline equations. Just put you equation in Rmarkdown between 2 $, example below

$lm(var1 ~ var2 + var3)$

which looks like this rendered in Rmarkdown

enter image description here

Upvotes: 0

user14212134
user14212134

Reputation:

(sorry, I found it, using the equatiomatic package)

Upvotes: 2

Related Questions