An extension of the stochastic susceptible–infectious–recovered (SIR) model is proposed in order to accommodate a regression context for modelling infectious disease data. The proposal is based on a multivariate counting process specified by conditional intensities, which contain an additive epidemic component and a multiplicative endemic component. This allows the analysis of endemic infectious diseases by quantifying risk factors for infection by external sources in addition to infective contacts. Inference can be performed by considering the full likelihood of the stochastic process with additional parameter restrictions to ensure non-negative conditional intensities. Simulation from the model can be performed by Ogata's modified thinning algorithm. As an illustrative example, we analyse data provided by the Federal Research Centre for Virus Diseases of Animals, Wusterhausen, Germany, on the incidence of the classical swine fever virus in Germany during 1993–2004.