choose_best: Choose Best Dimension

View source: R/choose_best.R

choose_bestR Documentation

Choose Best Dimension

Description

Chooses latent dimension that best predicts the outcome.

Usage

choose_best(
  x,
  bestmin = 0,
  othermax = 0,
  ndim = NULL,
  terms = NULL,
  nperterm = NULL,
  ...
)

Arguments

x

A #Votes x #Dimensions matrix of PRE values.

bestmin

Scalar indicating the minimum PRE value to be considered "well predicted" bythe model.

othermax

Scalar indicating the maximum PRE of the inferior dimension. If NULL, the algorithm just chooses the first highest PRE, regardless of the other PRE values.

ndim

Scalar giving the number of dimensions to use. The algorithm will use the first ndim columns of x in the calculation.

terms

Vector indicating the term to which each bill belongs.

nperterm

Scalar giving the number of bills to use per term. If NULL, all dimensions are used.

...

Other arguments to be passed down - currently not implemented.

Details

The algorithm chooses the best dimension by identifying for each vote the situation where the pre for variable j is greater than bestmin and the pre for all other variables not equal to j is less than othermin.

Value

A vector identifying which dimension was best or NA if no dimension met both criteria.


davidaarmstrong/legR documentation built on Oct. 13, 2023, 1:08 p.m.