From e14b1a3d0de5c621a33a431dac7995ca8078885d Mon Sep 17 00:00:00 2001 From: Awan Afiaz <87647778+awanafiaz@users.noreply.github.com> Date: Mon, 30 Sep 2024 14:15:58 -0700 Subject: [PATCH] updating to lowercase ipd --- R/ipd.R | 2 +- inst/IPD_POP-Inf_test.Rmd | 24 ++++++++++++------------ inst/paper.R | 4 ++-- tests/testthat.R | 4 ++-- vignettes/ipd.Rmd | 34 +++++++++++++++++----------------- 5 files changed, 34 insertions(+), 34 deletions(-) diff --git a/R/ipd.R b/R/ipd.R index 4004e68..35a94eb 100644 --- a/R/ipd.R +++ b/R/ipd.R @@ -151,7 +151,7 @@ #' \item{coefficients}{Estimated coefficients of the model} #' \item{se}{Standard errors of the estimated coefficients} #' \item{ci}{Confidence intervals for the estimated coefficients} -#' \item{formula}{The formula used to fit the IPD model.} +#' \item{formula}{The formula used to fit the ipd model.} #' \item{data}{The data frame used for model fitting.} #' \item{method}{The method used for model fitting.} #' \item{model}{The type of model fitted.} diff --git a/inst/IPD_POP-Inf_test.Rmd b/inst/IPD_POP-Inf_test.Rmd index 4985dc5..a30151b 100644 --- a/inst/IPD_POP-Inf_test.Rmd +++ b/inst/IPD_POP-Inf_test.Rmd @@ -1,5 +1,5 @@ --- -title: "Test POP-Inf in IPD R package" +title: "Test POP-Inf in ipd R package" author: "Jiacheng Miao " date: "2024-02-19" output: html_document @@ -10,7 +10,7 @@ output: html_document rm(list = ls()) #- Generate Example Data set.seed(42) -dat <- IPD::simdat() +dat <- ipd::simdat() form <- Y - Yhat ~ X1 @@ -20,7 +20,7 @@ f_l <- dat[dat$set == "labeled", all.vars(form)[2]] |> matrix(ncol = 1) f_u <- dat[dat$set == "unlabeled", all.vars(form)[2]] |> matrix(ncol = 1) -IPD::popinf_mean(Y_l, f_l, f_u) +ipd::popinf_mean(Y_l, f_l, f_u) ``` ## Linear regression @@ -28,7 +28,7 @@ IPD::popinf_mean(Y_l, f_l, f_u) rm(list = ls()) #- Generate Example Data set.seed(42) -dat <- IPD::simdat() +dat <- ipd::simdat() form <- Y - Yhat ~ X1 @@ -42,7 +42,7 @@ X_u <- model.matrix(form, data = dat[dat$set == "unlabeled",]) f_u <- dat[dat$set == "unlabeled", all.vars(form)[2]] |> matrix(ncol = 1) -IPD::popinf_ols(X_l, Y_l, f_l, X_u, f_u) +ipd::popinf_ols(X_l, Y_l, f_l, X_u, f_u) ``` ## Logistic regression @@ -50,7 +50,7 @@ IPD::popinf_ols(X_l, Y_l, f_l, X_u, f_u) rm(list = ls()) #- Generate Example Data set.seed(42) -dat <- IPD::simdat() +dat <- ipd::simdat() form <- Y - Yhat ~ X1 @@ -67,7 +67,7 @@ X_u <- model.matrix(form, data = dat[dat$set == "unlabeled",]) f_u <- dat[dat$set == "unlabeled", all.vars(form)[2]] |> matrix(ncol = 1) f_u <- ifelse(f_u > quantile(f_u, 0.75), 1, 0) -IPD::popinf_logistic(X_l, Y_l, f_l, X_u, f_u) +ipd::popinf_logistic(X_l, Y_l, f_l, X_u, f_u) ``` @@ -76,7 +76,7 @@ IPD::popinf_logistic(X_l, Y_l, f_l, X_u, f_u) rm(list = ls()) #- Generate Example Data set.seed(42) -dat <- IPD::simdat() +dat <- ipd::simdat() form <- Y - Yhat ~ X1 @@ -93,7 +93,7 @@ X_u <- model.matrix(form, data = dat[dat$set == "unlabeled",]) f_u <- dat[dat$set == "unlabeled", all.vars(form)[2]] |> matrix(ncol = 1) f_u <- round(f_u - min(f_u)) -IPD::popinf_poisson(X_l, Y_l, f_l, X_u, f_u) +ipd::popinf_poisson(X_l, Y_l, f_l, X_u, f_u) ``` ## Quantile Estimation @@ -101,7 +101,7 @@ IPD::popinf_poisson(X_l, Y_l, f_l, X_u, f_u) rm(list = ls()) #- Generate Example Data set.seed(42) -dat <- IPD::simdat() +dat <- ipd::simdat() form <- Y - Yhat ~ X1 @@ -111,5 +111,5 @@ f_l <- dat[dat$set == "labeled", all.vars(form)[2]] |> matrix(ncol = 1) f_u <- dat[dat$set == "unlabeled", all.vars(form)[2]] |> matrix(ncol = 1) -IPD::popinf_quantile(Y_l, f_l, f_u, q = 0.5) -``` \ No newline at end of file +ipd::popinf_quantile(Y_l, f_l, f_u, q = 0.5) +``` diff --git a/inst/paper.R b/inst/paper.R index 333a2f5..7b0803d 100644 --- a/inst/paper.R +++ b/inst/paper.R @@ -12,11 +12,11 @@ install.packages("devtools") #-- Install the IPD package from GitHub -devtools::install_github("awanafiaz/IPD") +devtools::install_github("awanafiaz/ipd") #-- Load the IPD library -library(IPD) +library(ipd) #-- Load additional libraries diff --git a/tests/testthat.R b/tests/testthat.R index 1c75d50..7f12c29 100644 --- a/tests/testthat.R +++ b/tests/testthat.R @@ -7,6 +7,6 @@ # * https://testthat.r-lib.org/articles/special-files.html library(testthat) -library(IPD) +library(ipd) -test_check("IPD") +test_check("ipd") diff --git a/vignettes/ipd.Rmd b/vignettes/ipd.Rmd index 8e326ae..16a083d 100644 --- a/vignettes/ipd.Rmd +++ b/vignettes/ipd.Rmd @@ -47,26 +47,26 @@ where \(\beta\) is a vector of regression coefficients and \(g(\cdot)\) is a giv ## Installation -To install the development version of `ipd` from [GitHub](https://github.com/awanafiaz/IPD), you can use the `devtools` package: +To install the development version of `ipd` from [GitHub](https://github.com/awanafiaz/ipd), you can use the `devtools` package: ```{r, eval = F} #-- Install devtools if it is not already installed install.packages("devtools") -#-- Install the IPD package from GitHub +#-- Install the ipd package from GitHub -devtools::install_github("awanafiaz/IPD") +devtools::install_github("awanafiaz/ipd") ``` # Usage -We provide a simple example to demonstrate the basic use of the functions included in the `IPD` package. +We provide a simple example to demonstrate the basic use of the functions included in the `ipd` package. ```{r setup} -#-- Load IPD Package +#-- Load ipd Package -library(IPD) +library(ipd) ``` ## Data Generation @@ -315,7 +315,7 @@ formula <- Y - f ~ X1 nboot <- 200 -IPD::ipd(formula, +ipd::ipd(formula, method = "postpi_boot", model = "ols", data = dat_ols, label = "set", @@ -329,7 +329,7 @@ IPD::ipd(formula, ```{r postpi_analytic_ols} #-- Fit the PostPI Analytic Correction -IPD::ipd(formula, +ipd::ipd(formula, method = "postpi_analytic", model = "ols", data = dat_ols, label = "set") |> @@ -341,7 +341,7 @@ IPD::ipd(formula, ```{r ppi_ols} #-- Fit the PPI Correction -IPD::ipd(formula, +ipd::ipd(formula, method = "ppi", model = "ols", data = dat_ols, label = "set") |> @@ -353,7 +353,7 @@ IPD::ipd(formula, ```{r ppi_plusplus} #-- Fit the PPI++ Correction -IPD::ipd(formula, +ipd::ipd(formula, method = "ppi_plusplus", model = "ols", data = dat_ols, label = "set") |> @@ -365,7 +365,7 @@ IPD::ipd(formula, ```{r pspa} #-- Fit the PSPA Correction -IPD::ipd(formula, +ipd::ipd(formula, method = "pspa", model = "ols", data = dat_ols, label = "set") |> @@ -413,7 +413,7 @@ formula <- Y - f ~ X1 nboot <- 200 -IPD::ipd(formula, method = "postpi_boot", model = "logistic", +ipd::ipd(formula, method = "postpi_boot", model = "logistic", data = dat_logistic, label = "set", nboot = nboot) |> @@ -425,7 +425,7 @@ IPD::ipd(formula, method = "postpi_boot", model = "logistic", ```{r ppi2} #-- Fit the PPI Correction -IPD::ipd(formula, method = "ppi", model = "logistic", +ipd::ipd(formula, method = "ppi", model = "logistic", data = dat_logistic, label = "set") |> @@ -437,7 +437,7 @@ IPD::ipd(formula, method = "ppi", model = "logistic", ```{r ppi_plusplus2} #-- Fit the PPI++ Correction -IPD::ipd(formula, method = "ppi_plusplus", model = "logistic", +ipd::ipd(formula, method = "ppi_plusplus", model = "logistic", data = dat_logistic, label = "set") |> @@ -449,7 +449,7 @@ IPD::ipd(formula, method = "ppi_plusplus", model = "logistic", ```{r pspa2} #-- Fit the PSPA Correction -IPD::ipd(formula, method = "pspa", model = "logistic", +ipd::ipd(formula, method = "pspa", model = "logistic", data = dat_logistic, label = "set") |> @@ -465,7 +465,7 @@ The package also provides custom `print`, `summary`, `tidy`, `glance`, and `augm nboot <- 200 -fit_postpi <- IPD::ipd(formula, +fit_postpi <- ipd::ipd(formula, method = "postpi_boot", model = "ols", data = dat_ols, label = "set", @@ -544,7 +544,7 @@ For questions, comments, or any other feedback, please contact the developers at ## Contributing -Contributions are welcome! Please open an issue or submit a pull request on [GitHub](https://github.com/awanafiaz/IPD). +Contributions are welcome! Please open an issue or submit a pull request on [GitHub](https://github.com/awanafiaz/ipd). ## License