uMpool: Pooled central moment estimates - two-sample

Description Usage Arguments Details Value See Also Examples

View source: R/unbGen.R

Description

Calculate unbiased pooled estimates of central moments and their powers and products up to specified order.

Usage

1
uMpool(smp, a, order)

Arguments

smp

sample.

a

vector of the same length as smp specifying categories of observations (should contain two unique values).

order

highest order of the estimates to calclulate. Estimates of lower orders will be included.

Details

Pooled estimates up to the 6th order can be calculated. Second and third orders contain estimates of the variance and third central moment, fourth order includes estimates of fourth moment and squared variance (μ[2]^2), fifth order - of fifth moment and a product of second and third moments (μ[2] μ[3]), sixth order - of sixth moment, a product of second and fourth moments (μ[2] μ[4]), squared third moment (μ[3]^2), and cubed variance (μ[2]^3).

Value

A named vector of estimates of central moments and their powers and products up to order. The highest order available is 6th. The names of the elements are "M2", "M3", "M4", "M5", "M6" for corresponding central moments, "M2M3", "M2M4" for products of the moments (second and third, second and fourth), and "M2pow2", "M2pow3", "M3pow2" for powers of the moments - corresponding to estimates of squared variance, cubed variance, and squared third moment.

See Also

uM for one-sample unbiased estimates.

Examples

1
2
3
4
nsmp <- 23
smp <- rgamma(nsmp, shape = 3)
treatment <- sample(0:1, size = nsmp, replace = TRUE)
uMpool(smp, treatment, 6)

innager/Umoments documentation built on June 24, 2021, 8:23 p.m.