Displaying 1 result from an estimated 1 matches for "intercept_a".
Did you mean:
intercept_1
2006 Jul 11
1
test regression against given slope for reduced major axis regression (RMA)
...onfidence
### intervall (two-tailed).
###
### see Sokal and Rohlf, p. 465/471
n <- length(x)
mydf <- n-2
## least square fit:
x2 <- (x-mean(x))^2
y2 <- (y-mean(y))^2
## regression (pedestrian solution):
xy <- (x-mean(x))*(y-mean(y))
slope1 <- sum(xy)/sum(x2)
intercept_a <- mean(y) - slope1 * mean(x)
## model data y_hat:
y_hat <- intercept_a + slope1 * x
## least squares of model data:
y_hat2 <- (y - y_hat)^2
s2yx <- sum(y_hat2) / (n-2)
sb <- sqrt(s2yx/sum(x2))
ts <- (slope1 - slope_2) / sb
pvalue <- 2*(pt(abs(ts), df, lower....