PdataPed             package:MasterBayes             R Documentation

_P_d_a_t_a_P_e_d _O_b_j_e_c_t

_D_e_s_c_r_i_p_t_i_o_n:

     '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'

_U_s_a_g_e:

     PdataPed(formula, data=NULL, id=data$id, sex=data$sex,
        offspring=data$offspring, timevar=data$timevar, 
        USdam=FALSE, USsire=FALSE, ...)

_A_r_g_u_m_e_n_t_s:

 formula: list of model predictors of the form
          'expression(varPed(...))'

    data: data frame containing the predictor variables

      id: vector of individual identifiers. If not specified, 'data'
          must have an 'id' column

     sex: vector of individual sexes (either 'Male' or 'Female' or
          'NA'). If not specified individuals are assumed to be
          hermpahroditic unless 'data' has a 'sex' column

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 'TRUE' a single undiferentaited
          population of unsampled females exists. If 'USdam' is a
          character vector it must have the same length as 'id' with
          factor levels representing sub-populations (in time or space)
          over which the number of unsampled females vary.

  USsire: logical or character; if 'TRUE' a single undiferentaited
          population of unsampled males exists. If 'USsire' is a
          character vector it must have the same length as 'id' with
          factor levels representing sub-populations (in time or space)
          over which the number of unsampled males vary.

     ...: further arguments to be passed

_D_e_t_a_i_l_s:

     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'.

_V_a_l_u_e:

     list containing the arguments passed

_A_u_t_h_o_r(_s):

     Jarrod Hadfield j.hadfield@sheffield.ac.uk

_S_e_e _A_l_s_o:

     'MCMCped'

_E_x_a_m_p_l_e_s:

     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)

