Description Usage Arguments Value Author(s) References See Also Examples
This function carries out batch analysis for mult-trait with same model and also output heritability etc. in ASReml-R package.
1 2 3 4 5 |
data |
aim dataset |
factorN |
A vector with sites of all factors. |
traitN |
A vector with sites of all traits. |
FMod |
Fixed mode. |
RMod |
Randomed variance structure. |
EMod |
Error variance structure for multi-trait model. |
mulT |
Value "T" or "TRUE" for multi-trait model, "F"(default). |
mulN |
Number of trait for one model in multi-trait analysis,2(default). |
mulR |
Value "T" or "TRUE" to count corr/error matrix, only works for bitrait, "F"(default). |
corM |
Value "T" or "TRUE" for corr model, "F"(default). |
corMout |
Value "T" or "TRUE" to output corr matrix, "F"(default). |
pformula |
Formula for h2 or corr. |
pformula1 |
Formula for h2 or corr. |
pformula2 |
Formula for h2 or corr. |
pformula3 |
Formula for h2 or corr. |
pformula4 |
Formula for h2 or corr. |
maxit |
Maximum number of iterations. |
ped |
Value "T" or "TRUE" for animal model with pedigree, "F"(default).. |
pedinv |
A G-inverse matrix for pedigree from ASReml.Ainverse(). |
ginverse |
a named list with each component identifying a G-inverse matrix. |
factorN |
A vector contains column site of factors in dataset, such as c(1:3,5) |
traitN |
A vector contains column site of aim trait in dataset, such as c(10:15) |
FMod |
Fixed mode,must start in "y~1+fixed.factor" (single trait) or "cbind(y1,y2)~trait+trait:fixed.factor" (multi-trait, cbind(y1,y2,y3,...)) |
RMod |
Random variance structure, such as "~Fam" or "~us(trait):Fam". |
EMod |
Error variance structure, such as "~units:us(trait)". |
pformula |
formula for h2 or corr, such as "h2 ~ 4 * V1/(V1+V2)". |
maxit |
maximum number of iterations, default is 20. |
Yuanzhen Lin <yzhlinscau@163.com>
Yuanzhen Lin. R & ASReml-R Statistics. China Forestry Publishing House. 2016
Website for instant update: yzhlin-asreml.ys168.com
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 | library(asreml)
library(AAfun)
##### example I for dataset without pedigree
data(PrSpa)
df<-PrSpa
# exmaple 1.1 for sigle trait model
df1=subset(df,Spacing==3)
asreml.batch(data=df1,factorN=1:5,traitN=c(9:13),
FMod=y~1+Rep+Plot,RMod=~Fam,
pformula=h2 ~ 4 * V1/(V1+V2))
# exmaple 1.2 for us model
asreml.batch(data=df1,factorN=1:5,traitN=c(10:13),
FMod=cbind(y1,y2)~trait+trait:Rep,
RMod=~us(trait):Fam,
EMod=~units:us(trait),
mulT=TRUE,mulN=2,mulR=TRUE,corMout=T,
pformula=r.g ~ V2/sqrt(V1*V3),
pformula1=h2.A ~ 4*V1/(V1+V5),
pformula2=h2.B ~ 4*V3/sqrt(V3+V7))
# exmaple 1.3 for corr model
asreml.batch(data=df1,factorN=1:5,traitN=c(10:13),
FMod=cbind(y1,y2,y3)~trait+trait:Rep,
RMod=~corgh(trait):Fam,
EMod=~units:us(trait), maxit=30,
mulT=TRUE,mulN=3,mulR=TRUE,corM=TRUE)
##### example II for dataset with pedigree
data(dfm2);df=dfm2
ped<-df[,1:3]
pedinv<-asreml.Ainverse(ped)$ginv
df1=subset(df,Spacing==3)
# example 2.1 sigle trait model
asreml.batch(data=df1,factorN=1:6,traitN=c(7:14),
FMod=y~1+Rep,RMod=~ped(TreeID),
ped=T,pedinv=pedinv,
ginverse=list(TreeID=pedinv),
pformula=h2 ~ V1/(V1+V2))
# exmaple 2.2 us model
asreml.batch(data=df1,factorN=1:6,traitN=c(10:14),
FMod=cbind(y1,y2)~trait+trait:Rep,
RMod=~us(trait):ped(TreeID),
EMod=~units:us(trait),maxit=40,
mulT=TRUE,mulN=2,mulR=TRUE,corMout=F,
ped=T,pedinv=pedinv,
ginverse=list(TreeID=pedinv),
pformula=r.g ~ V2/sqrt(V1*V3),
pformula1=h2.A ~ V1/(V1+V5),
pformula2=h2.B ~ V3/(V3+V7))
# exmaple 2.3 corr model
asreml.batch(data=df1,factorN=1:6,traitN=c(10:14),
FMod=cbind(y1,y2)~trait+trait:Rep,
RMod=~corgh(trait):ped(TreeID),
EMod=~units:us(trait),maxit=40,
mulT=TRUE,mulN=2,corM=TRUE,
ped=T,pedinv=pedinv,
ginverse=list(TreeID=pedinv))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.