One-way ANOVA find F-statistics for testing the hypothesis that $\mu_1=2\mu_2$ Model is $Y_{ij}=\mu_i+\epsilon_{ij}$ where $i=1,2,3$ and $j=1,2,\cdots,n_i$. Second question is find an F-statistic for testing the hypothesis that $\mu_1=2\mu_2$.
My confuse: it is not just comparing a pair nor a contrast. So I am not sure how to find the F-statistic.
Updata: Here is my solution. If we write as $\mathbb{Y}=\mathbb{X}\mathbb{\beta}+\mathbb{\epsilon}$ then the regression matrix is $n \times 3$ of rank 3, where $n=n_1+n_2+n_3$. Then by using $a=[1,-2,0]$ we can construct $F=\frac{RSS_H-RSS}{RSS/(n-3)}$ to test it. Don't know if my idea is correct or not.
Thanks so much.
 A: This can be tested using a "general linear hypothesis test", which involve specifying a contrast matrix and performing a 1 df Wald test of the hypothesis. If the mean vector is is
$$\mathbf{m}=\begin{bmatrix}\mu_1 & \mu_2 &\mu_3 \end{bmatrix}$$
you specify a matrix a contrast matrix $\mathbf{a}$ as
$$\mathbf{a}=\begin{bmatrix}1 & -2 & 0 \end{bmatrix}$$
Now, your test is equivalent to a test of $H_0: \mathbf{a}\mathbf{m}' = 0$ because $\mathbf{a}\mathbf{m}' = \mu_1 - 2\mu_2$.
The test statistic for this test is
$$t = \frac{\mathbf{a}\mathbf{m}'}{\sqrt{\mathbf{a}\Sigma\mathbf{a}'}}$$
where $\Sigma$ is the variance-covariance matrix of the means. It is approximately $t$-distributed with $N-3$ df. In R this looks like the following:
#Fit the model with G as the grouping variable
#-1 means no intercept
fit <- lm(Y ~ G - 1, data = data)
m <- coef(fit)
S <- vcov(fit)

#Specify contrast matrix
a <- cbind(1, -2, 0)

#Compute t-statistic
am <- a %*% m
SE <- sqrt(a %*% S %*% t(a))
t <- am/SE

#P-value; N is sample size
p <- 2*pt(-abs(t), N - 3)

If you don't want to assume equal variances, replace vcov() with sandwich::vcovHC().
