While developing models to predict the risk of a clinical event, the static prediction modeling (SPM) is commonly used, which relates baseline predictors to the time to event. Such analysis often uses data from longitudinal studies, with predictors measured at a series of clinical encounters post until the occurrence of the clinical event. This paper studies the generalized landmark analysis (GLA), a statistical framework to develop prediction models using longitudinal data. The GLA generalizes the landmark modeling, proposed for dynamic prediction, in studies where the baseline does not represent a clinical milestone, a situation common in chronic disease research. It can also be viewed as a longitudinal generalization of local regression, which has mainly been studied in the context of low-dimensional cross-sectional data. We illustrate the GLA using data from the Chronic Renal Insufficiency Cohort (CRIC) Study and the Wisconsin Allograft Replacement Database (WisARD). Comparison of the SPM and the GLA shows that the latter has similarly or better predictive performance, with most prominent improvement in situations where the study population have notable changes over time.