% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/statMatchLCM.R
\name{sma2_step2}
\alias{sma2_step2}
\title{SMA2 – Hot deck on fitted multinomial probabilities}
\usage{
sma2_step2(step1)
}
\arguments{
\item{step1}{list returned by the SMA step 1 procedure}
}
\value{
A list with:
\describe{
\item{datA_fused_2}{A data frame containing the final fused (imputed) version of dataset A.}
\item{out_nnd}{A list with results from the nearest-neighbour distance matching procedure.}
\item{model_form}{A formula object specifying the model used.}
\item{FitteddatA_imp1}{A data frame of fitted values obtained for dataset A.}
\item{FitteddatC_imp1}{A data frame of fitted values obtained for dataset C.}
}
}
\description{
Second step of SMA using multinomial models and nearest-neighbour hot deck on fitted probabilities
to improve data fusion accuracy.
}
\examples{
if (requireNamespace("NPBayesImputeCat", quietly = TRUE)) {
  data(datA)
  data(datB)

  datAB <- datAB_to_SM(datA, datB)
  datC <- data.frame(
    X = datB$X[1:4],
    Y1 = datA$Y1[1:4],
    Z1 = datB$Z1[1:4]
  )

  # adding auxiliary information
  datABC <- rbind(datAB, datC)

  output_list_AII <- NPBayesImputeCat::DPMPM_nozeros_imp(
    X = datABC,
    nrun = 50,
    burn = 10,
    thin = 10,
    K = 20,
    aalpha = 0.25,
    balpha = 0.25,
    m = 2,
    seed = 1234,
    silent = TRUE
  )

  step_first_aii <- sma_step1(datA, datB, datC, output_list_AII)
  step_second_aii2 <- sma2_step2(step_first_aii)

  result_aii2 <- step_second_aii2$datA_fused_2
  head(result_aii2)
}
}
\references{
\itemize{
\item Lewaa, I., Hafez, M. S., Ismail, M. A. (2023).
\emph{Mixed Statistical Matching Approaches Using a Latent Class Model: Simulation Studies}.
Journal of Statistics Applications  Probability, 12(1), 247--265.

\item D'Orazio, M., Di Zio, M., and Scanu, M. (2006).
\emph{Statistical Matching: Theory and Practice}.
John Wiley and Sons.

\item D'Orazio, M., Di~Zio, M., and Scanu, M. (2019).
Auxiliary variable selection in a statistical matching problem.

\item Zhang, L.-C., and Chambers, R.
Analysis of integrated data.
CRC/Chapman and Hall, pp. 101--120.

\item Conti, P. L., Marella, D., and Scanu, M. (2016).
Statistical matching analysis for complex survey data with applications.
\emph{Journal of the American Statistical Association}, 111(516), 1715--1725.
}
}
