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
Related Posts with Reshape Error
Adjusting for seasonality using sax12Dear Stata users, I'm working on a panel dataset, which two credit variables (basically two distinc…
Help with merging variablesHello, I'm trying to merge two datasets that have basically the same observations but with differen…
Get Post & Pre treatment yearsHello everyone, I am trying to make an event study graph. For this I need to pool my post and pre t…
Asdoc implementation problem Hello, i am relativ inexperienced in Stata and I wanted to incorporate my regression output into Wo…
mixed models, continuous variablesHi! I'm new on Stata and I apologize in advance for trivial questions I'm working on a mixed models…
Subscribe to:
Post Comments (Atom)
0 Response to Reshape Error
Post a Comment