R/change-in-contract-value.R

#' Compare contract prices and evaluated prices to find suspicious bids .
#'
#' According to the red flags pamphlet,
#'
#'     A change to the initial contract in the amount or type of services,
#'     and/or an increase in price from what was bid before the contract is
#'     signed, should be reviewed carefully. Profits can be generated by
#'     unjustifiably increasing the price and/or quantity of the services
#'     between the time the contractor is selected and the signing of the
#'     contract through a change in scope, (participation of) key personnel,
#'     manufacturing unit rates, or the General Conditions of Contract (GCC).
#'     In addition, once the contract is implemented, the contractor could
#'     substitute services by those of lesser value, quality and/or not use
#'     the agreed man hours.
#'
#' The present function looks for winning bids with large differences between
#' evaluated price and the contract price.
#'
#' @param bids Data frame of bids, with the columns "contract.price.amount"
#'   and "evaluated.price.amount"
#' @return Data frame of winning bids with a new "price.ratio" column containing the ratio between the two prices
#' @examples
#'   data(bids)
#'   change.in.contract.value(bids)
#' @export
change.in.contract.value <- function(bids) {
  bids <- subset(bids, !is.na(contract.price.amount))
  bids$price.ratio <- bids$contract.price.amount / bids$evaluated.price.amount
  bids.valuechange <- subset(bids, price.ratio > 1)
  bids.valuechange$suspiciousness.score <- bids.valuechange$price.ratio
  bids.valuechange
}
tlevine/red-flags documentation built on May 31, 2019, 3:51 p.m.