calculate_stipw functionality and documentation 1