lecture 10
1. Principles of observational and interventional studies
This section summarizes the core distinctions between observational and interventional study designs, detailing methods to mitigate bias in the former and establish causality in the latter, including the role of control, randomization, and blinding techniques.
1.1 Observational studies and sources of bias
Observational studies record data without intervening, making them highly susceptible to various forms of bias. Retrospective studies generally carry the greatest probability of introducing bias.
Key biases in observational studies include:
- Sampling bias: Occurs based on who was assessed versus who was not.
- For example, patients in one group might be more likely to die or volunteer information than those in another group.
- Historical data collection methods can introduce bias, such as landline phone surveys being biased toward older populations.
- Biased metrics: Results are affected if one group is more likely to report favorable outcomes than another.
-
Example: Placing police in charge of investigating police misconduct illustrates biased metrics.
-
- Coverage bias: Relates to how long or how often participants were surveyed.
- For instance, unvaccinated children might be followed for shorter durations and consequently have fewer doctor visits recorded.
- Confounding variables: These are external variables that influence both the exposure and the outcome. Ideally, data on all possible confounders should be collected and corrections applied if necessary.
Prospective observational studies, which follow participants through time (e.g., The Framingham Heart Study, The Nurses’ Health Study), help reduce sampling and coverage bias 3.
Tip: Contemporary research often highlights the influence of confounders; for example, studies linking acetaminophen (Tylenol) usage during pregnancy to autism risk were potentially confounded by factors related to the mother (e.g., underlying health status), which was controlled for in paired tests comparing multiple pregnancies within the same mother, where the effect disappeared 2.
1.2 Interventional studies and causality
Interventional studies are considered the only sure way to establish causality. These studies are generally easier and cheaper to execute in model organisms.
Key components of interventional studies include:
- Control group: Essential for comparison. In some cases, such as experimental cancer treatment protocols, a control group may be omitted, requiring comparison against an empirical expectation instead.
-
Example: A study comparing patients who successfully adhered to a diet eliminating fish, dairy, meat, and added oils (0.6% recurrence of cardiovascular events) versus non-adherent patients (62% recurrence) demonstrated a massive effect size, potentially warranting less rigorous control groups.
-
- Randomization: The process of assigning participants randomly to intervention or control groups. Randomization effectively controls for all confounding variables related to baseline characteristics.
- It is best practice to generate evenly-sized groups through randomization.
- If group sizes are small, purposefully matching key variables between groups is preferred over pure randomization.
- Caveat: The advantages of randomization can be lost if there is high dropout or low patient adherence during the study 4.
1.3 Psychological effects: Placebo and nocebo
Psychological factors significantly influence perceived outcomes, especially concerning subjective metrics.
- The mere act of being treated and listened to by an expert can directly induce positive outcomes (placebo effect).
- The nature of the intervention affects the magnitude of the effect; for instance, an injection or a large red pill induces larger placebo or nocebo effects than a small pill.
- Prognoses and treatments that cause psychological distress can induce negative nocebo effects.
- Subjective metrics (e.g., pain scores, fatigue) are highly susceptible to these effects.
- Objective metrics (e.g., blood marker levels) are much less affected, although outcomes tied to mood, such as test scores or even cancer survival, are susceptible to placebo/nocebo influence 5.
1.4 Mitigating psychological bias through controls and blinding
Designing effective controls is crucial to isolate the true treatment effect from psychological influence.
-
Placebo controls: Comparing one active treatment against another active treatment can sometimes eliminate the need for a pure placebo, although the possibility of a placebo effect should still inform interpretation.
- Designing adequate placebos can be difficult for certain interventions, such as diet studies, surgeries (requiring mock surgeries), or psychoactive drugs.
- Using objective metrics helps mitigate concerns when placebos are difficult to design 6.
-
Blinding: Techniques are used to prevent participants or researchers from knowing the assigned treatment arm.
- Placebos are designed specifically to blind the patients to their treatment arm.
- If those administering the treatment know the allocation, they can inadvertently influence the results. Double-blinding refers to blinding both the patients and the researchers administering the treatment.
- Bias can also manifest during data analysis. Triple-blinding may refer to blinding the data analysts or a third party, such as the study funders 7.
1.5 Crossover trials
Crossover trials provide a statistical advantage by utilizing participants in both intervention arms across different phases of the study.
- In a crossover trial, each participant is re-assigned to the alternate group in a second study phase.
- This design effectively doubles the size of each group, increasing statistical power.
- These trials are most effective for studying short-term changes and may necessitate a wash-out period between phases to eliminate carryover effects from the first intervention.
- If the first phase introduced significant biases in baseline characteristics among the participants, the results of the two phases may need to be analyzed separately 8.
2. Evaluating effect size and research priorities
Evaluating research relevance requires moving beyond mere statistical significance to focus on absolute effect sizes and contextual factors, which necessitates understanding the underlying mathematical frameworks used for modeling, such as regression and loss minimization.
2.1 Importance of absolute effect size and context
Absolute effect size metrics are crucial for assessing the practical relevance of findings, particularly in decision-making contexts involving risk or cost-benefit analysis.
- Absolute Effect Size: Metrics such as the Number Needed to Treat (NNT) are vital as they directly inform calculations for risk- or cost-benefit ratios.
- Contextual Relevance: The applicability of a statistic must be judged against the broader context, including side-effects, externalities (societal or environmental), and the baseline comparison being used (e.g., comparing a new treatment against a placebo, another active treatment, or an average outcome) 9.
- Research Prioritization: A holistic view suggests that funding should be optimized based on maximizing overall human lifespan and well-being, which might imply greater investment in longevity, diet optimization, prevention, sanitation, and education over singularly focusing on specific acute diseases like cancer, where curing all instances might only increase life expectancy by a modest amount 10.
- Guiding Policy: Absolute mortality metrics (like micromorts and microlives) and human-centered metrics (like happiness indexes) should centrally guide government policies and research funding decisions, similar to how absolute effect size guides financial risk assessment 11.
Tip: When evaluating research, always ask: "What is the baseline?" and "How much does this result actually matter in the wider context?" Statistics should support a balanced and holistic view to ensure the right questions are being asked 12.
2.2 Regression modeling and loss functions
Regression is the statistical technique used to model a dependent variable as a function of independent variables, typically involving continuous data. The quality of this model is quantified by minimizing a loss function, which summarizes the overall prediction error in a single number.
- Sum of Squares (SOS): The sum of squares is a standard and preferred loss function due to its mathematically convenient properties, leading to the term "least-squares" regression 13.
- Linear Regression Minimization: In linear regression, the objective is to find the parameters (wj and b) that minimize the total squared error between the observed values (y(i)) and the predicted values: minw1,…,wp,b2m1∑i=1m(y(i)−(∑j=1pwjxj(i)+b))2Loss function This formulation, when minimizing the sum of squares, guarantees the absence of local minima, ensuring that any minimization algorithm will find the global minimum 15.

- Multivariate Context: While 2D linear regression (related to Pearson’s product-moment correlation) can be solved analytically, multivariate regression (with more than one independent variable) requires iterative parameter fitting. A beneficial characteristic of the SOS loss function is that the resulting loss function is convex, allowing efficient optimization using methods like gradient descent 14.
2.3 Properties of convex functions
Convex functions are central to easy optimization because they possess reliable mathematical properties that guarantee finding the best possible solution (the global minimum).
- Definition of Convexity: A function f(x) is convex if, for any two points x1 and x2 on the curve, the line segment connecting f(x1) and f(x2) lies entirely above or on the curve itself. Mathematically, this is defined as: f(2x1+x2)≤2f(x1)+f(x2)For all x1,x2

- Convex Function Properties:
- Convex functions possess no local minima; they only have a global minimum.
- If f(x) and g(x) are convex, then their sum, f(x)+g(x), is also convex.
- If g(x)=f(wTx+b), then g(x) remains convex 16.
2.4 Non-convex functions and optimization challenges
Non-convex functions lack the desirable properties of convex functions, meaning optimization algorithms might converge to suboptimal solutions.
- Definition of Non-Convexity: A function is non-convex if the midpoint of the line segment connecting two points on the curve lies below the curve itself, violating the condition for convexity.

- Optimization Difficulty: Because non-convex functions can feature multiple local minima, standard greedy algorithms like gradient descent are not guaranteed to find the global minimum; they may get stuck in a local optimum 17.
2.5 Convexity in Least-Squares Regression
The specific loss function used in least-squares linear regression is mathematically guaranteed to be convex, which simplifies the optimization process significantly.
- The Least-Squares Loss Function is defined as: LossLS(w)=(wTx+b−y)2
- Since the least-squares loss function is convex, and it is composed of sums of simpler convex terms (where each term represents the loss for a single data point, e.g., Loss1=(wTx+b−y)2), the Total Loss(w) is also convex1.
- This convexity means that optimization for linear regression is inherently "easy" because finding the parameter values (w) that minimize the total loss reliably leads to the global optimum 18.

3. Practical regression techniques, evaluation, and regularization
This section summarizes the practical application of regression, interpreting standard evaluation metrics, methods for controlling for confounding effects, and the necessity and implementation of regularization techniques to enhance model stability and interpretability.
3.1 Interpreting OLS Regression Output
Linear models express the relationship between a dependent variable y and independent variables xi using weights (wi) and an intercept (b), represented generally as y(x)=w1x1+w2x2+w3x3+b. In practice, statistical packages like statsmodels require explicitly adding a constant term to the independent variables matrix (X) to ensure the intercept is modeled separately, rather than being implicitly confounded within the weights of the regressors 19 20.
When running Ordinary Least Squares (OLS) regression, the output provides several key statistics for evaluation 21:
- Model Fit Statistics:
- R2 (Coefficient of Determination): Indicates the fraction of variance in the dependent variable explained by the model. A value of 1.000 suggests perfect explained variance.
- F-statistic and Prob (F-statistic): These assess the overall statistical significance of the correlation between the predictors and the response variable, relying on R2 and the sample size (N).
- Coefficient Estimates and Significance:
coef(wi and b): The estimated weights (slopes) and the intercept.std err: The standard error associated with each coefficient estimate.t(t-statistic): Calculated as the ratio of the coefficient to its standard error (t=weight/SE).P>|t|(p-value): Indicates the significance of the association for each individual regressor, controlled for the effects of other variables in the model.

The fundamental measure of model fit is R2, the coefficient of determination, defined based on the ratio of variance explained. However, because R2 always increases as more parameters are added (even if irrelevant), the Adjusted R2 (Rˉ2) is preferred for reporting, as it mathematically penalizes the model complexity by incorporating the sample size (n) and the number of model parameters (p).
The formulas for R2 and Adjusted R2 are: R2=1−Total Sum of Squares (SST)Sum of Squares Residuals (SSR) Rˉ2=1−[(1−R2)n−p−1n−1] where n is the sample size and p is the number of model parameters (regressors) 22 24.

Tip: While R2 shows how well the model fits the observed data, use individual variable p-values (derived from T-scores) to determine if a variable is genuinely important for prediction or if it is redundant due to correlation with other predictors.
3.2 Controlling for Confounders and Limitations
Linear regression models are adept at teasing out independent effects, especially when the parameter space is small. To manage the linearity and normality assumptions, data can sometimes be ranked (similar to Spearman's rho). Furthermore, multivariate correlation techniques are effective for controlling confounding effects arising from categorical variables by using one-hot encoding (converting categories into 0s and 1s) 23 29.
A significant limitation to beware of is co-linearity, where two or more independent variables are so highly correlated that they essentially carry the same information. In such cases, the weights assigned to the collinear variables become unstable, largely determined by chance, undermining reliable interpretation of their relative predictive potential. Calculating all pairwise correlations is a method to detect this issue.
Example: If X1 and X2 are almost perfectly correlated, the regression results might assign a large positive weight to X1 and a large negative weight to X2, even if their combined effect is stable. The individual significance tests (t-values) for X1 and X2 will likely be poor 30.
3.3 Addressing Overfitting via Regularization
Overfitting occurs when a model, often due to high dimensionality or too many parameters, starts to memorize the training data, severely harming its generalizability to new, unseen data. Regularization methods address this by adding a penalty term to the loss function, favoring simpler models over overly complex ones 31.
3.3.1 Ridge Regression (L2 Regularization)
Ridge regression, or L2 regularization, adds a penalty proportional to the sum of the squares of the coefficients (wj) to the loss function. This forces the regression to find weights that minimize both the standard loss (error) and the magnitude of the weights. The objective function minimized is 32: Loss+C∑j=1pwj2 where C is a non-negative constant controlling the regularization strength. This constraint guarantees the existence of a global minimum 33.
3.3.2 LASSO Regression (L1 Regularization)
LASSO (Least Absolute Shrinkage and Selection Operator) uses L1 regularization, which penalizes the sum of the absolute values of the coefficients instead of the squares. This distinct penalty shape (diamond constraint in weight space) tends to force some coefficients exactly to zero, effectively performing feature selection and resulting in a sparser model, which aids interpretability 34.

3.3.3 Elastic Net
Elastic Net combines both L1 and L2 penalties. It utilizes the feature selection capability of LASSO while maintaining the grouping effect (keeping correlated features together) associated with Ridge regression. The specific balance between L1 and L2 is controlled by a parameter, typically l1_ratio 35.

These regularization methods are implemented in libraries like sklearn, where the regularization strength is generally controlled by the alpha parameter. Moreover, these techniques are applicable to other machine learning models beyond basic linear regression, such as logistic regression and support vector machines38.
Note on Implementation: In Scikit-learn, the
alphaparameter controls the overall strength of the regularization penalty, andl1_ratio(for Elastic Net) determines the mix between L1 and L2 penalties. Specialized functions, likeOLS.fit_regularizedinstatsmodels, allow specifying the method as'elastic_net'along with the strength (alpha) and the weight assigned to L1 (L1_wt) 36 37.
3.4 Handling Nonlinearity
Many regression problems that appear nonlinear can be successfully modeled using standard linear regression techniques by transforming the independent variables. This is achieved by introducing nonlinear terms (e.g., squared terms, interaction terms) as new, separate independent variables. For instance, a model like y=b+w1x1+w2x2+w3x12+w4x1x2 is still linear with respect to the parameters (wi,b) and the transformed variables (x1,x2,x12,x1x2) 39.
3.5 Model Evaluation Summary
A robust evaluation relies on several integrated metrics:
- Quality of Fit: Use R2 to quantify the fraction of variance explained and compare different model structures.
- Variable Importance: Rely on individual variable p-values (derived from T-scores) to identify which predictors significantly contribute to explaining the output, distinguishing them from redundant variables.
- Stability: Be cautious of co-linearity; highly correlated variables lead to chance-based relative T-scores, making interpretation of individual predictive power unreliable 40.
Common mistakes to avoid
- Review all topics thoroughly before exams
- Pay attention to formulas and key definitions
- Practice with examples provided in each section
- Don't memorize without understanding the underlying concepts
© 2026 Maeve. All rights reserved. This content is protected by copyright.