I want to do the following with some time series data: Calculate 95% confidence interval for mean defined as +/-sigma(x)qt(0.025, N*-1) / sqrt(N*) where sigma(x) is the standard deviation at any point x and qt(0.025, N*-1) is the 2.5 percentage point of the Student-t distribution with N*-1 degrees of freedom.
I have been trying to do this with HypothesisTests' ci() and OneSampleTTest() functions, but as far as I can see OneSampleTTest() does not allow me to choose the number of degrees of freedom. julia> t = OneSampleTTest(arr) One sample t-test ----------------- Population details: parameter of interest: Mean value under h_0: 0 point estimate: 0.3835 95% confidence interval: (0.14217301685460967,0.6248269831453903) Test summary: outcome with 95% confidence: reject h_0 two-sided p-value: 0.0057946078675091515 (very significant) Details: number of observations: 10 t-statistic: 3.5948622927526235 degrees of freedom: 9 empirical standard error: 0.10668002520517972 julia> t.df 9 julia> ci(t, 0.025, tail=:both) (0.09706297518543938,0.6699370248145606) Can anybody point me in the right direction?