POP-Inf
This repository hosts the R package that implements the POP-Inf
method described in the paper: Assumption-lean and data-adaptive post-prediction inference.
POP-Inf
provides valid and powerful inference based on ML predictions for parameters defined through estimation equations.
# install.packages("devtools")
devtools::install_github("qlu-lab/POPInf")
Here are examples of POP-Inf for M-estimation tasks including: mean estimation, linear regression, logistic regression, and Poisson regrssion. The main function is pop_M()
, where the argument method
indicates which task to do.
# Load the package
library(POPInf)
# Load the simulated data
set.seed(999)
data <- sim_data()
X_lab = data$X_lab ## Covariates in the labeled data
X_unlab = data$X_unlab ## Covariates in the unlabeled data
Y_lab = data$Y_lab ## Observed outcome in the labeled data
Yhat_lab = data$Yhat_lab ## Predicted outcome in the labeled data
Yhat_unlab = data$Yhat_unlab ## Predicted outcome in the unlabeled data
``````
### Mean estimation
fit_mean <- pop_M(Y_lab = Y_lab, Yhat_lab = Yhat_lab, Yhat_unlab = Yhat_unlab, alpha = 0.05, method = "mean")
print(fit_mean)
### Linear regression
fit_ols <- pop_M(X_lab = X_lab, X_unlab = X_unlab, Y_lab = Y_lab, Yhat_lab = Yhat_lab, Yhat_unlab = Yhat_unlab, alpha = 0.05, method = "ols")
print(fit_ols)
### Logistic regression
set.seed(999) data <- sim_data(binary = T) X_lab = data$X_lab X_unlab = data$X_unlab Y_lab = data$Y_lab Yhat_lab = data$Yhat_lab Yhat_unlab = data$Yhat_unlab
fit_logistic <- pop_M(X_lab = X_lab, X_unlab = X_unlab, Y_lab = Y_lab, Yhat_lab = Yhat_lab, Yhat_unlab = Yhat_unlab, alpha = 0.05, method = "logistic")
print(fit_logistic)
### Poisson regression
set.seed(999) data <- sim_data() X_lab = data$X_lab X_unlab = data$X_unlab Y_lab = round(data$Y_lab - min(data$Y_lab)) Yhat_lab = round(data$Yhat_lab - min(data$Yhat_lab)) Yhat_unlab = round(data$Yhat_unlab - min(Yhat_unlab))
fit_poisson <- pop_M(X_lab = X_lab, X_unlab = X_unlab, Y_lab = Y_lab, Yhat_lab = Yhat_lab, Yhat_unlab = Yhat_unlab, alpha = 0.05, method = "poisson")
print(fit_poisson)
```
We provide the script for analysis in the POP-Inf
paper here.
Please submit an issue or contact Jiacheng (jiacheng.miao@wisc.edu) or Xinran (xinran.miao@wisc.edu) for questions.
Assumption-lean and Data-adaptive Post-Prediction Inference
Valid inference for machine learning-assisted GWAS
POP-GWAS
, where statistical and computational methods are optimized for GWAS applications.Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.