Hi all.
I am using Health and Retirement Study data which is a survey done every 2 years. In one of the waves, the answer to a series of questions (5-question satisfaction with life scale) uses a 6 point likert scale. All the other waves use a 7 point scale. My goal is to create new variables for the 5 likert scale questions where the scale is converted from 6 to 7. The klb003a/b/c/d/e are my original variables and the ones with the "_new" ending is the ones I am creating.
generate klb003a_new=(6)*(klb003a-1)/(5)+1
generate klb003b_new=(6)*(klb003b-1)/(5)+1
generate klb003c_new=(6)*(klb003c-1)/(5)+1
generate klb003d_new=(6)*(klb003d-1)/(5)+1
generate klb003e_new=(6)*(klb003e-1)/(5)+1
After this step, I want to create another variable summing all 5 questions into one single variable. I did it like this:
egen lifesat06total_= rowtotal (klb003a_new klb003b_new klb003c_new klb003d_new klb003e_new)
replace lifesat06total_=. if klb003a==. | klb003b==. | klb003c==. | klb003d==. | klb003e==.
When I do "tab lifesat06total_" I do get a frequency table with all the cases and assigned values rangin from 5 to 35 including integers and noninteger numbers due to the conversion.
But when I do "count if lifesat06total_==33.8" I get this:
count if lifesat06total_==33.8
0
Why is this happening? I know there are observation where the value is equal to 33.8. So getting 0 is wrong. I need to fix this because my final goal is to create a categorical variable (6 categories for life satisfaction) using the lifesat06total_.
Thank you in advance.
I am using Health and Retirement Study data which is a survey done every 2 years. In one of the waves, the answer to a series of questions (5-question satisfaction with life scale) uses a 6 point likert scale. All the other waves use a 7 point scale. My goal is to create new variables for the 5 likert scale questions where the scale is converted from 6 to 7. The klb003a/b/c/d/e are my original variables and the ones with the "_new" ending is the ones I am creating.
generate klb003a_new=(6)*(klb003a-1)/(5)+1
generate klb003b_new=(6)*(klb003b-1)/(5)+1
generate klb003c_new=(6)*(klb003c-1)/(5)+1
generate klb003d_new=(6)*(klb003d-1)/(5)+1
generate klb003e_new=(6)*(klb003e-1)/(5)+1
After this step, I want to create another variable summing all 5 questions into one single variable. I did it like this:
egen lifesat06total_= rowtotal (klb003a_new klb003b_new klb003c_new klb003d_new klb003e_new)
replace lifesat06total_=. if klb003a==. | klb003b==. | klb003c==. | klb003d==. | klb003e==.
When I do "tab lifesat06total_" I do get a frequency table with all the cases and assigned values rangin from 5 to 35 including integers and noninteger numbers due to the conversion.
But when I do "count if lifesat06total_==33.8" I get this:
count if lifesat06total_==33.8
0
Why is this happening? I know there are observation where the value is equal to 33.8. So getting 0 is wrong. I need to fix this because my final goal is to create a categorical variable (6 categories for life satisfaction) using the lifesat06total_.
Thank you in advance.

Comment