write.lexstats {UCS}R Documentation

Write Data Files for Goodness-of-Fit Evaluation of LNRE Model (zm, fzm)


Creates three data files in lexstats format, which can be used to compare and LNRE model with other models from the lexstats package and evaluate its goodness-of-fit by a multivariate chi-squared test (Baayen, 2001, Sec. 3.3), using the lnreChi2 program (Baayen, 2001).


write.lexstats(model, file)


model an object of class "zm" or "fzm", representing a Zipf-Mandelbrot (ZM) or finite Zipf-Mandelbrot (fZM) LNRE model. The object must include observed word frequency data (in components N, V, and spc), usually because the model parameters have been estimated from the observed frequency spectrum.
file a character string giving the basename of the files that will be created


This functions creates files in lexstats format with the extensions .spc, .sp2, and .ev2, which are required by the lnreChi2 tool (Baayen, 2001, 270).

In addition, the basename file is extended with the string "_bZM" (for a ZM model) or "_bfZM" (for a fZM model), so that the lnreChi2 tool can correctly identify the number of degrees of freedom (reduced by two estimated parameters for the ZM model, and three estimated parameters for the fZM model).


The full basename of the created files (obtained by adding a model-specific suffix to the file parameter).


The combination of write.lexstats and the external lnreChi2 program to evaluate the goodness-of-fit of a LNRE model has been superseded by the built-in lnre.goodness.of.fit function (in the lexstats module). This function implements the multivariate chi-squared test as described by Baayen (2001, Sec. 3.3) in R without relying on external software.


Baayen, R. Harald (2001). Word Frequency Distributions. Kluwer, Dordrecht.

See Also

zm, fzm, EV, EVm, lnre.goodness.of.fit

[Package UCS version 0.5 Index]