Description Usage Arguments Value Examples
View source: R/alpha.compare.R
This function calculates average of alpha diversity indexes for a specific rarefaction depth, standardize diversity indexes and compare between groups using linear/linear mixed effect model and adjust for covariates.
1 2 3 4 5 6 7 8 9 10 11 12 | alpha.compare(
datlist,
depth,
mapfile,
mapsampleid,
comvar,
adjustvar,
personid = "personid",
longitudinal = "yes",
age.limit = 1e+06,
standardize = FALSE
)
|
datlist |
the list of your dataframe. |
depth |
the rarefaction depth of choice. Depth can be "max" (highest depth) or an order (number) of the depth in the list generated by alpha_rarefaction.py |
mapfile |
mapping file |
mapsampleid |
sample id in the mapping file |
comvar |
variable for comparison |
adjustvar |
variables that need to be adjusted in the model |
personid |
name of variable for person id. Default is "personid" (applicable when longitudinal="yes"). |
longitudinal |
longitudinal data or one time data. Options are c("yes","no"). Default is "yes". |
age.limit |
age upper limit for included samples. Default is 1000000 months (~no upper limit). |
standardize |
standardization of diversity indexes before comparison or not. Default is FALSE. |
list of comparison result matrices and mean diversity of all indexes for each samples (with or without standardization)
1 2 3 4 5 6 7 8 9 | data(alphadat)
data(covar.rm)
covar.rm$sampleid<-tolower(covar.rm$sampleid)
#comparison of standardized alpha diversity indexes between genders adjusting for
#breastfeeding and infant age at sample collection in infants <=6 months of age
alphacom<-alpha.compare(datlist=alphadat,depth=3,mapfile=covar.rm,
mapsampleid="sampleid", comvar="gender",adjustvar=c("age.sample","bf"),
longitudinal="yes", age.limit=6,standardize=TRUE)
alphacom$alphasum[,1:5]
|
Loading required package: gamlss
Loading required package: splines
Loading required package: gamlss.data
Attaching package: ‘gamlss.data’
The following object is masked from ‘package:datasets’:
sleep
Loading required package: gamlss.dist
Loading required package: MASS
Loading required package: nlme
Loading required package: parallel
********** GAMLSS Version 5.2-0 **********
For more on GAMLSS look at https://www.gamlss.com/
Type gamlssNews() to see new features/changes/bug fixes.
There were 50 or more warnings (use warnings() to see the first 50)
id Estimate.genderMale Std. Error.genderMale t value.genderMale
1 chao1 -0.06535198 0.1502276 -0.4350197
2 observed_species -0.14283545 0.1363228 -1.0477741
3 pd_whole_tree -0.13246866 0.1452980 -0.9117031
4 shannon -0.44008064 0.1993104 -2.2080165
Pr(>|t|).genderMale
1 0.66354814
2 0.29474270
3 0.36192504
4 0.02724312
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.