This paper provides a comparison between two estimators of nonparametric regression for longitudinal data, i.e., truncated spline and Fourier series. The main aim of this study is to investigate the performance of each estimator by applying the model to the pneumonia cases. Pneumonia cases in Indonesia is growing, considering the significant increase in the prevalence in just over the past ten years. The secondary data were collected from Indonesia Health Profile published by the Indonesian Ministry of Health. The predictors are the percentage of toddlers with Vitamin A intake, the percentage of basic immunization coverage in infants, the percentage of poor population, and the percentage of households with proper sanitation access. Our study shows that truncated spline nonparametric regression with three-knot points and the second type weighting method is the best estimator for modeling the percentage of pneumonia cases in Java Island.