Skip to content

Commit

Permalink
added per RX
Browse files Browse the repository at this point in the history
  • Loading branch information
ryan-odea committed Jul 16, 2024
1 parent 130dbf4 commit 144cab1
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 1 deletion.
30 changes: 30 additions & 0 deletions Cleaned Data/costData.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
"year","Glucagon type","total_reimbursement","nRx","multiplier","amtInflation","ppRx"
2012,"syringe, unmixed",15042204.37,78505,1.32709059233449,19962367.9073998,254.281484076171
2013,"syringe, unmixed",14750381.92,70051,1.30772532188841,19289447.944309,275.362920505189
2014,"syringe, unmixed",16974617.54,68541,1.28728348119983,21851144.7589269,318.803997008023
2015,"syringe, unmixed",19044653.27,63779,1.28565400843882,24484834.815903,383.901202839539
2016,"syringe, unmixed",22108648.37,62538,1.26958333333333,28068771.4930792,448.827456795535
2017,"syringe, unmixed",22169421.51,58593,1.24316605467156,27560272.2729376,470.368000835212
2018,"syringe, unmixed",21929916.55,56722,1.21346077260056,26611093.4798288,469.149421385507
2019,"Baqsimi nasal spray",1244584.41,2420,1.1916308173641,1483085.13776691,612.845098250791
2019,"syringe, unmixed",21068840.02,54403,1.1916308173641,25106279.053946,461.487032956749
2019,"Gvoke syringe, premixed",8268.79,15,1.1916308173641,9853.34498631209,656.889665754139
2020,"Baqsimi nasal spray",5690206.68,11673,1.1773570324575,6699404.85083462,573.923143222361
2020,"syringe, unmixed",16860902.44,44159,1.1773570324575,19851302.0613138,449.541476512461
2020,"Gvoke autoinjector, premixed",300769.48,574,1.1773570324575,354113.062426584,616.921711544572
2020,"Gvoke syringe, premixed",446883.77,786,1.1773570324575,526141.749300618,669.391538550405
2021,"Baqsimi nasal spray",9828111.09,20625,1.12435424354244,11050278.410048,535.771074426568
2021,"syringe, unmixed",13590369.81,37760,1.12435424354244,15280389.9671845,404.671344469929
2021,"Gvoke autoinjector, premixed",1345854.59,2741,1.12435424354244,1513217.31945756,552.067610163285
2021,"Gvoke syringe, premixed",387117.53,745,1.12435424354244,435257.237605166,584.237902825726
2021,"Singledose autoinjector",16972.52,21,1.12435424354244,19083.1248856089,908.720232648041
2022,"Baqsimi nasal spray",14424982.55,30514,1.04099760847284,15016372.3368124,492.114188137001
2022,"syringe, unmixed",11435564.17,34229,1.04099760847284,11904394.9525077,347.78681680761
2022,"Gvoke autoinjector, premixed",3931755.57,7271,1.04099760847284,4092948.14546976,562.914062091839
2022,"Gvoke syringe, premixed",1069365.93,1269,1.04099760847284,1113207.37571233,877.231974556606
2022,"Singledose autoinjector",101946.1,232,1.04099760847284,106125.646293133,457.438130573849
2023,"Baqsimi nasal spray",21053328.99,44221,1,21053328.99,476.093462155989
2023,"syringe, unmixed",9014452.52,28709,1,9014452.52,313.993957295621
2023,"Gvoke autoinjector, premixed",8903236.47,16425,1,8903236.47,542.053970776256
2023,"Gvoke syringe, premixed",790714.49,1766,1,790714.49,447.743199320498
2023,"Singledose autoinjector",297246.53,611,1,297246.53,486.491865793781
11 changes: 10 additions & 1 deletion glucagon.R
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ data <- fread("Cleaned Data/output_raw.csv", colClasses = c("ndc" = "character")
][`Radiology Use` == "N"
][utilization_type == "FFSU"
][year > 2011]

# Prescription Reimbuirsed & Count =============================================
#Inflation ====
url <- "https://www.minneapolisfed.org/about-us/monetary-policy/inflation-calculator/consumer-price-index-1913-"
Expand All @@ -94,7 +95,15 @@ Rx <- data[, .(rxCount = sum(number_of_prescriptions),
][inflation, on = "year"
][, amtInflation := amtReimbursed*multiplier
]
#write.csv(Rx, "reimbursements2023.csv")

costdata <- data[, .(total_reimbursement = sum(medicaid_amount_reimbursed),
nRx = sum(number_of_prescriptions)), by = c("year", "Glucagon type")
][inflation, on = "year"
][, amtInflation := total_reimbursement*multiplier
][, ppRx := amtInflation/nRx
][, cpi := NULL]
#write.csv(Rx, "Cleaned Data/reimbursements2023.csv")
#write.csv(costdata, "Cleaned Data/costData.csv", row.names = FALSE)
#Rx <- read.csv("reimbursements.csv")


Expand Down

0 comments on commit 144cab1

Please sign in to comment.