PdataPed | R Documentation |
PdataPed
creates an object of class PdataPed
, which typically contains the phenotype data to be passed to MCMCped
and the formula that defines the model to be fitted.
is.PdataPed
returns TRUE
if x
is of class PdataPed
PdataPed(formula, data=NULL, id=data$id, sex=data$sex, offspring=data$offspring, timevar=data$timevar, USdam=FALSE, USsire=FALSE)
formula |
list of model predictors of the form |
data |
data frame containing the predictor variables |
id |
vector of individual identifiers. If not specified, |
sex |
vector of individual sexes (either 'Male' or 'Female' or |
offspring |
binary vector indicating whether records belong to offspring (1) or not (0) |
timevar |
an optional vector indicating cohorts for multigenerational pedigree reconstruction |
USdam |
logical or character; if |
USsire |
logical or character; if |
If the number of unsampled individuals varies over subpopulations, and the parentage of an offspring is not restricted to ceratin subpopulations then the parameters will not be idenifiable. This can be resolved by using an informative prior (see priorPed
) for the number of unsampled individuals in each sub-population, or using the restrict
argument in varPed
.
list containing the arguments passed
Jarrod Hadfield j.hadfield@ed.ac.uk
MCMCped
id<-1:20 sex<-sample(c("Male", "Female"),20, replace=TRUE) offspring<-c(rep(0,18),1,1) lat<-rnorm(20) long<-rnorm(20) mating_type<-gl(2,10, label=c("+", "-")) test.data<-data.frame(id, offspring, lat, long, mating_type, sex) res1<-expression(varPed("offspring", restrict=0)) var1<-expression(varPed(c("lat", "long"), gender="Male", relational="OFFSPRING")) var2<-expression(varPed(c("mating_type"), gender="Female", relational="MATE")) var3<-expression(varPed("mating_type", gender="Male")) PdP<-PdataPed(formula=list(res1, var1, var2, var3), data=test.data)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.