Mixed Models Module

Everything related to the development of modules in jamovi
User avatar
jonathon
Posts: 2613
Joined: Fri Jan 27, 2017 10:04 am

Re: Mixed Models Module

Post by jonathon »

if you drop this on github somewhere, i can take a look. are you running the most up-to-date jmvtools and jamovi?

it looks like jmvtools is providing a less than helpful error message, so that's something we should address.

cheers

jonathon
User avatar
mcfanda@gmail.com
Posts: 457
Joined: Thu Mar 23, 2017 9:24 pm

Re: Mixed Models Module

Post by mcfanda@gmail.com »

Hi, another question: what is the logic behind the function .init() in the module.b.R. In the examples the code is executed usually in .run(), but I see some of the jmv modules (such as ANCOVA) have the .init() function before .run(). I'm using ANCOVA as a base for another module and I see that the output tables I define and populate in .run() do not get updated when the user changes some options. Some debugging shows that when the user changes some of the options only .init() is run, for some other options both .init() and .run() are executed. I cannot come around the the logic here. Thanks
User avatar
jonathon
Posts: 2613
Joined: Fri Jan 27, 2017 10:04 am

Re: Mixed Models Module

Post by jonathon »

so most of the time `init()` isn't required, as the results objects, rows in tables, etc. can all be generated by the `.r.yaml` file.

however, there are times where the number of rows in a table, or the number of columns must be determined by the analysis itself. in these cases, tables/images/rows/columns need to be created/added in the init phase.

after the init phase, the values from *last* time the analysis was run are copied across to the new results objects/tables (if a value is no longer valid, this copying can be prevented by using the 'clearWith' property).

then the run phase begins (`.run()` is called).

however, there is a property in the .a.yaml file (i think) called `completeWhenFilled`. if this is 'true', and all the tables/images/results are filled in, then it concludes that the analysis is complete, and it doesn't need to begin the run phase. so, depending on what you want, you may want to remove this property, or you may want to make more use of `clearWith`s ... you probably want the latter.

makes sense?

feel free to start a new thread in future if it's a new question too.

cheers

jonathon
User avatar
mcfanda@gmail.com
Posts: 457
Joined: Thu Mar 23, 2017 9:24 pm

Re: Mixed Models Module

Post by mcfanda@gmail.com »

thanks, it makes perfect sense
User avatar
jonathon
Posts: 2613
Joined: Fri Jan 27, 2017 10:04 am

Re: Mixed Models Module

Post by jonathon »

good that you ask. will prompt me to document some of these things properly!

jonathon
User avatar
mcfanda@gmail.com
Posts: 457
Joined: Thu Mar 23, 2017 9:24 pm

Re: Mixed Models Module

Post by mcfanda@gmail.com »

Hi
I get back to the init() problem. My situation is the following: Because the estimation of the model can be time consuming, I'd like the module to estimate it only when it is necessary. For instance, after the model has been estimated by setting the input variables, there is no need to estimate it again if the user asks for the plots.

Now, if the option completeWhenFilled is false, everything is re-run any time the user changes something in the UI. If completeWhenFilled is true, the model is estimated and the corresponding tables are filled in the first run, but when the user changes something later on in the UI, the results tables are empty and nothing happens, even if the user changes some UI filed which is associated with the results tables by a "clearWith:" statement
User avatar
jonathon
Posts: 2613
Joined: Fri Jan 27, 2017 10:04 am

Re: Mixed Models Module

Post by jonathon »

Is it possible for you to commit this somewhere? i'll see if i can figure out why clearWith isn't working. we make use of clearWith *a lot*.
User avatar
mcfanda@gmail.com
Posts: 457
Joined: Thu Mar 23, 2017 9:24 pm

Re: Mixed Models Module

Post by mcfanda@gmail.com »

sure, I just pushed it on
https://github.com/mcfanda/jamovi_mixed
User avatar
jonathon
Posts: 2613
Joined: Fri Jan 27, 2017 10:04 am

Re: Mixed Models Module

Post by jonathon »

thanks. can you attach an .omv file with an example of an analysis with this module?

i'm not that familiar with mixed models

with thanks
Post Reply