I developed this app based on the science of sleep. I used it to figure out my optimal bedtime (12:30) and optimal wake-up time (8:00). I also use it to track my diet, exercise, mood, productivity, alcohol use, nicotine use, meditation, and caffeine use.
It collects all the data and runs correlations between everything so you can see the effect of your habits. I did this using pearson correlations. Oh - and you can export your data at any time in order to do your own analysis.