1. Introduction
Growing concern over the building sector energy consumption and its contribution to greenhouse gas emissions has driven substantial investment in energy retrofit programs across the EU [
1], with explicit focus in certain cases on the residential sector [
2]. These interventions target thermal envelope improvements through enhanced insulation, window-door upgrades, airtightness measures, and replacing fossil fuel-based heating systems, with the primary objective of reducing heating energy demand [
3]. These measures, in addition to affecting the energy use of a building, also affect the indoor environment and consequently the health and wellbeing of occupants [
4,
5].
Despite this massive policy and financial commitment to retrofitting [
1]—from the EU’s Renovation Wave, which aims to renovate 35 million buildings by 2030 [
6], to national schemes targeting hundreds of thousands of homes [
2]—empirical evidence on how retrofits affect indoor environmental quality and health remains uneven and context-dependent [
4,
7]. While many studies have reported improved thermal comfort and reduced dampness following envelope upgrades [
7], indoor air quality outcomes are mixed, with some investigations finding increased concentrations of indoor pollutants, elevated radon levels, or greater summertime overheating in highly airtight homes that lack adequate ventilation [
7,
8,
9]. This inconsistency in findings means that retrofit programs cannot be evaluated on energy performance alone. To inform future climate action plans and retrofit support schemes, there is a pressing need for robust, building-scale evidence on how specific retrofit strategies influence indoor humidity, temperature, and air quality under real operating conditions [
7,
10]. In practice, this requires methodological approaches that can disentangle the effect of the retrofit itself from background variability in weather, building stock, and occupant behavior [
11].
1.1. Confounding in Retrofit Evaluation
Evaluating the impact of energy retrofits on indoor environmental conditions is complicated by multiple, overlapping sources of confounding. Indoor temperature and humidity respond not only to the retrofit measures themselves, but also to outdoor weather conditions, which drive heat and moisture transfer through the building envelope [
7,
12]. Occupant behavior—including window/door opening, thermostat set-points, and moisture-generating activities such as cooking, showering, and drying clothes—can substantially modify both indoor conditions and energy use [
7,
10]. These practices are, in turn, affected by the season, household composition, and socio-economic demographics [
10]. Building characteristics such as thermal mass, ventilation system type, airtightness level, age, and construction standard further shape how a dwelling buffers or amplifies outdoor climate fluctuations [
7]. Superimposed on these structural and behavioral factors are temporal patterns: heating versus non-heating seasons, day–night cycles and inter-annual variability in weather [
13].
Traditional evaluation approaches, such as simple pre/post comparisons or cross-sectional regressions with limited covariate control, rarely account for this full set of confounders and are therefore prone to biased retrofit effect estimates [
7,
14]. For example, if pre-retrofit monitoring happens to coincide with an unusually dry winter while post-retrofit data are collected during a wetter season, before/after comparisons of indoor humidity may wrongly attribute climate-driven changes to the retrofit. Similarly, differences in occupancy patterns or window-opening behavior between homes that do and do not receive retrofits can be misinterpreted as retrofit effects if not explicitly modelled [
10]. Robust retrofit evaluation therefore requires statistical methods that can separate intervention effects from background variability arising from weather, behavior, building stock and time [
11].
1.2. Mixed Effects Modelling Framework
Linear mixed effects (LME) models provide a principled framework for addressing these challenges [
11,
15]. By combining fixed effects and random effects, LMEs allow analysts to adjust explicitly for measured confounders, e.g., outdoor climate, season, building characteristics and proxy indicators of occupancy, while simultaneously accounting for the hierarchical structure of the data (repeated measurements nested within rooms and homes). Fixed effects capture population-average relationships between predictors and outcomes, enabling direct estimation of the retrofit effect after controlling for climate and behavioral covariates. Random intercepts and, where justified, random slopes at the building level, accommodate between-home differences in baseline indoor conditions and in sensitivity to outdoor drivers (for example, some homes being more responsive to external weather than others) [
11,
15].
This hierarchical formulation has several advantages over more conventional regression or aggregation-based approaches. First, it makes efficient use of all available observations without pre-averaging by home or time-period, thereby preserving within-home variability and avoiding information loss that can distort variance estimates and
p-values [
11]. Second, mixed effects models handle unbalanced longitudinal data naturally: homes with shorter monitoring periods or incomplete pre/post records still contribute information without requiring listwise deletion, an important property for real-world field studies where drop-out and sensor gaps are common. Third, the random effects themselves provide useful summaries of building-level heterogeneity in retrofit response, which can be related back to physical characteristics in subsequent analyses.
LME methods are now standard in biomedical and social sciences for precisely this combination of confounding control and hierarchical data handling [
11]. But they have been applied less consistently in building performance and indoor environmental quality research [
7], where simple before/after comparisons or ordinary least squares regression still predominate.
In building performance and indoor environmental quality research, the need for such models is increasingly recognized because monitoring datasets are typically structured as repeated observations nested within rooms, homes, or buildings, and are influenced simultaneously by weather, occupancy, and building-specific characteristics. The empirical retrofit and IEQ literature remains dominated by case-specific analyses focused on outcomes such as ventilation adequacy, pollutant concentrations, thermal comfort, or post-retrofit air quality. For example, studies have shown the importance of ventilation performance and occupant exposure patterns in deep energy-retrofitted dwellings, the broader indoor air quality implications of retrofit as part of a just transition, and the mixed effects of deep energy renovations on indoor air quality and thermal comfort [
8,
10,
16].
However, these studies do not provide a general, openly documented modelling workflow that other researchers can readily adapt for pre/post retrofit evaluation across outcomes and contexts. The contribution of the present paper is therefore not another outcome-specific retrofit analysis, but a transferable and reproducible LME framework, with accompanying open-source R code (R version 4.4.3 was used for all analysis reported in this work), for estimating retrofit effects while accounting for confounding, clustering, and building-level heterogeneity.
1.3. Objectives and Presentaiton Structure
There is thus both the need for robust retrofit evaluation and the methodological challenges that routine analytical approaches struggle to address. This paper responds to that gap by providing a complete, transferable methodological framework—grounded in LME modelling—that other researchers can apply to their own indoor climate datasets. Indoor humidity, expressed as the partial pressure of water vapor, measured in 23 Irish residential homes across pre- and post-retrofit periods, is used throughout as a worked example to ground the exposition [
17,
18]. The primary contribution, however, is the framework and its open-source implementation rather than the findings of that specific case study.
The work pays particular attention to confounding control, hierarchical data structure, and unbalanced longitudinal designs. Step-by-step R code covering data processing, model construction, fixed and random effect selection, model diagnostics, and result visualization have been provided. The complete analytical pipeline is demonstrated using the case study. Open-source, documented codebase that practitioners and researchers can readily adapt to their data is made freely available [
19].
The paper is structured as follows.
Section 2 presents the methodological framework, describing the general approach to LME model construction, selection of fixed and random effects, model parsimony criteria, and interpretation of standardized coefficients.
Section 3 presents results from the partial pressure of water vapor case study.
Section 4 discusses the advantages and limitations of the approach and offers guidance for adapting it to future applications.
3. Results
To illustrate the methodological workflow described in
Section 2, this section presents results from a case study. As discussed, this case study analyzes synthetic, representative data of 23 Irish residential homes. This section should be understood as a worked example demonstrating the analytical steps, from raw data characteristics through model specification, diagnostics, and interpretation. Researchers applying this methodology to different indoor climate outcomes (temperature, air quality), in different climates, or different intervention types can follow an identical workflow, applied to their parameter of interest.
3.1. Sample Characteristics
The case study dataset comprised hourly-aggregated measurements from 23 Irish residential homes (sample size: 28,822 observations total). The homes included a mix of building types (end-terrace, mid-terrace, semi-detached) constructed in 1994 or 2000. Pre-retrofit monitoring periods encompassed February–June 2015, while post-retrofit periods extended from September 2015 through February 2017.
Table 2 presents summary statistics for key variables, grouped by retrofit status. Data have been aggregated into two room types, living room and other rooms, based on the distinction used in the Irish Dwelling Energy Assessment Procedure (DEAP) [
18]. Pre-retrofit indoor average partial pressure of water vapor (Pw) ranged from 0.31–0.98 kPa (mean 0.62 ± 0.18 kPa), with slightly higher values during non-heating seasons (mean 0.68 ± 0.19 kPa) compared to heating seasons (mean 0.57 ± 0.16 kPa). Post-retrofit values showed comparable ranges and distributions, though with slightly more humid conditions.
3.2. Mixed Effects Model
Model selection proceeded in two stages, using likelihood ratio tests (LRTs) to compare nested model pairs and AIC/BIC as supporting criteria. In Stage 1, an expanded model was first fitted, augmenting the candidate fixed effects (Equation (2)) with built type, construction year, and household income. Comparison with the more parsimonious model, without these added predictors, showed that both AIC (−44,380 vs. −44,426) and BIC (−44,223 vs. −44,302) favored the simpler model.
The expanded model returned a lower log-likelihood despite the additional parameters (logLik = 22,209 vs. 22,228; (4) = 0, p = 1). This is consistent with a convergence failure likely attributable to the varying scales of the predictors and the limited number of homes (n = 23) relative to the added building-level predictors. The expanded model was discarded in favor of the simpler model.
A reduced model was then fitted by removing Season and Occupants from the fixed effects. The LRT strongly favored the model retaining these predictors ((2) = 16.34, p < 0.001), and AIC confirmed this (−44,426 vs. −44,413), while BIC was marginally closer between the two models (−44,302 vs. −44,306). Given the LRT result and the theoretical basis for including seasonal patterns and occupancy in indoor humidity modelling, the model was not further simplified.
The selected final model was therefore as follows:
RoomPw ~ RetrofitStatus + ExternalPw + ExternalT + RoomT + RoomType
+ Season + Occupants
+ (1 + RetrofitStatus + ExternalPw | HomeID)
AIC = −44,426, Marginal R2/Conditional R2 → 0.75/0.82
The random effects structure allows each home to have its own baseline humidity level (random intercept) as well as home-specific responses to retrofit status and external vapor pressure (random slopes), capturing building-level heterogeneity in both pre/post retrofit shift and sensitivity to outdoor moisture conditions.
3.3. Relative Importance of Predictors
The standardized coefficients and their 95% confidence intervals are presented in
Table 3. External vapor pressure was the strongest predictor of indoor humidity (
= 0.63, 95% CI [0.59, 0.66]). Building envelopes, even post-retrofit, did not fully decouple indoor from outdoor humidity.
Room temperature was the second strongest predictor ( = 0.46, 95% CI [0.46, 0.47]), with higher indoor temperatures associated with greater vapor pressure, likely reflecting combined effects of occupant-driven moisture generation and the temperature dependence of absolute humidity. External temperature had a moderate negative effect ( = −0.18, 95% CI [−0.19, −0.17]), consistent with cold outdoor air having lower absolute moisture content.
Room type showed a notable positive effect ( = 0.41, 95% CI [0.40, 0.42]), indicating that Other rooms carry systematically higher vapor pressure than Living rooms. This likely reflects differences in moisture source proximity (e.g., kitchens, bathrooms). The effect of season was small but statistically significant ( = 0.04, 95% CI [0.03, 0.06]), with slightly elevated vapor pressure during the non-heating season. Occupant count had the smallest effect among retained predictors ( = 0.08, 95% CI [0.00, 0.16]), with a p value just bordering upon significance, 0.051.
Importantly, the retrofit effect was positive and clearly significant ( = 0.35, 95% CI [0.25, 0.44]). This indicated higher indoor vapor pressure in the post-retrofit period relative to pre-retrofit, after adjusting for all covariates.
3.4. Model Specification and Diagnostics
Variance inflation factors for fixed effects were all < 1.5, indicating negligible multicollinearity—
Table 4.
The residual diagnostics plot has been included in
Appendix A (
Figure A1). The Q-Q plot showed minor deviations at the tails but overall adherence to normality. Residuals vs. fitted values plot showed relatively even scatter around zero, though slight heteroscedasticity at extreme predicted values. The Q-Q plot of the random intercepts confirmed approximate normality. The Durbin–Watson statistic of 1.45 indicated minimal temporal autocorrelation despite hourly aggregation.
Diagnostic plots (
Appendix A) for the original mixed-effects model showed positive autocorrelation at short lags in the residual auto correlation function (ACF), with a gradual decay in the partial autocorrelation function (PACF), consistent with low-order temporal dependence. Refitting the model with an AR(1) correlation structure yielded
and improved the model fit, with AIC decreasing from −44,426 to −44,763, suggesting that modest hour-to-hour dependence remained after adjustment for fixed and random effects. For this worked example, the simpler LME specification was retained to prioritize interpretability and transferability.
For the selected final model, marginal R2 (variance explained by fixed effects) was 0.75 and conditional R2 (variance explained by fixed and random effects) was 0.82. These values indicate that the model captures substantial variation in indoor humidity, with building-level heterogeneity accounting for an additional 7% of variance.
As the expanded model (
Section 3.2, Stage 1 model testing) had a convergence gradient warning, a convergence stability check was run for the coefficients of the final model against a stable optimizer. The results showed minimal difference between the coefficients (
Figure 1) indicating that the next step could be taken, despite the warning.
To assess sensitivity of the model to extreme observations, all observations falling outside the 5th–95th percentile range of each continuous predictor (External Pw, External T, Room T, Room Pw) were excluded, retaining 20,820 of the original 28,822 observations (72.2%). The final model was re-fitted on this trimmed dataset and fixed effect coefficients compared with those estimated from the full sample, referred to as the “Original” results in
Table 5.
Coefficients for external temperature, room temperature, and season showed negligible change across both datasets (Δ < 8%), confirming that these relationships are not driven by observations at the tails of the predictor distributions.
The retrofit effect attenuated modestly from 0.090 to 0.079 kPa (12.1%) but remained directionally consistent and of comparable magnitude. The key inference regarding retrofit impact on indoor humidity was therefore unchanged. External vapor pressure showed the largest absolute shift (Δ = −0.060 kPa, 10.8%), which is expected given that it has the widest dynamic range among the predictors. Its coefficient is consequently most sensitive to tail exclusion. Room type and occupant count exhibited proportional changes of 17.0% and 15.4%, respectively. However, their absolute magnitudes remain small and do not alter the interpretation of either predictor.
3.5. Random Effects and Building Heterogeneity
The intraclass correlation coefficient (ICC) of 0.29 indicated that 29% of the total variance in indoor vapor pressure was attributable to systematic differences between homes, independent of the measured predictors. This underlines the importance of the random effects structure. A fixed-effects-only model would treat these between-home differences as unexplained noise, inflating residual variance and producing overly narrow standard errors for the population-level estimates.
The random intercept variance ( = 0.02) exceeded the residual variance ( = 0.01), confirming that baseline differences in indoor humidity across homes were a larger source of variability than within-home measurement noise. The random slope variances for both retrofit status and external vapor pressure were negligible ( ≈ 0.00 for both), suggesting that while homes differed substantially in their baseline humidity levels, they responded to the retrofit intervention and to outdoor moisture conditions with broadly similar sensitivity once baseline level was accounted.
The strong negative correlation between random intercepts and the external vapor pressure slope (
= −0.79) is clearly visible in
Figure 2. This figure plots each home’s estimated baseline humidity level against its sensitivity to outdoor moisture conditions, separately for pre- and post-retrofit periods. Homes with higher baseline indoor humidity (positive random intercept, e.g., H09, H21) consistently exhibited weaker coupling to external moisture conditions, while homes with lower baselines (e.g., H02) showed the strongest outdoor–indoor moisture linkage. This pattern is physically plausible. Dwellings with persistently elevated indoor humidity may have characteristics, such as higher occupant moisture generation or less effective ventilation, that dominate the indoor moisture balance and reduce the relative influence of outdoor conditions. Notably, the pre- and post-retrofit panels of
Figure 2 are near-identical. The near-identical structure across pre- and post-retrofit panels is itself informative: it demonstrates that the negative intercept–slope relationship is a stable property of the home sample rather than an effect of the intervention. Both panels are shown to make this stability directly visible.
3.6. Room Type and Seasonal Effects
Figure 3 illustrates the distribution of indoor vapor pressure by room type and season, separately for pre- and post-retrofit periods. Indoor humidity was consistently higher in the non-heating season than in the heating season across both room types and both periods. Other rooms, i.e., not the living rooms, exhibited higher vapor pressure than living rooms throughout. Post-retrofit, both patterns were preserved but at a uniformly elevated level, relative to pre-retrofit conditions.
Although the seasonal separation is visually apparent in
Figure 3, the standardized coefficient for season in the final model was small (
= 0.04, 95% CI [0.03, 0.06]). This indicated a modest contribution of seasons to indoor humidity variation relative to the dominant predictors of external vapor pressure and room temperature. Formal pairwise contrasts for season were therefore not pursued.
Tukey-adjusted pairwise comparisons from the estimated marginal means of the final model confirmed that these visual differences were statistically distinguishable after controlling for outdoor climate and occupancy,
Table 6. Other rooms had significantly higher indoor vapor pressure than living rooms both pre-retrofit (Δ = 0.107 kPa, 95% CI [0.103, 0.110],
p < 0.001) and post-retrofit (Δ = 0.107 kPa, 95% CI [0.103, 0.110],
p < 0.001). The identical magnitude of this contrast in both periods indicates that the retrofit did not alter the relative humidity differential between room types. The structural moisture environment of other rooms (kitchens, bathrooms, bedrooms) remained persistently more humid than living rooms regardless of retrofit status. Elevated vapor pressure in rooms proximal to moisture sources such as kitchens and bathrooms is consistent with localized moisture generation, though the mediating roles of ventilation frequency and room usage pattern were not directly measured in this study.
The retrofit effect was also consistent across room types: both living rooms and other rooms showed a statistically significant increase in indoor vapor pressure post-retrofit of identical magnitude (Δ = 0.090 kPa, 95% CI [0.058, 0.122], p < 0.001 for both contrasts). The symmetry of these contrasts—both the room type difference and the retrofit effect—suggests that the retrofit acted as a uniform shift in the moisture baseline of the homes rather than differentially affecting rooms with distinct moisture source profiles.
3.7. Holdout Temporal Validation
To assess temporal generalizability of the fitted model, a 70/30 holdout assessment was performed. Observations were partitioned by stratified random sampling within homes, ensuring all 23 homes contributed to both training and test sets. This design evaluates whether the model generalizes to unseen time points from the monitored homes; it does not test transferability to an independent cohort of buildings. The model was re-fitted on the training set alone followed by testing the model created on the training set using the test data set.
On the held-out test set, the model achieved R
2 = 0.817 and RMSE = 0.11 kPa, closely matching the conditional R
2 of 0.824 obtained on the full dataset. This consistency between in-sample and out-of-sample performance indicates that the model is not overfitted to the training data and that the fixed effects structure generalizes well to unseen observations.
Figure 4 shows the predicted versus observed vapor pressure values for the test set. Points cluster tightly along the 1:1 line across the full range of observed values (approximately 0.7–2.2 kPa), with no evidence of systematic bias at either the lower or upper extremes of the distribution.
The training set-test set validation was performed to ensure the model was not overfitted. As the validation set comprises held-out observations from the same 23 homes rather than entirely new buildings, this assessment reflects temporal generalizability within the study sample. This is not about the transferability of the model to an independent cohort.
4. Discussion
This study demonstrates the rigorous framework provided by linear mixed effects models for evaluating energy retrofit impacts on indoor climate parameters while appropriately controlling for confounding variables. Using indoor vapor pressure in 23 Irish homes as a case study, the model identified a statistically significant post-retrofit increase of 0.090 kPa (approximately 6.6% relative to the pre-retrofit mean), after adjusting for outdoor climate, season, room type, and occupancy. This finding is consistent with studies documenting increased indoor moisture levels in homes where retrofit-driven reductions in air infiltration were not accompanied by adequate mechanical ventilation [
7,
9], and with Irish-specific evidence showing that post-retrofit improvements in airtightness can compromise indoor air quality when occupant ventilation behavior and installed ventilation systems are insufficient [
8,
10]. Whether post-retrofit humidity increases or decreases appears to depend critically on the ventilation strategy adopted alongside envelope improvements—a finding that reinforces the need for the kind of controlled, covariate-adjusted analysis presented here rather than simple before/after comparisons.
The dominant role of external vapor pressure and temperature in predicting indoor humidity reflects fundamental hygrothermal physics: interior moisture conditions arise primarily from the infiltration and diffusion of outdoor air moisture, modified by occupant-driven moisture generation and buffered by building thermal and hygric mass [
12,
39]. Even following envelope upgrades, outdoor climate remains the primary driver of indoor humidity variability, with external vapor pressure alone accounting for the largest standardized effect in the model (
= 0.63). This finding underscores that retrofit effectiveness in humidity management cannot be evaluated in isolation from the outdoor climate context—a design principle with direct implications for cross-study comparisons that pool results from different climatic zones.
The relative contribution of each pathway depends on building-specific properties such as airtightness, ventilation provision, and envelope permeability. This is partly reflected in the home-level variability captured by the random slope for ExternalPw in the selected model. Although the present work does not embed a first-principles moisture balance, the LME framework is designed to be outcome-agnostic and transferable across indoor climate parameters. A formal physical decomposition of the outdoor–indoor coupling mechanism will be pursued in a subsequent study using the complete dataset and focused specifically on the predictors of indoor humidity before and after retrofit. The regression coefficients can be contextualized against physical frameworks [
12,
39] in domain specific studies.
In practical terms, the detected 0.090 kPa increase in indoor vapor pressure, under typical temperate indoor temperature conditions, would correspond to ~4–5 percentage increase in RH. The precise value would be temperature dependent. This magnitude carries meaningful consequences for indoor environmental quality: sustained relative humidity above 60% is associated with conditions conducive to mold germination and dust mite proliferation, both of which are linked to respiratory health outcomes including asthma exacerbation and allergic rhinitis [
40]. Where post-retrofit homes already operate near this threshold—as may be the case in Ireland’s cool, humid Atlantic climate—even a modest humidity increase of this magnitude may shift occupancy periods from below to above the biological risk threshold. This finding highlights the importance of integrating humidity monitoring and adequate ventilation specification into retrofit programs rather than focusing solely on thermal and energy performance metrics.
While this paper focuses on residential energy retrofits, the analytical framework and R code presented here is domain-agnostic. It has direct applicability to before/after intervention studies across a range of scientific and engineering disciplines. Any study design involving repeated measurements nested within experimental units, a clearly defined pre/post intervention structure, and multiple confounding variables is a candidate for this approach. The open-source code provided with this paper requires only that users substitute their outcome variable, redefine their grouping structure, and specify contextually appropriate fixed effects, making cross-disciplinary adoption straightforward.
4.1. Advantages of the Mixed Effects Approach
The mixed effects framework offers several methodological advantages over simpler approaches to retrofit evaluation that are worth making explicit, particularly for researchers considering its adoption in their own field studies.
Simple before/after comparisons attribute all observed change in an indoor climate parameter to the retrofit, regardless of whether contemporaneous changes in outdoor climate, season, or occupant behavior may equally explain the difference [
7]. By including fixed effects for external vapor pressure, temperature, and season, the LME model partitions these contributions explicitly, isolating the retrofit effect from systematic variation in background conditions. This is not merely a statistical nicety: as demonstrated in
Section 3.2, the selected model with seasonal and occupancy controls was significantly preferred over the reduced model by likelihood ratio test (
(2) = 16.34,
p < 0.001), confirming that omitting these terms would have produced a materially biased retrofit effect estimate.
A related advantage concerns uncertainty quantification. Analyses that treat repeated measurements from the same home as independent observations—as ordinary least squares regression does—produce artificially narrow standard errors and confidence intervals, inflating Type I error rates [
11,
15]. By modelling both fixed effects and random variation across homes simultaneously, the LME framework ensures that confidence intervals for the retrofit effect properly reflect between-home heterogeneity. The ICC of 0.29 observed in our case study illustrates the practical importance of this: nearly one-third of total variance in indoor vapor pressure is attributable to home-level differences, a quantity that would otherwise be absorbed into the residual and misrepresent precision.
Beyond correcting for dependence, the random effects structure actively quantifies heterogeneity in retrofit response—a dimension of practical value that purely fixed-effects approaches cannot provide [
15]. The home-level random slopes estimated here reveal that buildings differ in their sensitivity to outdoor moisture conditions, and the negative intercept–slope correlation (
= −0.79) identifies a systematic pattern in which homes with higher baseline humidity exhibit weaker outdoor–indoor coupling. Such information is directly actionable for practitioners: it points toward building-level characteristics that may moderate retrofit effectiveness and that warrant investigation in larger studies.
The framework also preserves the full information content of the dataset. Aggregation-based approaches—such as computing monthly or seasonal means per home prior to analysis—discard within-period variability and can introduce ecological fallacy-type artefacts where group-level associations diverge from individual-level relationships [
41]. By retaining hourly observations and modelling their dependence structure directly, the LME approach avoids information loss while maintaining valid inference. This is particularly important when, as here, within-home variability across time is itself of scientific interest. Furthermore, the model handles unbalanced data—homes with different monitoring durations or missing observations in one period—without requiring listwise deletion, making it well-suited to the realities of longitudinal field studies [
15].
Finally, the provision of fully reproducible, open-source R code directly addresses a broader credibility challenge in building performance research [
19]. Publishing complete analysis code alongside results allows readers to verify methodological choices, extend the analysis to new outcomes or datasets, and adapt the framework to their own retrofit monitoring programs. In a field where study designs, data structures, and outcome definitions vary considerably, transferable and transparent analytical tools are arguably as valuable as any single empirical finding.
4.2. Limitations and Caveats
While the model controls for the primary measured confounders like outdoor climate, season, room type, and occupancy, several unmeasured sources of confounding remain. Occupants who have invested in a retrofit may alter their ventilation or heating behavior independently of the physical changes to the building envelope, a form of awareness-driven behavioral change that the model cannot distinguish from the structural retrofit effect. Sensor drift or physical relocation of monitoring equipment between pre- and post-retrofit periods could also introduce systematic measurement bias. Addressing these sources of residual confounding fully would require either randomized controlled trial designs, impractical at scale for residential retrofit programs, or instrumental variable approaches that exploit exogenous variation in retrofit uptake, both substantially more resource-intensive than observational field monitoring [
7,
14].
Indoor humidity exhibits daily and weekly cycles driven by occupancy patterns, ventilation behavior, and diurnal outdoor climate variation. While the Durbin–Watson statistic (1.45) suggests minimal first-order autocorrelation in the model residuals, it is just a preliminary check.
Our approach of modelling hourly observations with random effects captures much of the between-home temporal structure. But it does not explicitly model within-home autocorrelation at finer time scales. More sophisticated temporal models like autoregressive specifications, seasonal ARIMA, or state-space models, may provide improved fit for applications where the temporal dynamics of indoor climate parameters are themselves of primary interest, though typically at the cost of interpretability and computational tractability [
13].
The presence of residual autocorrelation is not unexpected in hourly indoor climate data, where adjacent observations are influenced by persistent occupancy patterns, ventilation behavior, and thermal inertia. In this study, the autocorrelation was modest but detectable, and an AR(1) sensitivity model fits the data better than the simpler independence-based specification. Importantly, the substantive conclusions regarding the retrofit effect were unchanged, indicating that the main findings are robust to reasonable alternative assumptions about the temporal error structure. Future applications of the framework to similarly dense monitoring data may benefit from explicitly modelling serial dependence when it is clearly present.
The case study results are specific to the Irish residential context. The direction and magnitude of the retrofit effect on indoor humidity may differ substantially in other climate zones or in housing stocks with different construction standards, airtightness levels, or thermal mass. Retrofit strategies also vary widely in intensity and scope, and findings from envelope-focused interventions may not generalize to deep retrofits that include mechanical ventilation with heat recovery. Practitioners applying this framework in other contexts should treat the fixed effect coefficients as case study-specific and reassess model structure using locally relevant predictor sets and climate data.
The illustrative findings reported here, including the estimated post-retrofit increase in indoor vapor pressure and the observed room-type differences, are intended to demonstrate the interpretive capacity of the LME framework rather than to constitute a definitive humidity risk assessment. A formal assessment of moisture-related health risk, including computation of mold growth indices and integration of location-specific climatic exceedance thresholds, is outside the scope of this methodological paper. Similarly, the attribution of elevated humidity in certain room types to proximity to moisture sources is offered as a plausible interpretation consistent with the model output, not as a validated causal claim. Mediating effects of ventilation frequency and room functional usage were not directly measured and warrant investigation in dedicated future work.
With 23 homes and approximately 29,000 observations, the dataset provides substantial power for estimating population-average fixed effects, including the retrofit effect. However, power for detecting home-level differences in random slopes (for example, identifying which specific buildings exhibit unusually strong or weak retrofit responses) is more limited at this cluster count [
24]. Researchers whose primary interest lies in building-specific effect heterogeneity rather than population-average inference should plan monitoring programs accordingly.
4.3. Practical Implementation Guidance
For researchers seeking to apply this methodology to their own datasets, the following guidance is available:
Understand your data structure and identify all levels of clustering (homes, rooms, time periods, geographic regions). Random effects should be specified at each relevant level. Select all mechanistically relevant predictors for the model. Include variables with clear theoretical/physical justification for the outcome. Check assumptions of the linear model and if violations are noted or warnings come up during execution, conduct sensitivity analyses. If needed, consider employing alternative link functions or variance structures [
11].
To compare the contribution across predictors, you may either adjust the predictors (standardize the data, convert to z-scores) or compare the standardized β coefficients. In this work, the latter approach is used. Whichever path you take, document the process for reproducibility. Reporting should specify both fixed and random effects. The advantage of LMEs is that we are not limited to population-average effects. We can report the heterogeneity across grouping units. This information is crucial for practitioners seeking to tailor interventions. Choose the response metrics analyzed strategically, based on research questions and study objectives, not based on what is convenient to analyze. Practitioners should also consider outcome metrics aligned with specific standards, for example, EN16798 or Standard 55 with respect to thermal comfort.
To facilitate verification and adaptation, works must consider providing minimal reproducible code alongside the publication. Open-source code with detailed comments accelerates methodological progress and builds community trust [
19]. To complement this, consider using tidy data standards, as described in
Section 2.1.2. This ensures easy machine readability and the ability to apply existing code without restructuring. Providing representative sample data, to enable code testing without disclosing proprietary full datasets, is also good practice.
4.4. Future Directions
Future research would need to extend to multivariate models, incorporating multiple indoor climate parameters simultaneously (co-modelling temperature, humidity, and air quality) to assess coupling effects. Similarly, time series analysis can be added in to explicitly analyze the temporal impacts of interventions, potentially using state-space or dynamic linear models [
13]. The strong negative correlation between random intercepts and external humidity needs to be verified in studies with larger and more diverse home samples for generalizing conclusions.
The methodology needs to be applied to datasets spanning diverse climates and building stocks to assess generalizability. A deeper analysis of interaction effects between retrofit strategy and occupant behavior is also called for to identify optimal retrofit approaches for specific populations. It is envisaged that the open-source solutions provided through this work will accelerate these steps.