Learn R Programming

imt (version 1.0.0)

pointEstimate: Calculate Point Estimate (Median or Mean) as Percentage

Description

This function computes a point estimate from a numeric vector, returning either the median or the mean as a percentage.

Usage

pointEstimate(x, median = TRUE)

Value

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.

Arguments

x

A numeric vector containing the data from which to calculate the point estimate.

median

A logical value indicating whether to use the median (default: TRUE) or the mean (FALSE) as the point estimate.

Details

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.