calculate_stipw functionality and documentation 2