You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have an issue with the manymome functions cond_indirect_effects() and mod_levels() when using a categorical moderator with two categories.
I get these warning and error messages :
Warning in seq_len(ncol(w_gp)): first element used of 'length.out' argument
Error in seq_len(ncol(w_gp)) : argument must be coercible to non-negative integer
I'm following the steps from Cheung & Cheung (2023) manymome:__ An R package for computing the indirect effects, conditional effects, and conditional indirect effects, standardized or unstandardized, and their bootstrap confidence intervals, in many (though not all) models.
I don't understand what's the issue. Is it a bug or is it an issue with my code/data ?
Mind that I don't have this issue when I'm using a continuous moderator with the same data.
Thanks in advance
library(lavaan)
#> This is lavaan 0.6-17#> lavaan is FREE software! Please report any bugs.
library(manymome)
##Sample datadf<-data.frame(
Intense= c(1.20302400035313,0.377413381825115,
-1.18646351469919,1.20057716684428,1.20138456799171,
-2.7774605624413,-1.94239715523117,0.402302832389528,-0.421912163704315,
0.331669138980736),
CatPers= c("0.792961214431443","0.792961214431443",
"-1.25872969475283","-1.25872969475283","-1.25872969475283",
"0.792961214431443","0.792961214431443","-1.25872969475283",
"0.792961214431443","0.792961214431443"),
Pos= c(-0.233043705579646,-0.376337459099043,
-0.530671521945183,1.34621539413837,-0.957223025488462,
0.90322432738519,-0.640637299527499,-0.158533233160109,
0.27334450686968,0.0162900160068483),
Wfc= c(1.00645422416079,0.418767308104094,
0.543193979890933,0.150878583032073,0.671868144845523,
-0.203760346081739,0.522581840151886,0.123494795372463,0.20299495139938,
0.211670048655376)
)
##Dummy variable based on a categorical variable with two categoriescorsci<- factor2var(df$CatPers,
x_contrasts="contr.treatment")
df[, "corsci"] <-corsci##Interaction termdf$Intense_corsci<-df$Intense*df$corsci##Structural modelmtest<-"Pos ~ Intense + Intense_corsci + corsciWfc ~ Pos"test.fit<- sem(mtest, df, std.lv=TRUE, fixed.x=FALSE, missing="fiml")
##Conditional indirect effectoutest<- cond_indirect_effects(wlevels="corsci",
x="Intense",
y="Wfc",
m="Pos",
fit=test.fit)
#> Warning in seq_len(ncol(w_gp)): seul le premier élément de l'argument#> 'length.out' est utilisé#> Error in seq_len(ncol(w_gp)): l'argument doit être convertible automatiquement en un entier non négatif
Hi,
I have an issue with the manymome functions cond_indirect_effects() and mod_levels() when using a categorical moderator with two categories.
I get these warning and error messages :
Warning in seq_len(ncol(w_gp)): first element used of 'length.out' argument
Error in seq_len(ncol(w_gp)) : argument must be coercible to non-negative integer
I'm following the steps from Cheung & Cheung (2023) manymome:__ An R package for computing the indirect effects, conditional effects, and conditional indirect effects, standardized or unstandardized, and their bootstrap confidence intervals, in many (though not all) models.
I don't understand what's the issue. Is it a bug or is it an issue with my code/data ?
Mind that I don't have this issue when I'm using a continuous moderator with the same data.
Thanks in advance
Created on 2024-02-14 with reprex v2.1.0
The text was updated successfully, but these errors were encountered: