Extracting parameter coefficients from the summary function [duplicate]
问题 This question already has answers here : Extract regression coefficient values (4 answers) Closed 6 years ago . I have fitted a linear regression model: Lin <- lm(y~x, data=df) When I use the summary function, I get some output. How do I extract the parameter coefficients from this output? 回答1: Here are a few ways of getting the parameter estimates: R> m = lm(y ~ x) R> m Call: lm(formula = y ~ x) Coefficients: (Intercept) x 0.5821 0.0878 Or ##See ?coef for details R> coef(m) R> coefficients(m