model <- lm(Petal.Length ~ Petal.Width, data = iris)
summary(model)$coefficients
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 1.083558 0.07296696 14.84998 4.043318e-31
## Petal.Width 2.229940 0.05139623 43.38724 4.675004e-86
cat("R-squared:", summary(model)$r.squared, "\n")
## R-squared: 0.9271098
Coefficients: Show the estimated intercept and slope.
P-values: Indicate whether the relationship is statistically significant.
R-squared: Represents how much of the variation in Petal Length is explained by Petal Width.