Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
branches: [main, master, devel]

name: R-CMD-check

Expand Down
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: stdmod
Title: Standardized Moderation Effect and Its Confidence Interval
Version: 0.2.13
Version: 0.2.14
Authors@R:
c(person(given = "Shu Fai",
family = "Cheung",
Expand All @@ -23,7 +23,6 @@ License: GPL-3
Encoding: UTF-8
LazyData: true
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.3
Suggests:
testthat,
knitr,
Expand All @@ -43,3 +42,4 @@ Imports:
manymome,
rlang
VignetteBuilder: knitr
Config/roxygen2/version: 8.0.0
11 changes: 10 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
# stdmod 0.2.13
# stdmod 0.2.14

## Miscellaneous

- Updated README and other files to
refer users to `manymome` and `betaselectr`
for more advanced functions.
(0.2.14)

# stdmod 0.2.14

## Miscellaneous

Expand Down
18 changes: 17 additions & 1 deletion R/condeff.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,23 @@
#'
#' @description Compute the conditional effects in a moderated regression model.
#'
#' @details [cond_effect()] uses the centering approach to find the conditional
#' @details
#'
#' ## NOTE
#'
#' For computing conditional effects and plotting conditional
#' effects in regression models, it is recommended to
#' use the package [`manymome`](https://sfcheung.github.io/manymome/).
#' It has more comprehensive support than `stdmod`. See
#' See [this demo](https://sfcheung.github.io/manymome/articles/mo_lm.html) for
#' a one-moderator model, and [these articles](https://sfcheung.github.io/manymome/articles/#moderated-regression)
#' for other demonstrations. The package also supports moderation
#' in structural equation models fitted by `lavaan`, which is not
#' supported in `stdmod`.
#'
#' ## Details
#'
#' [cond_effect()] uses the centering approach to find the conditional
#' effect of the focal variable. For each level of the moderator, the value for
#' this level is subtracted from the moderator scores, and the model is
#' fitted to the modified data.
Expand Down
19 changes: 18 additions & 1 deletion R/plotmod.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,24 @@
#'
#' @description Plot the moderation effect in a regression model
#'
#' @details This function generate a basic `ggplot2` graph
#' @details
#'
#'
#' ## NOTE
#'
#' For computing conditional effects and plotting conditional
#' effects in regression models, it is recommended to
#' use the package [`manymome`](https://sfcheung.github.io/manymome/).
#' It has more comprehensive support than `stdmod`. See
#' See [this demo](https://sfcheung.github.io/manymome/articles/mo_lm.html) for
#' a one-moderator model, and [these articles](https://sfcheung.github.io/manymome/articles/#moderated-regression)
#' for other demonstrations. The package also supports moderation
#' in structural equation models fitted by `lavaan`, which is not
#' supported in `stdmod`.
#'
#' ## Details
#'
#' This function generates a basic `ggplot2` graph
#' typically found in psychology manuscripts. It tries to
#' check whether one or more variables are standardized, and
#' report this in the plot if required.
Expand Down
14 changes: 14 additions & 0 deletions R/std_selected.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,20 @@
#' selected variables in a regression model and refit the model
#'
#' @details
#'
#' ## NOTE
#'
#' For standardizing only selected variables and for properly
#' standardizing product terms in regression models fitted by
#' `stats::lm()`, the function [`lm_betaselect()`](https://sfcheung.github.io/betaselectr/articles/betaselectr_lm.html)
#' from [`betaselectr`](https://sfcheung.github.io/betaselectr/)
#' can be used instead of `std_selected()` and `std_selected_boot()`.
#' The package also has supports models fitted by `stats::glm()`,
#' such as logistic regression models. See [this article](https://sfcheung.github.io/betaselectr/articles/betaselectr_glm.html)
#' for a demonstration.
#'
#' ## Details
#'
#' [std_selected()] was originally developed to compute the standardized
#' moderation effect and the standardized coefficients for other predictors
#' given an [lm()] output (Cheung, Cheung, Lau, Hui, & Vong, 2022).
Expand Down
13 changes: 13 additions & 0 deletions R/stdmod_lavaan.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,19 @@
#' form the nonparametric bootstrap confidence interval.
#'
#' @details
#'
#' ## NOTE
#'
#' For standardizing only selected variables in models fitted
#' by `lavaan`, `lavaan` natively supports this since version 0.7-2,
#' through setting `type` to a character vector of the variables
#' to be standardized. Alternatively, the function [`lav_betaselect()`](https://sfcheung.github.io/betaselectr/articles/betaselectr_lav.html)
#' from [`betaselectr`](https://sfcheung.github.io/betaselectr/)
#' can also be used. [`lav_betaselect()`](https://sfcheung.github.io/betaselectr/reference/lav_betaselect.html)
#' also supports properly standardizing a product term. In addition
#' to bootstrap confidence intervals, [`lav_betaselect()`](https://sfcheung.github.io/betaselectr/reference/lav_betaselect.html)
#' also supports delta-method confidence intervals.
#'
#' ## Important Notes
#'
#' Starting from Version 0.2.7.5, of [stdmod_lavaan()] adopts an approach
Expand Down
79 changes: 77 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,46 @@

# stdmod: Standardized Moderation <img src="man/figures/logo.png" align="right" height="150" />

(Version 0.2.13, updated on 2026-05-04, [release history](https://sfcheung.github.io/stdmod/news/index.html))
(Version 0.2.14, updated on 2026-07-23, [release history](https://sfcheung.github.io/stdmod/news/index.html))

**IMPORTANT NOTICE**

> This package will no longer be actively updated. It will
still be maintained. However, new features will not be added.
The package [`manymome`](https://sfcheung.github.io/manymome/)
can do all the tasks in `stdmod` related to computing,
testing, and printing conditional effects, and can be used
for any number of moderators. The package
[`betaselectr`](https://sfcheung.github.io/betaselectr/)
can do all the tasks related to forming confidence intervals
for properly standardized coefficients, in both regression
models fitted by `stats::lm()` and `stats::glm()`, as well
as structural equation models fitted by `lavaan::sem()`.

> For standardizing only selected variables and for properly
standardizing product terms in regression models fitted by
`stats::lm()`, the function [`lm_betaselect()`](https://sfcheung.github.io/betaselectr/articles/betaselectr_lm.html)
from [`betaselectr`](https://sfcheung.github.io/betaselectr/)
can be used instead of `std_selected()` and `std_selected_boot()`.
The package also has supports models fitted by `stats::glm()`,
such as logistic regression models. See [this article](https://sfcheung.github.io/betaselectr/articles/betaselectr_glm.html)
for a demonstration.

> For standardizing only selected variables in models fitted
by `lavaan`, `lavaan` natively supports this since version 0.7-2,
through setting `type` to a character vector of the variables
to be standardized. Alternatively, the function [`lav_betaselect()`](https://sfcheung.github.io/betaselectr/articles/betaselectr_lav.html)
from [`betaselectr`](https://sfcheung.github.io/betaselectr/)
can also be used. [`lav_betaselect()`](https://sfcheung.github.io/betaselectr/reference/lav_betaselect.html)
also supports properly standardizing a product term. In addition
to bootstrap confidence intervals, [`lav_betaselect()`](https://sfcheung.github.io/betaselectr/reference/lav_betaselect.html)
also supports delta-method confidence intervals.

> For computing conditional effects and plotting conditional
effects in regression models, the package [`manymome`](https://sfcheung.github.io/manymome/)
has more comprehensive support. See [these articles](https://sfcheung.github.io/manymome/articles/#moderated-regression)
for some demonstration. The package also supports moderation
in structural equation models fitted by `lavaan`.

(Important changes since 0.2.0.0: Bootstrap confidence intervals and
variance-covariance matrix of estimates are the defaults of `confint()`
Expand Down Expand Up @@ -54,11 +93,47 @@ https://sfcheung.github.io/stdmod/
- [plotmod](https://sfcheung.github.io/stdmod/articles/plotmod.html): How to generate a typical plot of
moderation effect using `plotmod()`.

- It is recommended to use [`manymome`](https://sfcheung.github.io/manymome/)
for plotting conditional effects. See [this article](https://sfcheung.github.io/manymome/articles/mo_lm.html)
for a demonstration, and [these articles](https://sfcheung.github.io/manymome/articles/#moderated-regression)
for more complicated models.

- [cond_effect](https://sfcheung.github.io/stdmod/articles/cond_effect.html): How to compute conditional
effects of the predictor for selected
levels of the moderator, and form nonparametric bootstrap
confidence intervals these effects.

- It is recommended to use [`manymome`](https://sfcheung.github.io/manymome/)
for computing conditional effects. See [this article](https://sfcheung.github.io/manymome/articles/mo_lm.html)
for a demonstration, and [these articles](https://sfcheung.github.io/manymome/articles/#moderated-regression)
for more complicated models.

## Related Functions in `betaselectr`

The function `lm_betaselect()` from the package `betaselectr`
can be used in place
of `std_selected()` and `std_selected_boot()`. A demonstration
of `lm_betaselect()` can be found [here](https://sfcheung.github.io/betaselectr/articles/betaselectr_lm.html).
This package also has `glm_betaselect()` for models, such
as logistic regression models, fitted by `stats::glm()`
(see a demonstration [here](https://sfcheung.github.io/betaselectr/articles/betaselectr_glm.html)).

The function `lav_betaselect()` from the package `betaselectr`
is a version of `std_selected()` but for structural equation
models fitted by `lavaan::sem()`. A demonstration
of `lav_betaselect()` can be found [here](https://sfcheung.github.io/betaselectr/articles/betaselectr_lav.html).

## Related Functions in `manymome`

Although the package `manymome` is mainly for mediation and
moderated mediation, moderation is a special case and is also
supported. The `plot` method in `manymome` is more powerful
than `plotmod`, supports not only a regression model but also
a structural equation model, and also supports any number of
moderators. The function `manymome::cond_effects()` in `manymome`
is also more powerful than `cond_effect` in `stdmod`, supporting
both regression models and structural equation models.

# Installation

The stable CRAN version can be installed by `install.packages()`:
Expand Down Expand Up @@ -90,4 +165,4 @@ are also taken into account.
# Issues

If you have any suggestions and found any bugs, please feel
feel to open a GitHub issue. Thanks.
free to open a GitHub issue. Thanks.
16 changes: 16 additions & 0 deletions man/cond_effect.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 17 additions & 1 deletion man/plotmod.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions man/std_selected.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions man/stdmod-package.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions man/stdmod_lavaan.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading