profiles | R Documentation |
Computes profiles (frequencies or percentages) for subgroups of observations defined by the levels of a categorical variable.
profiles(X, y, weights = NULL, stat = "cprop",
mar = TRUE, digits = 1)
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. |
A data frame with profiles in columns
Nicolas Robette
catdesc
, assoc.yx
, darma
, assoc.twocat
, assoc.twocat.by
data(Movies)
profiles(Movies[,c(2,4,5)], Movies$Country)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.