Differences in the stellar populations of galaxies can be used to quantify the effect of environment on the star formation history. We target a sample of early-type galaxies from the Sloan Digital Sky Survey in two different environmental regimes: close pairs and a general sample where environment is measured by the mass of their host dark matter halo. We apply a blind source separation technique based on principal component analysis, from which we define two parameters that correlate, respectively, with the average stellar age (eta) and with the presence of recent star formation (zeta) from the spectral energy distribution of the galaxy. We find that environment leaves a second order imprint on the spectra, whereas local properties - such as internal velocity dispersion - obey a much stronger correlation with the stellar age distribution.