Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Set Up R and Language Models

labcatalog runs without R and without a language model. R adds factor models and lets every analysis run in R; a language model drafts instruments and scoring scripts. Both are settings of your computer, made on the Settings page, and labcatalog never installs either for you.

R and the packages it needs

With R, labcatalog runs the analyses on the Analysis and Methods pages and the factor models in R, and in Python only when R is not set or fails. Confirmatory factor analysis and ω also have a Python version, but measurement invariance (across waves, reporters or groups) needs R.

  1. Install R from CRAN.

  2. In R, install the packages labcatalog uses:

    install.packages(c("lavaan", "semTools", "psych", "effectsize", "MBESS", "lme4", "lmerTest", "performance"))
  3. On the Settings page, under R, give the path to Rscript, which is in R’s bin folder, for example C:\Program Files\R\R-4.5.2\bin\Rscript.exe on Windows or /usr/local/bin/Rscript on macOS and Linux.

  4. Press Save and check. labcatalog runs R once and reports its version and any packages that are missing, with the command to install them.

Every analysis shows whether it was computed in R or in Python, and its Code section has both versions.

Language models

A language model can:

What it writes is always a draft for you to check, and the references, license and tags are always filled in by hand. These features need the ai extra (see Installation).

On the Settings page, under This project, choose the provider and the model, and press Save. They are saved in the project, so the whole lab uses the same model. What each person needs is set on their own computer:

With a cloud provider, the text you send (a PDF’s or Word file’s text, item wording) and the pictures you send go to that provider. Do not send anything your data agreements do not allow.