Given the dataset:
d = structure(list(x = c(22.9362216327734, 24.4504147133069, 23.2710364752618,
22.5253827558421, 24.8139647577093, 22.8804536162757, 24.3948588709677,
25.4304112554113, 25.7243410214168, 26.6003943661972, 26.0698382492864
), y = c(3.536, 3.867, 4.482, 2.033, 2.912, 3.958, 5.445, 6.973,
5.115, 8.382, 4.438)), .Names = c("x", "y"), class = "data.frame", row.names = c(16L,
17L, 19L, 20L, 23L, 24L, 25L, 26L, 28L, 29L, 30L))
I can make a nonlinear fit:
a = nls(y ~ a * exp(b * x), data = d, start = list(a = 1, b = 0.05))
Formula: y ~ a * exp(b * x)
Parameters:
Estimate Std. Error t value Pr(>|t|)
a 0.02980 0.05046 0.590 0.5694
b 0.20483 0.06723 3.047 0.0139 *
I am interested in the value of the b
parameter:
library(MASS)
confint(a, parm = 'b')
2.5% 97.5%
0.05583547 0.37719675
I see that the model converged on b
as 0.205 with a 95% CI of (0.056, 0.377).
My question is:
How do I calculate the p-value for the following null hypothesis?
H0: b = 0.069
I've seen online the conversion between CI and p-value when the null is zero but I'm unsure of:
- how many degrees of freedom exist for this parameter? Is it just
nrow(d) - 1
still? - how to calculate p-value with a non-zero null