Tutorials › Biostatistics › Types of Data in Biostatistics

Biostatistics Fundamentals

Types of Data in Biostatistics

A practical guide to categorical, numerical, discrete, continuous, ordinal, nominal, binary, count, interval, ratio, time-to-event, longitudinal, and repeated-measures data—and how the type of data influences statistical analysis.

Beginner 15 min read

What You'll Learn

  • How categorical and numerical data differ
  • The difference between nominal, ordinal, interval, and ratio scales
  • When a variable is binary, discrete, continuous, or a count
  • How data type affects statistical methods
  • How clinical trial endpoints map to data types
  • How to identify the data type before choosing a statistical test

Introduction

Before selecting a statistical test, calculating a confidence interval, or building a regression model, you need to know what kind of data you have.

This sounds simple, but data classification is one of the most important foundations of biostatistics.

Consider several variables collected in a clinical trial:

Variable Example
Treatment group Placebo / Drug A / Drug B
Sex Female / Male
Disease severity Mild / Moderate / Severe
Age 57 years
Systolic blood pressure 132 mmHg
Number of adverse events 4
Time to progression 14.7 months
Death Yes / No

All of these variables can appear in the same clinical database, but they do not represent the same type of information.

The distinction matters because statistical procedures make assumptions about the structure of the outcome or predictor being analyzed.

Key idea: There is no single classification system that describes every aspect of a variable. A variable can simultaneously be categorical, ordinal, and discrete, or numerical, continuous, and ratio-scaled. Good statistical practice begins by identifying the relevant properties of the variable rather than assigning it one label.

The Major Data Classifications

A useful first classification divides data into two broad groups:

1
Categorical data: observations belong to defined categories.
2
Numerical data: observations represent numerical quantities that can be meaningfully analyzed as measurements or counts.

Within these broad groups, several more specific classifications are useful:

Classification Meaning Example
Nominal Categories without inherent order Treatment group
Ordinal Ordered categories Mild / Moderate / Severe
Binary Two possible categories Responder / Non-responder
Discrete Separate countable numerical values Number of hospitalizations
Continuous Measurements that can theoretically take any value in an interval Weight
Count Nonnegative integer event counts Number of adverse events
Time-to-event Time until an event, often with censoring Time to death

Categorical Data

Categorical data classify observations into groups or categories.

For example, suppose a randomized clinical trial has three treatment groups:

  • Placebo
  • Low-dose treatment
  • High-dose treatment

The treatment variable is categorical because each patient belongs to one of several categories.

The labels themselves do not necessarily represent numerical quantities.

Important: Coding categories with numbers does not automatically make them numerical measurements. If placebo is coded as 0, low dose as 1, and high dose as 2, those numbers may simply be labels.

Examples of Categorical Variables

Variable Categories
Treatment arm Placebo, Drug A, Drug B
Sex Female, Male
Smoking status Never, Former, Current
Disease subtype Subtype A, B, C
Adverse event severity Grade 1, 2, 3, 4, 5

Categorical data are often summarized using:

  • Counts
  • Percentages
  • Proportions
  • Rates
  • Contingency tables

Nominal Data

Nominal data are categorical data in which the categories have no inherent ranking.

For example:

\[ \text{Treatment} \in \{\text{Placebo},\text{Drug A},\text{Drug B}\} \]

There is no mathematical sense in which Drug B is "greater than" Drug A.

The categories are simply different.

Examples of Nominal Variables

  • Blood type: A, B, AB, O
  • Country
  • Clinical site
  • Genotype category
  • Treatment group
  • Disease subtype

If numerical codes are used, they should generally be treated as labels rather than measurements.

For example:

1 = Placebo
2 = Drug A
3 = Drug B

The mean of these codes has no useful clinical interpretation.

Ordinal Data

Ordinal data are categorical observations with a meaningful order.

For example, disease severity might be classified as:

\[ \text{Mild}<\text{Moderate}<\text{Severe} \]

We know that severe disease represents greater severity than moderate disease, but we do not necessarily know that the difference between mild and moderate is numerically identical to the difference between moderate and severe.

Examples of Ordinal Data

Variable Ordered Categories
Disease severity Mild → Moderate → Severe
Pain severity None → Mild → Moderate → Severe
Likert response Strongly disagree → Strongly agree
Performance status Ordered functional categories
Adverse event grade Increasing severity grades
The key distinction: Ordinal data tell us which category is higher or lower, but they do not necessarily tell us that the numerical distance between adjacent categories is equal.

Binary Data

Binary data have exactly two possible categories.

Examples include:

  • Response: Yes / No
  • Death: Yes / No
  • Pregnancy: Yes / No
  • Relapse: Yes / No
  • Adverse event: Yes / No
  • Positive test / Negative test

A binary variable is a special case of categorical data.

It is frequently represented as:

\[ Y\in\{0,1\} \]

For example:

Y = 1  if the patient responds
Y = 0  if the patient does not respond

Binary outcomes are central to clinical research because many important endpoints are naturally expressed as events or non-events.

Proportions and Binary Outcomes

Suppose 42 of 100 patients respond.

The observed response proportion is:

\[ \hat p=\frac{42}{100}=0.42 \]

or 42%.

The underlying statistical model may treat each patient outcome as a Bernoulli random variable:

\[ Y_i\sim\operatorname{Bernoulli}(p) \]

The total number of responses then follows a binomial distribution:

\[ X=\sum_{i=1}^{n}Y_i \sim\operatorname{Binomial}(n,p) \]

This is why binomial methods are so common for single-arm response-rate analyses and sample-size calculations.

Numerical Data

Numerical data represent quantities measured or counted using numbers.

Examples include:

  • Age
  • Weight
  • Height
  • Blood pressure
  • Serum concentration
  • Creatinine
  • Number of adverse events
  • Duration of treatment

Numerical data can then be divided into discrete and continuous data.

Discrete Data

Discrete data take separate, countable values.

For example, the number of hospitalizations might be:

\[ 0,1,2,3,4,\ldots \]

A patient cannot have 2.73 hospitalizations.

Similarly, the number of adverse events is generally a count:

\[ 0,1,2,3,\ldots \]

Examples of Discrete Variables

  • Number of adverse events
  • Number of hospitalizations
  • Number of prior treatments
  • Number of exacerbations
  • Number of lesions
  • Number of responders

Discrete variables often arise from counting.

Continuous Data

Continuous data arise from measurements that can, in principle, take any value within a range.

Examples include:

  • Weight
  • Height
  • Temperature
  • Blood pressure
  • Serum concentration
  • Drug clearance
  • Area under the concentration-time curve
  • QT interval

For example, body weight could theoretically be:

\[ 72.1,\;72.13,\;72.137,\;72.1374,\ldots \]

The precision recorded in a database may be limited, but the underlying quantity is conceptually continuous.

Measured precision is not the same thing as data type. A variable recorded to one decimal place can still represent a continuous quantity. Rounding does not automatically make a measurement discrete.

Discrete vs. Continuous

Feature Discrete Continuous
Nature Countable values Measured quantity
Possible values Separate values Potentially infinitely many values within a range
Example Number of hospitalizations Hospital length of stay
Another example Number of adverse events Serum concentration

Count Data

Count data are a particularly important form of discrete data.

A count variable records how many times an event occurs.

Examples include:

  • Number of seizures
  • Number of hospital admissions
  • Number of adverse events
  • Number of asthma exacerbations
  • Number of infections

A basic count variable is often modeled using a Poisson distribution:

\[ Y\sim\operatorname{Poisson}(\lambda) \[

where \(\lambda\) represents the expected count over the specified observation period when the Poisson assumptions are appropriate.

In practice, count data can exhibit greater variability than a Poisson model allows. This is commonly called overdispersion and can motivate negative-binomial or other models.

Interval Data

An interval scale has meaningful differences between values, but zero does not represent an absolute absence of the quantity.

The classic example is temperature measured in Celsius.

The difference between 20°C and 30°C is the same size as the difference between 30°C and 40°C.

However, 40°C is not meaningfully "twice as hot" as 20°C.

This distinction matters because ratios require a meaningful zero point.

Interval scale: Differences are meaningful; ratios are not necessarily meaningful.

Ratio Data

Ratio data have all the properties of interval data plus a meaningful absolute zero.

Examples include:

  • Weight
  • Height
  • Age
  • Drug concentration
  • Clearance
  • Time duration
  • Laboratory concentration

For example, if one concentration is 20 ng/mL and another is 10 ng/mL, the first is twice the second in the ratio-scale sense.

Ratio scale: Differences and ratios are meaningful because zero represents the absence of the measured quantity.

Interval vs. Ratio

Property Interval Ratio
Ordered Yes Yes
Equal differences meaningful Yes Yes
Meaningful absolute zero No Yes
Ratios meaningful Generally no Yes
Example Temperature in Celsius Weight

Measurement Scales in One Framework

The classical measurement-scale framework consists of four levels:

1
Nominal: categories with no order.
2
Ordinal: ordered categories.
3
Interval: ordered numerical values with meaningful differences but no absolute zero.
4
Ratio: numerical values with meaningful differences and an absolute zero.

The hierarchy can be summarized as:

\[ \text{Nominal} \rightarrow \text{Ordinal} \rightarrow \text{Interval} \rightarrow \text{Ratio} \]

Each step adds information about the mathematical structure of the data.

One Variable Can Have Multiple Descriptions

A common source of confusion is treating data classifications as mutually exclusive labels.

They are not.

For example, age can be described as:

  • Numerical
  • Continuous in its underlying measurement concept
  • Ratio-scaled

Number of hospitalizations can be described as:

  • Numerical
  • Discrete
  • Count data
  • Ratio-scaled

Disease severity classified as mild, moderate, or severe can be described as:

  • Categorical
  • Ordinal
  • Discrete in the sense that only defined categories are observed
Better question: Instead of asking "What is the one data type?", ask several questions: Is it categorical or numerical? Is it ordered? Is it a count or a measurement? Is there a meaningful zero? Is it measured once or repeatedly?

Clinical Trial Endpoints by Data Type

Clinical trials use many different endpoint structures.

Endpoint Data Type
Objective response: Yes / No Binary categorical
Disease stage Ordinal categorical
Treatment arm Nominal categorical
Change in tumor size Continuous numerical
Number of adverse events Discrete count
Time to progression Time-to-event
Repeated blood pressure measurements Continuous longitudinal
Patient-reported Likert response Ordinal categorical
Number of hospitalizations Count

The endpoint type often determines the broad family of statistical methods that should be considered.

Binary Outcomes and Common Methods

Binary outcomes are often analyzed using methods such as:

  • Binomial confidence intervals
  • One-sample proportion tests
  • Two-sample proportion tests
  • Fisher's exact test
  • Chi-square tests
  • Logistic regression
  • Exact binomial methods

For example, if the endpoint is response versus non-response, logistic regression models the probability of response.

\[ \log\left(\frac{p}{1-p}\right) = \beta_0+\beta_1X \]

where \(p\) is the probability of the binary outcome.

Nominal Outcomes and Contingency Tables

Suppose a study records disease subtype:

Subtype A Subtype B Subtype C
Placebo 25 18 7
Drug 31 12 9

The categories are nominal because there is no inherent ordering of the subtypes.

Methods for categorical association may include chi-square or exact tests, depending on the study design, sample size, and assumptions.

Ordinal Outcomes and Common Methods

Suppose pain severity is recorded as:

\[ 0=\text{None},\quad 1=\text{Mild},\quad 2=\text{Moderate},\quad 3=\text{Severe} \]

The ordering contains information.

Possible methods include:

  • Mann–Whitney or Wilcoxon rank-sum methods for suitable two-group comparisons
  • Wilcoxon signed-rank methods for suitable paired comparisons
  • Ordinal logistic regression
  • Proportional-odds models
  • Other ordinal regression models
Do not automatically treat ordinal categories as continuous. Coding mild = 1, moderate = 2, and severe = 3 does not prove that the difference from mild to moderate is equivalent to the difference from moderate to severe.

Continuous Outcomes and Common Methods

Continuous outcomes include measurements such as:

  • Weight
  • Blood pressure
  • Biomarker concentration
  • Cholesterol
  • QT interval
  • Change from baseline

Common methods include:

  • t-tests
  • ANOVA
  • ANCOVA
  • Linear regression
  • Linear mixed-effects models
  • Repeated-measures models

The appropriate method still depends on the design and assumptions. Being continuous does not automatically mean that a t-test is appropriate.

Count Outcomes and Common Methods

Suppose the primary endpoint is the number of migraine attacks during a 12-week treatment period.

The outcome is a count:

\[ Y=0,1,2,3,\ldots \]

Potential methods include:

  • Poisson regression
  • Negative-binomial regression
  • Zero-inflated models in appropriate settings
  • Generalized linear mixed models for repeated counts

Exposure time may also matter.

For example, if patients are followed for different lengths of time, an incidence-rate analysis may incorporate an exposure offset.

\[ \log(E[Y_i]) = \beta_0+\beta_1X_i+\log(t_i) \]

where \(t_i\) represents the relevant exposure or observation time.

Time-to-Event Data

Time-to-event data record the time until an event occurs.

Examples include:

  • Overall survival
  • Progression-free survival
  • Time to relapse
  • Time to hospitalization
  • Time to treatment discontinuation

These data have an important feature that distinguishes them from ordinary continuous measurements: censoring.

For example, suppose a patient has not experienced progression when the study ends.

We may know that:

\[ T>t \]

but we do not know the patient's eventual progression time.

Time-to-event data are not simply continuous data. Although time is numerical and often continuous, censoring changes the statistical problem. Survival-analysis methods are designed specifically to handle this structure.

Common Time-to-Event Methods

Important methods include:

  • Kaplan–Meier estimation
  • Log-rank testing
  • Cox proportional-hazards regression
  • Parametric survival models
  • Accelerated failure-time models
  • Restricted mean survival time analysis

The survival function is:

\[ S(t)=P(T>t) \]

It represents the probability of remaining event-free beyond time \(t\).

Longitudinal Data

Longitudinal data consist of observations collected from the same participant over time.

For example, a clinical trial might measure systolic blood pressure at:

  • Baseline
  • Week 2
  • Week 4
  • Week 8
  • Week 12

The resulting data are not independent observations because measurements from the same patient are generally related.

A simplified structure might look like:

Patient Visit Blood Pressure
001 Baseline 148
001 Week 4 139
001 Week 8 134
002 Baseline 141
002 Week 4 138
002 Week 8 136

This is both continuous and longitudinal data.

Repeated-Measures Data

Repeated-measures data are a special case of correlated observations in which the same experimental unit is measured more than once.

Repeated measurements may be:

  • Continuous
  • Binary
  • Ordinal
  • Count-valued

For example, repeated pain assessments might be ordinal, while repeated biomarker measurements might be continuous.

The data type of the measurement still matters even though the measurements are repeated.

Two questions are needed: First ask what type of outcome is being measured? Then ask how are the observations related? A repeated continuous outcome may call for a mixed model, while a repeated binary outcome may require a generalized mixed model or another method for correlated binary observations.

Cross-Sectional vs. Longitudinal Data

Feature Cross-Sectional Longitudinal
Measurement timing Usually one time point Multiple time points
Same subject measured repeatedly Usually no Yes
Within-subject correlation Usually not relevant Important
Example Baseline cholesterol Cholesterol over 12 visits

Independent vs. Paired Data

Another important distinction concerns whether observations are independent.

Two treatment groups may consist of different patients:

\[ \text{Drug patients} \quad\text{vs.}\quad \text{Placebo patients} \]

These are typically independent groups.

In contrast, if each patient has a measurement before and after treatment, the observations are paired:

\[ Y_{\text{after},i}-Y_{\text{before},i} \]

The difference is calculated within patient.

This distinction affects whether an analysis should use paired or independent methods.

Data Type vs. Distribution

Data type and probability distribution are related but not identical concepts.

For example, a continuous variable could be approximately:

  • Normal
  • Log-normal
  • Gamma
  • Weibull
  • Approximately symmetric without a simple named distribution

A count variable might follow:

  • Poisson
  • Negative binomial
  • Another count distribution

A binary variable can be modeled using a Bernoulli distribution at the individual-observation level.

Do not confuse data type with distribution. "Continuous" describes the nature of the variable. "Normally distributed" describes a probability distribution that may or may not adequately represent that variable.

Transformation Does Not Necessarily Change the Scientific Data Type

Suppose drug concentration is measured on a ratio scale.

An investigator might analyze:

\[ \log(C) \]

instead of \(C\).

The analysis variable is now the logarithm of concentration, but the underlying scientific measurement remains drug concentration.

Similarly, a continuous biomarker might be transformed using a logarithm, square root, or another transformation to improve model fit.

Why Log Transformation Is Common in Pharmacokinetics

Pharmacokinetic concentrations are often positive and right-skewed.

A logarithmic transformation can produce a more symmetric analysis scale:

\[ Z=\log(C) \]

This is one reason pharmacokinetic analyses frequently report geometric means and geometric mean ratios.

For example:

\[ \text{Geometric Mean} = \exp\left( \frac{1}{n} \sum_{i=1}^{n}\log C_i \right) \]

The transformation changes the analysis scale; it does not mean the original concentration variable was categorical or discrete.

Data Type and Summary Statistics

The appropriate descriptive summary depends on the structure of the data.

Data Type Common Summaries
Nominal categorical Counts and percentages
Ordinal categorical Counts, percentages, medians, distributions
Binary Counts, percentages, proportions
Continuous approximately symmetric Mean, SD, confidence interval
Continuous skewed Median, IQR, range or other distributional summaries
Count Mean, variance, median, quantiles, count distribution
Time-to-event Median survival, survival probabilities, event counts

These are common conventions, not rigid rules.

The underlying distribution and scientific question should guide the summary.

Mean vs. Median

For a continuous variable, the arithmetic mean is:

\[ \bar{x} = \frac{1}{n} \sum_{i=1}^{n}x_i \]

The median is the middle observation after ordering the data.

The mean can be strongly affected by extreme observations, while the median is more resistant to outliers.

For example, consider hospital length of stay:

\[ 2,\;3,\;3,\;4,\;5,\;6,\;30 \]

The distribution is right-skewed because one patient stayed much longer than the others.

A median and interquartile range may provide a more useful descriptive summary than the mean and standard deviation in such a setting.

Data Type and Graphical Displays

The type of data also influences the most informative visualization.

Data Type Useful Graphs
Nominal categorical Bar chart
Ordinal Ordered bar chart
Binary Bar chart or proportion plot
Continuous Histogram, density plot, box plot
Count Bar chart, histogram, count distribution
Time-to-event Kaplan–Meier curve
Longitudinal continuous Spaghetti plot, mean trajectory, profile plot

A Common Mistake: Treating IDs as Measurements

Patient identification numbers are numerical strings, but they are not numerical measurements.

For example:

Patient 1001
Patient 1002
Patient 1003

The fact that 1003 is numerically larger than 1001 has no scientific meaning.

Patient ID is therefore essentially a nominal identifier.

Rule: A column containing numbers is not necessarily a numerical variable. Ask what the numbers mean, not merely how they are stored.

A Common Mistake: Treating Treatment Codes as Continuous

Suppose:

0 = Placebo
1 = Low dose
2 = High dose

If these values represent treatment categories, the coding itself does not make the variable continuous.

However, dose may also be represented by an actual numerical quantity such as:

\[ 0,\;10,\;30,\;60\text{ mg} \]

Now the variable represents a quantitative dose.

The distinction is between a category label and a measured or assigned quantity.

A Common Mistake: Treating Ordinal Data as Continuous

Suppose a questionnaire records:

1 = Strongly disagree
2 = Disagree
3 = Neutral
4 = Agree
5 = Strongly agree

The categories have a meaningful order.

But the coding does not establish that the psychological distance between "Strongly disagree" and "Disagree" is exactly equal to the distance between "Agree" and "Strongly agree."

There are circumstances in which researchers analyze multi-item scales using methods designed for approximately continuous scores, particularly when the scale has many categories and appropriate measurement properties.

But this is a modeling decision, not something established merely by the presence of numbers 1 through 5.

Data Type and Regression Models

Regression models are often selected according to the outcome variable.

Outcome Potential Model Family
Continuous Linear regression
Binary Logistic regression
Count Poisson or negative-binomial regression
Ordinal Ordinal logistic regression
Time-to-event Cox or parametric survival models

This table is a starting point, not a substitute for checking the study design, estimand, distribution, independence structure, and model assumptions.

The Outcome Usually Drives the Model Family

Suppose the predictor is age.

Age can appear in many different models.

For example:

  • Age predicting response → logistic regression
  • Age predicting a biomarker → linear regression
  • Age predicting number of hospitalizations → count regression
  • Age predicting survival → survival regression

The predictor being continuous does not determine the model by itself.

Key modeling principle: For many regression problems, the outcome type is the first major determinant of the model family. Predictors can then be incorporated according to their own measurement structure and scientific meaning.

Data Type and Hypothesis Tests

The same clinical question can require different tests depending on the outcome.

Suppose two treatment groups are being compared.

Outcome Potential Comparison
Binary response Difference in proportions, risk ratio, odds ratio
Continuous biomarker Mean difference or another continuous-data estimand
Ordinal severity Ordinal or rank-based comparison
Count of events Rate ratio or count regression
Time to progression Hazard ratio, survival probability, RMST, or related estimand

Thus, "compare Drug A and Drug B" is not enough information to choose a statistical test.

You also need to know what is being measured and how the observations were collected.

A Worked Example: Classifying a Clinical Trial Dataset

Consider the following simplified clinical trial database.

Variable Example Value Classification
Patient ID 10482 Nominal identifier
Treatment Drug A Nominal categorical
Sex Female Binary categorical
Disease severity Moderate Ordinal categorical
Age 58 Continuous/ratio numerical
Weight 72.4 kg Continuous/ratio numerical
Adverse event count 3 Discrete count
Response Yes Binary categorical
Biomarker 18.7 ng/mL Continuous/ratio numerical
Time to progression 9.4 months Time-to-event

Notice that the numerical value 58 in the Age column and the numerical value 3 in the Adverse Event Count column have very different statistical meanings.

Age is a measurement of a continuous quantity.

Adverse event count is a discrete event count.

Step 1: Identify What the Variable Represents

Before thinking about statistical software, ask:

1
Is this a category or a quantitative measurement?
2
If categorical, do the categories have an order?
3
If numerical, is it a count or a measurement?
4
Does zero represent an absolute absence of the quantity?
5
Are observations independent or repeated within subjects?
6
Does the variable involve time-to-event censoring?

Step 2: Identify the Study Structure

Data type alone is not enough.

Suppose the outcome is continuous.

A single measurement per patient might be analyzed differently from five measurements per patient.

Likewise, a binary outcome from independent groups differs from a binary outcome repeatedly measured on the same patient.

Outcome Structure Potential Analysis Family
Continuous Independent groups Linear models
Continuous Repeated over time Mixed/repeated-measures models
Binary Independent observations Binomial/logistic models
Binary Repeated observations Correlated binary models
Count Independent observations Poisson/negative-binomial models
Count Repeated observations Count mixed models or related approaches
Time-to-event Censored follow-up Survival analysis

Data Type and Missing Data

Missingness can also interact with the type of data.

For a continuous outcome, missing data may occur for a laboratory measurement.

For a binary endpoint, the issue may be an unknown responder status.

For longitudinal data, some patients may have measurements at baseline and Week 4 but not Week 8.

The missing-data strategy should therefore be considered together with the endpoint definition and analysis model.

Data Type and Outliers

Outliers have different meanings depending on the variable.

A very large value for a continuous laboratory measurement may be an actual biological observation, a measurement error, or a data-entry error.

A count of 30 adverse events may be unusual but still entirely legitimate.

A categorical value outside the permitted categories may instead indicate a coding or data-management problem.

Do not automatically delete unusual observations. First determine whether the observation is valid, whether it reflects a real clinical phenomenon, and whether the planned statistical method is appropriate for the resulting distribution.

Data Type and Normality

A common misconception is: "continuous data should be normally distributed."

That is not generally true.

Continuous variables can have many different distributions.

Normality is an assumption of some statistical procedures or models, not a definition of continuous data.

For example, a continuous variable may be strongly right-skewed and still be perfectly valid continuous data.

Data Type and Parametric Methods

Parametric methods typically make assumptions about the distribution or conditional distribution of the data.

For example, a linear model may be appropriate for a continuous outcome when its assumptions are reasonably satisfied.

If the outcome is binary, however, ordinary linear regression may not be the natural primary model for the probability because predicted values can fall outside the interval \([0,1]\).

Logistic regression instead models the log odds:

\[ \log\left(\frac{p}{1-p}\right) = X\beta \]

Why Data Classification Matters for Sample Size

Sample-size calculations depend strongly on the endpoint type.

For example, sample size for a single proportion is fundamentally different from sample size for a continuous mean.

Similarly, sample size for a survival endpoint must account for event information and potentially censoring.

Endpoint Typical Sample-Size Framework
Single binary proportion Binomial/proportion methods
Difference in proportions Two-proportion methods
Continuous mean difference Mean/variance-based methods
Count rate Rate/count models
Time-to-event Event-driven survival methods

Data Type in Regulatory Clinical Trials

Clinical trials commonly contain multiple endpoint types within the same study.

For example, a Phase III trial may collect:

  • A primary time-to-event endpoint
  • Binary responder status
  • Continuous laboratory measurements
  • Ordinal adverse-event severity
  • Count data for hospitalizations
  • Repeated patient-reported outcomes

There is therefore rarely one statistical method that applies to every variable in the database.

The statistical analysis plan should define how each prespecified endpoint and important analysis variable will be handled.

A Practical Data Classification Decision Tree

1
Are the values categories?
If yes, classify them as nominal, ordinal, or binary as appropriate.
2
If numerical, is the variable a count?
If yes, treat it as discrete/count data.
3
If numerical and measured, is it continuous?
Examples include weight, concentration, and blood pressure.
4
Does it have a meaningful zero?
If yes, the variable may have a ratio scale; if not, it may be interval-scaled.
5
Is it time until an event with censoring?
If yes, use a time-to-event framework rather than treating it as an ordinary continuous endpoint.
6
Are subjects measured repeatedly?
If yes, account for within-subject correlation.

Worked Example: Choosing the Analysis Family

Suppose a randomized clinical trial measures five outcomes.

Endpoint Type Possible Analysis Family
Responder status Binary Logistic/binomial methods
Change in LDL cholesterol Continuous Linear modeling
Number of hospitalizations Count Poisson/negative-binomial modeling
Disease severity grade Ordinal Ordinal methods
Time to disease progression Time-to-event Survival analysis

The correct approach begins by identifying the endpoint structure before selecting a test.

Data Type Does Not Automatically Determine One Statistical Test

It is tempting to memorize rules such as:

Continuous → t-test
Categorical → chi-square
Ordinal → Wilcoxon
Time-to-event → log-rank

These shortcuts can be useful for learning, but they are incomplete.

The final method depends on additional factors:

  • Study design
  • Number of groups
  • Independence
  • Repeated measurements
  • Distribution
  • Sample size
  • Censoring
  • Missing data
  • Covariates
  • Target estimand
  • Model assumptions
Think in terms of model structure, not test-name memorization. The data type tells you which statistical families are plausible. The study design and scientific question determine which method within that family is appropriate.

Common Data Types in Biostatistics

Data Type Definition Clinical Example
Nominal Unordered categories Treatment group
Ordinal Ordered categories Disease severity
Binary Two categories Response / no response
Discrete Separate countable values Number of visits
Continuous Measured numerical quantity Blood pressure
Count Number of events Number of exacerbations
Interval Equal differences, no absolute zero Temperature in Celsius
Ratio Equal differences and absolute zero Drug concentration
Time-to-event Time until event, often censored Overall survival
Longitudinal Repeated measurements over time Blood pressure at multiple visits

The Difference Between Data Type and Study Design

Data type describes the variable.

Study design describes how the observations were generated.

For example, a binary response can arise in:

  • A single-arm Phase II trial
  • A two-arm randomized trial
  • A crossover study
  • A longitudinal study
  • A diagnostic accuracy study

The outcome is binary in all five cases, but the appropriate statistical analysis may differ.

The Difference Between Data Type and Estimand

The same outcome type can support different estimands.

For a binary endpoint, investigators might target:

  • Risk difference
  • Risk ratio
  • Odds ratio
  • Response probability

For a continuous endpoint, they might target:

  • Mean difference
  • Median difference
  • Geometric mean ratio
  • Change from baseline

For time-to-event outcomes, they might target:

  • Hazard ratio
  • Survival probability at a specified time
  • Median survival
  • Restricted mean survival time
Important: Data type helps determine what models can be used, but the estimand determines what quantity the analysis is actually trying to estimate.

Data Type and Baseline Covariates

Not every variable in a clinical trial is an endpoint.

Baseline covariates can have many different data types.

Covariate Type
Age Continuous
Sex Binary categorical
Race/ethnicity categories Categorical
Disease stage Ordinal
Baseline biomarker Continuous
Prior treatment count Count

Regression models can incorporate these different predictor types using appropriate coding or functional forms.

Dummy Variables for Nominal Predictors

Suppose treatment has three categories:

Placebo
Drug A
Drug B

A regression model cannot generally insert the text labels directly into a numerical linear predictor.

Instead, indicator variables can be created.

For example, using placebo as the reference:

\[ I_A= \begin{cases} 1,&\text{Drug A}\\ 0,&\text{otherwise} \end{cases} \]
\[ I_B= \begin{cases} 1,&\text{Drug B}\\ 0,&\text{otherwise} \end{cases} \]

The model can then estimate treatment effects relative to placebo.

Ordinal Predictors Need Careful Coding

An ordinal predictor can sometimes be represented using:

  • Indicator variables for each category
  • A numeric score when a linear trend is scientifically justified
  • Other ordered-effect parameterizations

These approaches make different assumptions.

For example, coding:

Mild     = 1
Moderate = 2
Severe   = 3
and fitting a single linear coefficient assumes a particular relationship between the categories.

That assumption should be justified rather than made automatically.

Data Type and Missing Values

Missing data are not themselves a data type, but the consequences of missingness depend on the variable.

Examples include:

Variable Missing Observation
Binary response Responder status unknown
Continuous biomarker Laboratory value unavailable
Ordinal severity Severity category not assessed
Time-to-event Follow-up ends before event
Longitudinal outcome One or more visits missing

Importantly, a censored time-to-event observation is not necessarily the same thing as an ordinary missing observation.

For a censored patient, we often know that the event has not occurred through a particular time.

Censoring Is Information

Suppose a patient is followed for 18 months without progression.

We may not know the eventual progression time, but we do know:

\[ T>18 \]

That information contributes to survival analysis.

Simply deleting the patient would discard information and generally produce biased results.

Data Type and Distributional Assumptions

Different data types lead to different natural probability models.

Data Common Distributional Framework
Binary Bernoulli / binomial
Count Poisson / negative binomial
Continuous Normal, log-normal, gamma, etc.
Ordinal Ordinal probability models
Time-to-event Survival distributions and hazard models

These are modeling frameworks rather than rules that every dataset must obey.

Why Data Classification Is the First Step

Imagine being asked: "Which statistical test should I use?"

That question is incomplete.

A better sequence is:

1
Define the scientific question.
2
Define the endpoint or variable.
3
Classify the data type.
4
Identify the study and sampling structure.
5
Determine the estimand.
6
Select an appropriate statistical model.
7
Check assumptions and sensitivity analyses.

Quick Reference: Data Types

Question If Yes
Is it a category? Categorical
Are the categories ordered? Ordinal
Are there exactly two categories? Binary
Is it an unordered category? Nominal
Is it a numerical count? Discrete/count
Is it a measured quantity? Often continuous
Does zero represent absence of the quantity? Ratio scale
Are equal differences meaningful but zero arbitrary? Interval scale
Is it time until an event with censoring? Time-to-event
Is the same subject measured repeatedly? Longitudinal/repeated measures

Common Mistakes

  1. Assuming numbers automatically mean numerical data. Patient IDs and treatment codes can contain numbers while remaining nominal variables.
  2. Ignoring ordering in categorical data. Mild, moderate, and severe are not equivalent to three unrelated categories.
  3. Assuming ordinal scores are automatically continuous. The numerical coding does not guarantee equal distances between categories.
  4. Calling every numerical variable continuous. Event counts are discrete.
  5. Treating time-to-event data as ordinary continuous data. Censoring requires survival-analysis methods.
  6. Ignoring repeated measurements. Observations from the same patient are generally correlated.
  7. Confusing data type with distribution. Continuous does not mean normal.
  8. Choosing a test from the outcome type alone. Study design, independence, estimand, and other factors also matter.
  9. Assuming one statistical method applies to the whole dataset. A clinical trial can contain binary, continuous, ordinal, count, and time-to-event endpoints simultaneously.

Practical Workflow for Biostatisticians

1
Identify the variable.
What exactly is being measured?
2
Determine whether it is categorical or numerical.
3
For categorical variables, determine whether categories are ordered.
4
For numerical variables, distinguish counts from measurements.
5
Determine the measurement scale.
Nominal, ordinal, interval, or ratio as applicable.
6
Determine whether observations are independent or correlated.
7
Check whether the endpoint is time-to-event data.
8
Define the scientific estimand.
9
Select the statistical method.
10
Evaluate assumptions and sensitivity analyses.

Worked Example Summary

Consider these common clinical variables:

Variable Primary Classification Typical Statistical Family
Treatment group Nominal categorical Categorical/regression methods
Response Binary Binomial/logistic methods
Disease severity Ordinal Ordinal methods
Weight Continuous, ratio Linear/continuous-data methods
Adverse-event count Discrete count Poisson/negative-binomial methods
Time to progression Time-to-event Survival methods
Repeated biomarker Continuous longitudinal Mixed/repeated-measures methods

The Most Important Concept

The most important lesson is that data classification is more than putting variables into "categorical" and "continuous" boxes.

A good biostatistical analysis considers several dimensions simultaneously.

  • Is the variable categorical or numerical?
  • If categorical, is it nominal or ordinal?
  • If numerical, is it discrete or continuous?
  • Is it a count?
  • Is there a meaningful zero?
  • Are observations independent?
  • Are measurements repeated?
  • Does the endpoint involve censoring?
  • What quantity is the analysis intended to estimate?

Once these questions are answered, the appropriate statistical methods become much easier to identify.

Bottom line: Types of data form the foundation of biostatistical analysis. Nominal, ordinal, and binary variables are categorical; continuous and discrete variables are numerical; count data are a particularly important form of discrete data; interval and ratio describe measurement scales; and time-to-event and longitudinal data describe additional structural properties that require specialized methods. In clinical research, the data type should be identified before selecting a statistical test or model, but it should always be considered together with the study design, dependence structure, estimand, distribution, censoring, and missing-data mechanisms.

References

Agresti, A. (2018). An Introduction to Categorical Data Analysis, 3rd ed. Wiley.
Agresti, A. (2010). Analysis of Ordinal Categorical Data, 2nd ed. Wiley.
Altman, D.G. (1991). Practical Statistics for Medical Research. Chapman & Hall.
Fisher, L.D. & van Belle, G. (1993). Biostatistics: A Methodology for the Health Sciences. Wiley.
Hosmer, D.W., Lemeshow, S. & Sturdivant, R.X. (2013). Applied Logistic Regression, 3rd ed. Wiley.
McCullagh, P. & Nelder, J.A. (1989). Generalized Linear Models, 2nd ed. Chapman & Hall.
Pinheiro, J.C. & Bates, D.M. (2000). Mixed-Effects Models in S and S-PLUS. Springer.
Therneau, T.M. & Grambsch, P.M. (2000). Modeling Survival Data: Extending the Cox Model. Springer.