Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix simdat_crossed for between-subject/between-item factors #66

Merged
merged 3 commits into from
Feb 16, 2024

Conversation

jschepers
Copy link
Contributor

Hello,

I noticed a bug in the simdat_crossed function for factors that are both between-subject and between-items.

Example:

data = DataFrame(MixedModelsSim.simdat_crossed(2,4; subj_btwn = Dict(:cond => ["levelA","levelB"]), item_btwn = Dict(:cond => ["levelA","levelB"])))

For this function call, I would expect a design in which every subject (and every item) is only in one condition i.e. levelA or levelB.
However, one gets the following result:
grafik

@behinger and I adapted the simdat_crossed function for cases with between-subject/between-item factors and added new tests.

@behinger
Copy link
Collaborator

bump @palday, maybe you can have a look if you have time

src/simdat.jl Outdated Show resolved Hide resolved
Copy link

codecov bot commented Feb 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (fe3b36a) 95.49% compared to head (5ccbeb2) 95.76%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #66      +/-   ##
==========================================
+ Coverage   95.49%   95.76%   +0.26%     
==========================================
  Files           4        4              
  Lines         111      118       +7     
==========================================
+ Hits          106      113       +7     
  Misses          5        5              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@palday palday left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some formatting and efficiency suggestions, but overall looks good. Can you also bump the version in Project.toml to 0.2.8?

src/simdat.jl Outdated Show resolved Hide resolved
src/simdat.jl Outdated Show resolved Hide resolved
src/simdat.jl Outdated Show resolved Hide resolved
src/simdat.jl Outdated Show resolved Hide resolved
src/simdat.jl Outdated Show resolved Hide resolved
test/simdat.jl Outdated Show resolved Hide resolved
test/simdat.jl Outdated Show resolved Hide resolved
test/simdat.jl Outdated Show resolved Hide resolved
test/simdat.jl Outdated Show resolved Hide resolved
test/simdat.jl Outdated Show resolved Hide resolved
@jschepers
Copy link
Contributor Author

some formatting and efficiency suggestions, but overall looks good. Can you also bump the version in Project.toml to 0.2.8?

Thank you for the useful suggestions, especially regarding efficiency. I committed all the suggestions.
It looks like the version was already bumped to 0.2.8. (080910f) but there has been no new release since then.

Copy link
Member

@palday palday left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI failure is unrelated and I can't reproduce locally, so LGTM!

@palday palday merged commit b8d6b75 into RePsychLing:main Feb 16, 2024
8 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants