Let's say we have a two-way with interaction experiment with missing data. Being the dataset:
> dt
X1 X2 X3
1 1 1 58
2 1 1 45
3 1 1 47
4 1 2 61
5 1 2 65
6 2 1 31
7 2 1 35
8 2 1 29
9 2 2 43
10 2 2 51
11 2 2 49
12 3 1 45
13 3 1 55
14 3 2 31
15 3 2 37
16 3 2 37
17 4 1 78
18 4 1 83
19 4 2 36
20 4 2 34
21 4 2 34
> dput(dt)
structure(list(X1 = structure(c(1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L,
2L, 2L, 2L, 3L, 3L, 3L, 3L, 3L, 4L, 4L, 4L, 4L, 4L), .Label = c("1",
"2", "3", "4"), class = "factor"), X2 = structure(c(1L, 1L, 1L,
2L, 2L, 1L, 1L, 1L, 2L, 2L, 2L, 1L, 1L, 2L, 2L, 2L, 1L, 1L, 2L,
2L, 2L), .Label = c("1", "2"), class = "factor"), X3 = structure(c(58,
45, 47, 61, 65, 31, 35, 29, 43, 51, 49, 45, 55, 31, 37, 37, 78,
83, 36, 34, 34), .Dim = c(21L, 1L))), .Names = c("X1", "X2",
"X3"), row.names = c(NA, -21L), class = "data.frame")
I then perform an analysis of variance and estimate the means by the least squares method (lsmeans). So far so good...
But I have a quantitative X1, and want to do a cubic regression analysis for this factor. The problems begin:
- If I treat this case as a complete case scenario, the regression coefficients do not match the lsmeans means (Since I have four levels of the factor, the $R^2$ of the fitted model should be 1, with the curve containing the four means along its extension). In other words, the curve does not pass through the four lsmeans (one for each level of X1).
- If I input the missing data in the dataset based on the effects estimated by OLS (using the overparametrized design matrix, which gives me the mean effects of each factor and interaction) I can make the regression curve to match the lsmeans means. But now I have different sums of squares for the model and, most important, different degrees of freedom for the error estimate (due to the imputation of the missing values).
I am running this regression as a post-hoc analysis for the analysis of variance. What is the right approach? Won't the second one lead me to a type I error?