kappa_multinomial: kappa_multinomial

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

Description

A kappa-like measure for multinomial models

Usage

1
kappa_multinomial(obs, pred, nsim = 1000)

Arguments

obs

a data.frame with class obervations with n columns and m rows; each row represents a sample, the columns represent the classes of outcomes.

pred

a data.frame with class predictions with n columns and m rows; each rows represents a sample, the columns represent the classes of outcomes.

nsim

to be passed to the null model if null model is computed based on randmization. nsim represents the number of randomizations

Details

kappa_multinomial is caclulated from two components: kappa_loc and kappa_prob. For details see Douma et al 2017.

obs and pred should contain probabilities or discrete outcomes (0 or 1).

The null model is calculated analytically when observations are discrete and calculated by randomzation otherwise.

Value

returns a list with the following elements:

Author(s)

Bob Douma

References

Douma et al 2017 Journal of Biogeography

See Also

cohen.kappa for Cohen's Kappa

Examples

1
2
3
4
5
6
# generate multinomial probabilties with four classes
pred = data.frame(gtools::rdirichlet(100, c(0.1,0.1,0.5,0.5)))
# generate multinomial observations with four classes 
obs = data.frame(t(apply(pred,1,rmultinom,size=1,n=1)))
# calculate kappa multinomial 
kappa_multinomial(obs=obs,pred=pred) 

bobdouma/kappa_multinomial documentation built on May 12, 2019, 11:28 p.m.