gamlj / gamlj Goto Github PK
View Code? Open in Web Editor NEWGAMLj: GLM, Mixed, Generalized and Generalized mixed models for jamovi
GAMLj: GLM, Mixed, Generalized and Generalized mixed models for jamovi
it looks great BUT
my data is iin format where freq has number of target responses and Nmax has numbeer of alternatiives
this could be entered as freq rows with cat =1 and Nmax - freq rows with cat =0, where cat is the binary variable
in glmer ine can bind (freq,Nmax) as proprotion
is there any way one can do this in gamlj
i love jamovi - although exportingresults in EXCEL would also be nice
In admiration
Diana
Hi, I have a question.
How to make this plot ?
URL is "https://mcfanda.github.io/gamlj_docs/examples/mixed1/scat2.png"
Is there any reason that the Generalized Mixed Models menu doesn't feature a negative binomial option, but the Generalized Linear Model does? Could this option be added to the GMM section? Alternatively, could a negative binomial distribution be added to the custom distribution menu so that it could be specified there?
First of all, thank you for the great package.
I found that this package is tremendously useful, but I found a problem when I tried to run the script generated on Jamovi directly on R.
I am wondering if GAMLj is only running on Jamovi or there is a way to use GAMLj on R directly.
If there is a way to use GAMLj on R directly, can you provide more detailed instruction?
Thank you.
Hi Marcello,
OS: Win7 Pro Ita; jamovi 0.9.0.5; GAMLj 0.9.8.
With "Mixed Models: Repeated measure designs", the inclusion of a component for Random Effects produces the following error (see screenshot):
name space 'rlang' 0.1.1 is already loaded, but> = 0.1.2 is required
Thank you for your time.
Cheers,
Maurizio
Probably the plots are mixed up, I suspect that the mean is the last one and mean+sd is the middle one (according to plot titles they are supposed to be in increasing order)
Hi there,
I'm using gamljGLM
and want to modify the plot using ggplot functions. I therefore tried extracting the plot object by using descPlot$plot
and then adding the ggplot functions. However, this fails with non-numeric argument to binary operator
error.
Here's my data: self_adherence.xlsx
library(readxl)
library(gamlj)
self_adherence_data <- readxl::read_xlsx("self_adherence.xlsx")
## save model and plot to object p
p <- gamljGLM(self_adherence_data,
formula = formula("self_adherence ~ day_in_july"),
plotError = "ci",
plotHAxis = "day_in_july")
## run p to get the plot
## extract plot object from p and add xlab() function to edit title of x axis
p$descPlot$plot + xlab("whatever_x_title")
This gives error: non-numeric argument to binary operator
Furthermore, when I use is.ggplot()
on p$descPlot$plot
I get FALSE
:
> is.ggplot(p$descPlot$plot)
[1] FALSE
Otherwise, when I test the type
of p$descPlot$plot
it returns that it's an environment
and not list
> typeof(p$descPlot$plot)
[1] "environment"
R Version: 3.6.3
gamlj version: 2.0.5
jmv version 1.2.23
jmvcore version 1.2.23
jmvtools version 1.3.3
Any ideas for why it's not being treated as a ggplot object?
Thanks,
Emmanuel
Note. Numer of Obs
--> Number of Obs
Hi,
I want to run a Generalized Mixed Model on Jamovi with a continuous IV and a repeated measures continuous DV. However, it seems like we can only use categorical dependent variables. Is it possible to take a continuous variable as DV in the Generalized Mixed Model?
Hi,
we just came across an issue with GAMLJ freezing up. We tried to set up a mixed-effect model with 11 covariates, two factors and two cluster variables from ~400 lines of data. Jamovi uses over 1GB of RAM and freezes up.
Using the latest version from github (1.0.4), generating a plot (covariate on horizontal axis, factor as separate lines) in GLM analysis works fine. But when an interaction term is added (covariate * factor), the plot does not update.
When I force an update to the plot (by ticking un-ticking observed scores for y axis), an updated correct plot is generated.
This issue also existed in 1.0.3
Syntax
gamlj::gamljGLM(
data = data,
dep = "DV",
factors = "Condition",
covs = "moderator",
modelTerms = list(
"Condition",
"moderator",
c("Condition", "moderator")),
contrasts = list(
list(
var="Condition",
type="dummy")),
plotHAxis = "moderator",
plotSepLines = "Condition",
scaling = list(
list(
var="moderator",
type="centered")))
Loving this newly found module for jamovi. I have overdispersed count data to analyze using log-Poisson, but I also need to condition for random effects of a particular cluster variable. I see that the former can be controlled in Generalized Linear Models and the latter in Generalized Mixed Models, but I wonder is there a way I can run them both in the same evaluation?
In GAMLj's "Mixed Models" and "Generalized Mixed Models" menus, selecting either "cluster-based centered" or "cluster-based standardized" scaling returns the error "arguments must have same length". No errors occur when selecting "centered", "standardized", or "none".
Perhaps the cluster-based options should be renamed to avoid any spaces? (e.g., "cluster-based-centered" or "ClusterBasedCentered").
This is from Jamovi 1.2.2 with GAMLj 2.0.4 on Windows.
Looking at the syntax, this works fine:
gamlj::gamljMixed(
formula = Empowerment ~ 1 + LMX+( 1 | Team ),
data = data,
scaling = list(
list(
var="LMX",
type="standardized")))
But this returns the error:
gamlj::gamljMixed(
formula = Empowerment ~ 1 + LMX+( 1 | Team ),
data = data,
scaling = list(
list(
var="LMX",
type="cluster-based standardized")))
Hi,
I try to use the Multinomial model following the example you provide here https://mcfanda.github.io/gamlj_docs/gzlm_example1.html#simple_multinomial_model but I can't slide "prog" in "Dependant variable" because the module expects a continuous variable (ruler symbol) and "prog" is a nominal variable (Venn diagram).
Could you please tell me how you managed to get it done in your screen capture (I use the lastest versions of jamovi and GAMLj) ?
And thank you very much for your work :)
jamovi version: 0.9.6.7 (same issue on version - 0.9.5.17)
GAMLj version: 1.0.5
OS: Mac OS 10.14.4
When defining a model with a second degree polynomial by increasing the degree in the Components field under the Fixed Effects section, the term is added successfully to the Model Terms field (both as a main effect and as part of an interaction term), but the model fails with the following message at the top of the output section:
'x' must be a character vector or a list of NULL or raw vectors
It looks like it might be having some trouble converting the selected and superscripted number to the actual polynomial degree to be used. I'm including a screenshot with the extended debug message.
I don't know whether purposefully or not, but warning for singular fits is not displayed when fitting mixed models.
Love the module! So much more accessible than PROCESS. I was working on a mediation model for a publication, but I was wondering if there are any plans to add an overall effect size of the model ( R squared) to the output. Or is it in there and I am just missing it?
lf.createContrasts for 'simple' creates a treatment contrast, but the lf.contrastLabels function for 'simple' returns simple differences of neighboring levels (code is same as for 'dummy' - by accident?) - i.e., contrast weights and labeling does not correspond to each other. On the pasted image, see factor 'StimPrevDelta1C', compare the label in the fixed effects table, 2nd column with the weights in the Contrast Coefficients table. This can cause some trouble I think.
First of all, thanks for the great module.
I want to make sure I'm replicating my analyses on SPSS properly (for all my SPSS using collaborators...unfortunately).
In SPSS MIXED, you can specify the repeated covariance structure and the random effect covariance structure. I see that there are two options either VC or UN in this module. However, I am not replicating my results across both platforms. I wonder if it has to do with the repeated covariance that SPSS offers? I don't see that this module specifies this, or is it within lmer somewhere that I'm not seeing? Any insight would be helpful...
For recent versions of jamovi running GAMLj (e.g., jamovi 1.2.19), If I attempt to run even the simplest GAMLj analysis (generalized linear model with 1 dv and 1 iv), I get the following errors: "jamovi-engine.exe has stopped working", "This analysis has terminated, likely due to hitting a resource limit".
(I'm using Windows 10. I've tried uninstalling then reinstalling GAMLj but that did not help. The problem is only happening with GAMLj. Other aspects of jamovi are working fine.
Hello Marcello,
thank you for the great package. It was quite useful for me when teaching students about data analysis and statistics.
We discovered the following issue:
Trying to plot the results of a glm with a variable which has a space character in the name leads to the following error message:
'cannot coerce class "try-error" to a data.frame'.
Cheers,
Vladislav
Steps to reproduce:
gamlj version 2.0.0, jamovi version 1.2.0
Hi @mcfanda,
from RStudio I can not install gamlj with this message:
Installation failed: Invalid comparison operator in dependency: emmeans (>=1.2.0)
Thanks for your help.
Cheers,
Maurizio
In a mixed model, I had a 4-level factor with poly contrasts and a 2-level factor. I inspected the simple effects of the 4-lvl with the 2-lvl as a moderator. The labels of the contrasts are ordered cubic, linear, quadratic, while all the other columns are ordered linear, quadratic, cubic, as expected.
(PS: I checked the stats against emmeans by the way, and it appears that it gives the same t-stat, df and p-value with mismatching se and estimate. emmeans uses se-s that differ across contrasts, while for car the se-s are identical. It appears that car and emmeans reach the same conclusion via different paths. It's vaguely related but I thought that you might as well find it interesting.)
Hi!
Very glad that you hav built this module!
I have a question, why only categorical and ordinal variables are allowed as Factors/Predictor Variables? It is not possible to use numeric variables?
Thank you!
Burak
It does not currently seem possible to add control predictors to LMMs, this is useful for complex models.
Great work so far!
Best,
Tarandeep
Hi,
Would it be possible to add non-linear options and model comparisons (e.g. linear vs exponential or logarithmic and squared)?
Thanks for a great job with gamlj!
Hi
I am trying to run simple effects with GAMLj module. However, the following error message appears in screen;
Refine the model or the covariate conditioning(if any)
I attached "simple.omv" file
simple.zip
.
Could you check it for me?
Oh another question ^^ When do I expect to see SEM module in jamovi ?
Cheers
Seol
So in the files glm.events.js, gzlm.events.js, mixed.events.js, in the method updateScaling(....)
, the first line currently is var currentList = context.cloneArray(ui.contrasts.value(), []);
but my feeling is that it should be var currentList = context.cloneArray(ui.scaling.value(), []);
(edited)
This occurs in all three files.
The effect in the use of GAMlj is the following:
If you change the scaling from the default 'centered' to something else, and then click the options away, when you return to the analysis it will rerun using the default scaling (even though the UI still specify's the new scaling)
Hi,
Trying to run a mixed effect model on a small data set I have but am getting the following warning: "Some of the coefficients cannot be estimated because they are perfectly correlated with other coefficients in the model." with the AIC output showing as -199.592.
The data is from a within-within design (crossover).
Mixed_effect_data_SH.xlsx
Any advice on dealing with this data?
Best,
Scott
Hi,
I really like GAMLj and its features and I am always happy to use it. But there is one feature, in regards to graphs plotting, that would be a great asset.
When plotting graphs, there is an option to display CIs, however, there are no CIs plotted for slopes... Would it be possible to plot CI bands (in the same fashion as one would see in case of plotting regression line and it CI in scatter plots) for slopes too? It would make it very easy to interpret the resulting models.
So far I am using homebrewed R script to draw them, which is a bit too much clumsy solution. Please, see an example of what I mean below.
Dots indicate the mean, error bars represent the 95% CI of the mean values, semi-transparent bow-tie areas indicate the 95% CI of the fixed effect of the difference.
Hi,
Thanks for the excellent package for jamovi.
Do you think it would be feasible to add residuals analysis?
I know jamovi cannot populate new columns with data from a given analysis (so far), but I am currently running an analysis, where mean values of my DV do not change with an increase of my IV. However, based on visual inspection of the produced figure, CIs are widening on one side of the graph. Therefore I suspect heteroscedasticity in my data. I would like to test this by analysing residuals, and I would prefer not to jump to R to do so.
Thanks!
I am running a 'conditional mediation', and I think the output is awesome, thanks a lot for developing this for Jamovi (I normally run it via PROCESS 3.4 in SPSS).
In PROCESS, there is an option to get the pairwise contrasts, allowing you to compare the differences for each level of my moderator (I have a categorical moderator with 3 levels).
Would it be possible to integrate that here too? Otherwise, I have to create extra dummies for each comparison, which takes time.
Thanks in advance.
Jan
I love this package. I am trying to compare the output to SPSS and R base and car ANOVA. All looks good, except for the marginal means in both the general and generalized linear models. For a factorial ANOVA the estimated means for the cells have the correct numbers, but the labeling is incorrect (means are indicated for the incorrect cells). I have compared the results for two separate data set to both SPSS and R with the emmeans
package.
The estimated cell means also do not match with the Effects Plot.
Hi,
As I state in the title: whenever I re-open a model, the fixed effects, covariate scaling and factor coding revert to default. In my case, I want to include a covariate in the fixed effects, and it disappears every time I load the analysis, and the covscaling factorcoding specs also get back to their defaults.
Best,
Balázs
Thank you for your great module. Are you planning on doing assumption checks for mixed models?
The number displayed at the AIC seems to be what the lme4::lmer() %>% summary() textual output displays as "REML criterion at convergence". The result of extractAIC() does not match (I think this should yield the correct AIC).
Hi
Thanks for your fantastic module, GAMLj. ^^
Do you have any plan to develop 'Structural Equation Model' module in the future like SEM in the JASP program?
Best
Seol
Story: As a user I want to tell apart the different functions of Jamovi easily.
Problem: GAMLj uses the generic icon
Possible Solution: Design an icon for GAMLj
I could take on the task (or peers from opensourcedesign). Do you have any ideas of how an icon for GAMLj might look like? I though of a similar design as the regression one.
I chanced upon a moderation analysis you did on exercise and age. I saw that your GLM produced a simple effect table that included the slope of the regression line at -1 SD, +1 SD AND the mean of the moderator variables. I did the same analysis but my own simple effect table generated doesn't show the slopes for the regression line at different SD units of the moderator variables.
can anyone help out?
In plots, when having a factor on the x-axis (in GLM), the levels are sorted alphabetically, instead of (what I expected) sorted based on the sorting of the levels of the variable.
levels(psych::affect$Study)
#> [1] "maps" "flat"
m <- gamlj::gamljGLM(
data = psych::affect,
dep = "traitanx",
factors = "Study",
covs = "neur",
modelTerms = c("Study","neur", "Study","neur"),
plotHAxis = "Study",
plotSepLines = "neur"
)
#> Loading required namespace: jmvcore
#> [1] "init"
#> [1] "run"
#> [1] "anova and parameters have been estimated"
ggplot2::ggplot_build(m$descPlot$plot)$layout$panel_params[[1]]$x.labels
#> [1] "flat" "maps"
The GLM intercept seems to be miscomputed as it differs when computed with Regression/Linear Regression vs. Linear Models/General Linear Model in Jamovi. All the other predictors are estimated correctly.
Jamovi: v.1.2.25
gamlj: v.2.0.5
Also, it would be super nice to have the ANOVA Omnibus test for the intercept as well!
This is an example:
Firstly, I want to congratulate you for having developed the excellent module for the jamovi software.
Secondly, I want to ask you to include in the GAMLj module an option to combine variables. In R, the function is given by the cbind command.
combined.vars = cbind (dataframe$var1, dataframe$var2)
It works in the same way as the POOL command that is used by syntax in SPSS.
Third, until the above can be developed, please, show me if there is an option in the module in its current version to combine variables.
Best regards,
Alejandro
Hi,
For Mixed Models, at the Fixed Effects Plots panel, if I tick Obseved scores and specify a factor for "separate plots", all observations appear on all of the plots.
Best,
Balázs
Dear Marcello,
Simple effects were working fine in the previous version of GAMLJ, however, currently, the estimates are based off the wrong values. It compares the estimates against 0, instead of against the value of the control condition (my reference group), see image for my context.
I hope this is an easy fix
Hi
Could you provide the results of the statistical testing(chi-square testing) about Random Component(intercept and slopes) in the Mixed model?
Thanks in advance. ^^
Best Regards
Seol
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.