bbl.fit: bbl Inference with model matrix

Description Usage Arguments Details Value Examples

View source: R/bbl_s3.R

Description

Performs bbl inference using response vector and predictor matrix

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
bbl.fit(
  x,
  y,
  qJ = NULL,
  weights = NULL,
  xlevels = NULL,
  verbose = 1,
  method = "pseudo",
  prior.count = 1,
  ...
)

Arguments

x

Data frame of factors with each predictor in columns.

y

Vector of response variables.

qJ

Matrix of logicals indicating which predictor combinations are interacting.

weights

Vector of non-negative integer frequencies, recoding the number of times each row of data must be repeated. If NULL, assumed to be all 1. Fractional weights are not supported.

xlevels

List of factor levels for predictors. If NULL, will be inferred from data with factor levels ordered alphanumerically.

verbose

Verbosity level of output. Will be propagated to mlestimate with one level down.

method

c('pseudo','mf'); inference method.

prior.count

Prior count for computing single predictor and pairwise frequencies

...

Other arguments to mlestimate.

Details

This function would normally be called by bbl rather than directly. Expects the predictor data x and response vector y instead of formula input to bbl.

Value

List of named components h, J, lkh, and lz; see bbl for information regarding these components.

Examples

1
2
3
4
5
6
titanic <- as.data.frame(Titanic)
freq <- titanic$Freq
x <- titanic[,1:3]
y <- titanic$Survived
b <- bbl.fit(x=x,y=y, weights=freq)
b

bbl documentation built on Jan. 28, 2022, 1:07 a.m.