From 2baed2f0303e89ad7bcfbbf30e1f3ec1477ca7a4 Mon Sep 17 00:00:00 2001 From: Johnny Date: Tue, 7 May 2024 19:10:45 +0200 Subject: [PATCH] fix state with casewise diagnostics --- R/commonglm.R | 2 +- R/regressionlogistic.R | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/R/commonglm.R b/R/commonglm.R index ec2dd4b1..55d2e15a 100644 --- a/R/commonglm.R +++ b/R/commonglm.R @@ -798,7 +798,7 @@ } else { - depType <- if (isFALSE(logisticRegression)) "number" else "string" + depType <- if (is.numeric(dataset[[options[["dependent"]]]])) "number" else "string" influenceTable$addColumnInfo(name = "caseN", title = "Case Number", type = "integer") influenceTable$addColumnInfo(name = "stdResidual", title = gettext("Std. Residual"), type = "number", format = "dp:3") influenceTable$addColumnInfo(name = "dependent", title = options$dependent, type = depType) diff --git a/R/regressionlogistic.R b/R/regressionlogistic.R index c7f340d0..02f3a5f9 100644 --- a/R/regressionlogistic.R +++ b/R/regressionlogistic.R @@ -22,16 +22,16 @@ RegressionLogisticInternal <- function(jaspResults, dataset = NULL, options, ... .reglogisticCheckErrors(dataset, options) } # Output tables - model <- .reglogisticComputeModel( jaspResults, dataset, options, ready) + .reglogisticComputeModel( jaspResults, dataset, options, ready) .reglogisticModelSummaryTable( jaspResults, dataset, options, ready) .reglogisticEstimatesTable( jaspResults, dataset, options, ready) .reglogisticEstimatesTableBootstrap( jaspResults, dataset, options, ready) .reglogisticMulticolliTable( jaspResults, dataset, options, ready) .reglogisticFactorDescriptivesTable( jaspResults, dataset, options, ready) - if (options$residualCasewiseDiagnostic && is.null(jaspResults[["influenceTable"]])) { - finalModel <- model[[length(options[["modelTerms"]])]] - .glmInfluenceTable(jaspResults, finalModel, dataset, options, ready, position = 5, logisticRegression = TRUE) + if (options$residualCasewiseDiagnostic) { + finalModel <- jaspResults[["glmRes"]][["object"]][[length(options[["modelTerms"]])]] + .glmInfluenceTable(jaspResults, finalModel, dataset, options, ready, position = 5) .regressionExportResiduals(jaspResults, finalModel, dataset, options, ready = ready) }