Trend estimation from clustered data