diff --git a/DESCRIPTION b/DESCRIPTION index 535c3c0..f8be193 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: nlmixr2extra Title: Nonlinear Mixed Effects Models in Population PK/PD, Extra Support Functions -Version: 3.0.0 +Version: 3.0.1 Authors@R: c( person("Matthew", "Fidler", email="matthew.fidler@gmail.com", role = c("aut", "cre"), comment = c(ORCID = "0000-0001-8538-6691")), diff --git a/NAMESPACE b/NAMESPACE index f6e57b5..6cbcf50 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -20,15 +20,12 @@ export(adaptivelassoCoefficients) export(addCatCovariates) export(addorremoveCovariate) export(adjustedlassoCoefficients) -export(backwardSearch) export(bootplot) export(bootstrapFit) export(buildcovInfo) export(buildupatedUI) -export(covarSearchAuto) export(fixedControl) export(foldgen) -export(forwardSearch) export(horseshoeSummardf) export(ini) export(knit_print) diff --git a/NEWS.md b/NEWS.md index a202cbf..45e77f8 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,7 @@ +# nlmixr2extra 3.0.1 + +* Remove non-functioning SCM for now (#71) + # nlmixr2extra 3.0.0 * New `profile()` method for likelihood profiling (Issue #1) diff --git a/R/SCM.R b/R/SCM.R index b7fe26c..4ab0d84 100644 --- a/R/SCM.R +++ b/R/SCM.R @@ -18,7 +18,7 @@ #' of the covariate selection as well as "resFwd" for the forward #' selection method and "resBck" for the backward selection method. #' -#' @export +#' @noRd #' @author Vipul Mann, Matthew Fidler, Vishal Sarsani #' #' @examples @@ -146,7 +146,7 @@ covarSearchAuto <- function(fit, #' #' @return returns the updated 'fit' object at the end of the forward search and a table of information for all the covariates tested #' @author Vipul Mann, Matthew Fidler, Vishal Sarsani -#' @export +#' @noRd forwardSearch <- function(varsVec,covarsVec,catvarsVec=NULL,fit, pVal = 0.05, outputDir, restart = FALSE) { ## Update data and covarsvec if categorical variables are provided if (!inherits(fit, "nlmixr2FitCore")) { @@ -315,7 +315,7 @@ forwardSearch <- function(varsVec,covarsVec,catvarsVec=NULL,fit, pVal = 0.05, ou #' @param restart a boolean that controls if the search should be restarted; default is FALSE #' #' @return returns the updated 'fit' object at the end of the backward search and a table of information for all the covariates tested -#' @export +#' @noRd #' #' @author Vipul Mann, Matthew Fidler, Vishal Sarsani backwardSearch <- function(varsVec,covarsVec,catvarsVec=NULL, fitorig, fitupdated, pVal = 0.01, reFitCovars = FALSE, outputDir, restart = FALSE) { diff --git a/man/backwardSearch.Rd b/man/backwardSearch.Rd deleted file mode 100644 index e6e5813..0000000 --- a/man/backwardSearch.Rd +++ /dev/null @@ -1,46 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/SCM.R -\name{backwardSearch} -\alias{backwardSearch} -\title{Backward covariate search} -\usage{ -backwardSearch( - varsVec, - covarsVec, - catvarsVec = NULL, - fitorig, - fitupdated, - pVal = 0.01, - reFitCovars = FALSE, - outputDir, - restart = FALSE -) -} -\arguments{ -\item{varsVec}{character vector of variables that need to be added} - -\item{covarsVec}{character vector of covariates that need to be added} - -\item{catvarsVec}{character vector of categorical covariates that need to be added} - -\item{fitorig}{the original 'fit' object before forward search} - -\item{fitupdated}{the updated 'fit' object, if any, after the forward search} - -\item{pVal}{p-value that should be used for selecting covariates in the forward search} - -\item{reFitCovars}{if the covariates should be added before performing backward search - useful for directly performing backward search without forward search; default is FALSE} - -\item{outputDir}{the name of the output directory that stores the covariate search result} - -\item{restart}{a boolean that controls if the search should be restarted; default is FALSE} -} -\value{ -returns the updated 'fit' object at the end of the backward search and a table of information for all the covariates tested -} -\description{ -Backward covariate search -} -\author{ -Vipul Mann, Matthew Fidler, Vishal Sarsani -} diff --git a/man/covarSearchAuto.Rd b/man/covarSearchAuto.Rd deleted file mode 100644 index ba935d0..0000000 --- a/man/covarSearchAuto.Rd +++ /dev/null @@ -1,98 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/SCM.R -\name{covarSearchAuto} -\alias{covarSearchAuto} -\title{Stepwise Covariate Model-selection (SCM) method} -\usage{ -covarSearchAuto( - fit, - varsVec, - covarsVec, - pVal = list(fwd = 0.05, bck = 0.01), - catvarsVec = NULL, - searchType = c("scm", "forward", "backward"), - restart = FALSE -) -} -\arguments{ -\item{fit}{an nlmixr2 'fit' object} - -\item{varsVec}{a list of candidate variables to which the -covariates could be added} - -\item{covarsVec}{a list of candidate covariates that need to be -tested} - -\item{pVal}{a named list with names 'fwd' and 'bck' for specifying -the p-values for the forward and backward searches, respectively} - -\item{catvarsVec}{character vector of categorical covariates that need to be added} - -\item{searchType}{one of 'scm', 'forward' and 'backward' to specify -the covariate search method; default is 'scm'} - -\item{restart}{a boolean that controls if the search should be -restarted; default is FALSE} -} -\value{ -A list summarizing the covariate selection steps and -output; This list has the "summaryTable" for the overall summary -of the covariate selection as well as "resFwd" for the forward -selection method and "resBck" for the backward selection method. -} -\description{ -Stepwise Covariate Model-selection (SCM) method -} -\examples{ -\dontrun{ -one.cmt <- function() { - ini({ - tka <- 0.45; label("Ka") - tcl <- log(c(0, 2.7, 100)); label("Cl") - tv <- 3.45; label("V") - eta.ka ~ 0.6 - eta.cl ~ 0.3 - eta.v ~ 0.1 - add.sd <- 0.7 - }) - model({ - ka <- exp(tka + eta.ka) - cl <- exp(tcl + eta.cl) - v <- exp(tv + eta.v) - linCmt() ~ add(add.sd) - }) -} - -fit <- nlmixr2(one.cmt, nlmixr2data::theo_sd, est = "saem", control = list(print = 0)) -rxode2::.rxWithWd(tempdir(), {# with temporary directory - -auto1 <- covarSearchAuto(fit, varsVec = c("ka", "cl"), - covarsVec = c("WT")) - -}) - -## Note that this didn't include sex, add it to dataset and restart model - - -d <- nlmixr2data::theo_sd -d$SEX <-0 -d$SEX[d$ID<=6] <-1 - -fit <- nlmixr2(one.cmt, d, est = "saem", control = list(print = 0)) - -# This would restart if for some reason the search crashed: - -rxode2::.rxWithWd(tempdir(), {# with temporary directory - -auto2 <- covarSearchAuto(fit, varsVec = c("ka", "cl"), covarsVec = c("WT"), - catvarsVec= c("SEX"), restart = TRUE) - -auto3 <- covarSearchAuto(fit, varsVec = c("ka", "cl"), covarsVec = c("WT"), - catvarsVec= c("SEX"), restart = TRUE, - searchType = "forward") -}) -} -} -\author{ -Vipul Mann, Matthew Fidler, Vishal Sarsani -} diff --git a/man/forwardSearch.Rd b/man/forwardSearch.Rd deleted file mode 100644 index b8fcf87..0000000 --- a/man/forwardSearch.Rd +++ /dev/null @@ -1,40 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/SCM.R -\name{forwardSearch} -\alias{forwardSearch} -\title{Forward covariate search} -\usage{ -forwardSearch( - varsVec, - covarsVec, - catvarsVec = NULL, - fit, - pVal = 0.05, - outputDir, - restart = FALSE -) -} -\arguments{ -\item{varsVec}{character vector of variables that need to be added} - -\item{covarsVec}{character vector of covariates that need to be added} - -\item{catvarsVec}{character vector of categorical covariates that need to be added} - -\item{fit}{an nlmixr2 'fit' object} - -\item{pVal}{p-value that should be used for selecting covariates in the forward search} - -\item{outputDir}{the name of the output directory that stores the covariate search result} - -\item{restart}{a boolean that controls if the search should be restarted; default is FALSE} -} -\value{ -returns the updated 'fit' object at the end of the forward search and a table of information for all the covariates tested -} -\description{ -Forward covariate search -} -\author{ -Vipul Mann, Matthew Fidler, Vishal Sarsani -}