predict.textreg.result: Predict labeling with the selected phrases.

Description Usage Arguments Value Examples

Description

Given raw text and a textreg model, predict the labeling by counting appearance of relevant phrases in text and then multiplying these counts by the beta vector associated with the textreg object. Just like linear regression.

Usage

1
2
3
## S3 method for class 'textreg.result'
predict(object, new.text = NULL,
  return.matrix = FALSE, ...)

Arguments

object

A textreg.result object

new.text

If you want to predict for new text, pass it along.

return.matrix

TRUE means hand back the phrase appearance pattern matrix.

...

Nothing can be passed extra.

Value

Vector of predictions (numbers).

Examples

1
2
3
4
res = textreg( c( "", "", "A", "A" ), c( -1, -1, 1, 1 ), 
      C=1, Lq=1, convergence.threshold=0.00000001, verbosity=0 )
predict( res )
predict( res, new.text=c("A B C A") )

textreg documentation built on May 2, 2019, 8:34 a.m.