MyNixOS website logo
Description

Two-Sample Tests for Skewed Data.

The classical two-sample t-test works well for the normally distributed data or data with large sample size. The tcfu() and tt() tests implemented in this package provide better type-I-error control with more accurate power when testing the equality of two-sample means for skewed populations having unequal variances. These tests are especially useful when the sample sizes are moderate. The tcfu() uses the Cornish-Fisher expansion to achieve a better approximation to the true percentiles. The tt() provides transformations of the Welch's t-statistic so that the sampling distribution become more symmetric. For more technical details, please refer to Zhang (2019) <http://hdl.handle.net/2097/40235>.

tcftt

The classical two-sample t-test only fits for the normal data. The tcfu() and tt() tests implemented in this package are suitable for testing the equality of two-sample means for the populations having unequal variances. When the populations are not normally distributed, these tests can provide more power than a large-sample t-test using normal approximation, especially when the sample sizes are moderate. The tcfu() uses the Cornish-Fisher expansion to achieve a better approximation to the true percentiles. The tt() transforms the Welch’s t-statistic so that the sampling distribution become more symmetric. More technical details please refer to Zhang (2019) http://hdl.handle.net/2097/40235.

Installation

You can install the released version of tcftt from CRAN with:

install.packages("tcftt")

Example

This is a basic example which shows you how to solve a common problem:

library(tcftt)
x1 <- rnorm(20, 1, 3)
x2 <- rnorm(21, 2, 3)
tcfu(x1, x2, alternative = 'two.sided')
#> $stat
#> [1] -1.044103
#> 
#> $cutoff
#> [1] -1.970350  2.073316
#> 
#> $pvalue
#> [1] 0.3019628
#> 
#> $reject
#> [1] FALSE
tt(x1, x2, alternative = 'less')
#> $stat
#> [1] -1.063013
#> 
#> $cutoff
#> [1] -1.644854
#> 
#> $pvalue
#> [1] 0.8561119
#> 
#> $reject
#> [1] FALSE

Main functions

The function tcfu() implements the Cornish-Fisher based two-sample test (TCFU) and tt() implements the transformation based two-sample test (TT).

The function t_edgeworth() provides the Edgeworth expansion of the cumulative density function for the Welch’s t-statistic, and t_cornish_fisher() provides the Cornish-Fisher expansion for its percentiles.

The functions adjust_power() and pauc() provide power adjustment methods for simulation studies.

Metadata

Version

0.1.0

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows