The standard errors for the indepvar1
time trends are the same because the design is balanced with respect to the indepvar1:time
product terms:. The balance manifests as patterns of symmetry in the design matrix $\mathbf{X}$ and those are also reflected in the variance covariance matrix of the regression coefficients, $\operatorname{Var}(\boldsymbol{\beta}) = \sigma^2(\mathbf{X}'\mathbf{X})^{-1}$. See also How are the standard errors of coefficients calculated in a regression?.
Notice how each indepvar1
category has the same number of observations per time point (even, even though that number varies across time points). So each indepvar1
category has a block of rows in $\mathbf{X}$ with the same structure, which creates balance/symmetry in $\mathbf{X}$.
This is the main reason the trend SEstd. errors are the same. It also matters that there is balance between indepvar1:time
and indepvar2
.
demo_data |>
count(indepvar1, time, indepvar2) |>
pivot_wider(
names_from = time,
values_from = n
)
#> indepvar1 indepvar2 `0` `3` `6` `9` `12` `15`
#> unedited_vehicle MSH3aso_dose_ti… 1 1 1 1 NA NA
#> unedited_vehicle MSH3aso_dose_ti… 1 1 1 NA 1 1
#> unedited_vehicle MSH3aso_dose_ti… 1 1 NA 1 1 1
#> unedited_vehicle MSH3aso_dose_ti… 1 1 NA 1 1 1
#> unedited_MSH3aso_0.022uM MSH3aso_dose_ti… 1 1 1 1 NA NA
#> unedited_MSH3aso_0.022uM MSH3aso_dose_ti… 1 1 1 NA 1 1
#> unedited_MSH3aso_0.022uM MSH3aso_dose_ti… 1 1 NA 1 1 1
#> unedited_MSH3aso_0.022uM MSH3aso_dose_ti… 1 1 NA 1 1 1
#> unedited_MSH3aso_0.26uM MSH3aso_dose_ti… 1 1 1 1 NA NA
#> unedited_MSH3aso_0.26uM MSH3aso_dose_ti… 1 1 1 NA 1 1
#> unedited_MSH3aso_0.26uM MSH3aso_dose_ti… 1 1 NA 1 1 1
#> unedited_MSH3aso_0.26uM MSH3aso_dose_ti… 1 1 NA 1 1 1
#> unedited_MSH3aso_3uM MSH3aso_dose_ti… 1 1 1 1 NA NA
#> unedited_MSH3aso_3uM MSH3aso_dose_ti… 1 1 1 NA 1 1
#> unedited_MSH3aso_3uM MSH3aso_dose_ti… 1 1 NA 1 1 1
#> unedited_MSH3aso_3uM MSH3aso_dose_ti… 1 1 NA 1 1 1
#> unedited_SCRaso_3uM MSH3aso_dose_ti… 1 1 1 1 NA NA
#> unedited_SCRaso_3uM MSH3aso_dose_ti… 1 1 1 NA 1 1
#> unedited_SCRaso_3uM MSH3aso_dose_ti… 1 1 NA 1 1 1
#> unedited_SCRaso_3uM MSH3aso_dose_ti… 1 1 NA 1 1 1
Notice how the pattern of NA
s repeats 5 times (once for each indepvar1
category) with one observation per combination otherwise. A NA
indicateindicates there is no observation for the corresponding combination of the three predictors.
An easy way to "break" the second balance conditionbetween indepvar1:time
and indepvar2
is to shuffle indepvar2
. Effectively this redistributes the NA
s in an imbalanced way.