MCPwrite: Export the results of the 'MCPtest' function.

Description Usage Arguments Details Value Examples

View source: R/MCPwrite.R

Description

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

Usage

1
MCPwrite(x, MCP = "all", extension = "csv", dataMR = "all")

Arguments

x

object from the MCPtest functions.

MCP

Allows choosing the multiple comparison test. The defaut is "all". This option will go perform all tests from the MCPtest 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 MCPwrite function must be in accordance with the tests chosen in the x argument.

Value

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# 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 MCPtests package
library(MCPtests)

# Choosing any tests
results <- MCPtest(y = res, trt = "treat", alpha = 0.05,
                   main = "Multiple Comparison Procedures",
                   MCP = c("MGM", "TM"))

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

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

MCPtests documentation built on Dec. 17, 2020, 5:09 p.m.

Related to MCPwrite in MCPtests...