predict.textmodel_wordfish: Prediction from a textmodel_wordfish method

View source: R/textmodel_wordfish.R

predict.textmodel_wordfishR Documentation

Prediction from a textmodel_wordfish method

Description

predict.textmodel_wordfish() returns estimated document scores and confidence intervals. The method is provided for consistency with other ⁠textmodel_*()⁠ methods, but does not currently allow prediction on out-of-sample data.

Usage

## S3 method for class 'textmodel_wordfish'
predict(
  object,
  se.fit = FALSE,
  interval = c("none", "confidence"),
  level = 0.95,
  ...
)

## S3 method for class 'textmodel_wordfish'
coef(object, margin = c("both", "documents", "features"), ...)

coefficients.textmodel_wordfish(object, ...)

Arguments

object

a fitted wordfish model

se.fit

if TRUE, return standard errors as well

interval

type of confidence interval calculation

level

tolerance/confidence level for intervals

...

not used

margin

which margin of parameter estimates to return: both (in a list), or just document or feature parameters

Value

coef.textmodel_wordfish() returns a matrix of estimated parameters coefficients for the specified margin.


quanteda.textmodels documentation built on Sept. 11, 2024, 8:19 p.m.