Imputing missing values randomly from uniform or normal distributions
Filling missing values with a random number is often preferable to filling with a constant, such as the mean or median. If the distribution of a variable matches or nearly matches a known distribution, such as a uniform or normal distribution, one can use the functions in Modeler to generate random numbers, given the parameters needed to generate the random numbers.
In this recipe we will impute missing values with random distributions: uniform and normal.
Getting ready
This recipe uses the following files:
- Datafile:
cup98lrn_variable cleaning random impute recipe.sav
- Stream file:
Recipe - impute random with known random distribution.str
How to do it...
To impute missing values randomly with uniform or normal distributions:
- Open the
Recipe - impute random with known random distribution.str
file by navigating to File | Open Stream. - Make sure the datafile points to the correct path to the file
cup98lrn_variable clean
ing random impute...