The purpose of this report is to analyze the Spokane County medicare providers across multiple variables of data. Some of the data we have been provided includes information on the provider type, number of services, gender of the provider, facility type, and multiple columns of payment data.
library(tidyverse)
## ── Attaching packages ─────────────────────────────────────── tidyverse 1.3.0 ──
## ✓ ggplot2 3.3.0 ✓ purrr 0.3.3
## ✓ tibble 2.1.3 ✓ dplyr 0.8.3
## ✓ tidyr 1.0.0 ✓ stringr 1.4.0
## ✓ readr 1.3.1 ✓ forcats 0.4.0
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## x dplyr::filter() masks stats::filter()
## x dplyr::lag() masks stats::lag()
library(ggplot2)
library(rattle)
## Rattle: A free graphical interface for data science with R.
## Version 5.3.0 Copyright (c) 2006-2018 Togaware Pty Ltd.
## Type 'rattle()' to shake, rattle, and roll your data.
library(magrittr)
##
## Attaching package: 'magrittr'
## The following object is masked from 'package:purrr':
##
## set_names
## The following object is masked from 'package:tidyr':
##
## extract
load("/users/justinmarchiano/downloads/providerspokane.RDA")
load("providerspokane.RDA")
names(providerspokane)
## [1] "National.Provider.Identifier"
## [2] "Last.Name.Organization.Name.of.the.Provider"
## [3] "First.Name.of.the.Provider"
## [4] "Middle.Initial.of.the.Provider"
## [5] "Credentials.of.the.Provider"
## [6] "Gender.of.the.Provider"
## [7] "Entity.Type.of.the.Provider"
## [8] "Street.Address.1.of.the.Provider"
## [9] "Street.Address.2.of.the.Provider"
## [10] "City.of.the.Provider"
## [11] "Zip.Code.of.the.Provider"
## [12] "State.Code.of.the.Provider"
## [13] "Country.Code.of.the.Provider"
## [14] "Provider.Type"
## [15] "Medicare.Participation.Indicator"
## [16] "Place.of.Service"
## [17] "HCPCS.Code"
## [18] "HCPCS.Description"
## [19] "HCPCS.Drug.Indicator"
## [20] "Number.of.Services"
## [21] "Number.of.Medicare.Beneficiaries"
## [22] "Number.of.Distinct.Medicare.Beneficiary.Per.Day.Services"
## [23] "Average.Medicare.Allowed.Amount"
## [24] "Average.Submitted.Charge.Amount"
## [25] "Average.Medicare.Payment.Amount"
## [26] "Average.Medicare.Standardized.Amount"
#split the data
levels(providerspokane$Place.of.Service)=c("Facility","Other")
ggplot(providerspokane, aes(Provider.Type, fill =Gender.of.the.Provider )) + geom_bar()+coord_flip()
This grpah shows a breakdown of provider types and how many practicioners there are for each. The bars are further colored by gender. It is intersting to look into the breakdown of jobs by gender. For example, there are far more males in diagnostic radiology, but far more females in nursing.
ggplot(providerspokane) +
geom_bar(aes(x = Provider.Type, y = Number.of.Services),
stat = "identity", position = "dodge")+coord_flip()
This graph shows the different provider types and how many services they provide. Clinical labortory providers offe more than 150,000 different services, this being the largest amount of services offered. This most likely due to the fact that they offer many different kinds of testing services.
ggplot(providerspokane) +
geom_bar(aes(x = Provider.Type, y = Average.Medicare.Allowed.Amount),
stat = "identity", position = "dodge")+coord_flip()
This graph shows the average medicare ammount aloowed at each privder type. Medicare is the insurance used in the US for individuals 65+. Therefore, it makes sense that ambulance services and pain management are all heavily covered by Medicare, as these are often services that seniors need.
ggplot(providerspokane) +
geom_bar(aes(x = Provider.Type, y = Number.of.Distinct.Medicare.Beneficiary.Per.Day.Services),
stat = "identity", position = "dodge")+coord_flip()
This graph shows the provider type and the number of distinct medicare beneficiaries that are serviced each day. This graph is important becuase it shows what providers are being used the most.
providerspokane %>%
group_by(Gender.of.the.Provider)%>%
summarise(Mean.charge=mean(Average.Submitted.Charge.Amount))%>%
filter(Gender.of.the.Provider!="")%>%
ggplot(aes(Gender.of.the.Provider,Mean.charge))+geom_bar(stat="identity")
This graph just looks at the gender of the prider and the average submitted charge. Men are higher on average possibly because they are performing more expensive procedures. Additionally, men are stastically less healthy than women and may requie more services.
providerspokane%>%group_by(Gender.of.the.Provider)%>%
summarise(Mean.payment=mean(Average.Medicare.Payment.Amount))%>%
filter(Gender.of.the.Provider!="")%>%
ggplot(aes(Gender.of.the.Provider,Mean.payment))+geom_bar(stat="identity")
This graph shows that men are paid more for there services, but not as disportionatley as they submit charges for services.
providerspokane%>%
group_by(Gender.of.the.Provider)%>%
summarise(Mean.perday=mean(Number.of.Distinct.Medicare.Beneficiary.Per.Day.Services))%>%
filter(Gender.of.the.Provider!="")%>%
ggplot(aes(Gender.of.the.Provider,Mean.perday))+geom_bar(stat="identity")
This graph shows that the average number of services provided by male and female doctors is roughly the same.
Place = providerspokane%>%
group_by(Place.of.Service)%>%
summarise(mean.paid = mean(Average.Medicare.Payment.Amount))
ggplot(Place, mapping = aes(Place.of.Service, mean.paid, fill = Place.of.Service)) +geom_bar(stat = "identity") +coord_flip()
This graph shows that on average facilities recieve higher average payments.This is likely becuase facilities are more likely to include hospitlals and such. Non-facilities include things like outpatient centers and urgent care, where the majority of serives are not being performed.
ggplot(providerspokane) +
geom_bar(aes(x = Provider.Type, y = Number.of.Services, fill = Place.of.Service),
stat = "identity", position = "dodge")+coord_flip()
This graph shows the number of facility and non-facility services per provider. Most of the clinical laborotory work is coming from non-facility centers and essentially all of the ambulence services are coming from facility centers. it makes sense that a majority of unique services are hapening outside of facilitiesm which will likely house more expensive equitment that may be used for one purpose, such as a CT scan.
Place2 = providerspokane%>%
group_by(Place.of.Service)%>%
summarise(average.services = mean(Number.of.Services))
ggplot(Place2, mapping = aes(Place.of.Service,average.services, fill = Place.of.Service )) +geom_bar(stat = "identity")
Even though facilities are paid more, there are more average services at a non facility. Could it be that many facilities are specialized while non facilities are not.
ggplot(data = providerspokane[providerspokane$Average.Medicare.Payment.Amount<20000,], aes(x = Average.Medicare.Payment.Amount, y = Average.Submitted.Charge.Amount, color=Place.of.Service)) +
geom_point()+geom_smooth(method="lm")
## `geom_smooth()` using formula 'y ~ x'
Here we are looking at the relationship between the submitted charge and the average payment amount. On average, most charges end up being paid less than the submitted ammount. It would also seem that facilities on average submit charges that are closer to what gets paid. This could be becuase facilities are more used to dealing with common medicare procedures.