Description Usage Arguments Details Value See Also Examples
MAAR_mechanism
takes a matrix and deletes some of the entries
using a missing always at random mechanism that allows the missingness
in one variable to depend on a partially observed variable.
1 2 | MAAR_mechanism_noindep(samples, miss.coef, miss.nvar, miss.var = NULL,
prob.coef, seed = NULL)
|
samples |
A numeric matrix with no missing values. |
miss.nvar |
An integer specifying the number of variables that will have missing values. miss.nvar < ncol(samples). |
miss.var |
An integer vector of length equal to miss.nvar specifying which variables will have missing values. If left blank a random sample will be taken from the columns of samples will be taken. |
prob.coef |
A numeric matrix that represents the regression coefficients that will be used to generate the missing data pattern. The nrow(miss.coef) == miss.var and ncol(miss.coef) == ncol(samples). |
seed |
A numeric value used to set a seed, leave blank for NULL. |
miss.coef: |
A numeric value or a vector of length equal to miss.nvar. The missingness coefficient(s) determines the proportion of missing values for each variable. |
self.dep |
A logical values indicating if the probability of variable j missing depends on the values that variable j took. |
MAAR_mechanism
is part of the data generating functions used when
conducting simulation studies involving missing data.The probability that
a variable is missing is only a function of the observed variables.
For example, assume we have 3 variables, Y_1 and Y_2 can have
missing values and Y_3 is always fully observed. Let R_1 and
R_2 be the response indicators for Y_1 and Y_2 respectively
Then the probability that the i-th variable is missing is
p(R_{i,1}=1|Y_{i,\cdot}) = \text{logit}^{-1}(α_1+β_1Y_{i,3}).
p(R_{i,2}=1|Y_{i,\cdot},R_{i,1}) = \text{logit}^{-1}(α_2+ γ_1R_{i,1}Y_{i,1}+β_2Y_{i,3}).
The vector β is specified using the prob.coef
parameter,
and α is selected to ensure that the proportion of missing values
in each variable is equal to the miss.coef
parameter.
samples.obs A data matrix of dimensions equal to samples with some missing values.
Other data generating functions: MAAR_mechanism
,
MANAR_mechanism
,
logistic_prob
, sample_mvn
1 2 3 4 5 6 7 | # Generate 100 iid samples from a MVN with correlation equal to 0.3
samples.mvn <- sample_mvn(5, 0.3, 100)
# Take the Gaussian data and and delete some values from the fourth row.
obs.mvn <- MAAR_mechanism_noindep(samples = samples.mvn, miss.coef = 0.2,
miss.nvar = 1, miss.var = 1,
prob.coef = matrix(c( - 1, 0.5, 0.7,
- 0.2), 1, 4))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.