plot.OpenStatsMM: plot for an 'OpenStatsMM' object

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/Plots.R

Description

This function visualises an 'OpenStatsMM' object

Usage

1
2
 ## S3 method for class 'OpenStatsMM'
plot(x, main = "Final Model", ask = FALSE, mfrow = c(2, 2), ...)

Arguments

x

an instance of ‘OpenStatsMM' result from OpenStatsAnalysis(method = ’MM') function

main

a string to be pasted to the title of the plots

ask

see 'ask' in 'par()' function. Default FALSE

mfrow

the screen partition. see 'mfrow' argument in the 'par' function. Default c(2,2) then all plots display in one screen.

...

other parameters that can be passed to the 'plot' function

Details

The plot function creates some visualisations for the linear mixed model framework:

- Residual versus fitted values
- Residual density plot and the normality test p-value
- Residual Q-Q plot
- The density plot of the response variable and the normality test p-value

Value

Not applicable

Author(s)

Hamed Haseli Mashhadi <hamedhm@ebi.ac.uk>

See Also

OpenStatsAnalysis, plot.OpenStatsFE, plot.OpenStatsRR

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
26
27
####################################################################
# Data preparation
####################################################################
#################
# Continuous data - Creating OpenStatsList object
#################
fileCon <- system.file("extdata", "test_continuous.csv", package = "OpenStats")
test_Cont <- OpenStatsList(
  dataset = read.csv(fileCon),
  testGenotype = "experimental",
  refGenotype = "control",
  dataset.colname.genotype = "biological_sample_group",
  dataset.colname.batch = "date_of_experiment",
  dataset.colname.lifestage = NULL,
  dataset.colname.weight = "weight",
  dataset.colname.sex = "sex"
)

#################
#  Optimised Linear Mixed model (MM) framework
#################
MM1_result <- OpenStatsAnalysis(
  OpenStatsList = test_Cont,
  method = "MM",
  MM_fixed = data_point ~ Genotype + Weight
)
print(MM1_result, col = 2, main = "Optimised model")

OpenStats documentation built on Nov. 8, 2020, 5:20 p.m.