# Pointwise Nonparametric Estimation of Odds Ratio Curves with R: Introducing the flexOR Package
## 5 Discussion  
This paper provides a comprehensive overview of the flexOR package, showcasing its capabilities for computing pointwise estimates of odds ratio (OR) curves and corresponding confidence limits. Specifically designed for continuous predictors introduced nonlinearly in an additive multivariable logistic regression model, the flexOR package offers both numerical and graphical outputs, utilizing smoothing splines as the underlying technique. It is noteworthy to mention the absence of available R libraries for generalized additive models (GAM) with binary response variables that offer the functionality provided by our library. While it is true that we can obtain smooth effects of continuous covariates using libraries like gam or mgcv, they do not consider the reference value nor provide graphs with confidence bands adjusted to account for the reference value. Our library fills this gap by offering comprehensive tools for modeling GAMs with binary response variables, including the incorporation of reference values and the provision of graphical representations with adjusted confidence bands. To illustrate the practical application of the flexOR package, we employed two real datasets--namely, the Acute Coronary Syndrome (ACS) dataset and the Pima Indian dataset. These examples serve to demonstrate the efficacy and versatility of the proposed methods in the context of real-world data. The insights gained from these applications not  
Figure 3: Relation between body mass index (BMI) and log-odds of diabetes on the Pima Indian population in Arizona, USA. The log-odds ratio (LnOR) is depicted by a solid line, while the 80% and 95% confidence bands are represented by dashed lines. These visualizations are provided for a reference value of 40 for BMI. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Covariates** & **AIC** & **GCV.Cp** & **REML** \\ \hline Age & 3.30 & 3.30 & 3.44 \\ Mass & 4.10 & 3.96 & 4.17 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Degrees of freedom (df) for the multivariable logistic model with smoothing splines for age and mass. Pedigree was the remaining variable. Pima Indians diabetes. only contribute to a better understanding of the flexOR package but also provide valuable considerations for researchers and practitioners utilizing nonlinear logistic regression models in their analyses. The integration of these techniques into statistical software opens avenues for enhanced modeling and interpretation of complex relationships in diverse datasets. The application of the proposed methods enabled the identification of prognostic factors exhibiting nonlinear associations with the risk of death among Acute Coronary Syndrome (ACS) patients. Specifically, age (years), creatinine, and fasting blood glucose levels demonstrated intricate nonlinear relationships. Similarly, in the context of the Pima Indian diabetes dataset, age (years) and BMI exhibited nonlinear associations with the risk of diabetes. Notably, this study showcases the distinct functional forms characterizing these associations, providing a detailed understanding of the nuanced relationships within each dataset. A key consideration highlighted in this exploration is the importance of judiciously selecting the optimal amount of smoothing when employing smoothing splines. The flexOR software (version 1.0.0) addresses this concern by offering the flexibility to obtain degrees of freedom through various methods, including the AIC criterion, its corrected version proposed by [PERSON] et al., and the BIC criterion by [PERSON] and [PERSON]. Moreover, users can leverage the functionality to obtain degrees of freedom based on other criteria available in the well-established ngcv R package by [PERSON]. In light of the observed patterns in our two datasets, a noteworthy recommendation emerges for the use of the AIC method when determining degrees of freedom for smoothing splines.