BIFIE.univar | R Documentation |
Computes some univariate descriptive statistics (means and standard deviations).
BIFIE.univar(BIFIEobj, vars, group=NULL, group_values=NULL, se=TRUE)
## S3 method for class 'BIFIE.univar'
summary(object,digits=3,...)
## S3 method for class 'BIFIE.univar'
coef(object,...)
## S3 method for class 'BIFIE.univar'
vcov(object,...)
BIFIEobj |
Object of class |
vars |
Vector of variables for which statistics should be computed |
group |
Optional grouping variable(s) |
group_values |
Optional vector of grouping values. This can be omitted and grouping values will be determined automatically. |
se |
Optional logical indicating whether statistical inference based on replication should be employed. |
object |
Object of class |
digits |
Number of digits for rounding output |
... |
Further arguments to be passed |
A list with following entries
stat |
Data frame with univariate statistics |
stat_M |
Data frame with means |
stat_SD |
Data frame with standard deviations |
output |
Extensive output with all replicated statistics |
... |
More values |
See BIFIE.univar.test
for a test of equal means and
effect sizes \eta
and d
.
Descriptive statistics without statistical inference can be
estimated by the collection of
miceadds::ma.wtd.statNA
functions from the miceadds package.
Further descriptive functions:
survey::svymean
,
intsvy::timss.mean
,
intsvy::timss.mean.pv
,
stats::weighted.mean
,
Hmisc::wtd.mean
,
miceadds::ma.wtd.meanNA
survey::svyvar
,
Hmisc::wtd.var
,
miceadds::ma.wtd.sdNA
,
miceadds::ma.wtd.covNA
#############################################################################
# EXAMPLE 1: Imputed TIMSS dataset
#############################################################################
data(data.timss1)
data(data.timssrep)
# create BIFIE.dat object
bdat <- BIFIEsurvey::BIFIE.data( data.list=data.timss1, wgt=data.timss1[[1]]$TOTWGT,
wgtrep=data.timssrep[, -1 ] )
# compute descriptives for plausible values
res1 <- BIFIEsurvey::BIFIE.univar( bdat, vars=c("ASMMAT","ASSSCI","books") )
summary(res1)
# split descriptives by number of books
res2 <- BIFIEsurvey::BIFIE.univar( bdat, vars=c("ASMMAT","ASSSCI"), group="books",
group_values=1:5)
summary(res2)
#############################################################################
# EXAMPLE 2: TIMSS dataset with missings
#############################################################################
data(data.timss2)
data(data.timssrep)
# use first dataset with missing data from data.timss2
bdat1 <- BIFIEsurvey::BIFIE.data( data.list=data.timss2[[1]], wgt=data.timss2[[1]]$TOTWGT,
wgtrep=data.timssrep[, -1 ])
# some descriptive statistics without statistical inference
res1a <- BIFIEsurvey::BIFIE.univar( bdat1, vars=c("ASMMAT","ASSSCI","books"), se=FALSE)
# descriptive statistics with statistical inference
res1b <- BIFIEsurvey::BIFIE.univar( bdat1, vars=c("ASMMAT","ASSSCI","books") )
summary(res1a)
summary(res1b)
# split descriptives by number of books
res2 <- BIFIEsurvey::BIFIE.univar( bdat1, vars=c("ASMMAT","ASSSCI"), group="books")
# Note that if group_values is not specified as an argument it will be
# automatically determined by the observed frequencies in the dataset
summary(res2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.