Learn R Programming

imputeLCMD (version 2.0)

impute.wrapper.MLE: MLE-based imputation of missing data.

Description

Is is a wrapper function that performs the imputation of missing data using EM algorithm. The wrapper is built around the imp.norm function from the norm package.

Usage

impute.wrapper.MLE(dataSet.mvs)

Arguments

dataSet.mvs

A data matrix containing left-censored missing data.

Value

A complete expression data matrix with missing values imputed.

References

See package norm.

See Also

impute.wrapper.KNN, impute.wrapper.SVD

Examples

Run this code
# NOT RUN {
# generate expression data matrix
exprsDataObj = generate.ExpressionData(nSamples1 = 6, nSamples2 = 6,
                          meanSamples = 0, sdSamples = 0.2,
                          nFeatures = 1000, nFeaturesUp = 50, nFeaturesDown = 50,
                          meanDynRange = 20, sdDynRange = 1,
                          meanDiffAbund = 1, sdDiffAbund = 0.2)
exprsData = exprsDataObj[[1]]
  
# insert 15% missing data with 100% missing not at random

m.THR = quantile(exprsData, probs = 0.15)
sd.THR = 0.1
MNAR.rate = 100
exprsData.MD.obj = insertMVs(exprsData,m.THR,sd.THR,MNAR.rate)
exprsData.MD = exprsData.MD.obj[[2]]

# perform missing data imputation
  
exprsData.imputed = impute.wrapper.MLE(exprsData.MD)

# }
# NOT RUN {
hist(exprsData[,1])
hist(exprsData.MD[,1])
hist(exprsData.imputed[,1])
# }
# NOT RUN {
## The function is currently defined as
function (dataSet.mvs) 
{
    s <- prelim.norm(dataSet.mvs)
    thetahat <- em.norm(s, showits = FALSE)
    rngseed(1234567)
    dataSet.imputed <- imp.norm(s, thetahat, dataSet.mvs)
    return(dataSet.imputed)
  }
# }

Run the code above in your browser using DataLab