p_value = stats.t.sf(abs(t_score), df=degrees_of_freedom)
For a right-tailed t-test, the p_value can be calculated as:
p_value = stats.t.sf(abs(t_score), df=degrees_of_freedom)
And for a two-tailed t-test, the p_value can be calculated as:
p_value = stats.t.sf(abs(t_score), df=degrees_of_freedom)*2
The output of the previously mentioned Python code will be like the following:
p-value for left-tailed test: 0.16453340103337788 p-value for right-tailed test: 0.16453340103337788 p-value for two-tailed test: 0.32906680206675576








































0 Comments