Ask Question
22 March, 21:11

Define the function test_statistic which takes in an expected proportion and an actual proportion, and returns the value of the second test statistic in the previous question. Assume that you are taking in proportions, but you want to return your answer as a percentage.

+4
Answers (1)
  1. 22 March, 21:39
    0
    Previous question is not given.

    I'll assume that the test statistic is calculated as thus;

    (Expected Proportion - Actual Proportion) * 100

    The function goes as follows.

    #function is written in Python Programming Language.

    def test _statistic (expected, actual)

    return 100 * abs (expected - actual)

    The first line of the program defines the function test_statistic along with two parameters.

    The parameters are expected and actual.

    expected represents expected proportion whole actual represents actual proportion

    The second line calculates the value of the test_statistic.

    First the absolute value is calculated to remove all negative signs. Since the results is needed in percentage, it's then multiplied by 100.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “Define the function test_statistic which takes in an expected proportion and an actual proportion, and returns the value of the second test ...” in 📗 Engineering if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers