Nice question - however, I would suggest swapping your labelling so that your dependent variable is called Y and your independent variable is called X, in line with usual notation convention in statistical modelling. It seems odd to call an independent variable Y and a dependent variable X (though I understand in your case Y stands for Year).
It's not entirely clear to me from your post what you are really interested in in terms of testing hypotheses. But it seems that your problem would involve trying to compare probabilities that the dependent variable takes a certain value.
For example, if:
Prob_A(Year1, Period1)
Prob_A(Year1, Period2)
Prob_A(Year2, Period1)
Prob_A(Year2, Period2)
are the probabilities that the dependent variable takes the value A for specific combinations of values of Year and Period, you could test hypotheses of the form:
Ho: Prob_A(Year2, Period2) - Prob_A(Year2, Period1) = Prob_A(Year1, Period2) - Prob_A(Year1, Period1) versus
Ha: Prob_A(Year2, Period2) - Prob_A(Year2, Period1) $\neq$ Prob_A(Year1, Period2) - Prob_A(Year1, Period1)
These hypotheses would enable you to investigate whether there is a between-period difference across years with respect to the true probability that the dependent variable takes the value A.
Note that these hypotheses could be re-expressed as:
Ho: Prob_A(Year2, Period2) - Prob_A(Year2, Period1) - (Prob_A(Year1, Period2) - Prob_A(Year1, Period1)) = 0 versus
Ha: Prob_A(Year2, Period2) - Prob_A(Year2, Period1) - (Prob_A(Year1, Period2) - Prob_A(Year1, Period1)) $\neq$ 0
Similar hypotheses can be formulated for the other levels of your dependent variable (i.e., B, C and D) and you would test all the hypotheses simultaneously by using bootstrap to build confidence intervals for quantities such as Prob_A(Year2, Period2) - Prob_A(Year2, Period1) - (Prob_A(Year1, Period2) - Prob_A(Year1, Period1)), etc., and looking to see whether these intervals exclude the value 0.
In your bootstrap procedure, you would estimate the probabilities of interest from a multinomial logistic regression model relating the dependent variable to year, period and their interaction (if the interaction is supported by the model).
A more flexible R function for fitting multinomial logistic regression models for a categorical dependent variable with unordered categories is the vglm function in the VGAM package. For example, if your model includes no interaction between Period and Year, you can fit it like this:
## Load VGAM
library(VGAM)
## Use the first level of Dependent variable
## as the reference level for all comparisons
model.nonparallel <- vglm(Dependent ~ Period + Year, data = yourdata,
family = multinomial(parallel = FALSE,
refLevel = 1))
summary(model.nonparallel)
This fits the so-called non-parallel baseline category multinomial logit model.
This vglm model assumes that, after adjusting for Year, Period has a different effect on the (i) log odds that Dependent = B rather than A, (ii) log odds that Dependent = C rather than A and (iii) log odds that Dependent = D rather than A. Similarly, after adjusting for Period, the model assumes that Year has a different effect on these odds. The non-parallel assumption refers to a situation where we allow the effect of an independent variable to vary across the log-odds correaponding to the comparisons on interest involving the levels of the dependent variables: B versus A, C versus A and D versus A.
As explained for instance in this 2017 article on On the “Poisson Trick” and its Extensions for Fitting Multinomial Regression Models by Lee et al.,
(https://arxiv.org/pdf/1707.08538.pdf),
it is possible to relax the non-parallel assumption in a non-parallel model so that we consider that some or all independent variables included in the model have effects that do NOT differ across the comparisons of interest (i.e., effects that are the same across all comparisons of interest).
A parallel baseline category multinomial logit model would be one where the effects of all independent variables included in the model are assumed to NOT vary across comparisons of interest:
model.parallel <- vglm(Dependent ~ Period + Year, data = yourdata,
family = multinomial(parallel = TRUE,
refLevel = 1))
summary(model.parallel)
A partial baseline category multinomial logit model would be one where the effects of some (but not all) of the independent variables included in the model are assumed to NOT vary across comparisons of interest. For example, if the effects of Period only are assumed to NOT vary across the comparisons of interest, this can be specified as:
model.partial <- vglm(Dependent ~ Period + Year, data = yourdata,
family = multinomial(parallel = ~ -1 + Period,
refLevel = 1))
summary(model.partial)
See this excellent post on a Unified Approach to Ordinal (cumulative) and Polytomous (multinomial) Logistic Regressions using VGAM::vglm for more vglm details: http://rstudio-pubs-static.s3.amazonaws.com/5529_7944ecfa034f4c52b8645707e48f8c6d.html.
How you conduct the bootstrap will depend on your study design. You will likely need to adjust the confidence level of your bootstrap confidence intervals for multiplicity.
If you have clear hypotheses in mind that you would like to test, such as the ones I listed here, you might want to consider keeping your interaction between Period and Year in the model and letting go of performing a test of significance of interaction.
Things get a bit more complicated if you need to compare things across levels of the dependent variable, not just within a level.