How does one condition in this case? We fit a multivariate logistic regression model to…
- User
How does one condition in this case? We fit a multivariate logistic regression model to estimate the joint associations between benchmark properties and the probability that a benchmark is saturated at observation time, conditioning on benchmark age.
Assistant
In a multivariate logistic regression context, "conditioning on age" means you are treating age as a control variable (or covariate) to ensure that the associations you find between benchmark properties and saturation are not actually being driven by how long the benchmark has existed.Since older benchmarks are naturally more likely to be saturated, failing to condition on age would lead to a "spurious correlation."How Conditioning is Mathematically ExecutedIn a logistic regression model, conditioning is achieved by including age as an independent variable in the logit equation alongside your properties of interest.The probability of saturation P is modeled as:logit(P)=ln(1−PP)=β0+β1(Property1)+β2(Property2)+⋯+γ(Age)β1,β2: These represent the estimated effect of your properties holding age constant.γ: This coefficient accounts for the baseline effect of time/age on the probability of saturation.Implementation StrategiesDepending on the distribution of your data and your specific hypothesis, you can condition on age in a few different ways:Linear Control: Including Age as a continuous variable. This assumes that each additional unit of time has a constant additive effect on the log-odds of saturation.Fixed Effects (Binned Age): If the effect of age isn't linear (e.g., saturation happens rapidly in the first year and then plateaus), you can "bin" age into categories (0-6 months, 6-12 months, etc.) and include them as dummy variables.Stratification: You could run the model within specific "age strata." If the properties affect saturation differently for young benchmarks than for old ones, you would add an interaction term (e.g., Property×Age).Why This Matters for Your ResultsBy conditioning, you are essentially asking the model: "If we took two benchmarks of the exact same age, how much more likely is the one with 'Property X' to be saturated?" This isolates the intrinsic characteristics of the benchmark from the mere passage of time.Would you like me to help you write the specific R or Python code to implement this conditioning in your model?
- User
This assumes the effect of age is linear, right?
Assistant
Exactly. By simply adding Age as a standard covariate (like in the equation provided previously), you are assuming a linear relationship between age and the log-odds of saturation.In real-world data, this assumption is often "wrong" because the probability of saturation rarely increases at a constant rate over time.Why the Linear Assumption Might FailThe "Burn-in" Period: Saturation might be very slow initially while a benchmark gains traction.The Ceiling Effect: Once a benchmark is near 90% saturation, the rate of change usually slows down (an S-curve).Survival Bias: Very old benchmarks that aren't saturated yet might be "outliers" that behave differently than the average.How to Condition Without Assuming LinearityIf you suspect the effect of age is non-linear, you have three primary ways to adjust your model:1. Polynomial TermsYou can add a squared or cubed term for age. This allows the model to "bend" the relationship. logit(P)=⋯+γ1(Age)+γ2(Age2)2. Logarithmic TransformationIf saturation happens very quickly at the start and then tapers off, conditioning on ln(Age) often fits the data much better than raw age.3. Splines (Generalized Additive Models - GAMs)This is the most flexible approach. Instead of a fixed shape (like a line or a parabola), a spline uses "knots" to let the model curve locally to fit the actual trend of the data.In R: gam(saturation ~ properties + s(age), family = binomial)In Python: pygam library.4. Categorical BinningDivide age into logical groups (e.g., New, Mid-life, Legacy). This makes no assumptions about the shape of the relationship between bins, but you lose some "granularity" within the bins.Which one should you use?A good first step is to plot your data. If you plot Age on the x-axis and the Proportion Saturated on the y-axis, you can see if the trend looks like a straight line or a curve.Would you like to see how to perform a Likelihood Ratio Test to check if adding a non-linear age term significantly improves your model?