Learn R Programming

textir (version 1.5.2)

predict.mnlm: mnlm predict

Description

Predict function for Multinomial Logistic Regression

Usage

## S3 method for class 'mnlm':
predict( object, newdata, type=c("response","reduction"), ... )

Arguments

object
An output object from the mnlm function.
type
Under "reduction", provide the fitted reduction $F\phi$. Under "response", provide the fitted multinomial probabilities.
newdata
Under "response", an ncol(object$loadings)-column matrix of new covariates. Under "reduction", an nrow(object$loadings)-column matrix of multinomial phrase/category counts for new docum
...
Additional unused arguments.

Value

  • Under type="response", output is an nrow(newcounts) by nrow(object$loadings) matrix of predicted probabilities for each response category. Under type="reduction", output is an nrow(newcounts) by ncol(object$loadings) matrix of document scores in each factor (object$covars) direction.

Details

This function returns either the inverse regression sufficient reduction $F\Phi$ for new documents, or fitted multinomial probabilities given new covariate vectors.

References

Taddy (2011), Inverse Regression for Analysis of Sentiment in Text. http://arxiv.org/abs/1012.2098

See Also

mnlm, congress109