haplo.surv {SimHap} | R Documentation |
haplo.surv
performs a series of Cox proportional hazards models to survival data with haplotypes using a simulation-based approach to account for uncertainty in haplotype assignment when phase is unknown.
haplo.surv(formula1, formula2, pheno, haplo, sim, effect = "add", sub = NULL)
formula1 |
a symbolic description of the full model to be fit, including haplotype parameters. The response must be a survival object as returned by the Surv function. |
formula2 |
a symbolic description of the nested model excluding haplotype parameters, to be compared to formula1 in a likelihood ratio test. The response must be a survival object as returned by the Surv function. |
pheno |
a dataframe containing phenotype data. |
haplo |
a haplotype object made by make.haplo.rare . |
sim |
the number of simulations from which to evaluate the results. |
effect |
the genetic effect type: "add" for additive, "dom" for dominant and "rec" for recessive. Defaults to additive. See note. |
sub |
optional. An expression using a binary operator, representing a subset of individuals on which to perform analysis. e.g. sub=expression(sex==1) . |
formula1
should be in the form of response ~ predictor(s) + haplotype(s)
and formula2
should be in the form response ~ predictor(s)
. A formula has an implied intercept term. See documentation for the formula
function for more details of allowed formulae.
haplo.surv
returns an object of 'class' hapSurv
.
The summary
function can be used to obtain and print a
summary of the results.
An object of class hapSurv
is a list containing the
following components:
formula1 |
formula1 passed to haplo.surv . |
formula2 |
formula2 passed to haplo.surv . |
results |
a table containing the hazard ratios, confidence intervals and p-values of the parameter estimates, averaged over the n=sim models performed. |
empiricalResults |
a list containing the hazard ratios, confidence intervals and p-values calculated at each simulation |
logLik |
the average log-likelihood for the n=sim linear models fit using formula1. |
LRT |
a likelihood ratio test, testing for significant improvement of the model when haplotypic parameters are included |
predicted |
estimated marginal means of the outcome variable broken down by haplotype levels, evaluated at mean values of the model predictors, averaged over all simulations. |
ANOVA |
analysis of variance, comparing the two models fit with and without haplotypic parameters. |
Wald |
The Wald test for overall significance of the fitted model including haplotypes. |
rsquared |
r-squared values for models fit using formula1 and formula2 . |
effect |
the haplotypic effect modelled, `ADDITIVE', `DOMINANT' or `RECESSIVE'. |
To model a codominant haplotypic effect, define the desired haplotype as a factor in the formula1
argument. e.g. factor(h.AAA)
, and use the default option for effect
.
Pamela A. McCaskie
Andersen, P., Gill, R. (1982) Cox's regression model for counting processes, a large sample study, Annals of Statistics, 10:1100-1120.
Little, R.J.A., Rubin, D.B. (2002) Statistical Analysis with Missing Data. John Wiley and Sons, New Jersey.
McCaskie, P.A., Carter, K.W, Hazelton, M., Palmer, L.J. (2007) SimHap: A comprehensive modeling framework for epidemiological outcomes and a multiple imputation approach to haplotypic analysis of population-based data, [online] www.genepi.org.au/simhap.
Rubin, D.B. (1996) Multiple imputation after 18+ years (with discussion). Journal of the American Statistical Society, 91:473-489.
Therneau, T., Grambsch, P., Fleming, T. Martingale based residuals for survival models, Biometrika, 77(1):147-160.
snp.surv
, haplo.bin
, haplo.quant
, haplo.long
data(SNPsurv.dat) # convert SNP.dat to format required by infer.haplos survHaplo.dat <- SNP2Haplo(SNPsurv.dat) data(survPheno.dat) # generate haplotype frequencies and haplotype design matrix myinfer<-infer.haplos(survHaplo.dat) # print haplotype frequencies generated by infer.haplos myinfer$hap.freq # generate haplo object where haplotypes with a frequency # below min.freq are grouped as a category called "rare" myhaplo<-make.haplo.rare(myinfer,min.freq=0.05) mymodel <- haplo.surv(formula1=Surv(time, status)~age+h.V1AA, formula2=Surv(time, status)~age, haplo=myhaplo, pheno=survPheno.dat, sim=10) summary(mymodel) # example using a subsetting variable - looking at males only mymodel <- haplo.surv(formula1=Surv(time, status)~age+h.V1AA, formula2=Surv(time, status)~age, haplo=myhaplo, pheno=survPheno.dat, sim=10, sub=expression(sex==1)) summary(mymodel)