You can use either a simple t-test as proposed by Glen_b, or a more general Wald test.
The Wald test allows to test multiple hypotheses on multiple parameters. It is formulated as: $R\beta=q$ where R selects (a combination of) coefficients, and q indicates the value to be tested against, $\beta$ being the standard regresison coefficients.
In your example, where you have just one hypothesis on one parameter, R is a row vector, with a value of one for the parameter in question and zero elsewhere, and q is a scalar with the restriction to test.
In R, you can run a Wald test with the function linearHypothesis() from package car. Let us say you want to check if the second coefficient (indicated by argument hypothesis.matrix) is different than 0.1 (argument rhs):
reg <- lm(freeny)
coef(reg)
# wald test for lag.quarterly.revenue =0.1
>library(car)
>linearHypothesis(reg, hypothesis.matrix = c(0, 1, rep(0,3)), rhs=0.1)
#skip some result, look at last value on last row, of Pr(>F)
Res.Df RSS Df Sum of Sq F Pr(>F)
1 35 0.0073811
2 34 0.0073750 1 6.0936e-06 0.0281 0.8679
For the t-test, this function implements the t-test shown by Glen_b:
ttest <- function(reg, coefnum, val){
co <- coef(summary(reg))
tstat <- (co[coefnum,1]-val)/co[coefnum,2]
2 * pt(abs(tstat), reg$df.residual, lower.tail = FALSE)
}
> ttest(reg, 2,0.1)
[1] 0.8678848
Let us make sure we got the right procedure by comparing the Wald, our t-test, and R default t-test, for the standard hypothesis that the second coefficient is zero:
> linearHypothesis(reg, hypothesis.matrix = c(0, 1, rep(0,3)), rhs=0)[["Pr(>F)"]][2]
[1] 0.3904361
> ttest(reg, 2,0)
[1] 0.3904361
## The 'right' answer from R:
> coef(summary(reg))[2,4]
[1] 0.3904361
You should get the same result with the three procedures.