postpi_relate: postpi_relate function models the the relationship between...

Description Usage Arguments Value Examples

View source: R/postpi_relate.R

Description

This function is required to take in a data set (i.e. testing set) containing only observed and predicted outcomes and name for observed outcomes. It relates observed and predicted continuous outcomes through a gamma function. For categorical outcomes, user inputs observed outcomes and the probabilities of predicted outcomes (i.e. probabilities for each predicted category). It related categorical data through a user defined maching learning method from the caret package. The default method is k-nearest neighbours.

Usage

1
postpi_relate(relation_dat, yobs, method_categorical = "knn")

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 observed outcome in the testing set

method_categorical

Method to be passed to caret train function for categorical data

Value

rel_model relationship model between observed outcomes and predicted outcomes/probabilities

Examples

1
2
3
4
5
data(RINdata,package="postpi")

testing    <- RINdata[1:2000,]
relation_dat   <- data.frame(actual = testing$actual, pred = testing$predictions)
relation_model <- postpi_relate(relation_dat,actual)

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