• 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
  • About
    • Our Programs
    • Our Team
    • Our Core Values
    • Our Privacy Policy
    • Employment
    • Guest Instructors
  • Membership
    • Statistically Speaking Membership Program
    • Login
  • Workshops
    • Online Workshops
    • Login
  • Consulting
    • Statistical Consulting Services
    • Login
  • Free Webinars
  • Contact
  • Login

Recoding a Variable from a Survey Question to Use in a Statistical Model

by Jeff Meyer Leave a Comment

Survey questions are often structured without regard for ease of use within a statistical model.

Take for example a survey done by the Centers for Disease Control (CDC) regarding child births in the U.S. One of the variables in the data set is “interval since last pregnancy”. Here is a histogram of the results.

Reading the survey’s user guide it turns out the variable contains both nominal and continuous data. The continuous data has values from 4 to 300 months.  The nominal data is “no previous pregnancy” which has the value of 888 and “plural delivery” equal to the value of 3.

It’s not possible to use a variable in a statistical analysis if it is a combination of nominal and continuous data. This data could be an important predictor in an explanatory analysis on birth weight. How can we use it?

One strategy is to create a categorical predictor.

Two categories are easy to determine. One category would represent first pregnancy (no previous pregnancy) and the second would represent multiple births (plural delivery).

How should the balance of the data be categorized? One strategy is to aggregate data based on theory.

Research conducted by Dr. Agustin Conde-Agudelo and colleagues found the risk for low birth weight increased by 3.3% for each month less than 18 months. For each month between pregnancies longer than five years the risk of low birth weight increased by 0.6% to 0.9%.

Using the information from this study there is a theoretical reason to split the data into five categories.

  1. Multiple births
  2. First pregnancy
  3. Less than 18 months since last pregnancy
  4. Between 18 and 60 months since last pregnancy
  5. Greater than 60 months since last pregnancy

Regressing birth weight in pounds on the new categorical variable using a 3,000-observation random subsample of the data produced the following results.

Running a pairwise comparison of adjacent categories produces results that concur with the research done by Dr. Conde-Agudelo.

The bottom line: when a variable is a combination of continuous and nominal data, use theory to determine the aggregation of the data when creating a new categorical predictor.

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.

Four Critical Steps in Building Linear Regression Models
While you’re worrying about which predictors to enter, you might be missing issues that have a big impact your analysis. This training will help you achieve more accurate results and a less-frustrating model building experience.

Tagged With: categorical predictor, continuous predictor, predictor variable, recode, survey, survey questions

Related Posts

  • A Strategy for Converting a Continuous to a Categorical Predictor
  • A Useful Graph for Interpreting Interactions between Continuous Variables
  • Should I Specify a Model Predictor as Categorical or Continuous?
  • The Impact of Removing the Constant from a Regression Model: The Categorical Case

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

  • February Member Training: Choosing the Best Statistical Analysis

Upcoming Workshops

  • Logistic Regression for Binary, Ordinal, and Multinomial Outcomes (May 2021)
  • Introduction to Generalized Linear Mixed Models (May 2021)

Read Our Book



Data Analysis with SPSS
(4th Edition)

by Stephen Sweet and
Karen Grace-Martin

Statistical Resources by Topic

  • Fundamental Statistics
  • Effect Size Statistics, Power, and Sample Size Calculations
  • Analysis of Variance and Covariance
  • Linear Regression
  • Complex Surveys & Sampling
  • Count Regression Models
  • Logistic Regression
  • Missing Data
  • Mixed and Multilevel Models
  • Principal Component Analysis and Factor Analysis
  • Structural Equation Modeling
  • Survival Analysis and Event History Analysis
  • Data Analysis Practice and Skills
  • R
  • SPSS
  • Stata

Copyright © 2008–2021 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