precisionMeasureWithCustomDF: Confidence intervals with custom degree of freedom

precisionMeasureWithCustomDFR Documentation

Confidence intervals with custom degree of freedom


The following function computes a confidence interval with custom degree of freedom. The default is to use N-1 but this number is not always appropriate. For example, when there are heterogeneous variances, the confidence interval of the mean should mirror a Welsh test where the degrees of freedom are altered based on variances. The function CIwithDF.mean() accept an arbitrary defined degree of freedom (df). The df must be combined to the argument gamma after the confidence level.


CIwithDF.mean(x, gamma = 0.95 )



a vector of numbers, the sample data (mandatory);


a vector containing first a confidence level for CI (default 0.95) and a custom degree of freedom (when unspecified, it uses n-1 where n is the number of observations in x).


See the vignette "Unequal variances, Welch test, Tryon adjustment, and superb" for an example of use.


the confidence interval (CI) where the t value is based on the custom-set degree of freedom.




# this will issue a warning as no custom degree of freedom is provided
CIwithDF.mean( c(1,2,3), gamma = 0.90)          
# the confidence interval of the mean for 90% confidence level
CIwithDF.mean( c(1,2,3), gamma = c(0.90, 1.5) ) # uses 1.5 as df instead of 2.

superb documentation built on May 29, 2024, 8:51 a.m.