• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
The Analysis Factor

The Analysis Factor

Statistical Consulting, Resources, and Statistics Workshops for Researchers

  • Home
  • Our Programs
    • Membership
    • Online Workshops
    • Free Webinars
    • Consulting Services
  • About
    • Our Team
    • Our Core Values
    • Our Privacy Policy
    • Employment
    • Collaborate with Us
  • Statistical Resources
  • Contact
  • Blog
  • Login

Getting Accurate Predicted Counts When There Are No Zeros in the Data

by Jeff Meyer Leave a Comment

We previously examined why a linear regression and negative binomial regression were not viable models for predicting the expected length of stay in the hospital for people with the flu.  A linear regression model was not appropriate because our outcome variable, length of stay, was discrete and not continuous.

A negative binomial model wasn’t the proper choice because the minimum length of stay is not zero. The minimum length of stay is one day. Negative binomial and Poisson models can only be used on data where the observations’ outcome have the possibility of having a zero count.

We need to use a truncated negative binomial model to analyze the expected length of stay of people admitted to the hospital who have the flu. Calculating the expected length of stay is an easy task once we create our model.

Most software packages give you at least two options for predicting the outcome.  Because negative binomial regression uses a natural log link, the regression coefficients are all on a natural log scale. Just like in linear regression, you can compute your predicted values using these regression coefficients in a linear combination with the values of X, but you’ll end up with predicted ln(counts), not predicted counts.

This “linear” prediction is rarely useful for presenting results.

Our next choice is to predict the expected count on its original scale. This is called the incident rate and is simply the linear prediction exponentiated. This is the result of which we have interest. Here’s the summary table, which gives us the mean, standard deviation, minimum value and maximum value of all of the predicted counts.

If I didn’t know anything about natural log exponents I might believe the “linear” results were accurate. But I can’t quite understand the incident rate results. How could the maximum predicted count be 0.00000123? The data set’s actual mean number of days spent in the hospital is 2.18 days.

Where did the model go wrong?

It turns out there is one more method for predicting the expected number of days spent in the hospital.  This is the conditional mean, which takes into account the truncation. It is: E(y| y>LL).

This translates to the expected count of “length of stay” given that “length of stay” must be greater than LL, the lower limit.  The lower limit for this model was set at 0, meaning that all values must be greater than zero. Since this is a discrete model, the minimum value is 1.

Calculating the conditional mean value of “y,” given the predictors of the model and the lower limit of zero, the summary table for our expected length of stay is:

A minimum length of stay is one day and the maximum length of stay is 13 days.

Jeff Meyer is a statistical consultant with The Analysis Factor, a stats mentor for Statistically Speaking membership, and a workshop instructor. Read more about Jeff here.

Poisson and Negative Binomial Regression for Count Data
Learn when you need to use Poisson or Negative Binomial Regression in your analysis, how to interpret the results, and how they differ from similar models.

Tagged With: conditional mean, Count data, incidence rate ratio, linear regression, Negative Binomial Regression, predicted count, truncated negative binomial model, Zero Truncated

Related Posts

  • The Importance of Including an Exposure Variable in Count Models
  • Count Models: Understanding the Log Link Function
  • The Problem with Linear Regression for Count Data
  • A Few Resources on Zero-Inflated Poisson Models

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Please note that, due to the large number of comments submitted, any questions on problems related to a personal study/project will not be answered. We suggest joining Statistically Speaking, where you have access to a private forum and more resources 24/7.

Primary Sidebar

This Month’s Statistically Speaking Live Training

  • Member Training: Assumptions of Linear Models

Upcoming Free Webinars

The Pathway: Steps for Staying Out of the Weeds in any Data Analysis

Upcoming Workshops

  • Analyzing Count Data: Poisson, Negative Binomial, and Other Essential Models (Jul 2022)
  • Introduction to Generalized Linear Mixed Models (Jul 2022)

Copyright © 2008–2022 The Analysis Factor, LLC. All rights reserved.
877-272-8096   Contact Us

The Analysis Factor uses cookies to ensure that we give you the best experience of our website. If you continue we assume that you consent to receive cookies on all websites from The Analysis Factor.
Continue Privacy Policy
Privacy & Cookies Policy

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Non-necessary
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.
SAVE & ACCEPT