MyNixOS website logo
Description

Standardized Moderation Effect and Its Confidence Interval.

Functions for computing a standardized moderation effect in moderated regression and forming its confidence interval by nonparametric bootstrapping as proposed in Cheung, Cheung, Lau, Hui, and Vong (2022) <doi:10.1037/hea0001188>. Also includes simple-to-use functions for computing conditional effects (unstandardized or standardized) and plotting moderation effects.

Lifecycle: stable Project Status: Active - The project has reached a stable, usable state and is being actively developed. CRAN status CRAN: Release Date CRAN RStudio mirror downloads Code size Last Commit at Master R-CMD-check DOI

stdmod: Standardized Moderation

(Version 0.2.10, updated on 2024-02-22, release history)

(Important changes since 0.2.0.0: Bootstrap confidence intervals and variance-covariance matrix of estimates are the defaults of confint() and vcov() for the output of std_selected_boot().)

This package includes functions for computing a standardized moderation effect and forming its confidence interval by nonparametric bootstrapping correctly. It was described briefly in the following publication (OSF project page). It supports moderated regression conducted by stats::lm() and path analysis with product term conducted by lavaan::lavaan().

  • Cheung, S. F., Cheung, S.-H., Lau, E. Y. Y., Hui, C. H., & Vong, W. N. (2022) Improving an old way to measure moderation effect in standardized units. Health Psychology, 41(7), 502-505. https://doi.org/10.1037/hea0001188.

More information on this package:

https://sfcheung.github.io/stdmod/

Quick Links:

  • stdmod: A quick start on how to use std_selected() and std_selected_boot(), the two main functions, to standardize selected variables in a regression model and refit the model.

  • moderation: How to use std_selected() and std_selected_boot() to compute standardized moderation effect and form its nonparametric bootstrap confidence interval.

  • std_selected: How to use std_selected() to mean center or standardize selected variables in any regression models, and use std_selected_boot() to form nonparametric bootstrap confidence intervals for standardized regression coefficients (betas in psychology literature).

  • plotmod: How to generate a typical plot of moderation effect using plotmod().

  • cond_effect: How to compute conditional effects of the predictor for selected levels of the moderator, and form nonparametric bootstrap confidence intervals these effects.

Installation

The stable CRAN version can be installed by install.packages():

install.packages("stdmod")

The latest version of this package at GitHub can be installed by remotes::install_github():

remotes::install_github("sfcheung/stdmod")

Implementation

The main function, std_selected(), accepts an lm() output, standardizes variables by users, and update the results. If interaction terms are present, they will be formed after the standardization. If bootstrap confidence intervals are requested using std_selected_boot(), both standardization and regression will be repeated in each bootstrap sample, ensuring that the sampling variability of the standardizers (e.g., the standard deviations of the selected variables), are also taken into account.

Issues

If you have any suggestions and found any bugs, please feel feel to open a GitHub issue. Thanks.

Metadata

Version

0.2.10

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows