Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

7
  • Hi Nick, Thanks so much for your speedy help. I do still have a problem however, which I think is due to having duplicated IDs in the controlb1-b4 columns, and differing indexdates for these. (Some controls were matched to multiple cases, and the indexdate is decided based on the case.) Is there any way around this? Thanks. Error: variable id does not uniquely identify the observations Your data are currently wide. You are performing a reshape long. You specified i (index_date) and j(which). In the current wide form, variable index_date should uniquely identify the observations.
    – Emma
    Commented Jul 5 at 14:00
  • You need to revise your question so that you show a dataset that is complicated enough to show the problem and compact enough to show here.
    – Nick Cox
    Commented Jul 5 at 14:32
  • That said, I fear that you're asking for a data layout that won't work for your data. I would post a version of this on Statalist where you're much more likely to get attention from medical statisticians.
    – Nick Cox
    Commented Jul 5 at 14:44
  • Sure I've edited my question to reflect this. But I think you might be right, I have also been thinking I may need to look into a different data layout!
    – Emma
    Commented Jul 5 at 14:46
  • I'm unfortunately unable to register for statalist as my version of stata is based on a server without internet access, and so cannot get the authkey to register or contact them!
    – Emma
    Commented Jul 5 at 15:01