rbc: Fit a regression by composition model

View source: R/rbc.R

rbcR Documentation

Fit a regression by composition model

Description

Fit a regression by composition model

Usage

rbc(formula, init, flows, family, data, par, hessian = TRUE)

Arguments

formula

a formula object, with model components separated by '|'

init

the initial distribution

flows

a list of flows

family

(optional) an object of class 'CompositeFamily'; if supplied, 'init' and 'flows' are ignored

data

a data frame

par

a vector of starting values

hessian

logical; use Hessian matrix in model fitting?

Value

an rbc object

Examples

## Annette Dobson (1990)
## "An Introduction to Generalized Linear Models".
## Page 9: Plant Weight Data.
ctl <- c(4.17, 5.58, 5.18, 6.11, 4.50, 4.61, 5.17, 4.53, 5.33, 5.14)
trt <- c(4.81, 4.17, 4.41, 3.59, 5.87, 3.83, 6.03, 4.89, 4.32, 4.69)
dobson <- data.frame(
  weight = c(ctl, trt),
  group = gl(2, 10, 20, labels = c("Ctl", "Trt"))
)
dobson_fit <- rbc(weight ~ 1 | 1 + group,
  init = Normal(0, 1),
  flows = list(Scale, Translate),
  data = dobson
)

starr_fit <- rbc(
  height ~ 1 | 0 + I((280 + age)^(-1)) | 1 | 1,
  init = LogNormal(),
  flows = list(Power, Moebius, Scale, Translate),
  data = subset(starr, id %in% unique(id)[1:10])
)

rbc documentation built on April 3, 2025, 10:20 p.m.

Related to rbc in rbc...