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
Generating new variable using hospital codes of multiple diagnosisHello, I have a dataset with patient ids. Each patient is in the dataset multiple times and have mu…
Problems Stating a simultaneous GMM 3sls Model using MoptimzeApologies fore the long post that would follow, but I am having error estimating cluster robust 3SLS…
Problem with highly skewed independent variables and many zerosDear members, I have a binary dependent variable and want to estimate either a logistic regression …
Excluding samplesHi all, I have a problem with bootstrap. In particular I have a variable containing a lot of zeros.…
computing skewness and kurtosis of a binary variable with two mutually exclusive optionsHi there, This is my first post on this forum. I am rather confused at a question I have been assign…
Subscribe to:
Post Comments (Atom)
0 Response to Reshape Error
Post a Comment