当前位置: 首页>>代码示例 >>用法及示例精选 >>正文


R tidyr cms_patient_experience 来自医疗保险和医疗补助服务中心的数据


医疗保险和医疗补助服务中心提供了来自公共数据的两个数据集,https://data.cms.gov

用法

cms_patient_experience

cms_patient_care

格式

cms_patient_experience 是一个包含 500 个观察值和五个变量的 DataFrame :

org_pac_id,org_nm

组织 ID 和名称

measure_cd,measure_title

测量代码和标题

prf_rate

衡量绩效率

cms_patient_care 是一个包含 252 个观测值和 5 个变量的 DataFrame :

ccn,facility_name

设施 ID 和名称

measure_abbr

缩写的测量标题,适合用作变量名称

score

测量分数

type

分数是指满分 100 分 ("observed"),还是原始分数的最大可能值 ("denominator")

例子

cms_patient_experience %>%
  dplyr::distinct(measure_cd, measure_title)
#> # A tibble: 6 × 2
#>   measure_cd   measure_title                                              
#>   <chr>        <chr>                                                      
#> 1 CAHPS_GRP_1  CAHPS for MIPS SSM: Getting Timely Care, Appointments, and…
#> 2 CAHPS_GRP_2  CAHPS for MIPS SSM: How Well Providers Communicate         
#> 3 CAHPS_GRP_3  CAHPS for MIPS SSM: Patient's Rating of Provider           
#> 4 CAHPS_GRP_5  CAHPS for MIPS SSM: Health Promotion and Education         
#> 5 CAHPS_GRP_8  CAHPS for MIPS SSM: Courteous and Helpful Office Staff     
#> 6 CAHPS_GRP_12 CAHPS for MIPS SSM: Stewardship of Patient Resources       

cms_patient_experience %>%
  pivot_wider(
    id_cols = starts_with("org"),
    names_from = measure_cd,
    values_from = prf_rate
 )
#> # A tibble: 95 × 8
#>    org_pac_id org_nm       CAHPS…¹ CAHPS…² CAHPS…³ CAHPS…⁴ CAHPS…⁵ CAHPS…⁶
#>    <chr>      <chr>          <dbl>   <dbl>   <dbl>   <dbl>   <dbl>   <dbl>
#>  1 0446157747 USC CARE ME…      63      87      86      57      85      24
#>  2 0446162697 ASSOCIATION…      59      85      83      63      88      22
#>  3 0547164295 BEAVER MEDI…      49      NA      75      44      73      12
#>  4 0749333730 CAPE PHYSIC…      67      84      85      65      82      24
#>  5 0840104360 ALLIANCE PH…      66      87      87      64      87      28
#>  6 0840109864 REX HOSPITA…      73      87      84      67      91      30
#>  7 0840513552 SCL HEALTH …      58      83      76      58      78      26
#>  8 0941545784 GRITMAN MED…      46      86      81      54      NA      25
#>  9 1052612785 COMMUNITY M…      65      84      80      58      87      29
#> 10 1254237779 OUR LADY OF…      61      NA      NA      65      NA      17
#> # … with 85 more rows, and abbreviated variable names ¹CAHPS_GRP_1,
#> #   ²CAHPS_GRP_2, ³CAHPS_GRP_3, ⁴CAHPS_GRP_5, ⁵CAHPS_GRP_8, ⁶CAHPS_GRP_12

cms_patient_care %>%
  pivot_wider(
    names_from = type,
    values_from = score
  )
#> # A tibble: 126 × 5
#>    ccn    facility_name                         measure_…¹ denom…² obser…³
#>    <chr>  <chr>                                 <chr>        <dbl>   <dbl>
#>  1 011500 BAPTIST HOSPICE                       beliefs_a…     202   100  
#>  2 011500 BAPTIST HOSPICE                       composite…     202    88.1
#>  3 011500 BAPTIST HOSPICE                       dyspena_t…     110    99.1
#>  4 011500 BAPTIST HOSPICE                       dyspnea_s…     202   100  
#>  5 011500 BAPTIST HOSPICE                       opioid_bo…      61   100  
#>  6 011500 BAPTIST HOSPICE                       pain_asse…     107   100  
#>  7 011500 BAPTIST HOSPICE                       pain_scre…     202    88.6
#>  8 011500 BAPTIST HOSPICE                       treat_pref     202   100  
#>  9 011500 BAPTIST HOSPICE                       visits_im…     232    96.1
#> 10 011501 SOUTHERNCARE NEW BEACON N. BIRMINGHAM beliefs_a…     525   100  
#> # … with 116 more rows, and abbreviated variable names ¹measure_abbr,
#> #   ²denominator, ³observed

cms_patient_care %>%
  pivot_wider(
    names_from = measure_abbr,
    values_from = score
  )
#> # A tibble: 28 × 12
#>    ccn    facility…¹ type  belie…² compo…³ dyspe…⁴ dyspn…⁵ opioi…⁶ pain_…⁷
#>    <chr>  <chr>      <chr>   <dbl>   <dbl>   <dbl>   <dbl>   <dbl>   <dbl>
#>  1 011500 BAPTIST H… deno…   202     202     110     202      61     107  
#>  2 011500 BAPTIST H… obse…   100      88.1    99.1   100     100     100  
#>  3 011501 SOUTHERNC… deno…   525     525     438     525     101     325  
#>  4 011501 SOUTHERNC… obse…   100     100     100     100     100     100  
#>  5 011502 COMFORT C… deno…   295     295     236     295      38     121  
#>  6 011502 COMFORT C… obse…   100      99.3    99.2   100     100     100  
#>  7 011503 SAAD HOSP… deno…   694     694     555     694      37     677  
#>  8 011503 SAAD HOSP… obse…    99.9    96      99.6    98.3   100      99  
#>  9 011505 HOSPICE F… deno…   600     600     308     600     151     308  
#> 10 011505 HOSPICE F… obse…    97.8    92      97.7    99.8    98.7    92.5
#> # … with 18 more rows, 3 more variables: pain_screening <dbl>,
#> #   treat_pref <dbl>, visits_imminent <dbl>, and abbreviated variable
#> #   names ¹facility_name, ²beliefs_addressed, ³composite_process,
#> #   ⁴dyspena_treatment, ⁵dyspnea_screening, ⁶opioid_bowel,
#> #   ⁷pain_assessment

cms_patient_care %>%
  pivot_wider(
    names_from = c(measure_abbr, type),
    values_from = score
  )
#> # A tibble: 14 × 20
#>    ccn    facili…¹ belie…² belie…³ compo…⁴ compo…⁵ dyspe…⁶ dyspe…⁷ dyspn…⁸
#>    <chr>  <chr>      <dbl>   <dbl>   <dbl>   <dbl>   <dbl>   <dbl>   <dbl>
#>  1 011500 BAPTIST…     202   100       202    88.1     110    99.1     202
#>  2 011501 SOUTHER…     525   100       525   100       438   100       525
#>  3 011502 COMFORT…     295   100       295    99.3     236    99.2     295
#>  4 011503 SAAD HO…     694    99.9     694    96       555    99.6     694
#>  5 011505 HOSPICE…     600    97.8     600    92       308    97.7     600
#>  6 011506 SOUTHER…     589   100       589    99.7     477   100       589
#>  7 011508 SOUTHER…     420   100       420    99.5     347   100       420
#>  8 011510 CULLMAN…      54   100        54    90.7      27   100        54
#>  9 011511 HOSPICE…     179   100       179    99.4     123    99.2     179
#> 10 011512 SOUTHER…     396   100       396    99.5     241   100       396
#> 11 011513 SHEPHER…     335    99.1     335    87.2     154    90.9     335
#> 12 011514 ST VINC…     210   100       210    97.6     137   100       210
#> 13 011516 HOSPICE…     103   100       103    97.1      75    98.7     103
#> 14 011517 HOSPICE…     400    99.8     400    95.8     182    99.5     400
#> # … with 11 more variables: dyspnea_screening_observed <dbl>,
#> #   opioid_bowel_denominator <dbl>, opioid_bowel_observed <dbl>,
#> #   pain_assessment_denominator <dbl>, pain_assessment_observed <dbl>,
#> #   pain_screening_denominator <dbl>, pain_screening_observed <dbl>,
#> #   treat_pref_denominator <dbl>, treat_pref_observed <dbl>,
#> #   visits_imminent_denominator <dbl>, visits_imminent_observed <dbl>,
#> #   and abbreviated variable names ¹facility_name, …
源代码:R/data.R

相关用法


注:本文由纯净天空筛选整理自Hadley Wickham等大神的英文原创作品 Data from the Centers for Medicare & Medicaid Services。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。