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

Balanced Latin-Square Design with UXF #133

Open
A-Ivan opened this issue Jun 15, 2022 · 3 comments
Open

Balanced Latin-Square Design with UXF #133

A-Ivan opened this issue Jun 15, 2022 · 3 comments

Comments

@A-Ivan
Copy link

A-Ivan commented Jun 15, 2022

What would be the best way to use a balanced latin-square design for a study with UXF?

The idea would be to have a pre-defined list with the set order of blocks/conditions for each participant. For instance, if my study has an independent variable with 5 possible values (which we can think of as different block values), this would result in a 5x10 study matrix, one row for each participant which would repeat after participant 10.

The solution I thought, for this same example, would be to use the CSV Experiment Builder script to specify the block order using 10 different csv files and use the participant number (starting from 1 and increasing by 1 with each new participant) and calculate its remainder when divided by 10 to select the respective csv file?

Another solution might be to use a single csv file where each row (10 in total) represents the participant's block order, but I would not be able to use the CSV Experiment Builder script and would need to create my own to feed the date into the session script, correct?

Are these ideas correct and is are there any other solutions?

Thank you.

@jackbrookes
Copy link
Member

jackbrookes commented Jun 15, 2022

Hi, UXF does not have a nice "built in" way of doing this (but it is on the list for long term features. I have done this before, I would suggest that you define your IVs 5 values in the settings .json file, read it as an array/list, then then use some code to generate all possible permutations of them. There are lots of implementations online (google "permutations of array C#").

https://www.chadgolden.com/blog/finding-all-the-permutations-of-an-array-in-c-sharp

Then, you can use a value that you collect in the UI from 1-10 which selects the permutation, just using the integer value as the index to select the permutation

Edit: I see a perfect latin square is slightly different, but you can find source code here

http://euanfreeman.co.uk/balanced-latin-squares/

The principle of indexing the array remains the same.

@A-Ivan
Copy link
Author

A-Ivan commented Jun 15, 2022

Hi Jack,

This is an interesting solution. If you want I may be able to help with creating this feature as I will create it for my own study. I like the solution you gave, especially since when calculating the permutation the order is always the same, so this makes things easier to automatically assign participants their block order without having to worry if it will change each time the permutation is calculated.

The balanced latin square code you provided works well, I will have to make a few modifications though as they missed the part of having to double and mirror the order for odd number of conditions to avoid carryover effects.

p.s. Out of curiosity, do you have an page here on the repository with the list of features that are planned to be implemented?

@jackbrookes
Copy link
Member

p.s. Out of curiosity, do you have an page here on the repository with the list of features that are planned to be implemented?

Unfortunately no! We are still unsure how much resource we will have to work on UXF and implement these new features. But we hope we have some info soon.

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

No branches or pull requests

2 participants