f2S {RESI}R Documentation

Compute the robust effect size index estimate from F-statistic

Description

This function computes the robust effect size index from Vandekar, Tao, & Blume (2020). Vector arguments are accepted. If different length arguments are passed they are dealt with in the usual way of R.

Usage

f2S(f, df, rdf, n)

Arguments

f

The F statistic for the parameter of interest.

df

Number of degrees of freedom of the F statistic.

rdf

Model residual degrees of freedom.

n

Number of independent samples.

Details

The formula for converting an F statistic to S is:

S = \sqrt(max(0, (f * df * (rdf - 2)/rdf - df)/n))

The estimator is derived by setting the statistic equal to the expected value of the test statistic and solving for S.

Value

Returns a scalar or vector argument of the the robust effect size index estimate.

Examples


# to obtain example F values, first fit a lm
mod = lm(charges ~ region * age + bmi + sex, data = RESI::insurance)

# run Anova, using a robust variance-covariance function
# get the F values and Df values
fs = car::Anova(mod, vcov. = sandwich::vcovHC)[1:5, "F"]
dfs = car::Anova(mod, vcov. = sandwich::vcovHC)[1:5, "Df"]

# get RESI estimates
f2S(fs, df = dfs, rdf = mod$df.residual, n = nrow(RESI::insurance))

[Package RESI version 1.2.4 Index]