The x
object from a MRtest
is written to file arguments.
MRwrite(x, MCP = "all", extension = "csv", dataMR = "all")
x | object from the |
---|---|
MCP | Allows choosing the multiple comparison test.
The defaut is "all". This option will go perform all tests
from the |
extension | Type of format of the file. Four options
|
dataMR | Allows to choose the results to bee written. Three options are
available: |
MRwrite
writes the most important results for the chosen
tests in the MCP
argument.
Note that the choice of the tests in the MRwrite
function must be in accordance with the tests chosen
in the x
argument.
# Simulated data (completely randomized design) rv <- c(100.08, 105.66, 97.64, 100.11, 102.60, 121.29, 100.80, 99.11, 104.43, 122.18, 119.49, 124.37, 123.19, 134.16, 125.67, 128.88, 148.07, 134.27, 151.53, 127.31) # Treatments treat <- factor(rep(LETTERS[1:5], each = 4)) # Anova res <- aov(rv~treat) # Loading the midrangeMCP package library(midrangeMCP) # Choosing any tests results <- MRtest(y = res, trt = "treat", alpha = 0.05, main = "Multiple Comparison Procedures", MCP = c("MGM", "TM"))#> MCP's based on distributions of the studentized midrange and range #> #> Study: Multiple Comparison Procedures #> #> Summary: #> Means std r Min Max #> A 100.87 3.40 4 97.64 105.66 #> B 105.95 10.33 4 99.11 121.29 #> C 117.62 9.02 4 104.43 124.37 #> D 127.97 4.74 4 123.19 134.16 #> E 140.30 11.42 4 127.31 151.53 #> #> Mean Grouping Midrange Test #> #> Statistics: #> Exp.Mean CV MSerror Df n Stud.Midrange Ext.DMS Int.DMS #> 118.542 7.08182 70.47488 15 5 1.089968 5.90246 4.575105 #> #> Groups: #> Means Groups #> E 140.30 g1 #> D 127.97 g2 #> C 117.62 g3 #> B 105.95 g4 #> A 100.87 g4 #> #> Tukey Midrange Test #> #> Statistics: #> Exp.Mean CV MSerror Df n Stud.Midrange Ext.DMS Int.DMS #> 118.542 7.08182 70.47488 15 5 1.089968 5.90246 4.575105 #> #> Groups: #> Means Groups #> E 140.30 g1 #> D 127.97 g2 #> C 117.62 g3 #> B 105.95 g4 #> A 100.87 g4#Export file in latex (Output in Console) MRwrite(results, MCP = "all", extension = "latex", dataMR = "all")#> Table in latex of results of the MGM test #> #> % latex table generated in R 4.0.3 by xtable 1.8-4 package #> % Sun Apr 25 15:34:18 2021 #> \begin{table}[ht] #> \centering #> \begin{tabular}{lrl} #> \hline #> trt & Means & Groups \\ #> \hline #> E & 140.30 & g1 \\ #> D & 127.97 & g2 \\ #> C & 117.62 & g3 \\ #> B & 105.95 & g4 \\ #> A & 100.87 & g4 \\ #> \hline #> \end{tabular} #> \end{table} #> #> #> Table in latex of results of the TM test #> #> % latex table generated in R 4.0.3 by xtable 1.8-4 package #> % Sun Apr 25 15:34:18 2021 #> \begin{table}[ht] #> \centering #> \begin{tabular}{lrl} #> \hline #> trt & Means & Groups \\ #> \hline #> E & 140.30 & g1 \\ #> D & 127.97 & g2 \\ #> C & 117.62 & g3 \\ #> B & 105.95 & g4 \\ #> A & 100.87 & g4 \\ #> \hline #> \end{tabular} #> \end{table} #> #> See yours tables in Console #> Format: latex#> $`Result of tests` #> $`Result of tests`$group.MGM #> % latex table generated in R 4.0.3 by xtable 1.8-4 package #> % Sun Apr 25 15:34:18 2021 #> \begin{table}[ht] #> \centering #> \begin{tabular}{rlrl} #> \hline #> & trt & Means & Groups \\ #> \hline #> 1 & E & 140.30 & g1 \\ #> 2 & D & 127.97 & g2 \\ #> 3 & C & 117.62 & g3 \\ #> 4 & B & 105.95 & g4 \\ #> 5 & A & 100.87 & g4 \\ #> \hline #> \end{tabular} #> \end{table} #> #> $`Result of tests`$group.TM #> % latex table generated in R 4.0.3 by xtable 1.8-4 package #> % Sun Apr 25 15:34:18 2021 #> \begin{table}[ht] #> \centering #> \begin{tabular}{rlrl} #> \hline #> & trt & Means & Groups \\ #> \hline #> 1 & E & 140.30 & g1 \\ #> 2 & D & 127.97 & g2 \\ #> 3 & C & 117.62 & g3 \\ #> 4 & B & 105.95 & g4 \\ #> 5 & A & 100.87 & g4 \\ #> \hline #> \end{tabular} #> \end{table} #> #> #> $`Descriptive Statistics` #> % latex table generated in R 4.0.3 by xtable 1.8-4 package #> % Sun Apr 25 15:34:18 2021 #> \begin{table}[ht] #> \centering #> \begin{tabular}{rlrrrrr} #> \hline #> & trt & Means & std & r & Min & Max \\ #> \hline #> 1 & A & 100.87 & 3.40 & 4.00 & 97.64 & 105.66 \\ #> 2 & B & 105.95 & 10.33 & 4.00 & 99.11 & 121.29 \\ #> 3 & C & 117.62 & 9.02 & 4.00 & 104.43 & 124.37 \\ #> 4 & D & 127.97 & 4.74 & 4.00 & 123.19 & 134.16 \\ #> 5 & E & 140.30 & 11.42 & 4.00 & 127.31 & 151.53 \\ #> \hline #> \end{tabular} #> \end{table} #>#Observation: The MRwrite function export # only one extension at a time