classification {RprobitB}R Documentation

Classify deciders preference-based

Description

This function classifies the deciders based on their allocation to the components of the mixing distribution.

Usage

classification(x, add_true = FALSE)

Arguments

x

An object of class RprobitB_fit.

add_true

Set to TRUE to add true class memberships to output (if available).

Details

The function can only be used if the model has at least one random effect (i.e. P_r >= 1) and at least two latent classes (i.e. C >= 2).

In that case, let z1,,zNz_1,\dots,z_N denote the class allocations of the NN deciders based on their estimated mixed coefficients β=(β1,,βN)\beta = (\beta_1,\dots,\beta_N). Independently for each decider nn, the conditional probability Pr(zn=cs,βn,b,Ω)\Pr(z_n = c \mid s,\beta_n,b,\Omega) of having βn\beta_n allocated to class cc for c=1,,Cc=1,\dots,C depends on the class allocation vector ss, the class means b=(bc)cb=(b_c)_c and the class covariance matrices Omega=(Omegac)cOmega=(Omega_c)_c and is proportional to

scϕ(βnbc,Omegac).s_c \phi(\beta_n \mid b_c,Omega_c).

This function displays the relative frequencies of which each decider was allocated to the classes during the Gibbs sampling. Only the thinned samples after the burn-in period are considered.

Value

A data frame. The row names are the decider ids. The first C columns contain the relative frequencies with which the deciders are allocated to the C classes. Next, the column est contains the estimated class of the decider based on the highest allocation frequency. If add_true, the next column true contains the true class memberships.

See Also

update_z() for the updating function of the class allocation vector.


[Package RprobitB version 1.1.4 Index]