powered by
Functions such as GLM, REG, and aov1 can be run by levels of a variable.
BY(FUN, Formula, Data, By, ...)
a list of FUN function outputs. The names of the list are the levels of the By variable.
FUN
By
Function name to be called, such as GLM or REG
a conventional formula for a linear model.
a data.frame to be analyzed
data.frame
a variable name in the Data
Data
arguments to be passed to FUN function
Kyun-Seop Bae k@acr.kr
This mimics the BY clause of SAS procedures.
BY(GLM, uptake ~ Treatment + as.factor(conc), CO2, By="Type") BY(REG, uptake ~ conc, CO2, By="Type")
Run the code above in your browser using DataLab