1

I have run cluster analysis on some time series data using permuco in R. (Permutes the labels of control/treatment conditions and calculates the F statistic as to how likely it is that these time clusters of significant differences occurred by chance.) So far so good.

I have produced a number of plots using the inbuilt function plot.clusterlm that comes with this package. However, the data come from different groups, and the F values on the y axis get rescaled in each plot, i.e. the values and ticks are reset depending on how strong the effects are.

This is problematic, because the different plots based on different cluster analyses are not visually comparable. I would like to rescale the y axis, so that all clusters are visualised along the same F values (0-10 for example).

I haven't been able to do that, and I was wondering if there is a way to pass any additional functions into the plot.clusterlm to do this. This is the usage of the function, but I don't see a way to rescale the y axis. (Although rescaling the x axis is possible by manipulating the nbbaselinepts & nbptsperunit, but that's not what I want...)

    plot(x, effect = "all", type = "statistic",
    multcomp = "clustermass", alternative = "two.sided",
    enhanced_stat = FALSE, nbbaselinepts = 0, nbptsperunit = 1, ...)

If you have any ideas on this, please let me know. Thank you!

vikka
  • 11
  • 2
  • Welcome to Stack Overflow _ I see you tried to edit your post to make it readable but the text has come out one big lump _ The secret on SO is hit the Enter key twice to create a new paragraph _ If you edit the post by hitting Enter twice there will be a space created between paragraphs and it will be more readable ; ) – inputforcolor Nov 11 '19 at 00:30
  • 1
    Hi, Thanks for pointing that out, I've edited it. Please let me know if you have any ideas on the solution. Thanks! – vikka Nov 11 '19 at 11:54

2 Answers2

2

Thanks for using permuco! I opened an issue on GitHub to have a solution for implementing these features. You can expect changes in further releases of permuco.

However, the plot() method shows the F statistic which is not a good measure of effect size. A better measure of effect size is the partial-eta square which is implemented in the afex package

Joseph Wood
  • 7,077
  • 2
  • 30
  • 65
jaromil
  • 41
  • 4
0

In the base R plotting device axes are altered like this:

x<-1:10; y=x*x
# Simple graph
plot(x, y)
# Enlarge the scale
plot(x, y, xlim=c(1,15), ylim=c(1,150))
# Log scale
plot(x, y, log="y")

This is an example from STHDA where you can find many helpful tutorials.

PPK
  • 186
  • 2
  • 7
  • No, this doesn't answer my question. This is the way to do it with the normal plot function, but this is a function inside the permuco library, called plot.clusterlm. This function doesn't take ylim as an argument, and throws the error "slim is not a graphical parameter". This is because it plots F values against time that result from a cluster analysis model, and if F values above a certain value do not exist, it cannot plot them there. Is there a way to coerce this plot to shrink the data to put them on a plot with the y axis tick marks that I specify? I simply cannot find a way to do that. – vikka Nov 14 '19 at 10:53