Question 1:
I have five string variables:
Path1 Path2 Path3 Path4 Path5. These Path variables are in wide format and contain the same categories which are medicine A, medicine B, medicine C or medicine D. I have 1000 subjects in my dataset. I want to make a new variable that is a composite of patients walking three paths or more i.e. Path≥3 and I want to keep the Path1 and Path2 variable.
How do I do this? Do I need to reshape my data in long format? If so, do I use the "j' as I see that this is used for many things of this nature.
Question 2:
How do I make a Path1 and Path2 variable in long format as I have to test for associations between Path1 with Y, Path2 with Y, Path≥3 with Y.
Ps. one patient can have observations in all five Path variables, some in three, some in one.
I am not familiar with the STATA codes. Can anybody help me or provide me with an example so I can adjust it accordingly to my data.I do not have extensive STATA programming knowledge. I am a beginner. Please use easy STATA language. My excuses. Thanks in advance.
I have five string variables:
Path1 Path2 Path3 Path4 Path5. These Path variables are in wide format and contain the same categories which are medicine A, medicine B, medicine C or medicine D. I have 1000 subjects in my dataset. I want to make a new variable that is a composite of patients walking three paths or more i.e. Path≥3 and I want to keep the Path1 and Path2 variable.
How do I do this? Do I need to reshape my data in long format? If so, do I use the "j' as I see that this is used for many things of this nature.
Question 2:
How do I make a Path1 and Path2 variable in long format as I have to test for associations between Path1 with Y, Path2 with Y, Path≥3 with Y.
Ps. one patient can have observations in all five Path variables, some in three, some in one.
I am not familiar with the STATA codes. Can anybody help me or provide me with an example so I can adjust it accordingly to my data.I do not have extensive STATA programming knowledge. I am a beginner. Please use easy STATA language. My excuses. Thanks in advance.
Comment