FloSchuberth / cSEM

Composite-based SEM
https://floschuberth.github.io/cSEM/
GNU General Public License v3.0
28 stars 7 forks source link

Multi-Session Resampling Bugged for IGSCA #540

Open emstruong opened 1 month ago

emstruong commented 1 month ago

May be due to an issue in the future package https://github.com/HenrikBengtsson/future/issues/417. Investigate later.

tutorial_igsca_model <- "
# Composite Model
NetworkingBehavior <~ Behavior1 + Behavior2 + Behavior3 + Behavior5 + 
                      Behavior7 + Behavior8 +  Behavior9
Numberofjobinterviews <~ Interview1 + Interview2
Numberofjoboffers <~ Offer1 + Offer2 

# Reflective Measurement Model
HonestyHumility =~ Honesty1 + Honesty2 + Honesty3 + Honesty4 + Honesty5 + 
                    Honesty6 + Honesty7 + Honesty8 + Honesty9 + Honesty10
Emotionality =~ Emotion1 + Emotion2 + Emotion3 + Emotion4 + 
                Emotion5 + Emotion6 + Emotion8 + Emotion10
Extraversion =~ Extraver2 + Extraver3 + Extraver4 + Extraver5 + 
                Extraver6 + Extraver7 + Extraver8 + Extraver9 + Extraver10
Agreeableness =~ Agreeable1 + Agreeable3 + Agreeable4 + Agreeable5 +
                 Agreeable7 + Agreeable8 + Agreeable9 + Agreeable10
Conscientiousness =~ Conscientious1 + Conscientious3 + Conscientious4 + 
                     Conscientious6 + Conscientious7 + Conscientious8 + 
                     Conscientious9 + Conscientious10
OpennesstoExperience =~ Openness1 + Openness2 + Openness3 + Openness5 + 
                        Openness7 + Openness8 + Openness9 + Openness10

# Structural Model
NetworkingBehavior ~ HonestyHumility + Emotionality + Extraversion + 
                     Agreeableness + Conscientiousness + OpennesstoExperience
Numberofjobinterviews ~ NetworkingBehavior
Numberofjoboffers ~ NetworkingBehavior
"

data(LeDang2022)

csem(
  .data = LeDang2022,
  tutorial_igsca_model,
  .approach_weights = "IGSCA",
  .dominant_indicators = NULL,
  .tolerance = 0.0001,
  .conv_criterion =
    "sum_diff_absolute",
  .resample_method = "bootstrap",
  .R = 5,
  .eval_plan = "multisession",
  .user_funs = calculateFIT,
  .handle_inadmissibles = "ignore"
)
FloSchuberth commented 1 month ago

@emstruong What exactly is the bug? If I run the code, I get no error, just a warning that the original estimations are not admissible (because of the reliability issue). Moreover, what I saw is that the progress bar did not move...

FloSchuberth commented 1 month ago

Do you use a Windows machine?

emstruong commented 1 month ago

Hey Flo,

Sorry, it was late at night and I copy-pasted the wrong snippet of code. I've put the correct version up now.

I didn't use a Windows machine for this part.

I'm not entirely sure why the progress bar did not move, I'm not very familiar with how future() works...

Michael

FloSchuberth commented 1 month ago

Hey Michael,

no problem.

For me, the code runs on a Windows machine. I think, if you run it on a Linux machine, you need to use a different argument for .eval_plan. Parallel computing in R depends on operating system and therefore no eval_plan works for all operating systems.

I need to have a closer look at the progress bar. It is quite some time that we have implemented that....I guess this is only a minor issue.