This function computes a point estimate from a numeric vector, returning either the median or the mean as a percentage.
pointEstimate(x, median = TRUE)
A numeric value representing the chosen point estimate (median or mean)
of the input vector x
, multiplied by 100 to express it as a percentage.
A numeric vector containing the data from which to calculate the point estimate.
A logical value indicating whether to use the median (default: TRUE
)
or the mean (FALSE
) as the point estimate.
This function provides a simple way to obtain either the median or mean
of a numeric vector as a percentage. The choice between these two measures
of central tendency can be controlled by the median
argument.