Estimate Cohen's f-Squared and Local f-Squared and Generate the Corresponding Sampling Distribution Using the Monte Carlo Method
Source:R/betaMC-f-sq-mc.R
FSqMC.RdEstimate Cohen's f-Squared and Local 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 theMC()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(),
SCorSqMC()
Examples
# Data ---------------------------------------------------------------------
data("nas1982", package = "betaMC")
# Fit Model in lm ----------------------------------------------------------
object <- stats::lm(
formula = QUALITY ~ NARTIC + PCTGRT + PCTSUPP,
data = nas1982
)
# MC -----------------------------------------------------------------------
mc <- MC(
object = object,
R = 100, # use a large value e.g., 20000L for actual research
seed = 0508
)
# FSqMC -----------------------------------------------------------------
out <- FSqMC(object = mc, alpha = 0.05)
## Methods -----------------------------------------------------------------
print(x = 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.4340 100 1.8855 7.4025
#> NARTIC 0.9510 0.4166 100 0.1881 1.7333
#> PCTGRT 0.6019 0.2979 100 0.0822 1.2612
#> PCTSUPP 0.2909 0.1766 100 0.0519 0.6999
summary(object = 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.4340 100 1.8855 7.4025
#> NARTIC 0.9510 0.4166 100 0.1881 1.7333
#> PCTGRT 0.6019 0.2979 100 0.0822 1.2612
#> PCTSUPP 0.2909 0.1766 100 0.0519 0.6999
coef(object = out)
#> fsq NARTIC PCTGRT PCTSUPP
#> 4.1157764 0.9509843 0.6018924 0.2909455
vcov(object = out)
#> fsq NARTIC PCTGRT PCTSUPP
#> fsq 2.0563646 0.28875571 0.14962863 0.12579685
#> NARTIC 0.2887557 0.17355560 0.02591958 0.01014041
#> PCTGRT 0.1496286 0.02591958 0.08872025 0.01283835
#> PCTSUPP 0.1257968 0.01014041 0.01283835 0.03120310
confint(object = out, level = 0.95)
#> 2.5 % 97.5 %
#> fsq 1.88552174 7.4024507
#> NARTIC 0.18811284 1.7333186
#> PCTGRT 0.08215928 1.2612360
#> PCTSUPP 0.05188291 0.6999492