Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Calculating the proportion in hospital at any time

    Hi, i would like to calculate the proportion in hospital at any particularly time over-follow-up for my sample. I have dates of entry and exit from hospital and potential multiple dates per person. At the moment, the data are in wide format:

    ID, date_entry1, date_exit1, date_entry2, date_exit2 etc.

    with date_entryN or date_exitN missing for those with N-1 admissions

    I would like to calculate the porportion in hospital at any one day, for each day in the observation period - can anybody please advise?

    Thanks,

    Matt

  • #2
    Please repost and use the -dataex- command to give an actual example of your data. If you are running version 15.1 or a fully updated version 14.2, -dataex- is already part of your official Stata installation. If not, run -ssc install dataex- to get it. Either way, run -help dataex- to read the simple instructions for using it. -dataex- will save you time; it is easier and quicker than typing out tables. It includes complete information about aspects of the data that are often critical to answering your question but cannot be seen from tabular displays or screenshots. It also makes it possible for those who want to help you to create a faithful representation of your example to try out their code, which in turn makes it more likely that their answer will actually work in your data.

    When asking for help with code, always show example data. When showing example data, always use -dataex-.

    Also, it is the norm in this community to use our real given and surnames as our username, to promote collegiality and professionalism. Unfortunately, you cannot correct this by editing your user profile. So please click on "Contact Us" in the lower right corner of this page, and ask the system administrator to fix your username.

    Comment

    Working...
    X