Learn R Programming

compositions (version 1.01-1)

simulatemissings: Artifical simulation of various kinds of missings

Description

This is a simulation mechanism to check the missing technique. It just generates additional missings of the various types in a given dataset.

Usage

simulateMissings(x,detectionlimit=NULL,
     knownlimit=FALSE,MARprob=0.0,MNARprob=0.0,
     mnarity=0.5,SZprob=0.0)

Arguments

x
a dataset that should get the missings
detectionlimit
the detection limit described in clo, to impose an artificial detection limit
knownlimit
a boolean indicating wether the actual detection limit is still known in the dataset.
MARprob
the probability of occurence of 'Missings At Random' values
MNARprob
the probability of occurrence of 'Missings Not At Random'. The tendency is that small values have a higher probability to be missed.
mnarity
a number between 0 and 1 giving the strength of the influence of the actual value in becoming a MNAR. 0 means a MAR like behavior and 1 means that it is just the smallest values that is lost
SZprob
the probability to obtain a structural zero. This is done at random like a MAR.

Value

  • A dataset like x but with some additional missings.

Details

Without any additional parameters no missings are generated. The procedure to generate MNAR affects all variables.

References

See compositions.missings for more details.

See Also

compositions.missings

Examples

Run this code
data(SimulatedAmounts)
x <- acomp(sa.lognormals)
xnew <- simulateMissings(x,detectionlimit=0.05,MAR=0.05,MNAR=0.05,SZ=0.05)
acomp(xnew)
plot(missingSummary(xnew))

Run the code above in your browser using DataLab