weighted_Stats.Rd
Some descriptive statistics for weighted data: variance, standard deviation, means, skewness, excess kurtosis, quantiles and frequency tables. Missing values are automatically removed from the data.
weighted_mean(x, w=rep(1, length(x)), select=NULL ) weighted_var(x, w=rep(1, length(x)), method="unbiased", select=NULL ) weighted_sd(x, w=rep(1, length(x)), method="unbiased", select=NULL ) weighted_skewness( x, w=rep(1,length(x)), select=NULL ) weighted_kurtosis( x, w=rep(1,length(x)), select=NULL ) weighted_quantile( x, w=rep(1,length(x)), probs=seq(0,1,.25), type=NULL, select=NULL ) weighted_table( x, w=NULL, props=FALSE )
x | A numeric vector. For |
---|---|
w | Optional vector of sample weights |
select | Vector referring to selected cases |
method | Computation method (can be |
probs | Vector with probabilities |
type | Quantile type. For unweighted data, quantile types 6 and
7 can be used (see
|
props | Logical indicating whether relative or absolute frequencies should be calculated. |
Numeric value
See stats::weighted.mean
for
computing a weighted mean.
See stats::var
for computing
unweighted variances.
See stats::quantile
and
Hmisc::wtd.quantile
) for quantiles.