Learn R Programming

tcensReg (version 0.1.7)

pseudo_r2: Pseudo R2 for tcensReg Objects

Description

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

Usage

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

Value

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

Details

When comparing goodness of fit between methods for censored observations pseudo \(R^2\) is often the preferred metric veall1996pseudotcensReg. 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 mckelvey1975statistical;textualtcensReg and is the optimal metric suggested for limited dependent variables from veall1996pseudo;textualtcensReg. The formula is shown below $$R^{2}_{mz}= \frac{\sum_{i=1}^{N}(\hat{y_{i}}-\bar{\hat{y_{i}}})^{2}} {\sum_{i=1}^{N}(\hat{y_{i}}-\bar{\hat{y_{i}}})^{2}+N\hat{\sigma}}$$

References

Examples

Run this code
# NOT RUN {
#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")

# }

Run the code above in your browser using DataLab