BY: Analysis BY variable

View source: R/BY.R

BYR Documentation

Analysis BY variable

Description

Functions such as GLM, REG, and aov1 can be run by levels of a variable.

Usage

  BY(FUN, Formula, Data, By, ...)

Arguments

FUN

Function name to be called, such as GLM or REG

Formula

a conventional formula for a linear model.

Data

a data.frame to be analyzed

By

a variable name in the Data

...

arguments to be passed to FUN function

Details

This mimics the BY clause of SAS procedures.

Value

a list of FUN function outputs. The names of the list are the levels of the By variable.

Author(s)

Kyun-Seop Bae k@acr.kr

Examples

  BY(GLM, uptake ~ Treatment + as.factor(conc), CO2, By="Type")
  BY(REG, uptake ~ conc, CO2, By="Type")

sasLM documentation built on June 15, 2026, 9:07 a.m.