Skip to content

Commit

Permalink
updating to lowercase ipd
Browse files Browse the repository at this point in the history
  • Loading branch information
awanafiaz committed Sep 30, 2024
1 parent ee4b5bc commit e14b1a3
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 34 deletions.
2 changes: 1 addition & 1 deletion R/ipd.R
Original file line number Diff line number Diff line change
Expand Up @@ -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.}
Expand Down
24 changes: 12 additions & 12 deletions inst/IPD_POP-Inf_test.Rmd
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: "Test POP-Inf in IPD R package"
title: "Test POP-Inf in ipd R package"
author: "Jiacheng Miao <[email protected]>"
date: "2024-02-19"
output: html_document
Expand All @@ -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
Expand All @@ -20,15 +20,15 @@ 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
```{r}
rm(list = ls())
#- Generate Example Data
set.seed(42)
dat <- IPD::simdat()
dat <- ipd::simdat()
form <- Y - Yhat ~ X1
Expand All @@ -42,15 +42,15 @@ 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
```{r}
rm(list = ls())
#- Generate Example Data
set.seed(42)
dat <- IPD::simdat()
dat <- ipd::simdat()
form <- Y - Yhat ~ X1
Expand All @@ -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)
```

Expand All @@ -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
Expand All @@ -93,15 +93,15 @@ 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
```{r}
rm(list = ls())
#- Generate Example Data
set.seed(42)
dat <- IPD::simdat()
dat <- ipd::simdat()
form <- Y - Yhat ~ X1
Expand All @@ -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)
```
ipd::popinf_quantile(Y_l, f_l, f_u, q = 0.5)
```
4 changes: 2 additions & 2 deletions inst/paper.R
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions tests/testthat.R
Original file line number Diff line number Diff line change
Expand Up @@ -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")
34 changes: 17 additions & 17 deletions vignettes/ipd.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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",
Expand All @@ -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") |>
Expand All @@ -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") |>
Expand All @@ -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") |>
Expand All @@ -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") |>
Expand Down Expand Up @@ -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) |>
Expand All @@ -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") |>
Expand All @@ -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") |>
Expand All @@ -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") |>
Expand All @@ -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",
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit e14b1a3

Please sign in to comment.