  In multivariate nonparametric regression the additive models are very useful
when a suitable parametric model is difficult to find. The backfitting
algorithm is a powerful tool to estimate the additive components. However, due
to complexity of the estimators, the asymptotic $p$-value of the associated
test is difficult to calculate without a Monte Carlo simulation. Moreover, the
conventional tests assume that the predictor variables are strictly continuous.
In this paper, a new test is introduced for the additive components with
discrete or categorical predictors, where the model may contain continuous
covariates. This method is also applied to the semiparametric regression to
test the goodness-of-fit of the model. These tests are asymptotically optimal
in terms of the rate of convergence, as they can detect a specific class of
contiguous alternatives at a rate of $n^{-1/2}$. An extensive simulation study
is presented to support the theoretical results derived in this paper. Finally,
the method is applied to a real data to model the diamond price based on its
quality attributes and physical measurements.
