• Combining multiple questions into one variable

    From Vamsi Krishna@21:1/5 to All on Tue Nov 8 03:47:28 2022
    Hi All,

    I am working on a dataset which has the following variables.

    Are you covered under a health insurance scheme (Yes/No).
    If yes, then
    Are you covered under scheme A?(Yes/No)
    Are you covered under scheme B?(Yes/No)
    Are you covered under scheme C?(Yes/No)
    Are you covered under scheme D?(Yes/No)
    Are you covered under scheme E?(Yes/No)
    Are you covered under scheme F?(Yes/No)

    So now I need to combine all the questions above from A to F into one new dichotomous variable considering all who said yes. So please help me on how to do it.

    Thank you
    Vamsi Krishna

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Rich Ulrich@21:1/5 to [email protected] on Wed Nov 9 01:33:19 2022
    On Tue, 8 Nov 2022 03:47:28 -0800 (PST), Vamsi Krishna
    <[email protected]> wrote:

    Hi All,

    I am working on a dataset which has the following variables.

    Are you covered under a health insurance scheme (Yes/No).
    If yes, then
    Are you covered under scheme A?(Yes/No)
    Are you covered under scheme B?(Yes/No)
    Are you covered under scheme C?(Yes/No)
    Are you covered under scheme D?(Yes/No)
    Are you covered under scheme E?(Yes/No)
    Are you covered under scheme F?(Yes/No)

    So now I need to combine all the questions above from A to F into one new dichotomous variable considering all who said yes. So please help me on how to do it.


    A "dichotomous variable" has two values.

    Sometimes those are Yes/No for their values, like Q_a through Q_f;
    probably coded 0/1 or 1/2, with Yes and No as Value Labels.

    What are the value labels that you want for your proposed
    "combined" variable? If you figure that out, the computation
    will probably follow.

    I can imagine Combined = Missing : if Not covered in preliminary Q.
    and then Combined
    = "1" if only one of the schemes;
    = "2" if 2 or more schemes.

    ELSE: If you want some combined coding of up to 6 dichotomies,
    giving 64 values to encode all the possibilities, that is probably
    a silly thing to do. Most of the categories will be empty. Do some
    two-way tabulations, and a couple of 3-way (where the N is large)
    and figure out what categories are worth keeping separate.

    For instance, two new categories might be "A only" and "A with
    one or more other schemes".


    A brute-force method to get 64 values out of 6 variables, A-F,
    coded 0/1, can follow the pattern :

    Compute Combined= F + 10*(E + 10*(D + 10*(C + 10*(B + 10*(A) ) ) ) ).
    COMMENT looks like "100110" for "1" in A,D,E -- readable result.
    COMMENT If each 10* is replaced by 2*, codes are 0-63, in the same
    COMMENT order.
    COMMENT If A..F are not 0/1 dichotomies, they can be replaced
    COMMENT by logical expressions like (A eq "Yes")

    --
    Rich Ulrich

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)