Announcement

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

  • How to plot the number of hospitalizations

    I have a dataset containing details of all inpatients in the last ten years, such as name, admission time and discharge time and so on. I now want to plot the daily hospital admissions curve for the last ten years based on this dataset, I don't know which command series of stata should be used, what is the nature of my dataset? Time series? Panel?

  • #2
    A panel implies that you consider each individual separately, which graphically will not be feasible if you have a large number of patients over a long time period. If your goal is to show the trend in hospitalizations, you need to aggregate the data in some way (e.g., total number of hospitalizations or log of total number of hospitalizations) and graph the time-series.

    Code:
    webuse grunfeld, clear
    collapse (sum) mvalue, by(year)
    tsset year
    tsline mvalue, scheme(s1mono) xtitle("")
    Click image for larger version

Name:	Graph.png
Views:	1
Size:	25.2 KB
ID:	1643999

    Last edited by Andrew Musau; 07 Jan 2022, 07:46.

    Comment

    Working...
    X