Hi,
So I have a categorical variable for baseline and discharge diagnoses. I have a secondary outcome of seeing which people (from which had a non-affective disorder at baseline) then shifted to affective disorders at discharge.
My categorical variable for baseline and discharge include the following:
0 - Non psychotic
1 - Non-affective
2 - Affective
I want to create an outcome variable that measures this 'shift' but am unsure of how this would work. I know I have to recode so I am only using the people who have non-affective disorders at baseline but how would I create a main outcome variable to measure this. I have been using the follow command in stata:
gen shift_affect = nonaffect_baseline == affect_discharge (*note non_affect baseline is only those with a non-affective disorder at baseline and affect_discharge is only those with affective disorders at baseline)
However when I used this command, the numbers do not add up. If I do a simple tab of both my baseline and discharge original variables I am able to see how many people shifted from non-affective to affective and those numbers to not match the tabbed numbers for this new variable.
Any help on how to create this outcome variable would be helpful.
Kind regards,
So I have a categorical variable for baseline and discharge diagnoses. I have a secondary outcome of seeing which people (from which had a non-affective disorder at baseline) then shifted to affective disorders at discharge.
My categorical variable for baseline and discharge include the following:
0 - Non psychotic
1 - Non-affective
2 - Affective
I want to create an outcome variable that measures this 'shift' but am unsure of how this would work. I know I have to recode so I am only using the people who have non-affective disorders at baseline but how would I create a main outcome variable to measure this. I have been using the follow command in stata:
gen shift_affect = nonaffect_baseline == affect_discharge (*note non_affect baseline is only those with a non-affective disorder at baseline and affect_discharge is only those with affective disorders at baseline)
However when I used this command, the numbers do not add up. If I do a simple tab of both my baseline and discharge original variables I am able to see how many people shifted from non-affective to affective and those numbers to not match the tabbed numbers for this new variable.
Any help on how to create this outcome variable would be helpful.
Kind regards,
Comment