From 4ca048b507ccdf228861383a8a9d49996b73c6a3 Mon Sep 17 00:00:00 2001 From: Julius Pfadt Date: Tue, 20 Feb 2024 17:49:59 +0100 Subject: [PATCH] change flipped signs to none and move ignore-structural checkbox --- R/plssem.R | 8 ++------ inst/qml/PLSSEM.qml | 25 +++++++------------------ tests/testthat/test-plssem.R | 4 ---- 3 files changed, 9 insertions(+), 28 deletions(-) diff --git a/R/plssem.R b/R/plssem.R index 4c90a6c7..ede1fc3e 100644 --- a/R/plssem.R +++ b/R/plssem.R @@ -156,7 +156,7 @@ checkCSemModel <- function(model, availableVars) { modelContainer$dependOn(c("correlationMatrix", "convergenceCriterion", "estimateStructural", "group", "correctionFactor", "consistentPartialLeastSquares", "structuralModelIgnored", "innerWeightingScheme", "errorCalculationMethod", "robustMethod", "bootstrapSamples", "ciLevel", - "setSeed", "seed", "handlingOfInadmissibles", "Data", "handlingOfFlippedSigns", "endogenousIndicatorPrediction", + "setSeed", "seed", "handlingOfInadmissibles", "Data", "endogenousIndicatorPrediction", "kFolds", "repetitions", "benchmark", "predictedScore")) jaspResults[["modelContainer"]] <- modelContainer } @@ -236,11 +236,7 @@ checkCSemModel <- function(model, availableVars) { .user_funs = tickFunction, .resample_method = options[["robustMethod"]], .handle_inadmissibles = options[["handlingOfInadmissibles"]], - .sign_change_option = switch(options[["handlingOfFlippedSigns"]], - "individualReestimation" = "individual_reestimate", - "constructReestimation" = "construct_reestimate", - options[["handlingOfFlippedSigns"]] - ), + .sign_change_option = "none", .seed = if (options[["setSeed"]]) options[["seed"]])) diff --git a/inst/qml/PLSSEM.qml b/inst/qml/PLSSEM.qml index 6b0b7b05..707eb77c 100644 --- a/inst/qml/PLSSEM.qml +++ b/inst/qml/PLSSEM.qml @@ -45,12 +45,6 @@ Form Group { - CheckBox - { - enabled: approachWeigths.currentValue == "PLS-PM" && approachInner.currentValue != "path" - name: "structuralModelIgnored" - label: qsTr("Ignore structural model") - } CheckBox { @@ -146,6 +140,13 @@ Form ] } + CheckBox + { + enabled: approachInner.currentValue != "path" + name: "structuralModelIgnored" + label: qsTr("Ignore structural model") + } + DropDown { name: "convergenceCriterion" @@ -173,18 +174,6 @@ Form RadioButton { value: "ignore"; label: qsTr("Ignore") } RadioButton { value: "drop"; label: qsTr("Drop") } } - - DropDown - { - name: "handlingOfFlippedSigns" - label: qsTr("Handling of flipped signs") - values: [ - { value: "none", label: qsTr("None") }, - { value: "individual", label: qsTr("Individual") }, - { value: "individualReestimation", label: qsTr("Individual re-estimation") }, - { value: "constructReestimation", label: qsTr("Construct re-estimation") } - ] - } } } diff --git a/tests/testthat/test-plssem.R b/tests/testthat/test-plssem.R index 6e4f3ca4..0e438ea7 100644 --- a/tests/testthat/test-plssem.R +++ b/tests/testthat/test-plssem.R @@ -15,7 +15,6 @@ test_that("Basic PLSSEM works", { options$innerWeightingScheme <- "path" options$convergenceCriterion <- "absoluteDifference" options$correctionFactor <- "squaredEuclidean" - options$handlingOfFlippedSigns <- "none" results <- jaspTools::runAnalysis("PLSSEM", "poldem_grouped.csv", options) @@ -93,7 +92,6 @@ test_that("Multigroup, multimodel PLSSEM works", { options$observedIndicatorCorrelation <- TRUE options$innerWeightingScheme <- "centroid" options$structuralModelIgnored <- TRUE - options$handlingOfFlippedSigns <- "none" results <- jaspTools::runAnalysis("PLSSEM", "poldem_grouped.csv", options) @@ -290,7 +288,6 @@ test_that("Bootstrapping works", { options$robustMethod <- "bootstrap" options$bootstrapSamples <- 200 options$handlingOfInadmissibles <- "ignore" - options$handlingOfFlippedSigns <- "none" set.seed(123) results <- jaspTools::runAnalysis("PLSSEM", "poldem_grouped.csv", options) @@ -405,7 +402,6 @@ test_that("cSEM example matches output", { options$innerWeightingScheme <- "path" options$convergenceCriterion <- "absoluteDifference" options$correctionFactor <- "squaredEuclidean" - options$handlingOfFlippedSigns <- "none" options$additionalFitMeasures <- TRUE options$rSquared <- TRUE options$mardiasCoefficient <- TRUE