processR包的modSummary函数返回NULL

The modSummary function of processR package resturns NULL

我正在尝试学习 Keon-Woong Moon's processR 软件包,您可以简单地安装它:

install.packages("processR")

根据文档中的一些示例,我抓取了一个示例:

labels=list(X="frame",W="skeptic",Y="donate")
moderator=list(name='skeptic',site=list(c("c")))
model=tripleEquation(labels=labels,moderator=moderator,data=disaster,mode=1)
drawConcept(labels=labels, moderator=moderator, drawbox=TRUE)
semfit=sem(model=model,data=disaster,se="boot",bootstrap=200)
modSummary(semfit)
                                       

但是 modSummary 函数 returns NULL。如果您能帮助我了解我的错误在哪里以及我该如何解决,我将不胜感激。

在您对 model 的调用中,您要定义的参数称为 rangemode 而不是 mode。下面会生成模型,modSummary不再是NULL:

library(processR)
library(lavaan)

labels = list(X = "frame", W = "skeptic", Y = "donate")
moderator = list(name = 'skeptic', site = list(c("c")))
model = tripleEquation(
  labels = labels,
  moderator = moderator,
  data = disaster,
  rangemode = 1
)
drawConcept(labels = labels,
            moderator = moderator,
            drawbox = TRUE)
semfit = lavaan::sem(
  model = model,
  data = disaster,
  se = "boot",
  bootstrap = 200
)
modSummary(semfit)

Inference for the Moderation Effects
==================================================== 
                      Moderation Effect          
                   c1+c3*W = 0.679-0.171*W       
             --------------------------------------- 
 skeptic(W)   estimate    95% Bootstrap CI     p     
---------------------------------------------------- 
      1.350       0.449  -0.026 to  0.941    .065 
      3.378       0.103  -0.171 to  0.491    .545 
      5.406      -0.244  -0.694 to  0.373    .333 
==================================================== 
                             boot.ci.type:bca.simple