An analytical model for collisional effects on spectral line shape from the Doppler to the collision regime