||
本文链接:https://blog.csdn.net/yzhlinscau/article/details/100519053
1 pin.batch
用于单个asreml模型结果的批量pin计算,用法如下:
## S3 method for class 'asreml' pin.batch(object, mulp, digit = 4, signif = FALSE,Rres = FALSE) ---- object :asreml模型运行结果; ---- mulp :pin计算公式; ---- digit:保留小数点位数; ---- signif:是否输出显著性检验结果; ---- Rres:把pin批量结果返回为数据框。
简单示例如下:
pkgs<-c('asreml','AAfun4') lapply(pkgs,library,character.only=TRUE) fm1a.asr<-asreml(h5~1+Rep, random=~Fam, subset=Spacing=='3',data=PrSpa) bp1<-c(h2 ~4*V1/(V1+V2),H2~V1/(V1+V2/4)) pin.batch(fm1a.asr,mulp=bp1)
运行结果如下:
> pkgs<-c('asreml','AAfun4') > lapply(pkgs,library,character.only=TRUE) Loading required package: MatrixLoading required package: crayon []==================================================================[] [] ASReml-R Added Functionsv4 in R (AAfun4)2.0.1 (2019-08-28) [] [] Author: YuanZhen Lin [] [] Dedicated to South China Agricultural University [] [] Type 'citation('AAfun4')' to know how to cite AAfun4 [] []==================================================================[] AAfun4 is not free any more, user should pay RMB 100 for it. If you wanna use AAfun4, please email me(yzhlinscau@163.com). Please do not share AAfun4 with anyone without my permission. > pin.batch(fm1a.asr,mulp=bp1) pin batch results are as following: Esmate SE h2 0.3061 0.12397 H2 0.2490 0.08199
2 pin.batch2
用于多个asreml模型结果的批量pin计算,用法如下:
## S3 method for class 'asreml' pin.batch2(..., mulp, digit = 4, signif = FALSE,Rres = FALSE) ---- ... :多个asreml模型运行结果; ---- mulp :pin计算公式; ---- digit:保留小数点位数; ---- signif:是否输出显著性检验结果; ---- Rres:把pin批量结果返回为数据框。
简单示例如下:
fm1a2.asr<-update(fm1a.asr,fixed=h3~1+Rep)
pin.batch2(fm1a.asr,fm1a2.asr,mulp=bp1)
运行结果如下:
pin batch results are as following: $`fm1a.asr` Esmate SE h2 0.3061191 0.12396628 H2 0.2489604 0.08199425 $fm1a2.asr Esmate SE h2 0.3080801 0.12496889 H2 0.2502560 0.08246001
Archiver|手机版|科学网 ( 京ICP备07017567号-12 )
GMT+8, 2024-11-22 05:31
Powered by ScienceNet.cn
Copyright © 2007- 中国科学报社