postpi: postpi function provides the corrected inference result table...

Description Usage Arguments Value Examples

View source: R/postpi.R

Description

This function is required to take in the relationship model from 'postpi_relate()', a validation set, and the inference formula. Through a bootstrap approach, the function quantifies biases using the relationship model and then corrects the inference results in the validation set based on the input inference formula. The default number of bootstrapping is 100 and the seed is 1234. Both parameters can be defined by users.

Usage

1
2
3
4
5
6
7
8
postpi(
  valid_dat,
  rel_model,
  inf_formula,
  method = "par",
  bs = 100,
  seed = NULL
)

Arguments

valid_dat

validation set that contains only the predicted outcomes and covariates of interest

rel_model

model object created by 'postpi_relate()'

inf_formula

inference formula for fitting predicted outcomes ~ covariates, eg. yp ~ x1

method

parametric or non-parametric method to estimate standard error of estimates. Method = "par" or "non-par". The default value is "par", parametric method.

bs

number of bootstrap times. The default value is 100 times.

seed

seed number. The default value is 1234

Value

tidytable a tidy table for inference results. It contains conlumns: term, estimate, std.error, statistic, p.value

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
data(RINdata,package="postpi")

testing    <- RINdata[1:2000,]
validation <- RINdata[2001:nrow(RINdata),]

relation_dat   <- data.frame(actual = testing$actual, predictions = testing$predictions)
relation_model <- postpi_relate(relation_dat,actual)

inf_par    <- postpi(validation, relation_model, predictions ~ region_1)
inf_nonpar <- postpi(validation, relation_model, predictions ~ region_1, method = "non-par")

SiruoWang/IAP documentation built on Sept. 20, 2020, 4 a.m.