Question: How to transfer non numeric enrichment factor to numeric in RDA analysis
gravatar for Ginsea Chen
3.4 years ago by
Ginsea Chen130
Chinese Academy of Tropical Agricultural Sciences, Danzhou, China
Ginsea Chen130 wrote:

Dear all I tried to use vegan of R to perform RDA analysis for 16s rDNA datasets, while my enrichment factor is not numeric, such as one group data from Young species, while another group from old species. So, my question is how to transfer this non numeric enrichment factor to numeric(like PH values). If you have some suggestions, please tell me. Thanks for your help.

rda 16srdna enrichment factor • 860 views
ADD COMMENTlink written 3.4 years ago by Ginsea Chen130

Could you clarify your question ? In particular, are your enrichment factors numbers that happen to be encoded in a non-numeric R data type or are they represented by a categorical variable ?
In the first case, as.numeric(x) should do or if it's an R factor variable, you would need as.numeric(levels(x)[x]). If your enrichment factor is a categorical variable and you know some numerical values associated with each then you could substitute the values for the categories. Otherwise, you could do as is sometimes done in regression: create dummy variables, one less than the number of categorical variables and assign them 0 or 1 based on category membership.

Also, have you checked that rda() can not already deal with categorical variables ?

ADD REPLYlink modified 3.4 years ago • written 3.4 years ago by Jean-Karim Heriche21k
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1216 users visited in the last hour