pseudo_r2: Pseudo R2 for tcensReg Objects

Description Usage Arguments Details Value References Examples

View source: R/pseudo_r2.R

Description

Implementation of various methods for calculating pseudo R2 values popular with censored observations

Usage

1
pseudo_r2(obj, type = c("mckelvey_zavoina"))

Arguments

obj

Object of class tcensReg

type

Character value indicating the type of pseudo R2 to calculate. Currently only mckelvey_zavoina is available

Details

When comparing goodness of fit between methods for censored observations pseudo R^2 is often the preferred metric \insertCiteveall1996pseudotcensReg. While there are many different types of pseudo R^2 measures available this function implements those that are particularly relevant for censored observations. Below is a description. of the currently available methods within this function.

McKelvey-Zavoina

This measure of pseudo R^2 is from \insertCitemckelvey1975statistical;textualtcensReg and is the optimal metric suggested for limited dependent variables from \insertCiteveall1996pseudo;textualtcensReg. The formula is shown below

R^{2}_{mz}= \frac{∑_{i=1}^{N}(\hat{y_{i}}-\bar{\hat{y_{i}}})^{2}} {∑_{i=1}^{N}(\hat{y_{i}}-\bar{\hat{y_{i}}})^{2}+N\hat{σ}}

Value

List with numeric value representing the pseudo R^2 and type of pseudo R^2 calculated

References

\insertAllCited

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
#truncated normal underlying data
y_star <- rtnorm(n = 1000, mu = 0.5, sd = 1, a = 0)

#apply censoring
y <- ifelse(y_star <= 0.25, 0.25, y_star)

#find MLE estimates
mod_result <- tcensReg(y ~ 1, v = 0.25, a = 0)

pseudo_r2(mod_result, type="m")

tcensReg documentation built on July 8, 2020, 7:17 p.m.