ptfamily: Truncated Poisson Family for GLM

ptfamilyR Documentation

Truncated Poisson Family for GLM

Description

This function defines a truncated Poisson family for use in Generalized Linear Models (GLMs), where zero values are not allowed. It modifies the Poisson likelihood by excluding zero-count observations.

Usage

ptfamily(link = "log")

Arguments

link

Character string or a link-glm object specifying the link function. Accepted values are "log", "identity", and "sqrt".

Value

An object of class "family" that can be used in glm().

Examples

set.seed(123)
y <- rpois(100, lambda = 3)
y <- y[y > 0]  # Truncate zeros
x <- rnorm(length(y))
model <- glm(y ~ x, family = ptfamily())
summary(model)


spatemR documentation built on June 8, 2025, 1:16 p.m.