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.
The Major Data Classifications
A useful first classification divides data into two broad groups:
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.
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:
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:
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 |
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:
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:
or 42%.
The underlying statistical model may treat each patient outcome as a Bernoulli random variable:
The total number of responses then follows a binomial distribution:
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:
A patient cannot have 2.73 hospitalizations.
Similarly, the number of adverse events is generally a count:
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:
The precision recorded in a database may be limited, but the underlying quantity is conceptually continuous.
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:
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.
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.
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:
The hierarchy can be summarized as:
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
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.
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:
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
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:
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.
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:
but we do not know the patient's eventual progression time.
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:
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.
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:
These are typically independent groups.
In contrast, if each patient has a measurement before and after treatment, the observations are paired:
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.
Transformation Does Not Necessarily Change the Scientific Data Type
Suppose drug concentration is measured on a ratio scale.
An investigator might analyze:
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:
This is one reason pharmacokinetic analyses frequently report geometric means and geometric mean ratios.
For example:
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:
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:
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.
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:
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.
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:
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.
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:
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
If yes, classify them as nominal, ordinal, or binary as appropriate.
If yes, treat it as discrete/count data.
Examples include weight, concentration, and blood pressure.
If yes, the variable may have a ratio scale; if not, it may be interval-scaled.
If yes, use a time-to-event framework rather than treating it as an ordinary continuous endpoint.
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
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
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:
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 = 3and 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:
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:
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
- Assuming numbers automatically mean numerical data. Patient IDs and treatment codes can contain numbers while remaining nominal variables.
- Ignoring ordering in categorical data. Mild, moderate, and severe are not equivalent to three unrelated categories.
- Assuming ordinal scores are automatically continuous. The numerical coding does not guarantee equal distances between categories.
- Calling every numerical variable continuous. Event counts are discrete.
- Treating time-to-event data as ordinary continuous data. Censoring requires survival-analysis methods.
- Ignoring repeated measurements. Observations from the same patient are generally correlated.
- Confusing data type with distribution. Continuous does not mean normal.
- Choosing a test from the outcome type alone. Study design, independence, estimand, and other factors also matter.
- 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
What exactly is being measured?
Nominal, ordinal, interval, or ratio as applicable.
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.
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.