Skip to contents

Estimate Cohen's f-Squared and Generate the Corresponding Sampling Distribution Using the Monte Carlo Method

Usage

FSqMC(object, alpha = c(0.05, 0.01, 0.001))

Arguments

object

Object of class mc, that is, the output of the MC() function.

alpha

Numeric vector. Significance level \(\alpha\).

Value

Returns an object of class betamc which is a list with the following elements:

call

Function call.

args

Function arguments.

thetahatstar

Sampling distribution of \(f^2\) (column fsq) and the local \(f^2\) (one column per regressor).

est

Vector of estimates.

fun

Function used ("FSqMC").

Details

Cohen's \(f^2\) for the whole model, \(f^2 = R^2 / (1 - R^2)\), and the local \(f^2\) of each regressor, \(f^2_j = sr^2_j / (1 - R^2)\), where \(sr_j\) is the semipartial correlation, are derived from each randomly generated vector of parameter estimates. Confidence intervals are generated by obtaining percentiles corresponding to \(100(1 - \alpha)\%\) from the generated sampling distribution, where \(\alpha\) is the significance level.

References

Selya, A. S., Rose, J. S., Dierker, L. C., Hedeker, D., & Mermelstein, R. J. (2012). A practical guide to calculating Cohen's f2, a measure of local effect size, from PROC MIXED. Frontiers in Psychology, 3, 111. doi:10.3389/fpsyg.2012.00111

See also

Other Beta Monte Carlo Functions: BetaMC(), DeltaRSqMC(), DiffBetaMC(), MC(), MCMI(), PCorMC(), RSqMC(), SCorMC()

Author

Ivan Jacob Agaloos Pesigan

Examples

# Data ---------------------------------------------------------------------
data("nas1982", package = "betaMC")

# Fit Model in lm ----------------------------------------------------------
object <- lm(QUALITY ~ NARTIC + PCTGRT + PCTSUPP, data = nas1982)

# MC -----------------------------------------------------------------------
mc <- MC(
  object,
  R = 100, # use a large value e.g., 20000L for actual research
  seed = 0508
)

# FSqMC -----------------------------------------------------------------
out <- FSqMC(mc, alpha = 0.05)

## Methods -----------------------------------------------------------------
print(out)
#> Call:
#> FSqMC(object = mc, alpha = 0.05)
#> 
#> Cohen's f-squared (fsq) and local f-squared
#> type = "hc3"
#>            est     se   R   2.5%  97.5%
#> fsq     4.1158 1.4375 100 1.8593 7.1580
#> NARTIC  0.9510 0.4182 100 0.1777 1.6831
#> PCTGRT  0.6019 0.2624 100 0.1105 1.1149
#> PCTSUPP 0.2909 0.2019 100 0.0282 0.7851
summary(out)
#> Call:
#> FSqMC(object = mc, alpha = 0.05)
#> 
#> Cohen's f-squared (fsq) and local f-squared
#> type = "hc3"
#>            est     se   R   2.5%  97.5%
#> fsq     4.1158 1.4375 100 1.8593 7.1580
#> NARTIC  0.9510 0.4182 100 0.1777 1.6831
#> PCTGRT  0.6019 0.2624 100 0.1105 1.1149
#> PCTSUPP 0.2909 0.2019 100 0.0282 0.7851
coef(out)
#>       fsq    NARTIC    PCTGRT   PCTSUPP 
#> 4.1157764 0.9509843 0.6018924 0.2909455 
vcov(out)
#>               fsq     NARTIC      PCTGRT     PCTSUPP
#> fsq     2.0662933 0.31087589 0.103890299 0.141807429
#> NARTIC  0.3108759 0.17490518 0.038134937 0.013930003
#> PCTGRT  0.1038903 0.03813494 0.068876530 0.001811338
#> PCTSUPP 0.1418074 0.01393000 0.001811338 0.040765399
confint(out, level = 0.95)
#>              2.5 %   97.5 %
#> fsq     1.85929412 7.158033
#> NARTIC  0.17772569 1.683144
#> PCTGRT  0.11048857 1.114859
#> PCTSUPP 0.02819256 0.785064