Multi-year trend analysis using dataset from different years

Hi all

I am currently working on database called national inpatient sample which focused on hospital stay information. I want to analyze the trend of specific outcome i.e mortality from a certain disease, using datasets from different years. I was wondering is there any easy way or I will have to calculate the outcome separately for each dataset and look for the trend.

Thank you

Zafar

Can you provide some example data (and also what you are expecting your final results to look like)?

  AGE AGE_NEONATE AMONTH AWEEKEND  DIED DISCWT DISPUNIFORM  DQTR   DRG DRGVER DRG_NoPOA
 <dbl>       <dbl>  <dbl>    <dbl> <dbl>  <dbl>       <dbl> <dbl> <dbl>  <dbl>     <dbl>
1    49          NA      7        0     0   5.00           1     3   439     34       439
2    31          NA      7        1     0   5.00           1     3   775     34       775
3    70          NA      4        0     0   5              1     2   202     34       202
4    90          NA      7        0     0   5.00           5     3   872     34       872
5    80          NA      5        0     0   5              6     2   871     34       871
6    83          NA     11        0     0   5              5     4   469     35       469
# … with 140 more variables: DXVER <dbl>, ELECTIVE <dbl>, FEMALE <dbl>, HCUP_ED <dbl>,
#   HOSP_DIVISION <dbl>, HOSP_NIS <dbl>, I10_DX1 <chr>, I10_DX2 <chr>, I10_DX3 <chr>,
#   I10_DX4 <chr>, I10_DX5 <chr>, I10_DX6 <chr>, I10_DX7 <chr>, I10_DX8 <chr>,
#   I10_DX9 <chr>, I10_DX10 <chr>, I10_DX11 <chr>, I10_DX12 <chr>, I10_DX13 <chr>,
#   I10_DX14 <chr>, I10_DX15 <chr>, I10_DX16 <chr>, I10_DX17 <chr>, I10_DX18 <chr>,
#   I10_DX19 <chr>, I10_DX20 <chr>, I10_DX21 <chr>, I10_DX22 <chr>, I10_DX23 <chr>,
#   I10_DX24 <chr>, I10_DX25 <chr>, I10_DX26 <chr>, I10_DX27 <chr>, I10_DX28 <chr>, …

Above is the sample data for the year 2017. I want to find total died for dataset for 2018/2019. Do I need to calculate it separately?

Thanks

Not necessarily, you can read them into a single data frame or merge them and then calculate what you want by year.

If you need more specific help with this, please provide a proper REPRoducible EXample (reprex) illustrating your issue.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.