Changelog
Source:NEWS.md
semEff 0.7.2
12/09/2024
New features:
- New argument
excl.other.med
tosemEff()
, allowing calculation of indirect effects for specific SEM pathways, i.e. those comprising only user-specified mediators. - New extractor functions (e.g.
getEffTable()
) for returning unformatted tables of effects and confidence intervals.
Other changes:
- Improvements in
print()
andsummary()
output for"semEff"
objects. - New function
getFamily()
to flexibly extract a"family"
object from different model classes (mostly for internal use). - Minor improvements to code and documentation.
Bugfixes:
-
getData()
incorrectly evaluated variable names in objects supplied to"gls"
models, causing the check against variables indata
to fail.
semEff 0.6.1
22/08/2022
Changes:
- Minor updates to code and documentation (e.g. see #41).
Bugfixes:
getX()
threw an error when trying to construct model design matrices using factors with less than two levels (where contrasts can’t be applied). Such an error might occur where e.g. the dataset called by a model contained at least one character/factor variable with only one unique value, which was incorrectly coerced to a factor bygetX()
(typically in order to gain access to individual dummy variables not in the original design matrix).bootEff()
failed to name unnamed model lists where the names attribute was a character vector of empty strings (rather thanNULL
). Such names are apparently generated bypiecewiseSEM::psem()
.
semEff 0.6.0
12/10/2021
New features:
- New formatted table output for effect summaries for
semEff()
andbootCI()
, accessed via newprint()
andsummary()
methods. - Bootstrap standard errors and bias (mean minus original estimate) now included with effect summaries and fitted values from
predEff()
. - Support for
"psem"
objects (piecewiseSEM::psem()
) inbootEff()
/semEff()
. - New package vignettes demonstrating some examples.
Other changes:
- All calculated indirect effects (individual, not summed) now also returned as part of
"semEff"
object (for reference; does not include bootstrapped effects). Extract usinggetAllInd()
. - Unnamed model lists can now be supplied to
bootEff()
/semEff()
(names are generated automatically). - Updates to
R2()
(control of negative values, new improved default method for adjusted R-squared – Olkin-Pratt exact estimator). - New function
getX()
, for more flexible construction of model design matrices (mostly for internal use). - Removed
…
argument ofstdEff()
– arguments toR2()
are now passed as named list toR2.arg
. - Renamed extractor functions for effects (e.g.
dirEff()
->getDirEff()
) and added some new ones. - Various other code and documentation updates.
Bugfixes:
- Amendment to previous incomplete fix for issue where
xNam()
was not evaluating factor/character terms correctly. The function now explicitly treats all non-numeric predictor variables as factors and coerces where necessary. It also has improved handling of factor contrasts when evaluating names. -
pSapply()
did not work withparallel = "multicore"
, due to relying completely onparallel::parSapply()
for parallel processing (which is"snow"
only). The function now wrapsparallel::mcmapply()
for"multicore"
(not available on Windows systems).
semEff 0.5.0
09/04/2021
Other changes:
- Renamed
unique.x
argument ofstdEff()
tounique.eff
(old name temporarily allowed). - Removed default value of
R
argument ofbootEff()
. The number of bootstrap resamples must now be explicitly specified, which is probably better practice (10,000 is often recommended for confidence intervals). - Added
type
argument tobootEff()
, to specify the type of bootstrapping to perform (for mixed models). This replacesran.eff = "crossed"
, previously used to indicate parametric bootstrapping (although it’s temporarily allowed). -
bootEff()
will now treat a list containing both mixed and non-mixed models as all mixed (with a warning). Previously all such models were treated as non-mixed (unintentionally). This is presumably a relatively rare scenario.
Bugfixes:
-
R2()
did not calculate adjusted R-squared correctly for beta regression models (i.e. did not incorporate the ‘phi’ parameter in degrees of freedom calculations). -
xNam()
produced an error when attempting to evaluate factor contrasts in data, expecting that character vectors were factors (related to the change tostringsAsFactors = FALSE
as default inR 4.0.0
, but would have occurred in some cases regardless).
semEff 0.4.0
01/10/2020
New features:
- Standardised vs raw effects: added
incl.raw
argument tostdEff()
(stdCoeff()
), to append raw effects (unstandardised coefficients) to the output. This facilitates simultaneous bootstrapping of both sets of effects, allowing raw effects to be used alternatively for calculating (semEff(..., use.raw = TRUE)
) or predicting (predEff(..., use.raw = TRUE)
) effects/CIs.
Other changes:
- Renamed function
stdCoeff()
tostdEff()
, to better reflect the concept of standardised model coefficients as ‘effects’ (callingstdCoeff()
will still work – with a warning – until the next version at least). - Added
offset
argument togetY()
andR2()
, to explicitly retain/remove an offset (where present) in/from the response variable or fitted values. Offsets are removed by default, which ensures, for example, that standardised effects are scaled appropriately. - Added
env
argument to multiple functions, for explicitly specifying the location of data used to fit models (not necessary in most circumstances). This replaces the...
argument in many instances, which was previously used to pass an environment toeval()
(viagetData()
).env
(anddata
) can also now be passed (...
) tobootEff()
andpredEff()
. - Added confidence interval attributes to
bootCI()
/semEff()
output (i.e. confidence level, type). -
R2()
no longer calculates predictive R-squared for GLMMs, as the interpretation of the hat matrix used in calculations is not reliable (see https://rdrr.io/cran/lme4/man/hatvalues.merMod.html). - Removed ability to pass arguments from
getY()
toglt()
, allowing more controlled output ofgetY(..., link = TRUE)
. - Various minor updates to function code and documentation, improvement and addition of some new internal helper functions.
Bugfixes:
-
bootEff()
specified with correlated errors failed for mixed models of class"lmerModLmerTest"
(issue with re-fitting models usingupdate()
). -
predEff()
failed to evaluate some complex model terms (e.g. polynomials). -
stdEff()
(stdCoeff()
) did not re-fit model properly to calculate correct VIFs for a fully ‘centred’ model (i.e. did not account sufficiently for complex terms such as polynomials or transformations, where mean-centring should occur as the final step). -
xNam()
generated incorrect term names for categorical predictors under certain circumstances (different contrast types, interactive effects with no ‘main’ effects). -
stdEff()
(stdCoeff()
) incorrectly calculated ‘centred’ intercept for models with an offset specified. -
predEff()
failed when a nested list of models and list of numeric weights were supplied (i.e. a model averaging scenario). -
stdEff()
(stdCoeff()
) did not return the ‘phi’ parameter(s) for beta regression models.
semEff 0.3.0
25/03/2020
New features:
- Support for mixed models of class
"lmerModLmerTest"
. - New function
glt()
, for calculating ‘generalised’ link transformations for non-gaussian variables.
Other changes:
- Transfer of some functionality from
getY()
toglt()
. - Minor changes to arguments in
bootEff()
andgetY()
. - Added ability in
stdCoeff()
to use variables not present in the model design matrix (e.g. a ‘missing’ main effect for an interaction). - Added ability to pass a boot object (from
bootEff()
) to theeffects
argument ofpredEff()
. - Added a
refit.x
argument tostdCoeff()
, allowing control over whether to refit the model with centred predictors (for correct VIFs). - Various updates to documentation.
Bugfixes:
-
xNam()
did not generate correct term names for categorical variables with contrast types other thancontr.treatment()
. -
stdCoeff()
did not correctly adjust for multicollinearity for a model containing categorical variables when centring was specified (cen.x = TRUE
). -
getY()
failed to generate an estimated working response when a variable with missing values (NA
) was supplied (this functionality now inglt()
). -
predEff()
failed for models with categorical variables (did not access dummy variables in model matrix).
semEff 0.2.0
08/01/2020
New features:
- Added support for generalised least squares models (class
"gls"
). - Added support for beta regression models (class
"betareg"
).
Bugfixes:
- Function
xNam()
did not generate correct term names for interactions involving multi-coefficient terms (e.g. factors). - Function
xNam()
did not generate correct term names for factors when the model intercept is suppressed. - Function
R2()
with argumentpred = TRUE
threw an error for models where any weights = 0.