Are my slope and intercept significantly different from 1 and 0? I have been looking for a clear answer to my question, with unsuccessful results so far...
I am using R to compute a linear model between two variables. In a perfect world, I should obtain a relationship such as y = x, with a slope equal to 1 and an intercept of 0.
Below is a summary of the linear model I am computing with R:
Call:
lm(formula = Y ~ X, data = Data)

Residuals:
     Min       1Q   Median       3Q      Max 
-24.6647  -2.5081   0.7563   2.8372  24.9408 

Coefficients:
            Estimate Std. Error t value Pr(>|t|)    
(Intercept) -5.80592    1.48049  -3.922 0.000171 ***
X            1.09599    0.02548  43.015  < 2e-16 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 8.121 on 90 degrees of freedom
Multiple R-squared:  0.9536,    Adjusted R-squared:  0.9531 
F-statistic:  1850 on 1 and 90 DF,  p-value: < 2.2e-16


I understand that my intercept is -5.8 and slope 1.09. What I don't understand, based on the p-value that is also provided, if it says that it is statistically different from 0 and 1, or the complete opposite?
Thanks a lot for your help !! :)
 A: Unless there is a way to specify otherwise like there is in a function like t.test, the p-values in this kind of printout in R is for a test of the coefficient being zero, so you have quite strong evidence that neither the slope nor the intercept is zero. (Nothing you did specifies otherwise, though there might be a way to code the summary function to do so. If there is, I don’t know it.)
You have use the standard error and estimated value to construct a confidence interval. While there are ways to be more thorough about such a calculation, a “quick and dirty” way to get about a $95\%$ confidence interval for each coefficient is to take the estimated value $\pm$ two standard errors.
$$
\text{Intercept}: -5.81\pm 1.48 = (-8.77, -2.85)\\
\text{Slope}: 1.10\pm 0.0255 = (1.05, 1.15)
$$
These confidence intervals give somewhat strong evidence that the intercept is not zero and the slope is not one (though this one is close and might not be practically different from one; that is, the true (population-level) slope might not be one but might not be so different that you care).
A: The package emmeans has a great function to test various hypotheses about linear models.  Here I show how to test the slope different than 1 (the standard summary output already tests the intercept different from zero.
> data(trees)
> 
> mod <- lm(Height ~ Girth, data=trees)
> summary(mod)

Call:
lm(formula = Height ~ Girth, data = trees)

Residuals:
     Min       1Q   Median       3Q      Max 
-12.5816  -2.7686   0.3163   2.4728   9.9456 

Coefficients:
            Estimate Std. Error t value Pr(>|t|)    
(Intercept)  62.0313     4.3833  14.152 1.49e-14 ***
Girth         1.0544     0.3222   3.272  0.00276 ** 
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 5.538 on 29 degrees of freedom
Multiple R-squared:  0.2697,    Adjusted R-squared:  0.2445 
F-statistic: 10.71 on 1 and 29 DF,  p-value: 0.002758

> 
> library(emmeans)
> mod.emt <- emtrends(mod, ~1, var="Girth")
> mod.emt
 1       Girth.trend    SE df lower.CL upper.CL
 overall        1.05 0.322 29    0.395     1.71

Confidence level used: 0.95 
> test(mod.emt, null=1)
 1       Girth.trend    SE df null t.ratio p.value
 overall        1.05 0.322 29    1   0.169  0.8672

