  We consider Markov basis arising from fractional factorial designs with
three-level factors. Once we have a Markov basis, $p$ values for various
conditional tests are estimated by the Markov chain Monte Carlo procedure. For
designed experiments with a single count observation for each run, we formulate
a generalized linear model and consider a sample space with the same sufficient
statistics to the observed data. Each model is characterized by a covariate
matrix, which is constructed from the main and the interaction effects we
intend to measure. We investigate fractional factorial designs with $3^{p-q}$
runs noting correspondences to the models for $3^{p-q}$ contingency tables.
