-
Notifications
You must be signed in to change notification settings - Fork 0
/
README.Rmd
72 lines (48 loc) · 1.92 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please update that file using devtools::build_readme()-->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# medicareAnalytics
<!-- badges: start -->
<!-- badges: end -->
The goal of medicareAnalytics is to simplify the data processing and modeling for medicare research projects. This project is based on the medicare analytic file data structures, and used a lot variable names specifically only for the medicare analytic file.
Since most of the medicare projects are using the same cohort filters and models, this package can help the analysts and reseach fellows to conduct analyses.
## Installation
You can install the development version of medicareAnalytics from [GitHub](https://github.com/) with:
``` r
# install.packages("devtools")
devtools::install_github("UMCSTaR/medicareAnalytics")
```
## Example
### Create multi-procedure frequency table
```{r example}
library(medicareAnalytics)
library(tidyverse)
## basic example code
# load medicare dt
medicare = data.table::fread("/Volumes/George_Surgeon_Projects/standardized_medicare_data_using_R/analysis_ready_data/ecs_primary_surgeon_medicare2018.csv", nrows = 5000)
multiple_procedures_table(medicare, project_sepcific_procedure_tax = "e_proc_grp_lbl")
```
## Only keep US medschool graduates
```{r}
# load medicare dt
medicare = data.table::fread("/Volumes/George_Surgeon_Projects/standardized_medicare_data_using_R/analysis_ready_data/ecs_primary_surgeon_medicare2018.csv", nrows = 5000)
remove_nonUS_trained(medicare) %>%
select(-contains("id"), -contains("dt")) %>% # remove sensitive data
head()
```
### apply all filters
```{r}
medicare %>%
apply_all_filters(add_variables = "val_yr_practice") %>%
select(-contains("id"), -contains("dt")) %>% # remove sensitive data
glimpse()
```