ZerosPerGroup {MicrobiomeSurv}R Documentation

This function returns a matrix with rows are Micros and 9 columns containing number and the proportion of zeros per groups of treatments and in total.

Description

This function returns a matrix with rows are Micros and 9 columns containing number and the proportion of zeros per groups of treatments and in total.

Usage

ZerosPerGroup(
  Micro.mat,
  groups,
  week = 0,
  n.obs = n.obs,
  n.control = n.control,
  n.treated = n.treated,
  n.mi = n.mi,
  plot = FALSE
)

Arguments

Micro.mat

Micro matrix (rows are Micros, columns are subjects)

groups

Treatment groups or groups of any binary variables

week

A specific time point. To use when having different time points in the dataset.

n.obs

Number of patients.

n.control

Number of patients in control group or in the first group.

n.treated

Number of patients in treated group or in the second group.

n.mi

Number of taxa.

plot

A boolean parameter indicating if the plot should be shown. Default is FALSE.

Value

A matrix with information of number and the proportion of zeros per groups.

zero.per.group

A matrix with rows are Micros and 9 columns containing number and the proportion of zeros per groups of treatments and in total.

plot

Plot percentage of zeros per group

Author(s)

Thi Huyen Nguyen, thihuyen.nguyen@uhasselt.be

Olajumoke Evangelina Owokotomo, olajumoke.x.owokotomo@gsk.com

Ziv Shkedy

See Also

ZerosPerGroup

Examples


# Preparing data for analysis at OTU level
data(Week3_otu)
data(Week3_response)
Week3_otu = data.frame(Week3_otu)
otu_mat_w3 = t(data.matrix(Week3_otu[ , 1:2720]))
n_obs = dim(otu_mat_w3)[2]
n_control = table(Week3_response$Treatment_new)[1]
n_treated = table(Week3_response$Treatment_new)[2]
n_otu = dim(otu_mat_w3)[1]
# Calculate zeros per groups
zero_per_group_otu_w3 = ZerosPerGroup(Micro.mat = otu_mat_w3,
                                     groups = Week3_response$Treatment_new,
                                     week = 3,
                                     n.obs = n_obs,
                                     n.control = n_control,
                                     n.treated = n_treated,
                                     n.mi = n_otu,
                                     plot = TRUE)


[Package MicrobiomeSurv version 0.1.0 Index]