Learn R Programming

emax.glm (version 0.1.2)

make.dbinom: Build a Binomial log likelihood

Description

Build a Binomial log likelihood

Usage

make.dbinom(x, y, linkinv = binomial()$linkinv, weight = 1,
  log = FALSE)

Arguments

x

An n-by-p design matrix.

y

A vector of observation of length n.

linkinv

Inverse link function desired

weight

A n length vector of observation weight terms. This is currently designed to be either the exposure for a Poisson model or the number of trials for a Logistic model.

log

Boolean flag. If TRUE returns the log dist.

Value

A function to calculate (log) likelihood for a given set of parameters under a Binomial model.

Examples

Run this code
# NOT RUN {
x <- model.matrix(~ factor(wool) + factor(tension), warpbreaks)
y <- warpbreaks$breaks
make.dbinom(x, y)

# }

Run the code above in your browser using DataLab