== Note: AFEchidna包最新版本为1.62,github版本暂未实时更新。==
update()用法如下:
// summary
summary(object)
返回的结果为列表,含有5个元件:
org.res,varcomp,IC,coef.fixed和coef.random。
简单示例如下:
res11<-echidna(h3~1+Rep,
random=~Fam,
residual=NULL,
es0.file="fm.es0")
运用summary()来获取相应元件结果:
// orginal result from .esr files
> cat(summary(res11)$org.res)
Akaike Information Criterion 4697.68 (assuming 2 parameters).
Bayesian Information Criterion 4706.31
Analysis of h3
Wald F statistics
Source of Variation NumDF DenDF F-inc F-con P-inc
mu 1 53.4 11253.79 11252.85 <.001
Rep 4 525.3 36.34 36.34 <.001
Model_Term Order Gamma Sigma Z_ratio %C
Fam 55 0.834411E-01 132.587 2.35 0 P
Residual_units 559 1.00000 1588.99 15.84
mv 0 effects fitted.
Fam 55 effects fitted.
Note: Some residuals are large (0 -ve, 4 +ve); 0 are very large.
Note: Denominator DF calculation may be expensive. Use !DDF -1 to suppress.
其它结果:
// An highlighted block
> summary(res11)$varcomp
Term Sigma SE Z.ratio
1 Residual 1589.00 100.290 15.84405
2 Fam 132.59 56.459 2.34843
> summary(res11)$IC
DF parNO LogL AIC BIC
1 554 2 -2346.84 4697.68 4706.31
> summary(res11)$coef.fixed
Term Level Effect SE
1 Rep 1 0.000 0.000
2 Rep 2 -11.732 5.641
3 Rep 3 46.779 5.534
4 Rep 4 23.807 5.521
5 Rep 5 4.895 5.510
6 mu 1 231.494 4.389
> summary(res11)$coef.random %>% head
Term Level Effect SE
1 Fam 70048 3.792 7.781
2 Fam 70017 -0.903 8.574
3 Fam 70002 2.552 8.399
4 Fam 70010 3.489 7.786
5 Fam 70041 2.947 8.760
6 Fam 70031 6.637 8.393
当进行性状的批量分析时,summary()可以很方便地得到随机效应和固定效应的结果。
简单示例如下:
> res11b <- update(res11,trait=~h3+h4+h5,batch=T)
> summary(res11b)$coef.fixed
$h3
Term Level Effect SE
1 Rep 1 0.000 0.000
2 Rep 2 -11.732 5.641
3 Rep 3 46.779 5.534
4 Rep 4 23.807 5.521
5 Rep 5 4.895 5.510
6 mu 1 231.494 4.389
$h4
Term Level Effect SE
1 Rep 1 0.000 0.000
2 Rep 2 -5.972 8.549
3 Rep 3 83.994 8.315
4 Rep 4 82.364 8.294
5 Rep 5 -0.468 8.280
6 mu 1 366.740 6.511
$h5
Term Level Effect SE
1 Rep 1 0.000 0.000
2 Rep 2 2.022 10.421
3 Rep 3 109.833 10.138
4 Rep 4 93.284 10.114
5 Rep 5 -11.507 10.095
6 mu 1 547.771 8.038
> summary(res11b)$coef.random %>%
+ purrr::map(head)
$h3
Term Level Effect SE
1 Fam 70048 3.792 7.781
2 Fam 70017 -0.903 8.574
3 Fam 70002 2.552 8.399
4 Fam 70010 3.489 7.786
5 Fam 70041 2.947 8.760
6 Fam 70031 6.637 8.393
$h4
Term Level Effect SE
1 Fam 70048 8.999 11.096
2 Fam 70017 9.229 12.104
3 Fam 70002 1.856 11.885
4 Fam 70010 0.051 11.102
5 Fam 70041 0.146 12.335
6 Fam 70031 9.497 11.877
$h5
Term Level Effect SE
1 Fam 70048 14.502 14.233
2 Fam 70017 8.975 15.680
3 Fam 70002 7.072 15.360
4 Fam 70010 -4.218 14.241
5 Fam 70041 -5.097 16.018
6 Fam 70031 6.479 15.349