Discussion:
Combining multiple questions into one variable
(too old to reply)
Vamsi Krishna
2022-11-08 11:47:28 UTC
Permalink
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
Rich Ulrich
2022-11-09 06:33:19 UTC
Permalink
On Tue, 8 Nov 2022 03:47:28 -0800 (PST), Vamsi Krishna
Post by Vamsi Krishna
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
Loading...