linkf_CI: Confidence intervals for the frequency of host-symbiont...

linkf_CIR Documentation

Confidence intervals for the frequency of host-symbiont association

Description

From the matrix obtained in prob_statistic(), compute the confidence intervals for the frequencies (or residual/corrected frequencies) of the host-symbiont associations using a set of pairs of posterior probability trees of host and symbiont.

Usage

linkf_CI(
  freqfun = "paco",
  x,
  fx,
  c.level = 95,
  barplot = TRUE,
  col.bar = "lightblue",
  col.ci = "darkblue",
  y.lim = NULL,
  ...
)

Arguments

freqfun

Global-fit method. Options are "geoD" (Geodesic Distances), "paco" (PACo) or "paraF" (ParaFit). It should be the same method used to obtain "fx".

x

Matrix produced with prob_statistic() for"geoD" (Geodesic Distances), "paco" (PACo) or "paraF" (ParaFit).

fx

Vector of statistics produced with max_cong() or max_incong for"geoD" (Geodesic Distances), "paco" (PACo) or "paraF" (ParaFit).

c.level

Confidence interval level. Default is 95 (95\%).

barplot

Default is "TRUE", plots the distribution and confidence intervals of the frequencies.

col.bar

A vector of colors for the bars or bar components. By default, "lightblue" is used.

col.ci

A vector of colors for the confidence intervals arrows. By default, "darkblue" is used.

y.lim

Limits for the y axis.

...

Any graphical option admissible in barplot()

Value

A dataframe with associations information (columns 1 and 2), the observed value of the frequencies for these associations (column 3), the mean, the minimum and the maximum value of the frequencies (columns 4, 5 and 6) obtained with the sets of posterior probability trees.

Examples


data(nuc_cp)
N = 10 #for the example, we recommend 1e+4 value
n = 8
# Maximizing incongruence
NPi <- max_incong(np_matrix, NUCtr, CPtr, n, N, method = "paco",
                 symmetric = FALSE, ei.correct = "sqrt.D",
                 percentile = 0.99, diff.fq = TRUE,
                 strat = "parallel", cl = 8)
# Loaded directly from dataset
# THSi <- trimHS_maxI(N, np_matrix, n)
# pp_treesPACo_incong <- prob_statistic(ths = THSi, np_matrix,
#                        NUC_500tr[1:5], CP_500tr[1:5], freqfun = "paco",
#                        NPi, symmetric = FALSE, ei.correct = "sqrt.D",
#                        percentile = 0.99, diff.fq = TRUE, res.fq = FALSE,
#                        below.p = FALSE, strat = "parallel", cl = 8)
LFci <- linkf_CI (freqfun = "paco", x = pp_treesPACo_incong, fx = NPi,
                  c.level = 95, ylab = "Observed - Expected frequency")



Rtapas documentation built on June 22, 2024, 10:47 a.m.