Как использовать функцию cld для определенных генов в большом наборе данных?

Я новичок в программировании на R. Я предварительно сформировал двухфакторную аниову для моих данных КПЦР для разных генов, в разных обработках и линиях. Когда я преформcldдля моего набора данных результат отображает алфавиты для всех генов вместе. Тем не менее, я хотел бы, чтобы буквы отображались для каждого гена отдельно, но все же выполнял их с одним входным файлом.

Мой сценарий R

# Inputing your table into R
data <- read.table(file.choose(), header = TRUE)

# Define linear model (interaction of factor 1 and factor 2)
linear.model = lm(CT ~ Genotype + Treatment + Gene + Genotype:Treatment:Gene:Genotype,
                  data = data)
summary(linear.model)   ### Will show overall p-value and r-square

# Conduct analysis of variance
library(car)
aov.res = Anova(linear.model,
      type = "2")
summary(aov.res)

# Post-hoc analysis:tukey's test
library(multcomp)
library(lsmeans)

marginal.genotype = lsmeans(linear.model,
                   ~ Genotype + Treatment + Gene)
pairs(marginal.genotype,
      adjust="tukey")

cld.genotype = cld(marginal.genotype,
          alpha   = 0.05,
          Letters = letters,         ###  Use lowercase letters for .group
          adjust  = "tukey")         ###  Tukey-adjusted comparisons
cld.genotype

Вывод вышеуказанного скрипта:

Genotype Treatment Gene lsmean    SE df lower.CL upper.CL .group     
 Wt       Infected  G1  -7.05 0.183 36    -7.63    -6.46  a         
 Wt       Control   G1  -6.38 0.183 36    -6.97    -5.79  a         
 OX   Control   G1  -5.35 0.183 36    -5.93    -4.76   b        
 OX   Infected  G1  -5.25 0.183 36    -5.84    -4.66   b        
 RNAi Infected  G1  -3.33 0.183 36    -3.92    -2.75    c       
 RNAi_7.8 Control   G1  -3.17 0.183 36    -3.76    -2.58    c       
 RNAi_7.8 Infected  G2   1.93 0.183 36     1.34     2.51     d      
 OX   Infected  G2   2.10 0.183 36     1.51     2.69     d      
 OX   Control   G2   2.43 0.183 36     1.84     3.02     de     
 RNAi_7.8 Control   G2   2.79 0.183 36     2.20     3.38     def    
 Wt       Control   G3    3.29 0.183 36     2.71     3.88      ef    
 Wt       Infected  G2   3.56 0.183 36     2.97     4.15       f    
 Wt       Infected  DFR    4.87 0.183 36     4.28     5.46        g   
 Wt       Control   G2   5.04 0.183 36     4.46     5.63        g   
 RNAi_7.8 Infected  G3    6.88 0.183 36     6.30     7.47         h  
 RNAi_7.8 Control   G3    7.93 0.183 36     7.35     8.52          i 
 OX   Infected  G3   10.43 0.183 36     9.85    11.02           j
 OX   Control   G3   10.66 0.183 36    10.07    11.24           j

Confidence level used: 0.95 
Conf-level adjustment: sidak method for 18 estimates 
P value adjustment: tukey method for comparing a family of 18 estimates 
significance level used: alpha = 0.05

Любая помощь с приведенным выше анализом будет полезной. Заранее спасибо.

0 ответов

Другие вопросы по тегам