dev_logit: Deviance from predicted values of a logit model

Description Usage Arguments Details

View source: R/evaluate.R

Description

Deviance from predicted values of a logit model

Usage

1
dev_logit(y, xb = NULL, phat = NULL, w = 1)

Arguments

y

vector of the outcome that was regressed on, or the true values to predict

xb

estimates from the logit model, before the link function is applied.

phat

estimates from the logit model, after link function is applied. Only either xb or phat is necessary.

w

survey weights if appplicable

Details

The deviance without weights, dev(\hat p) for target y is computed as

-2 \times ∑_{i=1}^n y_i \log(\hat{p_i}) + (1 - y_i) \log(1 - \hat{p_i})

where

\hat{p} = \frac{\exp{(Xβ)}}{\exp{(Xβ)} + 1}

.

With weights, this simply becomes

-2 \times ∑_{i=1}^n w_i y_i \log(\hat{p_i}) + w_i (1 - y_i) \log(1 - \hat{p_i})


kuriwaki/sparseregMRP documentation built on March 20, 2020, 9:58 p.m.