Install midrangeMCP package

Archive.r (R Studio)
install.packages("midrangeMCP")
Console (R Studio)
> install.packages("midrangeMCP")
tentando a URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/midrangeMCP_3.1.zip'
Content type 'application/zip' length 122987 bytes (120 KB)
downloaded 120 KB

package ‘midrangeMCP’ successfully unpacked and MD5 sums checked

icon_CreatingApplication MidrangeMCP Package

icon_CreatingApplication The three main functions:

MRtest Function:

The MRtest function is expressed as follows:

MRtest( y, trt = NULL, dferror = NULL, mserror = NULL, replication = NULL, alpha = 0.05, main = NULL, MCP = “all”, ismean = FALSE)

being:

  • y: vector with the response variables, the desired model or the average of treatments;

  • trt: vector with the levels of the factor under study. If y is an object that receives a model of the functions lm () or aov (), in the argument trt you must indicate which the model component represents the effect of the treatments. For example, if y <- aov (vr ∼ treat), then trt = “treat”. The default trt = NULL is function protection if the user forgets to enter some information to that argument;

  • dferror: degree of freedom of the residue. This option will only be needed when the argument y is a vector with the response variables or vector of treatment means. So the default for this argument is dferror = NULL;

  • msferror: mean square of the residue. This option is necessary only when the argument y is a vector with the response variables or vector of treatment means. So the default for this argument is mserror = NULL;

  • alpha: level of significance adopted in the tests. The default is alpha = 0.05;

  • replication: number of treatment repetitions. If the data are unbalanced, the harmonic mean of these repetitions must be reported. This argument should be only when the argument is a vector of means or the repetitions of the main treatments unbalanced. The default is replication = NULL;

  • main: title of your analysis;

  • MCP: allows you to choose the desired multiple comparison test. The options are: “MGM”, “MGR”, “SNKM”, “TM” and “all”. The latter is the default, which results in calculate the four tests at once. If you want some tests, but not all, this argument can be concatenated with the desired options. For example, if want to perform the MGM and TM tests, just use MCP = c (“MGM”, “TM”)

  • ismean: logical argument. If ismean = TRUE, it is because the argument y is a vector of treatment means. Otherwise, ismean = FALSE.

MRbarplot Function:

The MRbarplot function is expressed as follows:

MRbarplot(x, MCP = “all”, col = heat.colors(10), horiz = FALSE, …)

being:

  • x:MRtest function object;

  • MCP: allows you to choose the desired multiple comparison test. The default is “all”. This option will perform all the tests that were chosen on the object MRtest. If you want some of the tests used on this object, you can concatenate it. See the MRCP function MCP argument;

  • col: allows you to choose the color of the graph bars. The default is heat.colors (10). The value 10 means the desired number of colors. If you want the graph to be colored on the black and white scale, you can choose the gray.colors (10) option;

  • horiz: choose the direction of the bars. The default is horiz = FALSE, that is, bars vertically. If you choose horiz = TRUE, the bars will be plotted horizontally;

  • … the function allows the user to add more arguments to the function barplot.

MRwrite Function:

The MRwrite function is expressed as follows:

MRwrite(x, MCP = “all”, extension = “csv”, dataMR = “all”)

being:

  • x: MRtest function object;

  • MCP: allows you to choose the desired multiple comparison test. The default is MCP = “all”. This option will perform all the tests that were chosen in the MRtest object. If you want some of the tests used on this object, you can concatenate it. See the MRCP function MCP argument;

  • extension: type of file format. There are four options: “csv”, “txt”, “xlsx” and “latex”. The default is “csv”.

  • dataMR: allows you to choose the results to be exported. There are three options: “groups”, “summary” or “all”. The “groups” option exports groups of treatment averages evaluated by choosing the test in the MCP argument. The “summary” option exports the descriptive statistics for the response variable. The option “all” exports both results.

icon_CreatingApplication Tests:

Tukey midrange test (TM test) :

Os passos para a aplicação dos teste são:

  1. As médias dos tratamentos devem ser ordenadas: \(\overline{Y}_{1}.,\overline{Y}_{2}.,..,\overline{Y}_{n}\)

  2. A diferença mínima significativa por:

    \[ \Delta_{n} = \overline{q}_{\alpha/2;n;v} \dfrac {\sqrt{QME} }{r} + \dfrac {1 }{\sqrt{2n}} \sqrt{\dfrac {QME} {r}} \]


  3. Calcula-se o valor da estatítica, determinando-se \(k\) e \(\overline{Y}\) como descrito anteriormente, por:

    \[\overline{r}_{n}= \dfrac {\overline{Y}_{1}+\overline{Y}_{n}} {2}-\overline{Y};\]

  4. Se $_n _n $, então as \(n\) médias serão consideradas não diferentes. Caso contrário, vai para o passo 5, considerando \(m = n\) médias;


  5. Faça \(m = m-1\);


  6. Considerando os grupos de médias:\(\overline{Y}_{(1)},\overline{Y}_{(2)},...,\overline{Y}_{(m)};\overline{Y}_{(2)},\overline{Y}_{(3)}...,\overline{Y}_{(m+1)};...;\overline{Y}_{(n-m+2)},...,\overline{Y}_{(n)};\) o número de grupos é dado por \(l=n-m+1\);


  7. Para cada um do grupos com \(m\) médias, é obtido

    \[\overline{r}_m= \dfrac {}{}\]


  8. Para cada grupo obtido e marcado como divisível, considere m o número de médias do grupo relacionado, devendo-se usar como diferença mínima significativa dada por:

    \[\Delta^*_n=\overline{q}_{\alpha/2;n.v} \sqrt{\dfrac{QME}{r}}; \]


  9. Se \(\mid \overline{r}_m \mid \leq \Delta^*_n\), então as \(m\) médias não diferem estatisticamente; caso contrário elas são diferentes nesse estágio;


  10. Repete-se o processo para todos os \(l\) grupos de \(m\) médias, refazendo-se os passos 7, 8 e 9. Terminado a comparação de todos os \(l\) grupos de \(m\) médias, retorna-se ao passo 5, atualizando-se o valor de \(m\). Isso deve ser repetido enquanto $m $.

GUI

Tests

Tukey midrange test (TM test)

SNK midrange test (SNKM test)

Mean grouping based on midrange (MGM test)

Mean grouping based on range (MGR test)

Performance and evaluation of the tests

Application and interpretation of tests