nobs.RprobitB_fit: Count independent likelihood units

View source: R/model.R

nobs.RprobitB_fitR Documentation

Count independent likelihood units

Description

Counts the observed choice occasions if the model has neither random effects nor latent classes, because the likelihood then factorizes over the occasions. Otherwise the occasions of a decider are dependent through the random coefficients or the class membership, and the deciders with at least one observed response are counted.

Usage

## S3 method for class 'RprobitB_fit'
nobs(object, ...)

Arguments

object

[RprobitB_fit]
Fitted choice model.

...

Currently not used.

Value

An integer(1) count.

Examples

set.seed(1)
model <- fit(
  choice ~ x, dgp_parameters = list(beta = c(x = 1, ASC_B = -0.5)),
  chains = 1
)
nobs(model)

RprobitB documentation built on Sept. 20, 2026, 9:07 a.m.