{"nbformat":4,"nbformat_minor":0,"metadata":{"colab":{"provenance":[],"authorship_tag":"ABX9TyPAugMtRHvKlgEMAklrEHhh"},"kernelspec":{"name":"python3","display_name":"Python 3"},"language_info":{"name":"python"}},"cells":[{"cell_type":"code","execution_count":1,"metadata":{"id":"wliD9-PgNkjT","executionInfo":{"status":"ok","timestamp":1717753061266,"user_tz":-330,"elapsed":1823,"user":{"displayName":"Amit Sachan","userId":"17076119069500437280"}}},"outputs":[],"source":["from statsmodels.stats.proportion import proportion_confint"]},{"cell_type":"code","source":["no_obs=546\n","yes=178\n","p=yes/no_obs\n","print(\"point estimate of the proportion of Indians not covered by life insurance :\", p)\n"],"metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"yqkwq8ZfQMXr","executionInfo":{"status":"ok","timestamp":1717753061267,"user_tz":-330,"elapsed":7,"user":{"displayName":"Amit Sachan","userId":"17076119069500437280"}},"outputId":"2a118ac1-4a27-4302-9a17-7ed57956c6b4"},"execution_count":2,"outputs":[{"output_type":"stream","name":"stdout","text":["point estimate of the proportion of Indians not covered by life insurance : 0.326007326007326\n"]}]},{"cell_type":"code","source":["CIP=proportion_confint(yes, no_obs, alpha=(1 - 0.95))\n","CIP= (round(CIP[0], 2), round(CIP[1], 2))\n","print(\"95% confidence interval for the population proportion :\", CIP)\n"],"metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"ykdRfzhFQMd_","executionInfo":{"status":"ok","timestamp":1717753061267,"user_tz":-330,"elapsed":5,"user":{"displayName":"Amit Sachan","userId":"17076119069500437280"}},"outputId":"489a753d-5244-4d49-da08-da095b630c90"},"execution_count":3,"outputs":[{"output_type":"stream","name":"stdout","text":["95% confidence interval for the population proportion : (0.29, 0.37)\n"]}]},{"cell_type":"code","source":[],"metadata":{"id":"7HzCvEzeQMg1","executionInfo":{"status":"ok","timestamp":1717753061267,"user_tz":-330,"elapsed":3,"user":{"displayName":"Amit Sachan","userId":"17076119069500437280"}}},"execution_count":3,"outputs":[]},{"cell_type":"code","source":[],"metadata":{"id":"gIimKlVJQMj5","executionInfo":{"status":"ok","timestamp":1717753061267,"user_tz":-330,"elapsed":3,"user":{"displayName":"Amit Sachan","userId":"17076119069500437280"}}},"execution_count":3,"outputs":[]}]}