Description Usage Arguments Details Value See Also Examples
A helper function which can aid in the process of constructing a MPT model file for MPTinR. It will check if the probabilities in each trees sum to 1 (if so, a tree is well constructed). If probabilities do not sum to 1, check.mpt
will return for which trees. Furthermore, it will return the number of parameters and their names (helpful in spotting typos), the number of categories and the number of dfs the model provides. Finally, you can also pass restrictions as an argument and will receive the number and names of the parameters after restrictions are applied.
1 |
model.filename |
A character |
restrictions.filename |
|
model.type |
Character vector specifying whether the model file is formatted in the easy format ( |
As default, check.mpt
expects a model file in the easy format, but if the filename ends with .eqn or .EQN check.mpt
will expect the EQN format.
In case of inequality restrictions, the original parameters which are inequality restricted are replaced with dummy parameters starting with hankX
. When using fit.mpt
you will not notice this, as the output only shows the original parameters. In contrast, check.mpt
removes the original parameters and shows the dummy parameters called hankX
. Note that this does not change the number of parameters in the model.
A list with
probabilites.eq.1 |
A logical value indicating whether or not the probabilities in each tree sum to 1. If |
n.trees |
Number of trees in the model. |
n.model.categories |
Total number of categories expected in a dataset for that model. |
n.independent.categories |
Number of independent response categories (i.e., independent data points) the model provides (i.e., |
n.params |
Number of parameters in the model. |
parameters |
Names of parameters in the model. |
If restrictions are present, the n.params
and parameters
are displayed for the unrestricted model (orig.model
) as well as for the restricted model (restr.model
).
see http://www.psychologie.uni-freiburg.de/Members/singmann/R/mptinr/modelfile for more information on MPTinR model files.
fit.mpt
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | # model of example 1 from example(fit.mpt)
model1 <- system.file("extdata", "rb.fig1.model", package = "MPTinR")
check.mpt(model1)
#model 1 in eqn format
model1.eqn <- system.file("extdata", "rb.fig1.model.eqn", package = "MPTinR")
check.mpt(model1.eqn)
#models of example 2 from example(fit.mpt)
model2 <- system.file("extdata", "rb.fig2.model", package = "MPTinR")
check.mpt(model2)
model2r.r.eq <- system.file("extdata", "rb.fig2.r.equal", package = "MPTinR")
check.mpt(model2, model2r.r.eq)
model2r.c.eq <- system.file("extdata", "rb.fig2.c.equal", package = "MPTinR")
check.mpt(model2, model2r.c.eq)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.