FAQ

Is the order of level names critical in xxmModel()?

Yes. The order of level names determines possible parent-child relationship among levels. For example,

myModel <- xxmModel(c("student","teacher"))

is correct for students nested within teachers. The following is incorrect:

myModel <- xxmModel(c("teacher", "student"))

Error: “Please check the number of rows and/or columns”

asdasd

What are the requirements for datasets?

For two level data structures, a single dataset is adequate. However with complex dependent data-structures it is most convenient to provide data for each level separately. Each dataset must include information about how each observation at that level is linked to an observation at a higher level. In general, datasets may have three types of variables:

  1. One or more columns of IDs or variables with linking information. ID columns are mandatory.
  2. Zero or more columns of dependent variables corresponding to the list of ys. (Optional)
  3. Zero or more columns of independent variables corresponding to the list of xs. (Optional).

A complete checklist to ensure that the data requirements are met:

  1. Each level must have a corresponding R dataset. To avoid confusion, the name of the dataset should match the level name.
  2. If a level does not have observed dependent or independent variables, the dataset should include a single column of level IDs.
  3. The first (1 + p) columns of a dataset include ID variables.
    • First column is the ID column for the current level.
    • The next p columns are the IDs for the parents of the current level.
  4. The names and order of the ID columns must match the corresponding level names declared in xxmModel.
  5. ID columns must be of type integer. Be careful, as R routinely converts categorical variables to a *factor* type.
  6. Dependent and independent variables must be of type numeric
  7. Use R command for examining structure of a dataset to ensure that the above requirements are met, e.g.
    str(myLevel1Data) and str(myLevel2Data).