Good morning, I have been working on a data bank containing the following dichotomous variables:
a1 to a18;
b1 to b4;
c1 to c6;
d1 to d3;
f1 to f11
A example:
f11 | Freq. Percent Cum.
------------+-----------------------------------
0 | 21 42.00 42.00
1 | 29 58.00 100.00
------------+-----------------------------------
Total | 50 100.00
a1 | Freq. Percent Cum.
------------+-----------------------------------
0 | 20 40.00 40.00
1 | 30 60.00 100.00
------------+-----------------------------------
Total | 50 100.00
b1 | Freq. Percent Cum.
------------+-----------------------------------
0 | 13 26.00 26.00
1 | 37 74.00 100.00
------------+-----------------------------------
Total | 50 100.00
How can I generating a variable that gives me the average score of postive responses of those variables, like:
newvar = (58+60+74)/3?
gen safety= 0
replace safety= 1 if newvar == 1
Many thanks in advance!
William
a1 to a18;
b1 to b4;
c1 to c6;
d1 to d3;
f1 to f11
A example:
f11 | Freq. Percent Cum.
------------+-----------------------------------
0 | 21 42.00 42.00
1 | 29 58.00 100.00
------------+-----------------------------------
Total | 50 100.00
a1 | Freq. Percent Cum.
------------+-----------------------------------
0 | 20 40.00 40.00
1 | 30 60.00 100.00
------------+-----------------------------------
Total | 50 100.00
b1 | Freq. Percent Cum.
------------+-----------------------------------
0 | 13 26.00 26.00
1 | 37 74.00 100.00
------------+-----------------------------------
Total | 50 100.00
How can I generating a variable that gives me the average score of postive responses of those variables, like:
newvar = (58+60+74)/3?
gen safety= 0
replace safety= 1 if newvar == 1
Many thanks in advance!
William
Comment