Hi all, hope someone can help! Really struggling.
I am analysing a dataset including medications for the treatment of Raynaud's phenemenon.
I have three variables (Medication 1, Medication 2, Medication 3).
That is, some patients maybe on 0 to three medications.
I am trying to create a variable that will allow me have 'Total medications'.
I have tried reshaping the data (long). However, this messes up the rest of the data (all the patients have a unique study ID) and this works. However, for example, I now have three times the total number of the variable 'Age' (presumably duplicated).
Any help gratefully accepted.
Mike
I am analysing a dataset including medications for the treatment of Raynaud's phenemenon.
I have three variables (Medication 1, Medication 2, Medication 3).
That is, some patients maybe on 0 to three medications.
I am trying to create a variable that will allow me have 'Total medications'.
I have tried reshaping the data (long). However, this messes up the rest of the data (all the patients have a unique study ID) and this works. However, for example, I now have three times the total number of the variable 'Age' (presumably duplicated).
Any help gratefully accepted.
Mike
Comment