Estimates a Wordfish model using Conditional Maximum Likelihood.

wordfish(
  wfm,
  dir = c(1, length(docs(wfm))),
  control = list(tol = 1e-06, sigma = 3, startparams = NULL, conv.check = c("ll",
    "cor")),
  verbose = FALSE
)

Arguments

wfm

a word frequency matrix

dir

set global identification by forcing theta[dir[1]] < theta[dir[2]] (defaults to first and last document)

control

list of estimation options

verbose

produce a running commentary

Value

An object of class wordfish. This is a list containing:

dir

global identification of the dimension

theta

document positions

alpha

document fixed effects

beta

word slope parameters

psi

word fixed effects

docs

names of the documents

words

names of words

sigma

regularization parameter for betas in poisson form

ll

final log likelihood

se.theta

standard errors for document position

data

the original data

Details

Fits a Wordfish model with document ideal points constrained to mean zero and unit standard deviation.

The control list specifies options for the estimation process. conv.check is either 'll' which stops when the difference in log likelihood between iterations is less than tol, or 'cor' which stops when one minus the correlation between the thetas from the current and the previous iterations is less than tol. sigma is the standard deviation for the beta prior in poisson form. startparams is a list of starting values (theta, beta, psi and alpha) or a previously fitted Wordfish model for the same data. verbose generates a running commentary during estimation

The model has two equivalent forms: a poisson model with two sets of document and two sets of word parameters, and a multinomial with two sets of word parameters and document ideal points. The first form is used for estimation, the second is available for alternative summaries, prediction, and profile standard error calculations.

The model is regularized by assuming a prior on beta with mean zero and standard deviation sigma (in poisson form). If you don't want to regularize, set beta to a large number.

References

Slapin and Proksch (2008) 'A Scaling Model for Estimating Time-Series Party Positions from Texts.' American Journal of Political Science 52(3):705-772.

See also

Author

Will Lowe

Examples

dd <- sim.wordfish() wf <- wordfish(dd$Y) summary(wf)
#> Call: #> wordfish(wfm = dd$Y) #> #> Document Positions: #> Estimate Std. Error Lower Upper #> D01 -1.48306 0.11325 -1.70504 -1.26109 #> D02 -1.14317 0.10357 -1.34617 -0.94017 #> D03 -0.85510 0.09751 -1.04621 -0.66399 #> D04 -0.49365 0.09253 -0.67501 -0.31229 #> D05 -0.11242 0.09036 -0.28952 0.06468 #> D06 0.09868 0.09049 -0.07868 0.27604 #> D07 0.49124 0.09328 0.30841 0.67406 #> D08 0.87199 0.09923 0.67750 1.06648 #> D09 1.10840 0.10462 0.90336 1.31345 #> D10 1.51574 0.11714 1.28614 1.74533