proba_mcar_tab: Estimation of a matrix of probabilities that missing values...

Description Usage Arguments Value Author(s) See Also Examples

Description

This function returns a matrix of probabilities that each missing value is MCAR from specified confidence intervals.

Usage

1
prob.mcar.tab(tab.l,tab.u,res)

Arguments

tab.l

A numeric matrix of lower bounds for missing values.

tab.u

A numeric matrix of upper bounds for missing values.

res

An output list resulting from the function estim.mix.

Value

A numeric matrix of estimated probabilities to be MCAR for missing values in the confidence intervals defined thanks to tab.l and tab.u.

Author(s)

Quentin Giai Gianetto <quentin2g@yahoo.fr>

See Also

estim.mix

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#Simulating data
res.sim=sim.data(nb.pept=2000,nb.miss=600,pi.mcar=0.2,para=0.5,nb.cond=2,nb.repbio=3,
nb.sample=5,m.c=25,sd.c=2,sd.rb=0.5,sd.r=0.2);

#Imputation of missing values with the slsa algorithm
dat.slsa=impute.slsa(tab=res.sim$dat.obs,conditions=res.sim$condition,repbio=res.sim$repbio);

#Estimation of the mixture model
res=estim.mix(tab=res.sim$dat.obs, tab.imp=dat.slsa, conditions=res.sim$condition);

#Computing probabilities to be MCAR
born=estim.bound(tab=res.sim$dat.obs,conditions=res.sim$condition);
proba=prob.mcar.tab(born$tab.lower,born$tab.upper,res);

#Histogram of probabilities to be MCAR associated to generated MCAR values
hist(proba[data$list.MCAR[,1],1],

freq=FALSE,main="Estimated probabilities to be MCAR for known MCAR values",xlab="",col=2);

#Histogram of probabilities to be MCAR associated to generated MNAR values
hist(proba[which(is.na(data$dat.obs[,1]))[!which(is.na(data$dat.obs[,1]))%in%data$list.MCAR[,1]],1],

freq=FALSE,main="Estimated probabilities to be MCAR for known MNAR values",xlab="",col=4);

imp4p documentation built on June 1, 2017, 5:02 p.m.

Search within the imp4p package
Search all R packages, documentation and source code