Usage
updateGamma(scores, z, desired.props, gamma.perc, index.to.update,
restaurant.tol = 10, iter = 1, max.iterations = 20, gamma_upper = NA,
gamma_lower = NA, resolve.ties = FALSE)
Arguments
scores
Numeric vector of size n, where n is the number is restaurants
to be graded. scores[i] represents the mean or raw
inspection score for restaurant i.
z
Character vector representing ZIP codes. z[i] is the ZIP code for
restaurant i.
desired.props
Numeric vector representing desired global grade
proportions across the entire jurisdiction. desired.props[j] is the desired
proportion of total (gradeable) restaurants in the jth highest
grading category.
gamma.perc
Numeric vector representing an initial set of percentiles.
index.to.update
Integer value in the set
1:(length(desired.props)-1) that represents the particular
percentile to be updated in the current run of updateGamma.
(Percentiles are not updated simultaneously, but rather are updated
sequentially with the smallest percentiles being the first to be updated.)
restaurant.tol
Integer value representing the maximum difference in
number of restaurants suggested by desired.props and the actual
number of restaurants in each of the top (length(desired.props) -
1) grade categories.
iter
Integer value representing the current iteration of updateGamma.
max.iterations
Integer value specifying the maximum number of
calls of the updateGamma percentile update function
for each of the sought after percentiles. gamma_upper
Numeric or NA value representing a value of
gamma.perc[index.to.update] that results in too many restaurants
gaining the desired grade proportion.
gamma_lower
Numeric or NA value representing a value of
gamma.perc[index.to.update] that results in too few restaurants
gaining the desired grade proportion.
resolve.ties
Boolean value specifying interpretation of how the
function's returned percentile will be applied across the subunits see:
percentileSeek. Should as close to (desired.props[1])% of
restaurants in a ZIP code receive an "A" grade, and as close to
(desired.props[2])% of restaurants in a ZIP code receive "B" grades
(resolve.ties = TRUE case)? Or should the returned percentiles be
interpretted as R quantile Type = 1 percentiles, and
at least (desired.props[1])% of restaurants in a ZIP code receive
an "A" grade?