Hi, and welcome!
For future reference, see FAQ: What's a reproducible example (`reprex`) and how do I create one? It's often essential to getting good answers.
Let's use one from the help(lm)
page
ctl <- c(4.17,5.58,5.18,6.11,4.50,4.61,5.17,4.53,5.33,5.14)
trt <- c(4.81,4.17,4.41,3.59,5.87,3.83,6.03,4.89,4.32,4.69)
group <- gl(2, 10, 20, labels = c("Ctl","Trt"))
weight <- c(ctl, trt)
ctl <- c(4.17,5.58,5.18,6.11,4.50,4.61,5.17,4.53,5.33,5.14)
trt <- c(4.81,4.17,4.41,3.59,5.87,3.83,6.03,4.89,4.32,4.69)
group <- gl(2, 10, 20, labels = c("Ctl","Trt"))
weight <- c(ctl, trt)
lm.D90 <- lm(weight ~ group - 1) # omitting intercept
summary(lm.D90)
#>
#> Call:
#> lm(formula = weight ~ group - 1)
#>
#> Residuals:
#> Min 1Q Median 3Q Max
#> -1.0710 -0.4938 0.0685 0.2462 1.3690
#>
#> Coefficients:
#> Estimate Std. Error t value Pr(>|t|)
#> groupCtl 5.0320 0.2202 22.85 9.55e-15 ***
#> groupTrt 4.6610 0.2202 21.16 3.62e-14 ***
#> ---
#> Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
#>
#> Residual standard error: 0.6964 on 18 degrees of freedom
#> Multiple R-squared: 0.9818, Adjusted R-squared: 0.9798
#> F-statistic: 485.1 on 2 and 18 DF, p-value: < 2.2e-16
Created on 2020-01-26 by the reprex package (v0.3.0)
Before running a regression, you should decide on \alpha, of the level of statistical significance. \alpha = 0.05 is conventional, and it means that the result has a 1 in 20 chance of being due to random variation.
The first thing to look at is the overall model results is the F statistic
, it's p-value
should be less than \alpha. In this case it is. If it isn't, the model
The stars are the p-values of the coefficients
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
But that's not the end of it. There are also diagnostic plots
For a longer discussion see my short introduction to OLS