jasp-stats / jasp-issues

This repository is solely meant for reporting of bugs, feature requests and other issues in JASP.
59 stars 29 forks source link

[Bug]: GLM Time (Pre-Post) as categorical variable #2997

Open obisaga opened 6 days ago

obisaga commented 6 days ago

JASP Version

0.19.1

Commit ID

No response

JASP Module

Mixed Models

What analysis are you seeing the problem on?

GLM

What OS are you seeing the problem on?

Windows 11

Bug Description

The problem is that if I code the variable "time" in GLM as a category (meaning measurement before and after intervention), I get an error "analysis cannot be performed because the variable has less than two factor levels"). Meanwhile, the variable only has two factors "pre" and "post". The variables "group" (case/control) and "gender" (female/male) are all nominal variables and are coded exactly the same - and there no problem occures. I tried already adding a third level of the factor "time" - follow-up, but to no avail.

Expected Behaviour

printscreen_GLM

Steps to Reproduce

1.adding the dependent variable (continuous variable).
2.Then adding the covariates (continuous variables). 3.Adding the nominal categorical variables: gender, group and finally time. The problem occurs only with this variable.

Log (if any)

No response

More Debug Information

No response

Final Checklist

EJWagenmakers commented 5 days ago

@FBartos who should this issue be assigned to? I received the (confidential) data file by email

FBartos commented 5 days ago

I think @JohnnyDoorn is maintainer of the regression module

JohnnyDoorn commented 5 days ago

Hi @obisaga ,

Can you maybe share your JASP file? You can also send it to me by email at (j.b.vandoorn uva.nl) if you prefer. That way I can take a closer look. The analysis should be able to handle factors with 2 levels, but maybe your Time variable only has a single level in your data? Or did you perhaps add any interaction effects?

Cheers, Johnny

EJWagenmakers commented 5 days ago

I already have the data, Johnny. Maybe @boutinb can forward you the email, since I am temporarily locked out of the jasp email account.

JohnnyDoorn commented 5 days ago

Hi @obisaga ,

I just received the data, and I see there is a lot of missingness in your data: for your continuous predictors, there are no valid observations for time=post; since the analysis only considers complete observations (i.e., where it has values for the predictors you specify), it only has "pre-test" observations.

Cheers, Johnny