profiles {descriptio} | R Documentation |
Profiles by level of a categorical variable
Description
Computes profiles (frequencies or percentages) for subgroups of observations defined by the levels of a categorical variable.
Usage
profiles(X, y, weights = NULL, stat = "cprop",
mar = TRUE, digits = 1)
Arguments
X |
data frame. The variables which are described in the profiles. There should be only factors. |
y |
factor. The categorical variable which defines subgroups of observations whose profiles will be computed. |
weights |
numeric vector of weights. If NULL (default), uniform weights (i.e. all equal to 1) are used. |
stat |
character. Whether to compute frequencies ("freq"), percentages ("prop"), row percentages ("rprop") or column percentages ("cprop", default). |
mar |
logical, indicating whether to compute margins. Default is TRUE. |
digits |
numeric. Number of digits. Default is 1. |
Value
A data frame with profiles in columns
Author(s)
Nicolas Robette
See Also
catdesc
, assoc.yx
, darma
, assoc.twocat
, assoc.twocat.by
Examples
data(Movies)
profiles(Movies[,c(2,4,5)], Movies$Country)