From f58e50ccf236746718b70467e4b663a98d5d6489 Mon Sep 17 00:00:00 2001 From: xsswang Date: Tue, 17 May 2022 21:14:23 -0400 Subject: [PATCH] Update parms for Rd --- .Rbuildignore | 2 ++ .gitignore | 2 ++ R/clm_MI_CR.R | 1 + R/clm_MI_delta.R | 1 + R/get_MI_RB.R | 1 + R/tang_MI_RB.R | 7 ++++--- man/clm_MI_CR.Rd | 9 +++++++-- man/clm_MI_J2R.Rd | 9 +++++++-- man/clm_MI_delta.Rd | 13 +++++++++---- man/get_MI_RB.Rd | 7 ++++++- man/tang_MI_RB.Rd | 7 +++++-- 11 files changed, 45 insertions(+), 14 deletions(-) diff --git a/.Rbuildignore b/.Rbuildignore index 66a77f1..1df48d7 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -8,3 +8,5 @@ ^README\.Rmd$ ^CRAN-RELEASE$ ^LICENSE$ +^doc$ +^Meta$ diff --git a/.gitignore b/.gitignore index adf3d6a..9ae08af 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ inst/doc revdep/ .Rproj.user +/doc/ +/Meta/ diff --git a/R/clm_MI_CR.R b/R/clm_MI_CR.R index a2456e3..51ccd50 100644 --- a/R/clm_MI_CR.R +++ b/R/clm_MI_CR.R @@ -1,6 +1,7 @@ #' Apply Copy-Reference(CR) Method to Update JAGS MCMC outputs under MAR for Cumulative Logistic Model #' #' Internal function to obtain Copy-Reference(CR) MCMC from an MAR object. +#' @inheritParams commParams #' @param object an object of class remoid #' @param treatment the variable name of treatment. Reference level of treatment should be coded as 0. #' @param start first iteration to be used. diff --git a/R/clm_MI_delta.R b/R/clm_MI_delta.R index ddc53a8..8c92f25 100644 --- a/R/clm_MI_delta.R +++ b/R/clm_MI_delta.R @@ -1,6 +1,7 @@ #' Apply Delta adjustment to Update JAGS MCMC outputs under MAR for Cumulative Logistic Model #' #' Internal function to obtain delta-adjusted MCMC from an MAR object. +#' @inheritParams commParams #' @param object an object of class remiod #' @param treatment the variable name of treatment. Reference level of treatment should be coded as 0. #' @param delta specific value used for Delta adjustment, applicable only diff --git a/R/get_MI_RB.R b/R/get_MI_RB.R index a0009e3..8e7434d 100644 --- a/R/get_MI_RB.R +++ b/R/get_MI_RB.R @@ -5,6 +5,7 @@ #' onto each other (i.e., long format; optionally including the original, #' incomplete data).\cr #' +#' @inheritParams commParams #' @param object an object of class JointAI #' @param treatment the variable name of treatment. Reference level of treatment should be coded as 0. #' @param method a method for obtaining multiple-imputed dataset. Options diff --git a/R/tang_MI_RB.R b/R/tang_MI_RB.R index de32561..3ba78ce 100644 --- a/R/tang_MI_RB.R +++ b/R/tang_MI_RB.R @@ -4,7 +4,9 @@ #' imputation method with the algorithm of Tang's sequential modeling. #' #' @inheritParams commParams -#' +#' @param dtimp imputed complete data sets from \code{remiod} function. +#' @param treatment name of the treatment variable. +#' @param thin thinning to be applied. #' @return multiple imputed datasets stacked onto each other (i.e., long format; #' optionally including the original incomplete data).\cr #' The variable \code{Imputation_} indexes the imputation, while @@ -12,8 +14,7 @@ #' In cross-sectional datasets the #' variable \code{.id} is added as subject identifier. #' -#' @param dtimp imputed complete data sets from \code{remiod} function. -#' @param treatment treatment variable. + tang_MI_RB = function(object, dtimp, treatment, method="MAR", delta=0, ord_cov_dummy=FALSE, exclude_chains=NULL, include=FALSE, thin=1){ diff --git a/man/clm_MI_CR.Rd b/man/clm_MI_CR.Rd index 862ac75..a544ff9 100644 --- a/man/clm_MI_CR.Rd +++ b/man/clm_MI_CR.Rd @@ -5,8 +5,8 @@ \title{Apply Copy-Reference(CR) Method to Update JAGS MCMC outputs under MAR for Cumulative Logistic Model} \usage{ clm_MI_CR(object, treatment, start = NULL, end = NULL, thin = NULL, - exclude_chains = NULL, subset = FALSE, seed = NULL, mess = FALSE, - ...) + exclude_chains = NULL, subset = FALSE, ord_cov_dummy = TRUE, + seed = NULL, mess = FALSE, ...) } \arguments{ \item{object}{an object of class remoid} @@ -23,6 +23,11 @@ clm_MI_CR(object, treatment, start = NULL, end = NULL, thin = NULL, \item{subset}{subset of parameters (columns of the mcmc object) to be used.} +\item{ord_cov_dummy}{optional. specify whether ordinal variables should be treated as +categorical variables or continuous variables when they are +included as covariates in the sequential imputation models. +Default is \code{TRUE}, dummy variables will be created accordingly.} + \item{seed}{optional seed value.} \item{mess}{logical, should messages be displayed?} diff --git a/man/clm_MI_J2R.Rd b/man/clm_MI_J2R.Rd index e4ce00f..a5c3b0c 100644 --- a/man/clm_MI_J2R.Rd +++ b/man/clm_MI_J2R.Rd @@ -5,8 +5,8 @@ \title{Apply Jump-to-Reference(J2R) Method to Update JAGS MCMC outputs under MAR for Cumulative Logistic Model} \usage{ clm_MI_J2R(object, treatment, start = NULL, end = NULL, thin = NULL, - exclude_chains = NULL, subset = FALSE, seed = NULL, mess = FALSE, - ...) + exclude_chains = NULL, subset = FALSE, ord_cov_dummy = TRUE, + seed = NULL, mess = FALSE, ...) } \arguments{ \item{object}{an object of class remiod} @@ -23,6 +23,11 @@ clm_MI_J2R(object, treatment, start = NULL, end = NULL, thin = NULL, \item{subset}{subset of parameters (columns of the mcmc object) to be used.} +\item{ord_cov_dummy}{optional. specify whether ordinal variables should be treated as +categorical variables or continuous variables when they are +included as covariates in the sequential imputation models. +Default is \code{TRUE}, dummy variables will be created accordingly.} + \item{seed}{optional seed value.} \item{mess}{logical, should messages be displayed?} diff --git a/man/clm_MI_delta.Rd b/man/clm_MI_delta.Rd index 2b44f0b..7c0e229 100644 --- a/man/clm_MI_delta.Rd +++ b/man/clm_MI_delta.Rd @@ -5,8 +5,8 @@ \title{Apply Delta adjustment to Update JAGS MCMC outputs under MAR for Cumulative Logistic Model} \usage{ clm_MI_delta(object, treatment, delta = 0, start = NULL, end = NULL, - thin = NULL, exclude_chains = NULL, subset = FALSE, seed = NULL, - mess = FALSE, ...) + exclude_chains = NULL, thin = NULL, subset = FALSE, + ord_cov_dummy = TRUE, seed = NULL, mess = FALSE, ...) } \arguments{ \item{object}{an object of class remiod} @@ -20,12 +20,17 @@ for method="delta".} \item{end}{last iteration to be used.} -\item{thin}{thinning to be applied.} - \item{exclude_chains}{optional vector of numbers, indexing MCMC chains to be excluded from the output.} +\item{thin}{thinning to be applied.} + \item{subset}{subset of parameters (columns of the mcmc object) to be used.} +\item{ord_cov_dummy}{optional. specify whether ordinal variables should be treated as +categorical variables or continuous variables when they are +included as covariates in the sequential imputation models. +Default is \code{TRUE}, dummy variables will be created accordingly.} + \item{seed}{optional seed value.} \item{mess}{logical, should messages be displayed?} diff --git a/man/get_MI_RB.Rd b/man/get_MI_RB.Rd index 3909d58..00b08ae 100644 --- a/man/get_MI_RB.Rd +++ b/man/get_MI_RB.Rd @@ -7,7 +7,7 @@ get_MI_RB(object, treatment, method = c("MAR", "J2R", "CR", "delta"), delta = 0, exclude_chains = NULL, start = NULL, end = NULL, seed = NULL, thin = NULL, subset = FALSE, include = TRUE, - mess = TRUE, ...) + ord_cov_dummy = TRUE, mess = TRUE, ...) } \arguments{ \item{object}{an object of class JointAI} @@ -35,6 +35,11 @@ for method="delta".} \item{include}{should the original, incomplete data be included? Default is \code{TRUE}.} +\item{ord_cov_dummy}{optional. specify whether ordinal variables should be treated as +categorical variables or continuous variables when they are +included as covariates in the sequential imputation models. +Default is \code{TRUE}, dummy variables will be created accordingly.} + \item{mess}{logical, should messages be displayed?} \item{...}{optional arguments pass from main function.} diff --git a/man/tang_MI_RB.Rd b/man/tang_MI_RB.Rd index 8a7ec74..4524c9f 100644 --- a/man/tang_MI_RB.Rd +++ b/man/tang_MI_RB.Rd @@ -5,14 +5,15 @@ \title{Implement controlled multiple imputation algorithms proposed by Tang} \usage{ tang_MI_RB(object, dtimp, treatment, method = "MAR", delta = 0, - ord_cov_dummy = FALSE, exclude_chains = NULL, include = FALSE) + ord_cov_dummy = FALSE, exclude_chains = NULL, include = FALSE, + thin = 1) } \arguments{ \item{object}{object inheriting from class 'remoid'} \item{dtimp}{imputed complete data sets from \code{remiod} function.} -\item{treatment}{treatment variable.} +\item{treatment}{name of the treatment variable.} \item{method}{a method for obtaining multiple-imputed dataset. Options include \code{MAR}, \code{J2R}, \code{CR}, and \code{delta} adjustment. @@ -31,6 +32,8 @@ should be excluded} \item{include}{logical, if TRUE, raw data will be included in imputed data sets with imputation ID = 0.} + +\item{thin}{thinning to be applied.} } \value{ multiple imputed datasets stacked onto each other (i.e., long format;