Hello, I am analyzing a hospital dataset which provides demographic, diagnostic, and procedural data for each discharged patient.
The patients are divided into two groups based on whether they have a specific diagnosis (yes they had this diagnosis, no they did not).
There are 15 procedure code variables for each patient (but not all patients had 15 procedures). These are labeled cpt1, cpt2, cpt3, etc. I would like to create a table with the top 10 cpt codes (out of all cpt codes) for each group, but do not know how to look at each variable simultaneously. For example, I don't want to just know what is the most common cpt1 code, but rather the most common code out of all CPT variables.
I did try to reshape the data to long form using the code below, but the counts were extremely low per each cpt code and I am not sure it was accurate. Is there another way to approach this?
reshape long cpt, i(patientid) j(proced_num)
tab cpt
I am using Stata/SE 14.2.
Related Posts with Counts for multiple variables
Accounting for imperfect diagnostic test results on data from an entire populationHello, I have data from a seroprevalence study which collected samples from an entire population (a…
Multiple twoway lines in same graph region.Dear All, I have a 50 US state panel by day. A policy of interest is implemented in the different s…
Marginal effects with a heteroskedastic tobitDear all, I am struggling to compute the average marginal effects using a Tobit allowing for hetero…
Test for differences between Cumulative Incidence Function curvesHello, I have a two-arm trial where an event can either occur or does not occur because of a compet…
New Stata module to estimate permanent-transitory state space modelscdecompose: Stata module to estimate permanent-transitory state space models is now available in SSC…
Subscribe to:
Post Comments (Atom)
0 Response to Counts for multiple variables
Post a Comment