knitr::opts_chunk$set(echo = TRUE,comment=NA,message=FALSE, warning=FALSE, fig.height=5,fig.width=7, fig.align="center")

The `processR`

package aims to be a user-friendly way to perform moderation, mediation, moderated mediation and moderated moderation in R. This package is inspired from famous PROCESS macro for SPSS and SAS created by Andrew Hayes.

`processR`

Andrew F. Hayes was not involved in the development of this R package or application and cannot attest to the quality of the computations implemented in the code you are using. Use at your own risk.

You can install the `processR`

package from github.

if(!require(devtools)) install.packages("devtools") devtools::install_github("cardiomoon/processR")

The `processR`

package covers moderation, mediation, moderated mediation and moderated moderation with R. Supporting models are as follows.

library(processR) sort(pmacro$no)

Currently, `r length(pmacro$no)`

models are supported.

I will explain functions of processR package by a example.

You can draw concept diagram and statistical diagram easily. For example, you can draw the concept diagram for PROCESS macro model 8.

pmacroModel(8)

You can draw statistical diagram of this model.

statisticalDiagram(8)

This package uses `lavaan`

and `mediation`

packages for analysis. The `lavaan`

package is extremely customizable and can also model latent variables if your measurement model requires it. But it is difficult to figure out the model equation for analysis. You can make model equation easily. For example, if you want to perform moderated mediation with data `disaster`

with the following concept model.

labels=list(X="frame",M="justify",Y="donate",W="skeptic") pmacroModel(8,labels=labels)

There is one moderator `skeptic`

in this model. The moderating site is "a" and "c". You can make model equation by the following command.

moderator=list(name="skeptic",site=list(c("a","c"))) model=tripleEquation(X="frame",M="justify",Y="donate",moderator=moderator) cat(model)

You can see full vignette for model 8 at http://rpubs.com/cardiomoon/468602

I have developed a shiny app. You can test the app at https://cardiomoon.shinyapps.io/processR. I will appreciate any comment.

You can see how to perform this analysis at http://rpubs.com/cardiomoon/468600

In the shiny app, you can download the analysis results as a powerpoint file. You can download the sample file model8.pptx - view with office web viewer.

**Any scripts or data that you put into this service are public.**

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.