fee: First-Exposure Effect

View source: R/fee.R

feeR Documentation

First-Exposure Effect

Description

Computes the first-exposure effect (FEE) from a fitted 'oneinfl' model object. The FEE measures the difference between the expected count for a first-time exposure and the expected count under the baseline (non-inflated) model. The function supports models estimated using either a one-inflated positive Poisson distribution or a one-inflated zero-truncated negative binomial distribution.

Usage

fee(model, data, at = "AE")

Arguments

model

A fitted model object of class "oneinfl".

data

The original data frame used to fit the model.

at

A character string or list. Specifies how the first-exposure effect should be evaluated. Options are "AE" (average effect across the data), "EM" (effect at means), or a named list specifying covariate values for evaluating a representative case.

Details

The effect can be evaluated in three ways, determined by the 'at' argument:

  • "AE": Average the FEE over all data points (default).

  • "EM": Evaluate the FEE at the sample means of the covariates.

  • list: Evaluate the FEE at a user-specified set of covariate values.

If 'at = "AE"', the returned object also includes the total number of treatment visits implied by the FEE across all observations.

Value

A list with components:

fee

The estimated first-exposure effect.

sefee

The standard error of the estimated effect.

where

A character string describing the evaluation point.

treatment_visits

(Optional) Total implied treatment visits if at = "AE".

Examples

# Example usage
df <- data.frame(x = runif(10,0,10), d = sample(c(0,1), 10, replace=TRUE), y = rpois(10, 3) + 1)
model <- oneinfl::oneinfl(formula = y ~ x + d | x + d, df = df, dist = "Poisson")
fee(model, data = df)


fee documentation built on Aug. 8, 2025, 7:45 p.m.

Related to fee in fee...