By {memisc} | R Documentation |
Conditional evaluation of an expression
Description
Usage
By(formula,expr,data=parent.frame())
Arguments
formula |
an expression or (preferably) a formula
containing the names of conditioning variables or factors. |
expr |
an expression that is evaluated for any unique combination
of values of the variables contained in formula . |
data |
a data frame, an object that can be coerced into
a data frame (for example, a table), or an environment,
from which values for the variables in formula
or expr are taken.
|
Value
A list of class "by", giving the results for each combination of values
of variables in formula
.
Examples
berkeley <- aggregate(wtable(Admit,Freq)~.,data=UCBAdmissions)
By(~Dept,glm(cbind(Admitted,Rejected)~Gender,family="binomial"),data=berkeley)
attach(berkeley)
By(~Dept,glm(cbind(Admitted,Rejected)~Gender,family="binomial"))
detach(berkeley)
[Package
memisc version 0.11-8-2
Index]