[Solved] Linear Regression in R – coef Function

[ad_1]

Please read the help page before you post a question. ?coef says that:

coef is a generic function which extracts model coefficients from
objects returned by modeling functions

Therefore, you need to run a linear model using lm() on your data-set, then extract the coefficients from the model:

coef(lm(...))

[ad_2]

solved Linear Regression in R – coef Function