dat2cov {confreq}R Documentation

conversion of a covariate dataset into summary covariate values

Description

Given a dataset x, this function returns summary values for some (numeric) covariate variables in x for each pattern (configuration) defined by a set of factor variables in x.

Usage

dat2cov(
  x,
  FUN = "mean",
  ...,
  notobs = 0,
  katorder = FALSE,
  caseorder = TRUE,
  wgt = NULL
)

Arguments

x

an object of class "data.frame" with at least 2 factor variables representing the pattern (configurations) and at least 1 numeric variable representing the covariate(s).

FUN

a function to compute the summary statistics which can be applied to all covariate variables in x. See function aggregate.

...

further arguments passed to or used by methods in FUN.

notobs

a numeric vector possibly with length equal to the number of numeric variables in x, defining the summary value for the respective covariate variable to use for unobserved pattern (configurations) defined by the factor variables in x. By default it is assumed that this value is 0. notobs is recycled if only one value is given.

katorder

see dat2fre

caseorder

see dat2fre

wgt

a numerical vector of survey weights to weight the cases (rows) in x

Details

No further details

Value

An object of class c("data.frame", "Pcov") holding the summary statistics for the covariate variables corresponding to the pattern (configurations) of the given dataset in the argument x.


[Package confreq version 1.6.1-1 Index]