From 502d5257af576eabc988377aff63d0d5f48c0591 Mon Sep 17 00:00:00 2001 From: JTPetter <61797391+JTPetter@users.noreply.github.com> Date: Fri, 23 Aug 2024 14:32:25 +0200 Subject: [PATCH] Remove draft of response optimizer --- R/doeAnalysis.R | 37 ------------------------------------- 1 file changed, 37 deletions(-) diff --git a/R/doeAnalysis.R b/R/doeAnalysis.R index ff072d21..30eb36a0 100644 --- a/R/doeAnalysis.R +++ b/R/doeAnalysis.R @@ -513,43 +513,6 @@ get_levels <- function(var, num_levels, dataset) { levels_var[2:(num_levels + 1)] } -# .doeResponseOptimizer <- function(jaspResults, dataset, options, ready, continuousPredictors, discretePredictors, blocks, covariates, dependent) { -# # get regression equation and predictors -# #result <- jaspResults[["doeResult"]]$object[["regression"]] -# result <- result$regression -# regressionEquation <- result$object$coefficients -# -# # Define a pattern for first-order terms -# first_order_pattern <- paste0("^(", paste(names(result$object$model)[-1], collapse = "|"), ")$") -# -# # Extract first-order coefficients -# first_order_coefficients <- regressionEquation[grepl(first_order_pattern, names(regressionEquation))] -# -# # Print the first-order coefficients -# print(first_order_coefficients) -# -# predictors <- -# -# # get process SD -# Y <- result$object$model[[1]] # vector of the outcome, always first column of the model object -# psd <- sd(Y) # process standard deviation -# -# # sample from value space of predictors -# nPredictors <- ncol(result$object$model) - 1 # all cols of the model, minus one for the result -# nSimulations <- 1000 -# optimizationDf <- data.frame() -# for (sim in seq_len(nSimulations)) { -# -# } -# -# # what to do with blocks and covariates? just assume that block and covariate are at mean? or at zero? -# -# # use regression equation to predict outcomes -# # get sampled value space with highest min cpk -# # return this optimized value set -# -# } - .getVIF <- function(regressionFit, predictors) { if (ncol(regressionFit$model) < 3) { VIF <- rep(NA, length(regressionFit$coefficients))