Last chance! 50% off unlimited learning
Sale ends in
Calculates sums for groups.
groupwiseSum(
formula = NULL,
data = NULL,
var = NULL,
group = NULL,
digits = NULL,
...
)
A data frame of statistics by group.
A formula indicating the measurement variable and the grouping variables. e.g. y ~ x1 + x2.
The data frame to use.
The measurement variable to use. The name is in double quotes.
The grouping variable to use. The name is in double quotes. Multiple names are listed as a vector. (See example.)
The number of significant figures to use in output.
The default is NULL
, which results in no
rounding of values.
Other arguments passed to the sum
function
Salvatore Mangiafico, mangiafico@njaes.rutgers.edu
The input should include either formula
and data
;
or data
, var
, and group
. (See examples).
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"))
Run the code above in your browser using DataLab