cooksD: Calculate Cook's Distance.

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/auxiliar_functions.r

Description

Function to calculate the Cook's distances.

Usage

1
  cooksD(mod, cov_type = 'hessian', trace = TRUE)

Arguments

mod

A fitted rasch model.

cov_type

A character indicating which covariance matrix estimation is to be used. Possible choices are 'hessian', 'opg' and 'sandwich'.

trace

Wheter to show progress of the leave-one-out loop.

Details

The algorithm proceeds by deleting an entire row of the item matrix at a time. At every iteration the vector of parameters of the full model is compared with the vector of parameters having deleted the i-th row.

Value

A numeric vector containing the value of the statistic.

Author(s)

Fernando Massa, fmassa@iesta.edu.uy

See Also

pfs

Examples

1
2
3
4
5
6
7
8
9
n   <- 50
J   <- 5
X   <- sim_rasch(n, delta = seq(-2, 2, length = J))
# alter 10th observation
X[10, ] <- rep(c(1,0),c(2,3))
# estimate model
mod <- rasch(X)
# Cook's distance 
cooksD(mod)

nando11235813/raschreg documentation built on Oct. 2, 2021, 3:11 p.m.