*2.3. Statistical Analysis*

All analyses were performed using R statistical software version 3.5.1 [34]. Descriptive data were reported as mean ± standard error of the mean (SEM) for both sIgA and cortisol concentrations in each time period, and as overall concentrations for each sex. A generalized least-squares method (GLS) was used to compare di fferences in sIgA and cortisol concentrations over time. The GLS model was constructed by using nonlinear mixed-e ffects (nlme) package 3.1-137 [35]. We constructed the model using time period and day of sample collection as the main e ffects. Individual elephant was defined as a random e ffect. For GLS modelling, the Akaike information criterion (AIC) was determined from models with di fferent covariance structures, including compound symmetry, autoregressive process of order 1 (AR1), and general correlation matrix with no structure. The compound symmetry structure had the lowest AIC value for the sIgA comparison model and AR1 had the lowest AIC value for cortisol, indicating the best fitted models. Therefore, the structure of the covariance pattern for GLS models for sIgA and cortisol were defined as the compound symmetry and AR1, respectively. Significant di fferences in mean sIgA and cortisol concentrations between di fferent time periods were analyzed by Tukey's post-hoc tests followed by examining linear, quadratic, and quartic trend e ffects over the 24 h cycle using the linear regression model and the locally weighted least squares regression (loess) method. Residuals from the fitted models were tested for normality and homogeneity of variance assumption by plotting standardized residuals versus quantiles of standard normal (QQ normality graph) and plotting standardized residuals versus fitted values, respectively. The plot indicated no violation for both assumptions, thus transformation of the sIgA and cortisol concentration data was not necessary. The scatter plots of sIgA and cortisol values were created using ggplot2 package 3.1.1 [36]. The repeated measures correlation (rmcorr) package 0.3.0 [37] was used to determine the correlation between sIgA and cortisol accounted for inter-individual di fferences in baseline concentrations. For all statistical tests, the significance level was set at α = 0.05.
