Skip to contents

Returns the number of observations used to fit an amerasfit object after missing-value handling and any family-specific row exclusions.

Usage

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

Arguments

object

A fitted model object of class amerasfit, as returned by ameras.

...

Additional arguments, currently unused.

Value

The number of observations used for fitting. This excludes rows omitted by na.action, uninformative matched-set rows for conditional logistic regression, and zero-follow-up rows for proportional hazards regression with entry times.

See also

ameras for model fitting, summary for detailed row-exclusion counts, and nobs for the generic function.

Examples

example_data <- ameras_simulated[1:100, ]
example_data$X1[1] <- NA

fit <- ameras(
  Y.gaussian ~ dose(V1:V10) + X1,
  data = example_data,
  family = "gaussian",
  methods = "RC",
  na.action = na.omit
)
#> Fitting RC

nobs(fit)
#> [1] 99