Learn R Programming

repeated (version 1.1.10)

biv.binom: Marginal Bivariate Binomial Regression Models

Description

biv.binom fits (logit) linear regression models to a marginal bivariate binomial distribution. The covariates must be of length K, that is the number of 2x2 tables.

Usage

biv.binom(
  freq,
  marg1 = ~1,
  marg2 = ~1,
  interaction = ~1,
  pmarg1 = 1,
  pmarg2 = 1,
  pinteraction = 1,
  print.level = 0,
  typsize = abs(p),
  ndigit = 10,
  gradtol = 1e-05,
  stepmax = 10 * sqrt(p %*% p),
  steptol = 1e-05,
  iterlim = 100,
  fscale = 1
)

Value

A list of class bivbinom is returned.

Arguments

freq

A four-column matrix containing K 2x2 frequency tables.

marg1

The model formula for the first margin.

marg2

The model formula for the second margin.

interaction

The model formula for the interaction.

pmarg1

Initial parameter estimates for the first margin regression.

pmarg2

Initial parameter estimates for the second margin regression.

pinteraction

Initial parameter estimates for the interaction regression.

print.level

Arguments for nlm.

typsize

Arguments for nlm.

ndigit

Arguments for nlm.

gradtol

Arguments for nlm.

stepmax

Arguments for nlm.

steptol

Arguments for nlm.

iterlim

Arguments for nlm.

fscale

Arguments for nlm.

Author

J.K. Lindsey

Examples

Run this code

# 5 2x2 tables
Freq <- matrix(rpois(20,10),ncol=4)
x <- c(6,8,10,12,14)
print(z <- biv.binom(Freq,marg1=~x,marg2=~x,inter=~x,pmarg1=c(-2,0.08),
	pmarg2=c(-2,0.1),pinter=c(3,0)))

Run the code above in your browser using DataLab