postpi_der: postpi_der function provides the corrected inference result...

Description Usage Arguments Value Examples

View source: R/postpi_der.R

Description

This function is required to take in two data sets (i.e. testing set and validation set), names for observed and predicted continuous outcomes, and an inference formula. The function relates continuous observed and predicted outcomes in the testing set and quantify biases and then corrects the inference results in the validation set based on the input inference formula

Usage

1
postpi_der(relation_dat, yobs, ypred, valid_dat, inf_formula)

Arguments

relation_dat

testing set that contains observed outcomes and predicted outcomes (continuous data) or probabilities of predicted outcomes (categorical data)

yobs

name of the continuous observed outcome

ypred

name of the continuous predicted outcome

valid_dat

validation set that contains predicted outcomes and covariates

inf_formula

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

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
data(RINdata,package="postpi")

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

relation_dat <- data.frame(actual = testing$actual, pred = testing$predictions)
inf_results  <- postpi_der(relation_dat, actual, pred, validation, predictions ~ region_1)

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