I spent a year devising a data-driven approach to behaving ethically. Here it is.