Calculate a censored mean
mean_tobit.RdCalculate a censored mean
Usage
mean_tobit(
x,
lower = -Inf,
upper = Inf,
include_equal = TRUE,
include_equal_lower = include_equal,
include_equal_upper = include_equal,
distribution,
na.rm = TRUE,
...
)Arguments
- x
A numeric vector
- lower, upper
The lower and upper bounds for censoring
x- include_equal, include_equal_lower, include_equal_upper
Should the bounds consider
x <= lowerandx >= upper(ifTRUE) orx < lowerandx > upper(ifFALSE) to be censored? (include_equalis overridden by settinginclude_equal_lowerorinclude_equal_upper.)- distribution
What distribution (Student "t" or "normal") should be used. If "t", the degrees of freedom are the number of non-
NAvalues inx.- na.rm
A logical value indicating whether
NAvalues should be stripped fromxbefore the computation proceeds.- ...
Arguments passed on to
stats::optimparInitial values for the parameters to be optimized over.
fnA function to be minimized (or maximized), with first argument the vector of parameters over which minimization is to take place. It should return a scalar result.
grA function to return the gradient for the
"BFGS","CG"and"L-BFGS-B"methods. If it isNULL, a finite-difference approximation will be used.For the
"SANN"method it specifies a function to generate a new candidate point. If it isNULLa default Gaussian Markov kernel is used.methodThe method to be used. See ‘Details’. Can be abbreviated.
lower,upperBounds on the variables for the
"L-BFGS-B"method, or bounds in which to search for method"Brent".controla
listof control parameters. See ‘Details’.hessianLogical. Should a numerically differentiated Hessian matrix be returned?
Value
A 'mean_tobit' object which is a number with attributes for the standard deviation (sd) and convergence information in the "message" attribute.
See also
Other Censored Descriptive Statistics:
geomean_tobit(),
sd_tobit()