Generation

generate functionTue, 21 Mar 2023

You are given test results for two drugs: A (results for the group of people getting drug A) and B (results for the other group of people getting drug B). You need to assess whether there is a statistically significant difference in the effect in these patients. Use the null hypothesis, the inverse hypothesis, and Student's t-test for calculations.

from scipy import stats import pandas as pd def check_for_significance(a, b): t, p = stats.ttest_ind(a, b) df = pd.DataFrame({"t" : t, "p-value" : p}, index = [0]) return df

Questions about programming?Chat with your personal AI assistant