Skip to content

Commit

Permalink
Remove draft of response optimizer
Browse files Browse the repository at this point in the history
  • Loading branch information
JTPetter committed Aug 23, 2024
1 parent 6cf30f0 commit 502d525
Showing 1 changed file with 0 additions and 37 deletions.
37 changes: 0 additions & 37 deletions R/doeAnalysis.R
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 502d525

Please sign in to comment.