haplofreq: Fit Hardy-Weinberg equilibrium model for haplotype...

Description Usage Arguments Value Author(s) References Examples

Description

Fit MLE of Hardy-Weinberg equilibrium model for haplotype frequencies based on genotype data

Input is genotype data.

The haplotype model assumes Hardy-Weinberg equilibrium

P(H=(h_k,h_j)) = π_k pi_j

with K different haplotypes, where we parametrize the frequencies as

π_k= \frac{ \exp(θ_k) }{\exp(θ_1)+...+\exp(θ_{K-1})+1}

We allow a regression design on the haplotype parameters to reduce the dimensionality

θ = G α

where G is matrix of dimension (K-1) x (d-1). The α and θ version both have the same baseline that is a single haplotype.

Usage

1
2
3
haplo.freqs(geno.type, geno.setup=NULL, Nit = 10,detail = 0,
haplo.freq = NULL, step = 1,lev.marq=1,min.lev.marq=0, 
haplo.design=NULL,haplo.baseline=NULL,alpha=NULL)

Arguments

geno.type

a data.frame with the variables.

geno.setup

setup form genotype data.

Nit

number of iterations for Newton-Raphson algorithm.

detail

if 0 no details is printed during iterations, if 1 details are given.

haplo.freq

haplo type frequencies for starting values or for fixed values.

step

step size for iteration steps.

lev.marq

starting value for Levenberg-Marquart algorithm.

min.lev.marq

stopping value for Levenberg-Marquart algorithm after initial steps, min.lev.marq=0 is stopping value for Levenberg-Marquart algorithm after initial steps, min.lev.marq=0 is Newton-Raphson steps, that are needed to get correct standard errors.

haplo.design

design for haplo parameters, default is diagonal of size K-1

haplo.baseline

gives the name of the geno.setup that should be used as baseline, default is last haplotype.

alpha

starting value of parameters for haplo.design

Value

returns an object of type "haplo.freq". With the following arguments:

haplo.alpha

MLE of alpha parameters for haplo.design.

haplo.pars

MLE of haplotype parameters.

haplo.freq

MLE of haplotype frequencies.

var.haplo.alpha

variance matrix for alpha

D2linv

second derivative of log-likelihood.

score

score for likelihood.

haplo.design

design that relates haplotype parameters to alpha parameters.

alpha.iid

iid decomposition of alpha parameters, in this case score contributions for each subject for score of for log-likelihood.

freq.names

names of haplotypes

Author(s)

Thomas Scheike and Jeremy Silver

References

Scheike, Martinussen and Silver, Haplotype effects for survival data, Submitted.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
n<-200
g<-matrix(rbinom(200*4,1,0.5),n,4); # simple genotypes

gs<-geno.setup(g); 

hgs<-haplo.freqs(g,geno.setup=gs)
summary(hgs); 
hgs$haplo.freq         # haplo-type frequencies
hgs$haplo.pars         #  related parameters 
hgs$haplo.alpha        #  related parameters  haplo.pars = X alpha
hgs$var.haplo.alpha    #  variance of alpha parameters 

# structured haplo-frequency model, baseline is set to "0,0"

gs<-geno.setup(g,haplo.baseline="0,0"); 

X<-matrix(1,3,1); 
hgs<-haplo.freqs(g,geno.setup=gs,haplo.design=X)
summary(hgs); 
hgs$haplo.freq         # haplo-type frequencies
hgs$haplo.pars         # related parameters 
hgs$haplo.alpha        # related parameters  haplo.pars = X alpha
hgs$var.haplo.alpha    # variance of alpha parameters 

HaploSurvival documentation built on May 2, 2019, 5:49 p.m.