Learn R Programming

repeated (version 1.1.10)

biv.betab: Bivariate Beta-binomial Regression Models

Description

biv.betab fits dependent (logit) linear regression models to a bivariate beta-binomial distribution.

Usage

biv.betab(
  freq,
  x = NULL,
  p,
  depend = TRUE,
  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 bivbetab is returned.

Arguments

freq

A matrix containing four columns corresponding to 00, 01, 10, and 11 responses.

x

A matrix of explanatory variables, containing pairs of columns, one for each response, and the same number of rows as freq.

p

Initial parameter estimates: intercept, dependence (if depend is TRUE, and one for each pair of columns of x.

depend

If FALSE, the independence (logistic) model is fitted.

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

y <- matrix(  c( 2, 1, 1,13,
		 4, 1, 3, 5,
		 3, 3, 1, 4,
		15, 8, 1, 6),ncol=4,byrow=TRUE)
first <- c(0,0,1,1)
second <- c(0,1,0,1)
self <- cbind(first,second)
other <- cbind(second,first)
biv.betab(y,cbind(self,other),p=c(-1,2,1,1))
# independence
biv.betab(y,cbind(self,other),p=c(-1,1,1),dep=FALSE)

Run the code above in your browser using DataLab