jamovi / jmv

jamovi for R
https://www.jamovi.org
58 stars 27 forks source link

Update descriptives.b.R #342

Closed atpinto closed 2 years ago

atpinto commented 2 years ago

Changed the critical value for the confidence interval for the mean. The critical values is now chosen as the quantile from the t-distribution with df=n-1 rather than the quantile from the normal distribution.

atpinto commented 2 years ago

The confidence interval for the mean in the Descriptive statistics command is using the critical values from the normal distribution instead to the t-distribution. When the sample size is small size, this confidence interval will fail to have the correct coverage because is too narrow. Given that we are using the sample standard deviation for the calculation of the standard error, the t-distribution should be used for the calculation of the confidence interval for the mean.

The correct confidence interval can be obtained form the t-test command and it will not match the normal-based confidence interval in the descriptives command.

jonathon-love commented 2 years ago

i think we want to add a footnote too @raviselker ? 1. so people are aware of the change. 2. because it's informative to have?

raviselker commented 2 years ago

I fixed up this PR in #348 (there were some other issues with it).