BIFIE.correl: Correlations and Covariances

View source: R/BIFIE.correl.R

BIFIE.correlR Documentation

Correlations and Covariances

Description

Computes correlations and covariances

Usage

BIFIE.correl(BIFIEobj, vars, group=NULL, group_values=NULL, se=TRUE)

## S3 method for class 'BIFIE.correl'
summary(object,digits=4, ...)

## S3 method for class 'BIFIE.correl'
coef(object,type=NULL, ...)

## S3 method for class 'BIFIE.correl'
vcov(object,type=NULL, ...)

Arguments

BIFIEobj

Object of class BIFIEdata

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 BIFIE.correl

digits

Number of digits for rounding output

type

If type="cov", then covariances instead of correlations are extracted.

...

Further arguments to be passed

Value

A list with following entries

stat.cor

Data frame with correlation statistics

stat.cov

Data frame with covariance statistics

cor_matrix

List of estimated correlation matrices

cov_matrix

List of estimated covariance matrices

output

Extensive output with all replicated statistics

...

More values

See Also

stats::cov.wt, intsvy::timss.rho, intsvy::timss.rho.pv, Hmisc::rcorr, miceadds::ma.wtd.corNA

Examples

#############################################################################
# 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 ] )

# Correlations splitted by gender
res1 <- BIFIEsurvey::BIFIE.correl( bdat, vars=c("lang", "books", "migrant" ),
              group="female", group_values=0:1 )
summary(res1)

# Correlations splitted by gender: no statistical inference (se=FALSE)
res1a <- BIFIEsurvey::BIFIE.correl( bdat, vars=c("lang", "books", "migrant" ),
              group="female", group_values=0:1, se=FALSE)
summary(res1a)

BIFIEsurvey documentation built on May 29, 2024, 2:52 a.m.