Release of v0.7-3 to CRAN

110 views
Skip to first unread message

michael.hallquist

unread,
Dec 1, 2018, 10:37:37 AM12/1/18
to MplusAutomation
Dear MplusAutomation users,

I'm pleased to announce that we've released a minor update (v0.7-3) to the package that fixes a few problems and offers new functionality. You can obtain this version using the update.packages() function in R. Details of the update are below.

Best,
Michael

Version 0.7-3
 - feature:     Support use of plausible values for factors in BAYES output using SAVE=FSCORES(NIMP) approach
 - feature:     readModels provides initial support for extraction of SUMMARY OF DATA section, including ICCs in 2-level models. See $data_summary.
 - feature:     Allow input files to have .in or .inp extension to increase compatibility with lavaan lavExport.
 - feature:     Extract residual DSEM outputs containing ^
 - feature:     Initial support for extraction of RESULTS IN PROBABILITY SCALE output. See $parameters$probability.scale from readModels().
 - feature:     prepareMplusData can now hash filenames for multiply imputed data. Hashing is done for individual files, so that as long as all files exist, the order can be re-arranged or imputations can be dropped and still no new data needs to be written (closes issue #53).
 - feature:     prepareMplusData now is more efficient at converting datasets to numeric and  utilizes fwrite to increase speed of writing out datasets (closes issue #54).
 - feature:     new utility function mplusAvailable() attempts to determine whether Mplus is installed and findable on the system.
 - bugfix:      Extract modification indices for thresholds 
 - bugfix:      Abstract invariance testing summary extraction from Caspar van Lissa into a separate function.
 - bugfix:      Fix pred/outcome swap in specific indirect sections
 - bugfix:      Handle spaces in SAVEDATA variable information section in Mplus v8+ (e.g., SAVE=FSCORES in BSEM).
 - bugfix:      Improve parsing of mixture outputs in mixtureSummaryTable.


Christopher Bratt

unread,
Dec 4, 2018, 12:59:50 PM12/4/18
to MplusAutomation
Thank you for the update.

One reduced functionality seems to be that MplusAutomation no longer converts labelled data, or character variables. This was very handy in the previous version. 

For instance, I now get:

Error in .convertData(df) : 
Currently only variables of class: 
numeric, integer, logical, or factor
but found additional class types including: 
labelled

Just to let you know. 

For anyone else getting similar problems: character variables can be converted to numeric in R, for instance with these commands:

data$fact.var <- factor(data$oldvar)
data$newvar   <- as.numeric(data$fact.var)

Variable labels are convenient and often follow the data if you use "haven" to import data from Stata or SPSS, maybe from SAS too. One option to get rid of them is the following:

library(sjlabelled)
data <- remove_all_labels(data)


Christopher Bratt



zack li

unread,
Jan 17, 2024, 5:04:45 AMJan 17
to MplusAutomation

Hi Michael

I am currently utilizing the MplusAutomation package in R for statistical analysis and have found it to be an invaluable tool. However, I have encountered a couple of queries where I believe your expert guidance would be greatly beneficial.

  • In the results obtained through the mplusModeler function, I am interested in retrieving all plausible values for each observation. Could you kindly advise if this information is available in the results list generated by the function? If so, in which specific element of the results list can these values be found?
  • I am also seeking guidance on how to get 'data imputation' command in an .inp file using mplusObject. I would appreciate any insights or examples you could provide on this matter. For your reference, I am including a snippet of my current code below:

    input = mplusObject(TITLE = “test”, 

                        VARIABLE = 

                        "MISSING = all(99999);

                        CLUSTER = N_index;

                        LAGGED = sc(1);",

                        ANALYSIS = 

                        "TYPE = TWOLEVEL RANDOM;

                        ESTIMATOR = BAYES;

                        PROCESSORS = 2;

                        FBITERATIONS = 50000;", 

                        MODEL = 

                        "%WITHIN%

                        fa2|d2 ON d1;

                        fa3|d3 ON d2;

                        fa4|d4 ON d3;

                        fa5|d5 ON d4;

                        fa6|d6 ON d5;

                        fa7|d7 ON d6;

                        sa | sc ON sc&1;

                        logfv2|d2;

                        logfv3|d3;

                        logfv4|d4;

                        logfv5|d5;

                        logfv6|d6;

                        logfv7|d7;

                        logsv | sc;

                        

                        %BETWEEN%

                        d1-d7 sc fa2-fa7 sa logfv2-logfv7 logsv(var1-var22);

                        [d1-d7 sc fa2-fa7 sa logfv2-logfv7 logsv] (mu1-mu22);

     

                        ",

                        MODELPRIORS = 

                        "mu1-mu22 ~ N(0,100);

                        var1-var22 ~ IG(0.001,0.001);", 

                        MODELCONSTRAINT = 

                        "NEW (mu_dd); 

                         mu_dd= MEAN(mu1 mu2 mu3 mu4 mu5 mu6 mu7);

                         NEW (mu_fa); 

                         mu_fa= MEAN(mu9 mu10 mu11 mu12 mu13 mu14); 

                         NEW (mu_logfv); 

                         mu_logfv= MEAN(mu16 mu17 mu18 mu19 mu20 mu21);",

                        SAVEDATA = paste0("SAVE=FSCORES(200 1);FILE = savedata_",con,"_",re,".csv;"),

                        OUTPUT = "TECH1 TECH8;",

                        PLOT = "TYPE = PLOT3;

                        FACTORS = ALL;",#estimated factor scores for all between-level random effects be available for plotting

                        usevariables = c("N_index","sc",'d1', 'd2', 'd3', 'd4', 'd5', 'd6', 'd7'),

                        rdata = Y,

                        autov = TRUE)

    res = mplusModeler(input,dataout = paste0(con,"/threelevel dsem_",con,'_',re,".dat"),modelout = paste0(con,"/threelevel dsem_",con,'_',re,".inp"), run = 1L)


Your expertise and insights into these matters would be greatly appreciated. I am looking forward to implementing these features correctly in my project.

Thank you very much for your time and assistance. I am eagerly awaiting your valuable response.

Reply all
Reply to author
Forward
0 new messages