% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/binomial.twostage.R, R/sim.clayton.oakes.R,
%   R/twostage.R
\name{p11_binomial_twostage_RV}
\alias{p11_binomial_twostage_RV}
\alias{concordanceTwostage}
\alias{concordanceTwinACE}
\alias{kendall_ClaytonOakes_twin_ace}
\alias{kendall.ClaytonOakes.twin.ace}
\alias{kendall_normal_twin_ace}
\alias{ascertained_pairs}
\alias{twin-design}
\alias{twin_polygen_design}
\alias{twin.polygen.design}
\alias{ace_family_design}
\alias{make_pairwise_design}
\alias{p11.binomial.twostage.RV}
\title{Concordance Probability from Twostage Model}
\usage{
p11_binomial_twostage_RV(
  theta,
  rv1,
  rv2,
  p1,
  p2,
  pardes,
  ags = NULL,
  link = 0,
  i = 1,
  j = 1
)

concordanceTwostage(
  theta,
  p,
  rv1,
  rv2,
  theta.des,
  additive.gamma.sum = NULL,
  link = 0,
  var.par = 0,
  ...
)

concordanceTwinACE(
  object,
  rv1 = NULL,
  rv2 = NULL,
  xmarg = NULL,
  type = "ace",
  ...
)

kendall_ClaytonOakes_twin_ace(parg, parc, K = 10000, test = 0)

kendall.ClaytonOakes.twin.ace(x, y, ...)

kendall_normal_twin_ace(parg, parc, K = 10000)

ascertained_pairs(pairs, data, cr.models, bin = FALSE)

twin.polygen.design(x, ...)

ace_family_design(
  data,
  id = "id",
  member = "type",
  mother = "mother",
  father = "father",
  child = "child",
  child1 = "child",
  type = "ace",
  ...
)

make_pairwise_design(pairs, kinship, type = "ace")
}
\arguments{
\item{theta}{dependence parameter vector.}

\item{rv1}{random-effects design for subject 1.}

\item{rv2}{random-effects design for subject 2.}

\item{p1}{marginal probability for subject 1.}

\item{p2}{marginal probability for subject 2.}

\item{pardes}{parameter design matrix.}

\item{ags}{additive gamma sum matrix (optional).}

\item{link}{link function indicator (0 = identity, 1 = log).}

\item{i}{index for subject 1.}

\item{j}{index for subject 2.}

\item{p}{matrix of marginal probabilities (n x 2).}

\item{theta.des}{parameter design matrix linking theta to lambda parameters.}

\item{additive.gamma.sum}{optional matrix for additive gamma sums.}

\item{var.par}{if 1, parameters are rescaled by sum squared.}

\item{...}{additional arguments.}

\item{object}{a binomial twostage model object.}

\item{xmarg}{optional covariate values for marginal probabilities.}

\item{type}{model type: \code{"ace"}, \code{"ade"}, \code{"ae"}, \code{"de"},
\code{"dce"}, or \code{"un"}.}

\item{parg}{genetic variance parameter (gamma shape for genetic component).}

\item{parc}{common environment variance parameter (gamma shape for environment).}

\item{K}{number of simulated twin pairs (multiplied by 2 internally).}

\item{test}{if 1, prints diagnostic correlations.}

\item{x}{passed as \code{parg} (alias wrapper).}

\item{y}{passed as \code{parc} (alias wrapper).}

\item{pairs}{matrix of pair indices (n x 2).}

\item{data}{a data.frame with twin/family data.}

\item{cr.models}{formula specifying time and status variables.}

\item{bin}{logical; if TRUE uses binary (prevalence) ordering rather than time ordering.}

\item{id}{character name of the cluster (pair) identifier column.}

\item{member}{character name of the family member type column.}

\item{mother}{value identifying mothers in the member column.}

\item{father}{value identifying fathers in the member column.}

\item{child}{value identifying children in the member column.}

\item{child1}{column name distinguishing first child from second.}

\item{kinship}{vector of kinship coefficients for each pair.}
}
\value{
A list of concordance tables, one per pair, each containing
  \code{pmat} (2x2 probability matrix), \code{casewise} (casewise concordance),
  and \code{marg} (marginal probabilities).

A list of concordance tables per zygosity group.

A list with components:
  \item{pardes}{parameter design matrix linking random effects to variance parameters.}
  \item{des.rv}{random-effects design matrix for subjects.}
}
\description{
Computes concordance probability (joint probability of both subjects
experiencing the event) given dependence parameters and random-effect
variance structures from a twostage model.

Computes concordance probabilities for twin ACE/ADE models from a
binomial twostage object.

Functions for constructing random-effects design matrices for twin and
family models. These designs specify the genetic (A), dominance (D),
common environment (C), and unique environment (E) variance components.
}
\details{
\code{twin_polygen_design} creates a polygenic random-effects design for
twin pairs, distinguishing MZ and DZ twins.

\code{twin.polygen.design} is an alias for \code{twin_polygen_design}.

\code{ace_family_design} creates designs for nuclear families (mother,
father, children).

\code{make_pairwise_design} creates pairwise random-effects designs for
arbitrary kinship structures.

\code{concordanceTwostage} computes concordance probabilities from a
twostage model.

\code{concordanceTwinACE} computes concordance from a twin ACE model.

\code{kendall_ClaytonOakes_twin_ace} and \code{kendall_normal_twin_ace}
compute Kendall's tau for Clayton-Oakes and normal-frailty twin ACE models
respectively.

\code{ascertained_pairs} identifies ascertained (affected) pairs in
clustered survival data.

\code{p11_binomial_twostage_RV} computes the joint probability P(T1<=t, T2<=t)
for the additive gamma binary random effects model.
}
\author{
Klaus K. Holst, Thomas Scheike
}
