ptfamily {spatemR} | R 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)
[Package spatemR version 1.2.0 Index]