BIFIE.ecdf.Rd
Computes an empirical distribution function (and quantiles).
If only some quantiles should
be calculated, then an appropriate vector of breaks
(which are quantiles)
must be specified.
Statistical inference is not conducted for this method.
BIFIE.ecdf( BIFIEobj, vars, breaks=NULL, quanttype=1, group=NULL, group_values=NULL )
# S3 method for BIFIE.ecdf
summary(object,digits=4,...)
Object of class BIFIEdata
Vector of variables for which statistics should be computed.
Optional vector of breaks. Otherwise, it will be automatically defined.
Type of calculation for quantiles. In case of quanttype=1
,
a linear interpolation is used (which is type='i/n'
in
Hmisc::wtd.quantile
),
while for quanttype=2
no interpolation is used.
Optional grouping variable
Optional vector of grouping values. This can be omitted and grouping values will be determined automatically.
Object of class BIFIE.ecdf
Number of digits for rounding output
Further arguments to be passed
A list with following entries
Data frame with probabilities and the empirical distribution function (See Examples).
Data frame with empirical distribution function stacked with respect to variables, groups and group values
More extensive output
More values
Hmisc::wtd.ecdf
,
Hmisc::wtd.quantile
#############################################################################
# EXAMPLE 1: Imputed TIMSS dataset
#############################################################################
data(data.timss1)
data(data.timssrep)
# create BIFIE.dat object
bifieobj <- BIFIEsurvey::BIFIE.data( data.list=data.timss1, wgt=data.timss1[[1]]$TOTWGT,
wgtrep=data.timssrep[, -1 ] )
# ecdf
vars <- c( "ASMMAT", "books")
group <- "female" ; group_values <- 0:1
# quantile type 1
res1 <- BIFIEsurvey::BIFIE.ecdf( bifieobj, vars=vars, group=group )
summary(res1)
res2 <- BIFIEsurvey::BIFIE.ecdf( bifieobj, vars=vars, group=group, quanttype=2)
# plot distribution function
ecdf1 <- res1$ecdf
plot( ecdf1$ASMMAT_female0, ecdf1$yval, type="l")
plot( res2$ecdf$ASMMAT_female0, ecdf1$yval, type="l", lty=2)
plot( ecdf1$books_female0, ecdf1$yval, type="l", col="blue")