residualPlot: Make residual plots

Description Usage Arguments Details Value See Also Examples

View source: R/F_residualPlot.R

Description

Make residual plots

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
residualPlot(
  RCM,
  Dim = 1,
  whichTaxa = "response",
  resid = "Deviance",
  numTaxa = 9,
  mfrow = NULL,
  samColour = NULL,
  samShape = NULL,
  legendLabSize = 15,
  legendTitleSize = 16,
  axisLabSize = 14,
  axisTitleSize = 16,
  taxTitle = TRUE,
  h = 0
)

Arguments

RCM

an RCM object

Dim

an integer, which dimension?

whichTaxa

a character string or a character vector, for which taxa to plot the diagnostic plots

resid

the type of residuals to use, either 'Deviance' or 'Pearson'

numTaxa

an integer, the number of taxa to plot

mfrow

passed on to par(). If not supplied will be calculated based on numTaxa

samColour, samShape

Vectors or character strings denoting the sample colour and shape respectively. If character string is provided, the variables with this name is extracted from the phyloseq object in RCM

legendLabSize

size of the legend labels

legendTitleSize

size of the legend title

axisLabSize

size of the axis labels

axisTitleSize

size of the axis title

taxTitle

A boolean, should taxon title be printed

h

Position of reference line. Set to NA for no line

Details

If whichTaxa is 'run' or 'response' the taxa with the highest run statistics or steepest slopes of the response function are plotted, numTax indicates the number. If whichTaxa is a character vector, these are interpreted as taxon names to plot. This function is mainly meant for linear response functions, but can be used for others too. The runs test statistic from the tseries package is used.

Value

Plots a ggplot2-object to output

See Also

RCM

Examples

1
2
3
4
5
6
7
8
9
data(Zeller)
require(phyloseq)
tmpPhy = prune_taxa(taxa_names(Zeller)[1:120],
prune_samples(sample_names(Zeller)[1:75], Zeller))
#Subset for a quick fit
zellerRCMlin = RCM(tmpPhy, k = 2,
covariates = c('BMI','Age','Country','Diagnosis','Gender'),
responseFun = 'linear', round = TRUE, prevCutOff = 0.03)
residualPlot(zellerRCMlin)

RCM documentation built on Nov. 8, 2020, 5:22 p.m.

Related to residualPlot in RCM...