MRwrite {midrangeMCP}R Documentation

Export the results of the MRtest function.

Description

The x object from a MRtest is written to file arguments.

Usage

MRwrite(x, MCP = "all", extension = "csv", dataMR = "all")

Arguments

x

object from the MRtest functions.

MCP

Allows choosing the multiple comparison test. The defaut is "all". This option will go perform all tests from the MRtest object.

extension

Type of format of the file. Four options "csv", "txt" "xlsx" and "latex". The default is "csv".

dataMR

Allows to choose the results to bee written. Three options are available: "groups", "summary" or "all". The option "groups" writes the treatment mean groups avaluated by the chosen test in the MCP argument. The "summary" writes the descriptive statistics of the response variable. The options "all" should be chosen for both results.

Details

Note that the choice of the tests in the MRwrite function must be in accordance with the tests chosen in the x argument.

Value

MRwrite writes the most important results for the chosen tests in the MCP argument.

Examples

# 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"))

#Export file in latex (Output in Console)
MRwrite(results, MCP = "all", extension = "latex", dataMR = "all")

#Observation: The MRwrite function export
#             only one extension at a time

[Package midrangeMCP version 3.1.1 Index]