0

I took this code from the official scipy documentation:

from scipy import stats
import numpy as np
rng = np.random.default_rng()
rvs = stats.uniform.rvs(size=50, random_state=rng)
stats.ttest_1samp(rvs, popmean=0.5)

In R, it's possible change the confidence level (90%, 94%, 99%, as example), but there is no mention of how to do this in scipy, at least in the official documentation. Does anyone know if there is any python library in which it is possible to adjust the confidence level or if it is possible to make this adjustment in the function stats.ttest_1samp. In the official documentation there is no option for confidence level in the function arguments, that's why I didn't try to put an argument in the function stats.ttest_1samp. Thanks.

  • 1
    Does this answer your question? [How to set significance level for scipy.stats test](https://stackoverflow.com/questions/73107018/how-to-set-significance-level-for-scipy-stats-test) – AlexK Nov 02 '22 at 04:34

1 Answers1

1

The version where you can do it directly isn't released yet. Here is the link https://scipy.github.io/devdocs/reference/generated/scipy.stats.ttest_1samp.html

To compute confidence intervals in Python check this answer Compute a confidence interval from sample data

Dawar
  • 69
  • 8