Git Product home page Git Product logo

alignmentmplusautomation's Introduction

! This is a legacy page, the functions were moved to the R package MIE

https://github.com/MaksimRudnev/MIE.package

Automation of alignment in Mplus

Three functions that facilitate setting up (frequentist) alignmnet in Mplus, extracting, and summarizing its results.

Installation:

source('https://raw.githubusercontent.com/MaksimRudnev/AlignmentMplusAutomation/master/source_repo.R')

runAlignment

runAlignment(
  model,                           # Formula in Mplus format
  group,                           # Grouping variable
  dat,                             # Data object 
  categorical = NULL,              # Vector of indicators that are binary or ordinal
  sim.samples = c(100, 500, 1000), # Group sample sizes for simulation, 
                                   #  the length of this vector also determines 
                                   #  a number of simulation studies.
  sim.reps = 500,                  # A number of simulated datasets in each simulation.
  Mplus_com = "Mplus",             # Sometimes you don't have a direct access to Mplus, so this 
                                   #  argument specifies what to send to a system command line.
  path = getwd(),                  # Where all the .inp, .out, and .dat files should be stored?
  summaries = F                    # If the extractAlignment() 
                                   #   and extractAlignmentSim() should
                                   #   be run after all the Mplus work is done.
  )

This function will set up and run free alignment, then it will set up and run fixed alignment using the smallest mean from the free alignmnet output. Optionally, it will also set up and run simulations as recommended by Muthen & Asparouhov (2014).

extractAlignment

extractAlignment("fixed.out")

It has a single argument which is a filename of the Mplus output. This function extracts alignment-related information from the Mplus output file. The most valueable us summary which includes all the info usually reported about about alignment.

extractAlignmentSim

extractAlignmentSim(c("sim500.out", "sim100.out", "sim1000.out"))

It has a single argument which is a vector of Mplus output files containing results of alignment simulations. It extracts only one portion that is directly related to alignment, namely correlations of true and estimated means.


See the tutorial on measurement invariance alignmnet in Mplus : https://maksimrudnev.com/2019/05/01/alignment-tutorial/

Use freely and credit as

Rudnev M.(2019) Alignment measurement invariance: Tutorial. URL: https://maksimrudnev.com/2019/05/01/alignment-tutorial/


See example

alignmentmplusautomation's People

Contributors

maksimrudnev avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

leomartinsjf

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.