FHDI : An R Package for Fractional Hot Deck Imputation

Fractional hot deck imputation (FHDI), proposed by Kalton and Kish (1984) and investigated by Kim and Fuller (2004), is a tool for handling item nonresponse in survey sampling. In FHDI, each missing item is filled with multiple observed values yielding a single completed data set for subsequent analyses. An R package FHDI is developed to perform FHDI and also the fully efficient fractional imputation (FEFI) method of (Fuller and Kim, 2005) to impute multivariate missing data with arbitrary missing patterns. FHDI substitutes missing items with a few observed values jointly obtained from a set of donors whereas the FEFI uses all the possible donors. This paper introduces FHDI as a tool for implementing the multivariate version of fractional hot deck imputation discussed in Im et al. (2015) as well as FEFI. For variance estimation of FHDI and FEFI, the Jackknife method is implemented, and replicated weights are provided as a part of the output.


Introduction
Incomplete data are common in survey sampling, biomedical, and social sciences.Naive analysis with only complete cases, conducted by removing all the cases with any missing items, is exposed to nonresponse bias unless the missing data mechanism is missing completely at random (Rubin, 1976).Even if the complete cases can be treated as a complete random sample, the complete case analysis is inefficient, as all the partially observed cases are ignored.To incorporate these partial observations, we may consider an imputation technique in which the missing items are filled in with plausible values.
Imputation is often classified into single imputation and repeated imputation on the basis of the number of imputed values per each missing value.Several values are assigned to each missing value in repeated imputation, while a single value is imputed in single imputation.Although single imputation is often preferred in practice, due to its convenience, it does not necessarily preserve the distribution of the original data.Thus, single imputation is inadequate for general purpose estimation.
There are two popular methods in the repeated imputation: multiple imputation and fractional imputation.Multiple imputation, proposed by Rubin (1987Rubin ( , 1996) ) produces multiply imputed data sets as imputation output.Many multiple imputation methods are already available in R, for example, mice (van Buuren and Groothuis-Oudshoorn, 2011), mi (Su et al., 2011), Amelia (Honaker et al., 2011), and VIM (Kowarik and Templ, 2016).Fractional imputation, initially proposed by Kalton and Kish (1984) and extensively discussed in Fay (1996), Kim and Fuller (2004), Durrant and Skinner (2006), and Kim (2011), creates a single completed data set with fractional weights after imputation.The size of the imputed data is always larger than that of the incomplete input data.However, there is no suitable R package for implementing fractional imputation.So far, the only publicly available software for doing fractional imputation is the SAS procedure SURVEYIMPUTE (SAS Institue Inc., 2015), which partly covers some fractional imputation methods.
Fractional imputation is yet to be widely used in practice other than survey sampling possibly because it is relatively new and there is more complexity involved in implementing variance estimation compared to multiple imputation.However, fractional imputation has its own advantages.For instance, in the case of using a method-of-moment estimator, fractional imputation provides consistent variance estimation while the multiple imputation variance estimator is inconsistent (Yang and Kim, 2016).
Imputing multivariate missing data is challenging for both multiple imputation and fractional imputation.In practice, a full conditional specification of the joint model can be used to fill in several missing items.One popular method is multiple imputation using chained equations, also named mice (van Buuren and Groothuis-Oudshoorn, 2011) as in the name of its R package.This multiple imputation procedure by chained equation (MICE) involves a variable-by-variable approach using chained equations, whereby the imputation model for each missing item is separately specified with the other items as predictors.A linear regression model or predictive mean matching is used for continuous variables, and a logistic regression is used for categorical variables.Once all the conditional distributions are specified, the multiple imputation procedure is repeated until convergence.However, full conditional specification is subject to model mis-specifications and model compatibility problems (Chen, 2010), and the parameter estimation procedure is sometimes cumbersome.As an alternative, we employ the fractional hot deck imputation (FHDI) proposed by Im et al. (2015), which is a nonparametric imputation approach using a two-phase sampling idea.To apply FHDI in multivariate missing data, Im et al. (2015) first created imputation cells to match donors and recipients The R Journal Vol.10/1, July 2018 ISSN 2073-4859 in a nonparametric way, where units with complete data serve as donors and units with at least one missing item serve as recipients.Once the imputation cells are created, multiple donors are assigned to each recipient with the probability proportional to fractional weights, which can be understood as the conditional probability of obtaining the imputed values given the partial observation.After that, the observed values of each donor are jointly imputed to fill the missing parts of the recipient.
The complete R package FHDI and entire source codes are available in Im et al. (2018), and can be installed with R 3.4.0or higher.The package basically includes three main functions with separate purposes.The function FHDI_CellMake() converts continuous data into categorical data which can be used as imputation cells.The function FHDI_CellProb() is provided to estimate the imputation cell probability using a version of the expectation maximization (EM) algorithm.This function can be used to get the maximum likelihood estimates of the cell probabilities from multivariate, incomplete, categorical data under the missing at random assumption.The function FHDI_Driver() performs fractional hot deck imputation, and also provides a set of replicated fractional weights for variance estimation.

FHDI
Fractional hot deck imputation (FHDI), proposed by Kim and Fuller (2004), replaces each missing value with a set of imputed values.Those imputed values are selected at random from values of the donors in the same imputation cell, with the cells constructed to achieve within-cell data homogeneity.Fractional weights are assigned to each imputed value to preserve the original data structure, and a singly imputed data set is obtained as the output of the FHDI.Im et al. (2015) extended Kim and Fuller (2004)'s idea in two ways.First, the new FHDI does not require imputation cells to be made in advance.Imputation cells are determined as a by-product of the imputation procedure, and are generally created to preserve the most of the correlations among survey items.Second, the new FHDI method is now applied to multivariate missing data with arbitrary missing patterns.
The FHDI of Im et al. (2015) can be understood as an imputation method using two-phase sampling for stratification.In phase one, the imputation cells are determined so that the survey values are homogeneous within cells and each missing unit has at least two possible donors within each imputation cell.The cell probabilities are estimated using the EM by weighting method (Ibrahim, 1990).Once imputation cells are fixed, then the fully efficient fractional imputation (FEFI), named by Fuller and Kim (2005), is implemented by replacing each missing value with all observed values within the imputation cell.The FEFI fractional weights are obtained during this FEFI procedure.However, in general, the size of imputed data from the FEFI procedure can be too large to handle for statistical analysis.To avoid this size issue, we may select M(≥ 2) donors on each missing unit instead of taking all possible donors.In phase two, a set of donors are assigned to each recipient with the probability proportional to their FEFI fractional weights.A vector of missing values is jointly imputed with the observed values of assigned donors.

Basic setup
For a description of the FHDI procedure, suppose that we have a finite population of size N, indexed by U = {1, 2, . . ., N}, with two continuous variables y 1 and y 2 .Let z 1 and z 2 be discretized values of y 1 and y 2 , respectively.Assume that z 1 takes values in {1, . . ., G} and z 2 takes values in {1, . . ., H}.Let δ p (p = 1, 2), a response indicator function of y p , take a value of one if y p is observed and zero otherwise.Note that if y p has a missing value, then z p is also missing.
The finite population U can be subdivided into G × H cells based on z 1 and z 2 , and we assume a cell mean model on the cells such that where y = (y 1 , y 2 ), µ gh = (µ 1,gh , µ 2,gh ) is a vector of cell means and Σ gh is the variance-covariance matrix of y in cell (gh).
Let y obs and y mis be the observed and missing part of y, respectively.We assume that the data are missing at random (MAR) in the sense that where δ = (δ 1 , δ 2 ).The MAR condition (2) implies that the imputation model (1) also holds for the respondents.
Let A be the index set of the sample elements selected from the finite population U. Let A R be the The R Journal Vol.10/1, July 2018 ISSN 2073-4859 index set of the respondents who answered both items y 1 and y 2 , that is, A R = {j ∈ A; δ 1j δ 2j = 1}.Similarly, define A M to be the set of the nonrespondents who have at least one missing value.That is, A M = {j ∈ A; δ 1j δ 2j = 0}.Denote n R and n M as the size of A R and A M , respectively.We assume that A R is non-empty and there exists enough donors in A R , that is, for some n * R .The value of n * R is determined by the size of the imputation cells.

Imputation
The FHDI procedure in Im et al. (2015) consists of the following four steps: (i) Cell construction by discretization, (ii) Estimating cell probabilities, (iii) Constructing FEFI fractional weights, and (iv) Imputation.A detailed step-by-step description is provided below.

(Step 1): Cell construction by discretization
We wish to construct imputation cells satisfying (1).The imputation cell variable z can be given in advance, or can be obtained using the estimated sample quantiles.To discuss the latter case, let {a 1 , . . ., a G } be a set of cumulative proportions such that 0 = a We can choose a i so that each cell contains an equal number of respondents.Let be the estimated distribution function for y 1 , where w i is the sampling weight of unit i; I(S) is an indicator function that takes value of one if S is true and zero otherwise; and q(a k ) be the estimated sample quantile corresponding to a k , defined by q(a k ) = min{t; F(t) ≥ a k }.Once we have the estimated sample quantiles, we can construct z 1i from y 1i .For instance, z 1i = g if q(a g−1 ) < y 1i ≤ q(a g ).If y 1i is missing, then z 1i has a 'NA' value.Similarly, we can construct z 2 with the range from 1 to H.
From the realized values of z 1i and z 2i in the sample, we can construct two sets of observed patterns of (z 1 , z 2 ) for A R and A M .Let V R be the set of all observed combinations of z 1 and z 2 in A R .A size of V R is G × H at maximum, but it can be smaller in the realized samples.Similarly we obtain V M based on the observed parts of nonrespondents.For example, we may have V M = {(NA, NA), (NA, z 2 = 1), (NA, z 2 = 2), (z 1 = 1, NA), (z 1 = 2, NA)} in the case of two binary outcomes.
For the proposed FHDI, we need at least two donors for each recipient to capture the variability from imputation.However, an initial discretization may not give enough donors for some recipients.In this case, we apply a cell collapsing procedure to have at least two donors to each recipient.During the cell collapsing, the dimension of the cell variable z can be adjusted to have larger samples within the cells.However, each cell variable z should have at least two distinct values marginally for its validity in the construction of imputation cell.The cell collapsing procedure is designed to be stopped if any cell variable has a single observation.In the left panel of Table 1, we only have one possible donor for recipients with (z 1 = N A, z 2 = 1).In the right panel of Table 2, two cells, (z 1 = 1, z 2 = 1) and (z 1 = 1, z 2 = 2), are merged into a single cell to guarantee a larger size of donors to the recipients.As the result of cell collapsing, recipients who have observed values in z 2 with z 2 = 1 or z 2 = 2 share the same donors if they have z 1 = 1.Since the cell variables z 2 have two distinct values given z 1 = 2, the cell collapsing result does not contradict the overall size assumption of H ≥ 2.
Table 1: An illustrative example for the number of donors in cell with G = 2 and H = 2. Left panel: initial imputation cell; right panel: final cell subdivision after cell collapsing.

(Step 2): Estimating of cell probabilities
Once the imputation cells are finalized from the above discretization, we need to estimate the cell probabilities defined by The R Journal Vol.10/1, July 2018 ISSN 2073-4859 The initial cell probabilities are obtained using only the respondents in A R .These initial cell probabilities are updated using the following EM method, modified from the EM by weighting (Ibrahim, 1990): E-step: Let z obs and z mis be observed and missing part of z, respectively.Then, the conditional probability of z mis = b * given z obs = a, denoted by πb * |a , is computed using the current t-th estimate of the joint probability, where a is the observed value in z obs , b * is one possible value for z * mis , and M-step: Updates the joint probability of a particular combination

(Step 3): Constructing FEFI fractional weights
The key point of the approach in Im et al. (2015) is to approximate the FEFI by the FHDI method with a smaller size of donors.To achieve this goal, we first need to compute the FEFI fractional weights for all possible donors assigned to each recipient.Let w * ij be the j-th fractional weights for the recipient i corresponding to donor j given by where z * i,mis is an imputed value for the missing part of recipient i and (z k,obs(i) , z k,mis(i) ) denotes the values of unit k corresponding to the observed and missing part of recipient i in the sample imputation cell.Here, the FEFI fractional weights are constructed using the cell conditional probability of z i,mis in the missing part given the observed part z i,obs .Note that the sum of w * ij over all j is equal to one by construction.

(Step 4): Imputation
In FEFI, we employed all respondents as donors to each recipient in the same cell, and then assign the FEFI fractional weights to each donor.However, this FEFI may not be attractive in practice due to its huge size.Instead of using all the respondents, we can select just M donors among the FEFI donors with the selection probability proportional to FEFI fractional weights and then assign equal fractional weights.As for donor selection, we used a tailored systematic sampling method given below: (a) Sort all FEFI donors in y values by the half-ascending half-descending order.That is, for example, {1, 2, . . ., 8} is sorted as follows: 1,3,5,7,8,6,4,2.
(b) Let k ∈ A Rd , where A Rd is a set of the FEFI donors, be the FEFI donors after the sorting algorithm in (a).Let (L k , U k ) be the interval for the following systematic sampling scheme: (c) Let A Mr be a subset of A M who has the same values in the observed part and n Mr be the size of A Mr .Let RN be a random number generated from a uniform distribution U(0, 1).For each l ∈ A Mr , we select M donors as follows: for j = 1, . . ., M, if for some k, then a donor k is selected as the j-th donor for recipient l.
This tailored systematic sampling is designed to select the FEFI donors efficiently within imputation cells.If n Rd is less than M, we select all donors and then assign the FEFI fractional weights instead of assigning equal weights M −1 .

Analysis
After imputation, we obtain the imputed data in the size of n R + n M × M. On the imputed data, we can conduct statistical analysis such as mean estimation, regression analysis, and so on.The FHDI mean estimator is where y * ij and w * ij are the imputed values and the fractional weights for unit i ∈ A M , but y * ij = y i for all j and w * ij = 1 for i = j and w * ij = 0 for all i = j if unit i ∈ A R .Similarly, the regression coefficient for the regression of y 1 given y 2 can be written as a classical weighted regression in the form, where X is a design matrix including a vector of y * 2,ij , and W is a weighting matrix whose diagonal elements are w i w * ij and non-diagonal elements are all zeros.The replication method is considered for variance estimation of the FHDI estimator.For L replicates, the replication variance estimator for the FEFI estimator is where c k is a replicate factor associated with θ(k) FHDI and θ(k) FHDI is the the k-th replicate estimate obtained using the k-th fractional weights replicate denoted by w The current version of the FHDI package provides a set of replication fractional weights using a jackknife method.See Im et al. (2015) for details in computation of the replication fractional weights.

Implementation of FHDI
In the FHDI package, we have three main functions: (i) FHDI_CellMake, (ii) FHDI_CellProb, and (iii) FHDI_Driver.The function FHDI_CellMake() is used to create the imputation cell variable z.The EM algorithm introduced in Section 2.2 is built into the function FHDI_CellProb().The main function FHDI_Driver() conducts imputation and variance estimation including cell construction and estimating cell probabilities.We used simulated data to describe these components of the package FHDI.All results in this section are obtained from a Microsoft Windows 64 bit operation system.The FEFI results should be the same without reference to the underlying operating system, while the FHDI results using other platforms (e.g., Linux) may be slightly different, as FHDI selects donors using a standard random number library which is generally platform-dependent.

DATA
We have n = 100 sample observations for the multivariate data vector y i = (y 1i , y 2i , y 3i , y 4i ), i = 1, . . ., n, generated from We set ρ = 0.5; e 1 and e 2 are generated from a standard normal distribution; e 3 is generated from a standard exponential distribution; and e 4 is generated from a normal distribution N(0, 3/2).
Response indicators are generated from a Bernoulli distribution with different p k , where (p 1 , p 2 , p 3 , p 4 ) = (0.6, 0.7, 0.8, 0.9).Although the response indicators are generated based on the missing completely at random (MCAR) assumption for simplicity, the FHDI method also holds for other response models based on MAR.

Imputation cell
Using the R function summary() We now use the function FHDI_CellMake() to convert continuous y variables into discretized variables z.A vector of initial cell dimension k should be given as input information.If the input value k is a single integer, the same number of category is applied to all variables for initial discretization.The current version allows up to 35 distinct categories for each variable.When the variables are specified as the unordered categorical type through the option, the algorithm excludes those variables from the discretization procedure.The details are illustrated in the a ppendix along with the application of mixed data types.
Sample weight and ID are optional for input information.Default values are 1 through n for the ID while 1.0 for the sample weight.Another option is s_op_merge which controls randomness in the cell collapsing procedure.There are two possible values for s_op_merge: "fixed" as default and "rand" as optional.During the cell collapsing, randomness occur if there exists multiple adjacent cells for a fixed cell, which is required to be merged into another cell.If s_op_merge is set with "rand", then the matrix of discretized values can be different even for the same incomplete data.The last option is "categorical" used to denote the data type which has a value 1 if the input variable is unordered and 0 otherwise.If the input vector for the option "categorical" is not specified by the users, the algorithm treats all variables as continuous or ordered categorical types.
The main outputs of the function FHDI_CellMake() are (a) incomplete data matrix attached with ID and sample weight named by "data", (b) matrix for imputation cell variables named by "cell", (c) cell pattern matrix for respondents named by "cell.resp",and (d) cell pattern matrix for nonrespondents named by "cell.non.resp".When missing values are recorded with specific numeric values other than NA, the response indicator matrix (i.e., "datr") should be inserted with the original data matrix.The indicator matrix "datr" has the same dimension as "daty" contains 0 for missing cell locations and 1 otherwise.For instance, the first six rows of "datr" of the "daty" given above will look like: The R Journal Vol.10/1, July 2018 ISSN 2073-4859 As long as "daty" contains NA at the missing cell locations, automatic detection of missing cell locations takes place.When one wants to define more missing cell locations, one can override the automatic detection by separately defining "datr" and including it in the function argument, for example, 'FHDI_CellMake(daty,datr,k=3)'.We set k = 3 and do not give additional input information on weights and ID, then the first output is shown as The observed values are converted to ordered categorical values from 1 to k.Here, missing values are presented with a common missing value "0".During the discretization procedure, the initial dimension of k can be down to have larger donors within imputation cells.In our example, the default value k = 3 was kept for all variables.

> head(cdaty
y1 y2 y3 y4 0 42 34 18 11 1 26 18 27 30 2 13 36 32 28 3 19 12 23 31 From the output component named by "cell", we can find out whether the cells are merged during the discretization process.For instance, we have 34 missing values in y 2 , and this indicates that 22 (= 66/3) observations are evenly distributed for each category based on the estimated density function.However, the finalized frequencies for three categories are 18, 36, and 12.This means that some initial cells are merged to adjacent cells to obtain enough donors for recipients.
It is important to specify the cell patterns to match the respondents and the nonrespondents.Thus, the cell pattern matrix for respondents and nonrespondents, named by "cell.resp"and "cell.non.resp", are produced as the outputs of the function FHDI_CellMake().Note that it is possible to have 3 4 = 81 distinct vectors theoretically, but we only have 10 unique patterns in our toy example.
The R Journal Vol.10/1, July 2018 ISSN 2073-4859 Note that it is possible to have all zero values as a cell pattern, because we allow to have missing values for all variables.Under the MAR assumption, if there are no additional auxiliary variables, then the cases with missing values in all items can be safely removed from the original data set.

Cell probability estimation
We now estimate the cell probabilities based on the second output obtained using FHDI_CellMake().
Since the function FHDI_CellProb() is based on the EM algorithm designed to compute cell probabilities for multivariate categorical data, this function can be separately used when we are only interested in obtaining the maximum likelihood estimates for the cell probabilities.Note that the joint cell probabilities are estimated only from observed patterns, not from all possible values.Overall sum of the joint cell probabilities should be equal to one.All discretized values are presented by a single values in the order of data columns.For example, a value of "1111" denotes a vector (z 1 = 1, z 2 = 1, z 3 = 1, z 4 = 1).If the number of categories in a variable is larger than 10, the categories are label with 26 alphabet letters (a-z).If we have a value 'b2c', then it denotes the z vector (11,2,12).

Fractional hot deck imputation
We can use the function FHDI_Driver() without searching for a suitable imputation cell matrix in advance.In short, FHDI_Driver() automatically performs FHDI_CellMake() and FHDI_CellProb() and then proceeds toward the imputation and/or variance estimation.The main input information is the matrix of original variables, matrix for response indicators, and the imputation method ("FEFI", "FHDI").In the case of 's_op_imputation="FHDI"', the imputation size M should be given as an input value.For instance, when M = 5, FHDI will randomly select 5 donors from all possible donors.In the case of "FEFI", the imputation is conducted to assign all possible values to each recipient with the FEFI fractional weights.
The output consists of four main parts except for input information: (i) imputation results with fractional weights named by "fimp.data",(ii) an imputed data in format of single imputation result named by "simp.data",(iii) the FHDI mean estimates with estimated standard error named by "imp.mean", and (iv) replication fractional weights for variance estimation named by "rep.weight".If variance estimation option is given by 'i_op_variance=0', then third output and fourth output are not produced as the main output.The default is 'i_op_variance=1'.
The R Journal Vol.10/1, July 2018 ISSN 2073-4859 The part of the fractionally imputed data are given below with newly attached variables FID and FWT, where FID denotes donors' local serial index and FWT denotes fractional weights assigned to imputed values: > FEFI = FHDI_Driver(daty, s_op_imputation = "FEFI", i_op_variance = 1, k = 3) > names(FEFI) [1] "fimp.data" "simp.data""imp.mean"[4] "rep.weight" "M" "s_op_imputation" [7] "i_option_merge" > FEFI$fimp.data[1:20,] ID FID WT FWT y1 y2 y3 y4 [1,] 1 1 1 0 The singly imputed data has the same size as the original incomplete data in which missing values are filled with a single value, essentially the mean of fractionally imputed values.For example, in the first sample presented at 'daty[1,]' below, we have a missing value for y 3 .The imputed values are 2.881646 and 2.493438 presented above, and the weighted mean of two values 2.6875422, considering sample weights and fractional weights, replaces the missing value.This second output can be used as the result for single imputation.However, its uses should be controlled under the limitations of single imputation.The second output is partially presented below The component "imp.mean"shows the FEFI mean estimates with the standard errors.The first row presents the FEFI mean estimates and the second row presents the standard error of the FEFI mean estimates.In our example, the FEFI mean estimates (standard errors) for variables are approximately 0.90(0.128),1.87(0.121),1.82(0.137),and −0.03(0.130),respectively.Because a jackknife method is used for variance estimation, a matrix of the replication fractional weights has n I rows and n columns, where n I (> n) denotes the size of the imputed data.By its construction, the column sums of the replication fractional weights should be the sum of unit weights, that is, ∑ n i=1 w (k) i = ∑ n i=1 w i holds for all k.Instead of the FEFI, we can perform a general FHDI with M(≥ 2).If the imputation method is chosen to be "FHDI" and an imputation size M is given, then M donors are assigned to each recipients.If the number of donors for a recipient is smaller than M, all donors are selected and assigned the FEFI fractional weights.
Note that in the recipient with ID=3 (see 'FEFI$fimp.data[1:20,]' results shown above), there are six donors for FEFI but there are five donors (M = 5) for FHDI (see 'FHDI$fimp.data[1:14,]' results shown below).Five donors are randomly selected among all possible six donors with the probability proportional to the FEFI fractional weights.This indicates that we have additional randomness due to donor selection in the FHDI method.As shown in 'FHDI$imp.mean'results below, the FHDI mean estimates (standard errors) are approximately 0.90(0.129),1.87(0.121),1.82(0.137),and −0.04(0.131),respectively.Compared to the FEFI estimates, both point and variance estimates are similar to each other.This indicates that the FHDI estimator well approximates the FEFI estimator with smaller size of the imputed data.The results (which can vary slightly between operating systems) are presented below: > FHDI = FHDI_Driver(daty, s_op_imputation="FHDI", M=5, i_op_variance=1, k=3  It should be noted that the automatically generated "datz" can be replaced with a user-defined one.If the imputation cell matrix "datz" is separately obtained from FHDI_CellMake() or provided by the user, it needs to be specified as an option of the function FHDI_Driver().An example code is given below: > FEFI=FHDI_Driver(daty,datz,s_op_imputation="FEFI",i_op_variance=1,k=3) If survey variables are all categorical, the original data "daty" can be directly used for "datz."In the case of mixed types including continuous and/or ordered and unordered categorical data, we need two steps to obtain the imputation cell matrix: (i) discretization procedure for the continuous parts, and (ii) combining procedure for the converted data and the unordered categorical data.If an error message is presented due to insufficient of the donors from the function FHDI_CellMake(), then the cell collapsing procedure has to be engaged manually for the categorical part.We illustrate an example in Appendix when and how we manually merge categories in practice.

Regression analysis
We now consider a regression analysis using the imputed data.The imputed data can be treated as complete data with assigned fractional weights.Thus, the regression coefficient estimates of y 1 given y 2 can be directly obtained using the lm() function.Compared to using only observed samples, the fractional weights are given as input information.The estimates are also obtained using a classical weighted regression estimator presented in Section 2.2.The R codes for obtaining the regression coefficient estimates for the three estimators are given below: > reg.naive = lm(y1 ~y2, data = as.data.frame(daty))> reg.naive$coeff (Intercept) y2 -0.07425917 0.58798028 > summary(reg.naive)$coeff[,2](Intercept) y2 0.3050262 0.1424451 > i.daty = as.data.frame(FEFI$fimp.data)> reg.fefi = lm(y1 ~y2, data = i.daty, weights = FWT) > reg.fefi$coeff (Intercept) y2 0.03465671 0.46615949 > i.daty2 = as.data.frame(FHDI$fimp.data)> reg.fhdi = lm(y1 ~y2, data = i.daty2, weights = FWT) > reg.fhdi$coeff (Intercept) y2 0.0227328 0.4721299 Note that if we directly use lm() on the imputed data, the standard errors are 0.103 and 0.048 for the FEFI estimator and 0.111 and 0.052 for the FHDI estimator, respectively.However, the standard errors using the replication method are nearly 0.251 and 0.094 for both the FEFI estimator and FHDI estimator.Because the variances coming from imputation are not captured with a classical variance estimator of the regression estimator, variance estimation should be conducted using the replication variance estimator formula in (10).

Conclusion
FHDI is a useful tool for handling item nonresponse.Since FHDI employs a nonparametric estimation of the joint distribution and uses observed values as imputed values, it can be widely accepted in many research and incomplete data analysis.This paper documents the R package FHDI to enable R users to perform fractional hot deck imputation as well as fully efficient fractional imputation.
The current version of the package FHDI has some limitations.First, the functions within the package are not always applicable for all types of incomplete data.The current imputation algorithms cannot be applied to fill in missing values when there is no fully observed units over all variables.Although the users may assume conditional independence to apply our imputation algorithms, the imputation on the basis of untestable conditional independence assumption may break the original data structure.Second, the unordered categorical data should be handled manually for the insufficient donor cases before the users use FHDI_Driver().However, overcoming this limitation is identical to coming up with a way to implement cell collapsing with no regard to the rationality of categorization.Also, jackknife variance estimation may be not appropriate or efficient for larger or complicated incomplete data.Algorithm-oriented parallel computing methods and substantial issues including variable types and variance estimation options will be targeted in the future update.SM, 32:25-36, 2006. [p140] The R Journal Vol.10/1, July 2018 ISSN 2073-4859 in the FHDI_CellMake() may have the opposite political positions.Note that even if the size of initial categories is given as k = 3, the dimension of variables specified as the unordered categorical type is kept to preserve their original sizes.
The R Journal Vol.10/1, July 2018 ISSN 2073-4859 Bibliography H. Y. Chen.Compatibility of conditionally specified models.Statistics and Probability Letters, 80:670-677, 2010.[p140] G. B. Durrant and C. Skinner.Using missing data methods to correct for measurement error in a distribution function.
we see missing values in all four variables; realized response rates are 0.58, 0.66, 0.82, and 0.89, respectively; and sample means for complete cases are 0.98, 1.93, 1.80, and −0.01, respectively.

Table 2 :
Table2presents the standard errors of the three mean estimators.Here, the Naive estimator is just a simple mean estimator computed using only observed values.Since the partially observed values are used in the mean estimation, the two estimators obtained using fractional hot deck imputation produce smaller standard errors compared to the Naive estimator.Standard errors of three mean estimators.

Table 3 :
Regression coefficient estimates with standard errors.(S.E.: standard error.)Table3presentsthe regression coefficient estimates with standard errors for the three estimators.Point estimates of the FEFI and FHDI estimators are much closer to the true values compared to the values of the Naive estimator.Also, two fractional imputation estimators have smaller standard errors than those of the naive estimator.All R codes to obtain these results are given below: