groupwiseSum | R Documentation |
Calculates sums for groups.
groupwiseSum(
formula = NULL,
data = NULL,
var = NULL,
group = NULL,
digits = NULL,
...
)
formula |
A formula indicating the measurement variable and the grouping variables. e.g. y ~ x1 + x2. |
data |
The data frame to use. |
var |
The measurement variable to use. The name is in double quotes. |
group |
The grouping variable to use. The name is in double quotes. Multiple names are listed as a vector. (See example.) |
digits |
The number of significant figures to use in output.
The default is |
... |
Other arguments passed to the |
The input should include either formula
and data
;
or data
, var
, and group
. (See examples).
A data frame of statistics by group.
The parsing of the formula is simplistic. The first variable on the left side is used as the measurement variable. The variables on the right side are used for the grouping variables.
Beginning in version 2.0, there is no rounding of results by default. Rounding results can cause confusion if the user is expecting exact sums.
Salvatore Mangiafico, mangiafico@njaes.rutgers.edu
groupwiseMean
,
groupwiseMedian
,
groupwiseHuber
,
groupwiseGeometric
### Example with formula notation
data(AndersonBias)
groupwiseSum(Count ~ Result + Gender,
data = AndersonBias)
### Example with variable notation
data(AndersonBias)
groupwiseSum(data = AndersonBias,
var = "Count",
group = c("Result", "Gender"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.