gramm icon indicating copy to clipboard operation
gramm copied to clipboard

Grouping variable to display meaningful errorbars

Open romainligneul opened this issue 6 years ago • 1 comments

Hi Pierre,

I was wondering whether you foresee any method which would make me able to automatically group observations into "individuals", in order to have correct errorbars when plotting for eg SEMs.

Imagine that I have 3 repeated observation per individual, per condition. The default input method of gramm doesn't allow me to automatically average these 3 repeated observations, does it?

Cheers,

Romain

romainligneul avatar Oct 17 '18 12:10 romainligneul

Salut Romain,

To get what you want the only way is to provide gramm with the per-individual per-condition means. The good news is that if your data is already organized for gramm use (as a table or as something that is very close to a table) you can get a new table containing the desired means in one line of code using Matlab's rowfun() using the 'GroupingVariables' argument. For some representations however, you could use the 'group'argument in gramm, for example if you wanted to represent per-individual per-condition averages directly (i.e. not making CIs over subjects) but didn't want to have different colors/facets/etc per individual.

I hope that helps !

Pierre

piermorel avatar Oct 17 '18 19:10 piermorel