The HPIMPUTE Procedure

Obtaining the Statistics for Imputation

PROC HPIMPUTE first computes the imputation value and then imputes with that value. Some statistics (such as the mean, minimum, and maximum) are computed precisely. The pseudomedian, which is calculated if you specify METHOD=PMEDIAN in the IMPUTE statement, is an estimation of the median. The computation of the median requires sorting the entire data. To address this challenge, a binning-based method is used to estimate the pseudomedian.

For variable x, assume that the data set is {x Subscript i}, where i equals 1 comma 2 comma ellipsis comma n. Let m i n left-parenthesis x right-parenthesis equals min Underscript i element-of StartSet 1 period period n EndSet Endscripts left-brace x Subscript i Baseline right-brace, and let m a x left-parenthesis x right-parenthesis equals max Underscript i element-of StartSet 1 period period n EndSet Endscripts left-brace x Subscript i Baseline right-brace. The range of the variable is r a n g e left-parenthesis x right-parenthesis equals m a x left-parenthesis x right-parenthesis minus m i n left-parenthesis x right-parenthesis.

A simple bucket binning method is used to obtain the basic information. Let N be the number of buckets, ranging from m i n left-parenthesis x right-parenthesis to m a x left-parenthesis x right-parenthesis. For each bucket upper B Subscript i, i equals 1 comma 2 comma ellipsis comma upper N, PROC HPIMPUTE keeps following information:

  • c Subscript i: count of x in upper B Subscript i

  • m i n Subscript i: minimum value of x in upper B Subscript i

  • m a x Subscript i: maximum value of x in upper B Subscript i

For each bucket upper B Subscript i, the range upper R Subscript i is

upper R Subscript i Baseline equals StartLayout Enlarged left-brace 1st Row 1st Column left-bracket m i n left-parenthesis x right-parenthesis plus left-parenthesis i minus 1 right-parenthesis asterisk d comma m i n left-parenthesis x right-parenthesis plus i asterisk d right-parenthesis 2nd Column if i less-than upper N 2nd Row 1st Column left-bracket m i n left-parenthesis x right-parenthesis plus left-parenthesis i minus 1 right-parenthesis asterisk d comma m a x left-parenthesis x right-parenthesis right-bracket 2nd Column if i equals upper N EndLayout

where d equals StartFraction m a x left-parenthesis x right-parenthesis minus m i n left-parenthesis x right-parenthesis Over upper N EndFraction

To calculate the pseudomedian, PROC HPIMPUTE finds the smallest I, such that sigma-summation Underscript i equals 1 Overscript upper I Endscripts c Subscript i greater-than equals 0.5 asterisk m, where m is the number of nonmissing observations of x in the data set. Therefore, the pseudomedian value Q is

upper Q equals StartLayout Enlarged left-brace 1st Row 1st Column m i n Subscript upper I Baseline 2nd Column if sigma-summation Underscript i equals 1 Overscript upper I Endscripts c Subscript i Baseline greater-than 0.5 asterisk m 2nd Row 1st Column m a x Subscript upper I Baseline 2nd Column if sigma-summation Underscript i equals 1 Overscript upper I Endscripts c Subscript i Baseline equals 0.5 asterisk m EndLayout

N is set to 10,000 in PROC HPIMPUTE. Experiments show that the pseudomedian is a good estimate of the median and that the performance is satisfactory.

Last updated: March 06, 2023