title: Multiple Imputation (mice) and "Conditional Missings" in R
body: <p>I am using <code>mice</code> in <code>R</code> to impute random missing data. I ran into a problem when attempting to account for conditional or structured <code>NAs</code> in a dataset. </p>
  
  <p>A simple dataset to illustrate the problem:</p>
  
  <pre><code>TestData &lt;- data.frame(Condition= c(1,1,1,1,2,NA,2,2), 
  Dependent1=c(1,NA,2,3,NA,NA,NA,NA),
  Dependent2=c(1,12,44,1,NA,NA,NA,NA),
  Dependent3=c(NA,2,3,5,NA,NA,NA,NA), 
  UnaffiliatedQ=c(1,NA,3,2,27,NA,32,35))
  
  TestData$Condition &lt;- factor(TestData$Condition,
                           levels = c(1,2),
                           labels = c("Yes","No"))
  </code></pre>
  
  <p>In this example, the variable <code>Condition</code> is a gatekeeper question which determines whether a respondent needs to fill the next three questions, <code>Dependent#</code>. If a respondent answers with "No" and he/she does not see the next three questions, then they are marked as <code>NA</code>s - though not technically missing. </p>
  
  <p>What can I do in this type of situation? If I Impute the <code>NA</code> value in the <code>Condition</code> variable, along with those in <code>Dependent1</code>, <code>Dependent2</code>, and <code>Dependent3</code>, how would I ensure that I don't end up with values in <code>Dependent#</code> that don't make sense? </p>
  
  <p>I've thought of possible solutions, but none that I think would be valid or a good idea,e.g., creating a structured missing value like <code>-999</code> subsetting the dataframe based on conditional answers. </p>
  
  <p>In reading through the documentation and paper of <code>mice</code>s authors  I don't see any arguments in <code>mice</code> for this type of situation. The other alternative is that I've simply been running down the rabbit hole of multiple imputation and this is not the correct use of it.</p>