Learn R Programming

semhelpinghands

(Version 0.1.10 updated on 2024-03-12, release history)

This package is an assortment of time-saving helper functions for doing structural equation modeling (SEM), mainly by lavaan::lavaan() and its wrappers, such as lavaan::sem() and lavaan::cfa(). This package is not for implementing advanced statistical procedures. This should be the job of excellent packages such as semTools. These helper functions are for tasks that come in handy (at least to me) when doing SEM. They are usually used during the data analysis phase, not for publishing or presenting results.

Many of the tasks can be done by base R code or by dplyr functions. However, these functions may help users who are not familiar with R programming or use R only occasionally to do these tasks without writing their own code, or for people like me who know how to do this using base R but do not want to write the code every time.

I intentionally use base R if possible because I want to keep semhelpinghands a light weight package, depending on as few other packages as possible, so that I do not need to worry about deprecated functions or updates in other packages that break things, defeating the "time saving" purpose of this package.

Home Page

More about this package can be found from the GitHub page of this package:

https://sfcheung.github.io/semhelpinghands/

Installation

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

install.packages("semhelpinghands")

The latest developmental version at GitHub can be installed by remotes::install_github():

remotes::install_github("sfcheung/semhelpinghands")

Motive

One major motive behind all these functions is writing something for my own work with others. So, each function should be at least useful to me myself and I myself will use them. Nevertheless, maybe there are others who, like me, just want some simple functions for some simple tasks. I also like using packages to pack functions I used myself in my work, so I do not have to source files again and again. Therefore, I packaged them into semhelpinghands also for myself. I hope this package will also be useful for some others.

I will only devote a limited amount of time on this package. The package and its functions are means for me to do research. They are not the goals themselves.

Acknowledgement

I would like to thank Prof. Rosseel and Prof. Jorgensen for developing lavaan and semTools. Their advice in the lavaan Google Group and GitHub pages (for lavaan and semTools) on various issues about lavaan helped me in writing some of the functions here, before they were packed into semhelpinghands. If there are people who inspired some of the functions but I forgot to acknowledge, please let me know.

Suggestions and Bugs

This package is still under development. There will be bugs, and there are limitations. Comments and suggestions are welcomed. Feel free to add an issue at GitHub. Although I may not be able to address all of them because this package is intended to be a collection of simple functions for simple tasks, and they are designed to be easy to maintain, I will try to do what I can do.

Copy Link

Version

Install

install.packages('semhelpinghands')

Monthly Downloads

653

Version

0.1.10

License

GPL (>= 3)

Maintainer

Shu Fai Cheung

Last Published

March 12th, 2024

Functions in semhelpinghands (0.1.10)

group_estimates

Group Estimates By Dependent or Independent Variables
group_by_groups

Group Estimates By Groups
filter_by

Filter a Parameter Estimates Table
dvs_ivs

Sample Dataset: 3 Predictors and 3 Outcomes
show_cfi

Visualize How CFI and TLI Are Computed
plot_models_fm

Plot Models on a Chi-Squares-vs-Dfs Graph
print.std_solution_boot

Print an 'std_solution_boot' Object
record_history

Record the Minimization History
store_boot_def

Store Bootstrap Estimates of User-Defined Parameters
plot_boot

Diagnostic Plots of Bootstrap Estimates in 'lavaan'
ptable_to_syntax

Convert a 'lavaan' Parameter Table to a 'lavaan' Model Syntax
add_exo_cov

Add Covariances Between Exogenous Variables
semhelpinghands-package

semhelpinghands: Helper Functions for Structural Equation Modeling
vec_rsquare

Wrapper Functions to Extract Information as a Vector
print.est_table

Print an 'est_table' Object
sort_by

Sort a Parameter Estimates Table
show_more_options

Show More Major Options in an Output of 'lavaan'
print.fit_by_models

Print a 'fit_by_models' Object
standardizedSolution_boot_ci

Bootstrap CIs for Standardized Solution
show_options

Show Major Options in an Output of 'lavaan'
simple_mediation

Sample Dataset: Simple Mediation
compare_estimators

Refit a 'lavaan'-Model by Several Estimators
fitMeasures_by_models

Fit Measures By Models
group_by_models

Group Estimates By Models
annotate_matrices

Annotate the Matrices of a 'lavaan' Model
add_sig

Add Significant Test Results