Learn R Programming

mets (version 1.3.4)

bptwin: Liability model for twin data

Description

Liability-threshold model for twin data

Usage

bptwin(
  x,
  data,
  id,
  zyg,
  DZ,
  group = NULL,
  num = NULL,
  weights = NULL,
  weights.fun = function(x) ifelse(any(x 

Arguments

x

Formula specifying effects of covariates on the response.

data

data.frame with one observation pr row. In addition a column with the zygosity (DZ or MZ given as a factor) of each individual much be specified as well as a twin id variable giving a unique pair of numbers/factors to each twin pair.

id

The name of the column in the dataset containing the twin-id variable.

zyg

The name of the column in the dataset containing the zygosity variable.

DZ

Character defining the level in the zyg variable corresponding to the dyzogitic twins.

group

Optional. Variable name defining group for interaction analysis (e.g., gender)

num

Optional twin number variable

weights

Weight matrix if needed by the chosen estimator (IPCW)

weights.fun

Function defining a single weight each individual/cluster

strata

Strata

messages

Control amount of messages shown

control

Control argument parsed on to the optimization routine. Starting values may be parsed as 'start'.

type

Character defining the type of analysis to be performed. Should be a subset of "acde" (additive genetic factors, common environmental factors, dominant genetic factors, unique environmental factors).

eqmean

Equal means (with type="cor")?

pairs.only

Include complete pairs only?

samecens

Same censoring

allmarg

Should all marginal terms be included

stderr

Should standard errors be calculated?

robustvar

If TRUE robust (sandwich) variance estimates of the variance are used

p

Parameter vector p in which to evaluate log-Likelihood and score function

indiv

If TRUE the score and log-Likelihood contribution of each twin-pair

constrain

Development argument

varlink

Link function for variance parameters

...

Additional arguments to lower level functions

Author

Klaus K. Holst

See Also

twinlm, twinlm.time, twinlm.strata, twinsim

Examples

Run this code
data(twinstut)
b0 <- bptwin(stutter~sex,
             data=droplevels(subset(twinstut,zyg%in%c("mz","dz"))),
             id="tvparnr",zyg="zyg",DZ="dz",type="ae")
summary(b0)

Run the code above in your browser using DataLab