cdf() for a ProductNormal3 with lower.tail = FALSE now integrates the upper tail directly instead of computing 1 - p, so
a far upper tail is resolved: at unit means, q = 100 and tol = 1e-10 it returns 7.84e-11 where 1 - p gave a value
about 4% too large (50 times too large at the default tol) (#177). The two tails of the object now agree to the
integration tolerance, not exactly.dist_quantile() and confint() for a ProductNormal3 now use the object's method ("gauss" or "hcubature"), as
cdf() already did; before, they always used "gauss" (#177).dist_quantile() on a ProductNormal now accepts a vector of probabilities with the default type = "dop", returning one
quantile per element with the names of p kept; before, a vector p stopped with the condition has length > 1
(#176). A single p returns the same value as before, and type = "mc" already accepted a vector.ci(mu = ..., Sigma = ..., quant = ...) now stops with a message that says to pass the estimates as the first argument
by position, instead of argument "object" is missing, with no default (#179). ci() still dispatches on its first
argument, so the call form is unchanged; ?ci now lists the arguments of the numeric form.scripts/pre-release-matrix.sh runs the Linux, macOS and Windows checks and lint on dev before a release PR (#178).pprodnormal3() now takes a vector of quantiles, like pprodnormal(), dprodnormal(), qprodnormal() and
dprodnormal3(). The result is a numeric vector of the same length and names as q, in the order given; with
diagnostics = TRUE the "error" and "nodes" attributes have one entry per q. A single q behaves exactly as
before (same value, same error messages, no attributes unless diagnostics = TRUE). A missing, infinite or empty q
vector is an error.
pprodnormal3() gains lower.tail = TRUE. With lower.tail = FALSE it returns P(X1 * X2 * X3 > q) by integrating
the complement directly, so far upper tails (for example q = 100 at unit means, about 8e-11) are resolved
instead of lost to 1 - p. As everywhere in this function the accuracy is the absolute tol, so use a tol well
below the probability you want. Default calls return the same values as before; vectors, names, diagnostics,
method = "hcubature" and every degenerate reduction (zero-variance factors, point masses) support it.
New qprodnormal3(p, mean, cov, lower.tail = TRUE, tol = 1e-6): the quantile of the product of three normals, the
counterpart of qprodnormal(). It inverts pprodnormal3() by root-finding in either tail (so a small upper-tail p is
resolved), keeps the names of p, and returns -Inf/Inf at p = 0/1. dist_quantile() on a ProductNormal3
now uses the same routine, so the two agree; at p = 0 and p = 1 it returns -Inf and Inf, and for a point
mass (three zero variances) it returns prod(mu).
?ci now documents the p element of the Monte Carlo result: a two-sided proportion of simulated values above or
below 0 (the "P Value" on the density plot), 0 for any clearly nonzero effect, not a null-distribution test. The
element name is MCError, as returned, not MC Error. The asymptotic result has no p.sq := a*a) could fail with non-finite function value under
type = "dop". rho = Sigma[1, 2] / (se.x * se.y) can come out as 1 plus or minus one rounding step because
sqrt(v)^2 is not always v; above 1 the distribution-of-the-product root-finder failed. A rho within 1e-12 of 1 or -1
is now taken as exactly 1 or -1, so the closed-form collinear branch is used. A genuinely invalid correlation is still
rejected.ci() on a lavaan fit no longer stops on a defined parameter that repeats a coefficient inside a product of
three or more factors (ab := a*b*a, cube := a*a*a, or a nested abx := ab*a). The exact three-factor interval
does not apply because the repeated factors are perfectly correlated, and it used to fail with a "perfect
correlation" error. Such a parameter now gets a Monte Carlo interval, with a warning when you set type to anything
other than "MC". Two factors (a*a) and three distinct factors are unchanged.No change to returned values for any call that worked before; the only API addition is the optional @provenance on MBCOResult.
mbco() result now records what produced it in a new @provenance property: the RMediation, OpenMx, medfit
(when loaded) and R versions, the test type, the bootstrap size R, RNGkind() and the run time. print() and
summary() show it in a trailing block, after every line they printed before. The random seed is not recorded
(it cannot be recovered afterward), so call set.seed() and report it. names() of an MBCOResult gains one
name, "provenance", appended after the nine existing ones; those keep their order. Results built by hand
keep @provenance NULL.ci() on a lavaan fit now resolves a defined parameter (:=) that uses another one, for example
abc := ab*c where ab := a*b; before, the whole call stopped with an error. A definition that cannot be
resolved (a cycle, or text that does not parse) gets a warning and a NULL entry, and the other intervals are
returned.ci() on a lavaan fit no longer stops on a product of three or more coefficients (abc := a*b*c, a serial
indirect effect) under type = "dop", "asymp", "prodclin" or "all". Exactly three coefficients get the exact
interval of ci(ProductNormal3(...)), whatever type is, returned as a named c(lower, upper) (a warning says so
when you set type to "asymp", "prodclin" or "all"). Four or more coefficients get a Monte Carlo interval,
with a warning when you set type. type = "MC" is unchanged.ci() on a lavaan fit now warns when type was given explicitly but a defined parameter is not a product of
estimated coefficients (for example a*b + c). Such a parameter always gets a Monte Carlo interval; the call used
to say nothing.medci() for each type, the leading argument names of medci() and pprodnormal3(), and the dimensions and
columns of memory_exp (#132); and the results of ci() (for a ProductNormal, for numeric estimates with
type = "MC" and type = "asymp") and ci_mediation_data(), including the interval labels and the
MC.Error / MCError spellings (#134). A change to any of these now fails a test..mbco_semi() test, is muffled so the suite
runs warning-free (#133).The ci(type = "asymp") interval label changes (see Behavior changes); two silent-wrong-value density bugs are fixed.
ci(type = "asymp") now names its interval by its confidence level, 100 * (1 - alpha), as medci() does. It used
to use 100 * (1 - alpha / 2), so the default 95% interval was labeled 97.5% CI (and alpha = 0.10 gave
95% CI). The interval itself was always correct. Code that indexes the result by the old name, such as
res$"97.5% CI", must use res[[1]] or the new name ("95% CI" at the default alpha) (#123).dprodnormal() and dprodnormal3() no longer return 0, NA or a silently low density when a factor's mean is
very large relative to its standard error (mu / se above about 3000 for two factors, about 1000 for some
three-factor cases). The integrand is a narrow spike there and the fixed integration window missed it. The window is
now split at the spike (found from the roots of the conditional mean), with a scaled absolute tolerance for the
far subintervals. Values for well-conditioned inputs are unchanged (#117).medci()/ci() endpoints
(#115), point masses and |rho| = 1 (#116), pMC()/qMC() closed forms (#118), qprodnormal() (#119, #126),
confintAsymp()/confintMC() (#120), .prod3_bound() (#121) and MBCO size and a real-OpenMx check (#122).No change to returned values or to the API.
medci() and ci() on a ProductNormal3 now show the real output of those calls (they
showed intervals that the functions do not return), and the Monte Carlo calculator of the online apps is linked.mbco() route is no longer described as experimental: medfit dropped that label in 0.11.0.|rho| = 1, point masses, the densities)..lintr (120 columns) and wrapped 61 over-long or mis-indented lines in R sources and tests; the parsed code
is unchanged. Rewrapped roxygen lines regenerate seven help pages with the same content.SEMFit MBCO tests and the mbco() example pass fixed_x and
meanstructure to medfit::fit_sem() explicitly, at today's values, so
medfit 0.14.0's default-change warning does not appear (medfit flips these
defaults in 0.15.0). Results are unchanged; the example now needs medfit
= 0.9.0 (#85).
medci_prototype() is removed. It was an exported S7-core prototype of
medci() (shipped in 1.6.1) that nothing in the package called. Use
medci(), or ci() on a ProductNormal, which return the same intervals.mbco(type = "parametric") now checks every bootstrap replicate like type = "semi" does.
It used to hand the bootstrap to OpenMx::mxCompare(boot = TRUE), so a replicate null fit
that violated its constraint (for example OpenMx/OpenMx#433 dropping a zero-Jacobian
equality at a replicate's start) entered the null distribution unchecked and understated its
statistic. The package now simulates each replicate from the fitted h0 with
OpenMx::mxGenerateData(), fits h0 and h1, refits a violated h0 constraint, and stops
with an error of class RMediation_bootstrap_infeasible when it cannot be repaired. Behavior
changes: a replicate with a non-finite statistic or an h1 fit worse than its h0 fit now stops the
call (mxCompare dropped such replicates; the last check also applies to type = "semi"; a
replicate that does not converge is dropped within a 5% bound, see the next entry), and a model without a
single raw data set (a covariance-data or multigroup model) is refused before sampling. The
observed statistic, df and the result shape are
unchanged; seeded p-values differ because the replicates are drawn by a different loop.
The DOP CDF (pprodnormal(), qprodnormal(), medci()) is exact at |rho| = 1: it now uses
Meeker & Escobar's (1994) quadratic-root solution instead of integrating a step function, which
was wrong by up to 4e-5 and could stop with "the integral is probably divergent". For
|rho| < 1 the integrand is evaluated from the factored quadratic (no cancellation at large
means) with the roots as breakpoints, and a roundoff report from integrate() relaxes the
tolerance to 1e-8, then 1e-6, instead of failing. All 495 evaluations in the article's own test
domain (means of +/-3e5, |rho| up to 0.99999) now succeed; 10 used to stop with an integrator
error.
mbco_product_null() stops, with class RMediation_h1_nonconverged, when the full model h1 did
not converge or was never run. mbco() warns, with class RMediation_fit_nonconverged, when a
supplied h0 or h1 carries an unaccepted OpenMx status; the result is unchanged.
Point masses now have the right-continuous CDF. pprodnormal3() returned 0.5 at q == 0 for a
product identically equal to 0 (and for a single zero-variance, zero-mean first component);
it now returns 1, matching P(XYZ <= q). pprodnormal() with a zero standard error follows
the same rule (q >= c lower, q < c upper). Continuous zero-mean distributions still give
0.5 at 0.
pprodnormal3() rejects a covariance that is not finite and positive semidefinite, including
negative variances at very different scales, instead of clamping negative variances to zero.
pprodnormal(lower.tail = FALSE) and qprodnormal(lower.tail = FALSE) with
type = "dop" now integrate the upper tail directly instead of computing
1 - P(XY <= q), which cancelled below about 1e-10 (an upper quantile at
p = 1e-12 round-tripped to a relative error of 7e-5, and smaller tails
could not be resolved). The quantile root finder's tolerance is tightened
from the uniroot() default (1.2e-4) to 1e-12, and the integrand handles
|rho| = 1 (a point-mass conditional) without a 0/0. Probabilities below
about 1e-22 remain unresolved (the integration window leaves out 1.5e-23).
medci(type = "mc") reported MC.Error as SE / n.mc; it is now
SE / sqrt(n.mc), the standard error of the simulated mean, as documented
elsewhere. Intervals and estimates are unchanged.
medci() Monte Carlo and plotting no longer stop with a Cholesky error when
the covariance is singular (rho = +/-1 or a zero standard error); type = "dop"/"all" with a zero standard error now fails with an actionable
message instead of "non-finite function value".
plot/plotCI must be a single TRUE/FALSE in medci() and ci()
(a vector or NA previously failed with an obscure condition error).
ci(<ProductNormal>, type = "dop") shared the large-mean defect of #60 through
a second copy of the integral (it stopped with "please use type='MC'" at
mu/se of about 20 where medci() already worked). The S7 core now calls
qprodnormalMeeker(), so both paths use one integral.
pprodnormal3() (and cdf()/dist_quantile() on ProductNormal3) returned 0
for every q, or an error, when two or three components had zero variance.
It now returns the exact answer: a point mass at prod(mean) when all three
are fixed, and a scaled normal when exactly one is random (#64).
medci() was defined twice, in R/medci.R and R/medci_legacy_backup.R
(identical code). The backup sorted later and was the live definition, and
?medci merged both sets of documentation into duplicated Usage, Value and
Details sections. The backup file is removed; behavior is unchanged. A test
now fails if any top-level function is defined in more than one R/ file.
pprodnormal() and qprodnormal() with type = "dop" no longer collapse at
large standardized means (pprodnormal(400, 20, 20, 1, 1) returned 8e-7
instead of about 0.507) and are accurate in far tails (previously wrong by up
to 4e-6 absolute). Both now share one integral over the support of the
conditioning variable at a tight tolerance. The CDF is also clamped to
[0, 1], so lower.tail = FALSE can no longer be slightly negative (#60).
dprodnormal3(): exact density of the product of three normal variables with any mean vector and
positive-definite covariance (the counterpart of pprodnormal3()), computed as a
two-dimensional integral that conditions on the first factor and reuses the dprodnormal()
integral for the other two. Matches the derivative of pprodnormal3() to about 7 digits.
dprodnormal() now resolves very small z at nonzero means (it previously could stop with
"the integral is probably divergent").
dprodnormal() is the exact density of the product of two normal random
variables (any means, any -1 < rho < 1), completing the d/p/q family. It
uses the one-dimensional integral of Rohatgi (Glen et al., 2004) in general
and the Bessel-K closed form of Nadarajah and Pogany (2016) when both means
are zero; the two agree to near machine precision and each is the other's
test oracle. The density is Inf at exactly 0 (a log singularity).
pprodnormal() and qprodnormal() accept a vector q / p and return one
probability / quantile per element (a list of two vectors for type = "all").
For type = "MC" all elements share one simulated sample, so the estimates
are mutually consistent. Scalar calls are unchanged.
ml_omitted_confounder() adds a sensitivity analysis for an omitted
confounder of the mediator-outcome relation in two-level (1-1-1) mediation,
after Tofighi and Kelley (2016). It returns an MLOmittedConfounder object
with print, summary, plot and as.data.frame methods. The default
screen keeps only positive-definite grid points, so it does not reproduce the
published tables; use screen = "none" for those.
mbco(h0, h1, type = "asymp") accepts two fitted medfit SEMFit objects
with medfit >= 0.8.0. It returns MBCOResult using stats::anova() without
refitting or requiring OpenMx. The restricted fit must come first; df is the
actual difference. Active tested bounds refuse an invalid chi-square p-value.
Bootstrap types, mixed classes and unused fitting controls error. Existing
OpenMx paths and CI integration with medfit >= 0.2.0 are preserved.
medfit remains optional in Suggests >= 0.2.0. The SEMFit route needs the GitHub/r-universe medfit release; CRAN medfit 0.3.2 cannot exercise it. This development change does not lift the CRAN submission or development-to-main hold.
OpenMx mbco() now checks the constraints of h0 and h1 at the fitted
solution (issue #34). The OpenMx default feasibility tolerance (0.05) can leave
a constrained fit off the null set and understate the statistic. A returned
number now changes in that case: a violated h0 (scaled violation above
1e-6) is refit once at tolerance 1e-8 for all three types, the refit model
supplies the observed statistic and the bootstrap, a warning of class
RMediation_h0_refit reports the change, and the new refit slot of
MBCOResult records it (NULL when no refit was needed). Clean fits and
constraint-free models are unchanged. If the refit fails, does not converge or leaves
the constraint violated, mbco() stops with an error of class
RMediation_h0_refit_failed naming the constraint, instead of returning a
statistic from a known-invalid fit. A
constraint that cannot be evaluated now errors. See the wrong-branch warning below.
OpenMx mbco() now also warns, with class RMediation_constraint_not_enforced and right
after RMediation_h0_refit, when the refit ran and h0's fit was identical to
h1's (statistic 0 before the refit) although a constraint of h0 was violated
(issue #84). The constraint may not have been enforced. OpenMx (2.19.1 and later)
silently drops an equality constraint whose Jacobian is zero at the starting values
(OpenMx/OpenMx#433), for example b1 * b2 == 0 started at zero, and a violation
within the feasibility tolerance looks the same; a fitted h0 keeps no starting
values, so the warning cannot say which. The statistic and the refit slot are
unchanged (the seeded example goes from 0 to 0.0878); for a product null use
mbco_product_null(). Bootstrap replicates are refit and checked the same way
for both bootstrap types (see the type = "parametric" entry under Bug fixes).
mbco(type = "semi") and mbco(type = "parametric") now drop a bootstrap replicate whose
fits did not converge instead of stopping at the first one (issue #92). Up to 5% of the R
replicates may be dropped; above that the call stops with an error of class
RMediation_bootstrap_too_many_dropped (with fewer than 20 replicates none may be dropped).
The new dropped slot of MBCOResult reports the count (NULL for results without a
bootstrap), and the p-value is the proportion of the kept replicates strictly above the
observed statistic, with no (1 + k)/(R + 1) correction: the rule of
OpenMx::mxCompare(boot = TRUE), whose denominator was also the kept replicates. Only
non-convergence is dropped; an unrepairable constraint violation
(RMediation_bootstrap_infeasible), a non-finite statistic and an h1 fit worse than its h0
fit still stop the call. ?mbco states the rule.
OpenMx mbco() now warns (class RMediation_constraint_branch) when a
feasible, converged h0 is not the constrained optimum of an equality
constraint: fixing one of the parameters the constraint depends on at 0 gives a
converged, feasible fit with -2LL lower by more than 1e-4 (issue #35). It
catches the single-constraint product null that lands on the larger-statistic
branch (memory_exp: 221.05 against 0.0831) without parsing the constraint.
It runs once per call for every type, costs one extra fit per involved
parameter (a constraint with more than 5 is skipped with a message), changes no
result, and cannot fail the call. In a simulation (60 seeds at each of three
effect sizes) it flagged all 28 wrong-branch fits with no false positives.
mbco_product_null() avoids the problem.
mbco_product_null(h1, paths, ...) tests a product null (a*b = 0, or a
serial product) with OpenMx as an intersection-union test: it fixes each path
at 0 in a copy of the fitted full model, runs mbco() on each, and returns the
result of the branch with the largest p-value, with the new optional
MBCOResult@branch slot naming it. Unlike a single nonlinear constraint such
as ind == 0, it cannot land on the larger-statistic branch (issue #35; on
memory_exp it returns 0.0831 where one constraint gives 221.05). The
p-value is conservative when more than one path is 0. A branch whose fit
does not converge is an error naming the branch.
For numeric/lavaan formula CIs, MCError now uses SE / sqrt(n.mc),
the sampling standard error of the simulated mean. The previous SE / n.mc
understated simulation uncertainty. This is not an endpoint error estimate.
ci(type = "all", H0 = TRUE) now forwards H0, mu0 and Sigma0 to
its Monte Carlo component, preserving the alternative/null result pair
rather than silently ignoring the requested null distribution.
OpenMx MBCO now rejects equal-df and reversed model pairs, and nonfinite or negative observed statistics, before bootstrap sampling. Previously the semiparametric route could report a significant result with df 0 or -1. The restricted model must be supplied first; substantive nesting is still the analyst's responsibility.
OpenMx bootstrap workers now restore global options on success and error. Semiparametric bootstrap rejects failed refits and nonfinite statistics, with explicit errors for singular sample or null covariances. Parametric bootstrap rejects invalid reported statistics, degrees of freedom and p-values.
mbco() no longer rejects fitted OpenMx RAM models with "h0 must be an
MxModel". The check compared class(h0) to "MxModel", which fails for
subclasses such as MxRAMModel; it now uses methods::is(). Verified for
type = "asymp" only; the bootstrap types ("parametric", "semi") have
not been exercised on fitted RAM models (rmediation#35).
The ?mbco example had shifted path labels (endVar started with "x", so
the labels a1, a2, cp landed on the wrong paths) and passed a tibble to
mxData(). Both are fixed. The example now tests a1 * b1 = 0 with one
linear null per path (a1 == 0, b1 == 0) and reports the smaller statistic
(0.0831), because a single nonlinear ind1 == 0 null can converge to the
wrong branch (221.05) (rmediation#35).
?mbco now has a Details section on testing a product null (a*b = 0): fit
one linear null per path and report the smaller statistic, because a single
nonlinear null can converge to the wrong branch. It also says to build h0
from the unfitted model, since a constraint refit from the fitted model's
estimates can stop at an infeasible point (diffLL 0) (rmediation#35).memory_exp (linear nulls
a1 == 0: 221.045546 and b1 == 0: 0.083100) and an end-to-end mbco()
test against it.pprodnormal3() (and its alias p_prod3()) returned materially wrong
probabilities when the (X, Y) covariance block was ill-conditioned, silently
and with no diagnostic. At rho = 0.999 the error reached 24% at q = 0.5,
and 92% in relative terms in the lower tail. Tightening tol did not help --
the old integrator converged to a stable but incorrect value. Because
cdf(), dist_quantile(), confint() and ci() invert this CDF by
root-finding, all of them inherited the error.
The default integration method is now "gauss" -- tensor-product
Gauss-Legendre quadrature on a domain partitioned at the coordinate axes,
with the node count escalated automatically until successive rules agree to
tol. Partitioning is what makes a fixed-grid rule valid here: the integrand
has a kink along both axes, and an unpartitioned grid can return values
outside [0, 1].
This changes results. On well-conditioned input the new default agrees
with the old one to about 1e-6. On ill-conditioned input it differs
substantially -- that difference is the correction. The new method is also
faster (roughly 8-20x at the covariances tested).
method = "hcubature" selects the previous integrator, retained for
cross-checking and backward comparison. It is not recommended when the
(X, Y) block is ill-conditioned.
The error figures above were measured at q = 0.5 with
mean = c(0.2, 0.1, 0) on one family of covariance matrices: unit
variances, correlation 0.5 between Z and each of X and Y, and rho
between X and Y in {0.5, 0.99, 0.999, 0.9999}. The reference value
was a 1024-node Gauss-Legendre rule that agreed with the 512-node rule to
3e-7 or better and lay within 3 standard errors of a 1e7-draw Monte
Carlo check. The magnitudes describe that family: the error is not a
monotone function of the condition number across arbitrary covariance
matrices, and a well-conditioned matrix can show a smaller error than an
ill-conditioned one.
New nodes argument forces a fixed number of Gauss-Legendre nodes per
dimension instead of escalating adaptively.
New diagnostics argument. When TRUE, the returned value carries "error"
(the gap between the last two quadrature rules -- a real convergence
estimate) and "nodes" attributes. It defaults to FALSE so the return
value stays a bare numeric for existing callers. The meaning of "error"
differs by method and is NA when nodes is supplied; see
?pprodnormal3 for the per-method contract.
pprodnormal3() now warns when quadrature reaches the node cap without
meeting tol, instead of returning a wrong answer silently. The warning
reports the gap between the last two rules, which bounds the remaining
discretization error, and does not assert a cause: a well-conditioned
covariance reaches the cap too when tol is tighter than 2048 nodes can
deliver (issue #31).
Fixed: the documented ProductNormal3() constructor call raised an error.
The method property had no default, and the validator rejected the resulting
empty value, so the form shown in the README and the getting-started
vignette --
ProductNormal3(mu = mu, Sigma = Sigma)
#> Error: method must be 'hcubature'
-- failed for anyone who copied it. method now defaults to "gauss", and
the call works as documented. Passing method explicitly was, and remains, a
valid alternative.
The new default also fixes a second, previously unreported failure of the old
integrator: at large standardized means (mean / sd beyond roughly 8) it
returned exactly 0 where the true probability is around 0.46. That failure
was independent of conditioning and equally silent.
p_prod3() is renamed to pprodnormal3() to match the existing
pprodnormal()/qprodnormal() family. p_prod3() remains available as a
silent (non-warning) alias and will gain a formal deprecation warning in a
future release.
ProductNormal2() remains available but is superseded by ProductNormal()
for direct construction; internal callers now use ProductNormal()
directly.
The ci() generic's dispatch argument is renamed from mu to object for
consistency with the package's other S7 generics (cdf(), dist_quantile()).
This only affects callers using ci(mu = ...) as a named argument;
positional calls (ci(mu, ...)) are unaffected.
Undocumented internal helpers (validate_ProductNormal(),
is_valid_for_computation(), ProductNormal_from_lavaan()) are now hidden
from the package documentation index (@noRd); they remain available
internally but are not part of the public API.
| Old | New |
|-----|-----|
| p_prod3(q, mean, cov, ...) | pprodnormal3(q, mean, cov, ...) |
| ci(mu = ..., Sigma = ..., quant = ...) | ci(..., Sigma = ..., quant = ...) (positional) |
@examples to all exported functions/generics that previously
lacked them, addressing goodpractice::gp() advisories ahead of CRAN
resubmission.ProductNormal3 for sequential indirect effects of the form
a1 * a2 * b, with print(), cdf(), confint(), and ci() methods.p_prod3() computes P(a1 * a2 * b <= q) via the
conditional-expectation dimension-reduction double integral (Tofighi, 2026).cubature::hcubature; degenerate covariances are
reduced to the existing two-variable product-normal CDF.cubature (>= 2.1.0) to Imports.Remotes: data-wise/medfit; medfit now resolves from CRAN. Pinned Suggests: medfit (>= 0.2.0).ci() for medfit MediationData/SerialMediationData now extracts the path
covariance by parameter name and uses the full covariance matrix (including
off-diagonals) for both simple and serial mediation. Removed the previous
positional/value-matching heuristics and the independence/diagonal fallbacks,
which could silently produce incorrect intervals; unresolved path labels now
raise an informative error.medfit::extract_mediation()
produces a SerialMediationData for both lavaan (ordered mediator vector)
and lm/glm (mediator_models) chains, and ci() consumes it via the
documented d1, d2, ... path-name contract. Added integration tests that fit a
real model, extract, and run ci() end-to-end (skipped when medfit < 0.2.0).ubuntu-latest (devel) and ubuntu-latest (oldrel-1) configurations--ignore-vignettes flag to skip vignette validation during CI checksreexports topic from _pkgdown.yml reference indextidy topic to _pkgdown.yml reference index^STATUS\.md$ to match ecosystem standardsubuntu-latest (devel) and ubuntu-latest (oldrel-1) configurations--ignore-vignettes flag to skip vignette validation during CI checksreexports topic from _pkgdown.yml reference indextidy topic to _pkgdown.yml reference index^STATUS\.md$ to match ecosystem standardse1071, modelr, and generics packages are no longer required..skewness(), .kurtosis(), and .resample_bootstrap() functions to replace external dependencies.tidy() generic instead of re-exporting from generics.R-CMD-check.yaml workflow for multi-platform testing (macOS, Windows, Ubuntu with R devel/release/oldrel).test-coverage.yaml workflow for Codecov integration.VignetteBuilder: knitr to DESCRIPTION for proper vignette building.ProductNormal: Represents the distribution of the product of normal random variables.MBCOResult: Encapsulates results from MBCO tests.cdf(), dist_quantile(), ci(), print(), summary(), show().print, summary, show) for meaningful output.type = "mc").ProductNormal(mu = c(0.3, 0.4, 0.5), Sigma = diag(3)) for three-way products..compute_ci_dop(), .compute_ci_mc(), .compute_ci_asymp(), .compute_cdf_dop(), .compute_cdf_mc(), .compute_quantile_dop(), .compute_quantile_mc().ProductNormal objects natively.medci(), pprodnormal(), qprodnormal()) convert parameters and dispatch to S7 core.ci() Functionci() to S7 generic with methods for:
numeric: Legacy support for direct coefficient/covariance input.lavaan: Automatic extraction and CI computation for indirect effects.ProductNormal: Native S7 class support.ab := a*b) in lavaan models.mu for better legacy compatibility.mbco() to S7 generic with method for MxModel objects.MBCOResult S7 objects with properties: statistic, df, p_value, type.$, [[, names) for backward-compatible list-style access (e.g., result$chisq, result$p).checkmate package across all functions.match.arg() for categorical arguments.print(), summary(), and show() methods.ProductNormal displays: distribution type, means, covariance matrix, SDs, and correlations.MBCOResult displays: test type, statistics, p-values with significance levels, and interpretation.quantile() generic to dist_quantile() to avoid masking stats::quantile().print(), summary(), show() now properly register with base generics.S7::S4_register() for formal generic support.doParallel, foreach, methods).alpha and level parameters.type parameter (accepts "MC", "mc", "DOP", "dop", etc.).ci() method (now returns list with CI, Estimate, SE components).mbco function documentation.checkmate for robust input validation.Fixed an issue where the type="all" in the medci function would generate an error "object 'MeekerCI' not found".
changed the dependency version for grDevices to >= 3.5 in the description file.
*New parametric and non-parametric MBCO test, using mbco function.
'medci' function output structure is changed. For each 'type', it produces a 'list' of '(1-alpha/2)% CI', 'Estimate', and 'SE'. See help(ci) for more information.
Two functions 'pMC' and 'qMC' are added.
for medci(), type=’prodclin’ is replaced with ’dop’.