Hello everyone,
I need help in generating a new variable based on an existing one. The existed variable is (Oral Impact on Daily Performance--OIDP) and the variable I would like to generate is (tooth decay related OIDP), both variables are continuous.
Now, I feel that I should explain OIDP to you. OIDP is a self- administrated questionnaire that include questions about the frequency and severity of oral impacts on eight daily performances: eating, speaking, cleaning teeth, sleeping, emotional stability, smiling, studying and socialising. For each of the eight daily performances assessed, the OIDP questionnaire provides a list of different oral problems that participants are likely to perceive as the main cause of a specific impact (e.g., toothache, sensitivity, decay, gum bleeding, large space between teeth, etc.).
The “tooth decay related OIDP” should be equal to “OIDP” if the perceived cause of the impact is related to tooth decay, that is, toothache, sensitivity or decay.
The command I used are to generate tooth decay related OIDP are as shown below:
gen Actv1_CSOIDP= Actv1_OIDP if Toothache1 | Sensitivity1 | Decay1==1
label variable Actv1_CSOIDP "tooth decay related OIDP if OIDP is associated with decay “toothache | decay| sensitivity"
Where:
Actv1_CSOIDP =tooth decay related OIDP in activity
Actv1_OIDP =OIDP scores in activity 1
Toothache1 | Sensitivity1 | Decay1==1 (1= yes)
This list of commands was used for each of the eight activities and everything was good. Until I wanted to generate a variable for the sum of (tooth decay related OIDP) for all 8 activities.
I used the following commands:
gen SUM_CS_OIDP= Actv1_CSOIDP + Actv2_CSOIDP + Actv3_CSOIDP + Actv4_CSOIDP + Actv5_CSOIDP + Actv6_CSOIDP + Actv7_CSOIDP + Actv8_CSOIDP
No error was shown here, but the total number of participants with (SUM_CS_OIDP) scores was only 9 when it should be over 100.
I do not know what went wrong, I know it's a long process and mistakes could happen along the wayand while generating the new variables but I truly hope someone can help me and point it out or give an advice.
Thanks a lot and Merry Christmas
0 Response to Problem with generating new variable-- Need help please
Post a Comment