Hello everyone,
Array

I am struggling with this problem, I am running an analysis in Stata, with longitudinal database with two time points of observations, which means that currently I have two observations for each individual. Now the data base is in long format and I need to go from long to wide, by -reshape command.

My command is:

reshape wide ptsd, i (record_id) j (cohort)

-ptsd: is my outcome variable
-record_id: is my unique identifier
-cohort: identifies whether the data is from 6 months==1 or 12 months==2 of follow up.

After running I got the r (9) message, what that means is "There are variables other than a, b, record_id, cohort in your data. They must be constant within record_id because that is the only way they can fit into wide data without loss of information"

The variable or variables listed above are not constant within record_id. Perhaps the values are in error. Type reshape error for a list fo the problem observations.


Either that, or the values vary because they should vary, in which case you must either add the variables to the list of xij variables, or drop them.

Comments and thoughts:
1. I have a long list of variables (more than 100) that theoretically should be included on the code, would be able Stata to handle it?
2. What can I do at this point?
3. I wont be able to show you guys the output because of the rules at my center regarding protected data of patients. But even I can show you a part of the output, even when is a screenshot (sorry, I know is not the standard here, but it was the best I could do).

Please, I would appreciate any help, I need to fix it out, and moving forward with this analysis as soon as I can.

Cheers,

C