Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The most obvious way seems to use two vectors:</p> <ul> <li>Vector 1: a data vector, where all missing values are represented using <code>NA</code>. For example, <code>c(2, 50, NA, NA)</code></li> <li>Vector 2: a vector of factors, indicating the type of data. For example, <code>factor(c(1, 1, -1, -7))</code> where factor <code>1</code> indicates the a correctly answered question.</li> </ul> <p>Having this structure would give you a create deal of flexibility, since all the standard <code>na.rm</code> arguments still work with your data vector, but you can use more complex concepts with the factor vector.</p> <p><strong>Update following questions from @gsk3</strong></p> <ol> <li><em>Data storage will dramatically increase:</em> The data storage will double. However, if doubling the size causes real problem it may be worth thinking about other strategies.</li> <li><em>Programs don't automatically deal with it.</em> That's a strange comment. Some functions by default handle NAs in a sensible way. However, you want to treat the NAs differently so that implies that you will have to do something bespoke. If you want to just analyse data where the NA's are "Question not asked", then just use a data frame subset. </li> <li><em>now you have to manipulate two vectors together every time you want to conceptually manipulate a variable</em> I suppose I envisaged a data frame of the two vectors. I would subset the data frame based on the second vector. </li> <li><em>There's no standard implementation, so my solution might differ from someone else's.</em> True. However, if an off the shelf package doesn't meet your needs, then (almost) by definition you want to do something different.</li> </ol> <hr> <p>I should state that I have never analysed survey data (although I have analysed large biological data sets). My answers above appear quite defensive, but that's not my intention. I think your question is a good one, and I'm interested in other responses.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload