Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

anova.haplo.glm

Analysis of variance for haplo.glm model fit


Description

Perform an analysis of variance between two haplo.glm model fits using the deviances from the fitted objects

Usage

## S3 method for class 'haplo.glm'
anova(object, ..., dispersion=NULL, test="Chisq")

Arguments

object

A haplo.glm or glm object

...

More model fits to compare against the fit in the first argument

dispersion

the dispersion parameter for the fitting family. By default it is obtained from the object(s)

test

character string for the test of model comparison. Only "Chisq" supported for haplo.glm objects

Details

Uses print.anova for the displayed result

Value

A data.frame of the anova class, with these columns: Df, Deviance, Resid.Df, Resid.Dev, p-value

See Also

Examples

data(hla.demo)
 geno <- as.matrix(hla.demo[,c(17,18,21:24)])
 keep <- !apply(is.na(geno) | geno==0, 1, any) # SKIP THESE THREE LINES
 hla.demo <- hla.demo[keep,]                   # IN AN ANALYSIS
 geno <- geno[keep,]                           # 
 attach(hla.demo)
 label <-c("DQB","DRB","B")
 y <- hla.demo$resp
 y.bin <- 1*(hla.demo$resp.cat=="low")

# set up a genotype array as a model.matrix for inserting into data frame
# Note that hla.demo is a data.frame, and we need to subset to columns
# of interest. Also also need to convert to a matrix object, so that
# setupGeno can code alleles and convert geno to 'model.matrix' class.

 geno <- setupGeno(geno, miss.val=c(0,NA))

  # geno now has an attribute 'unique.alleles' which must be passed to
  # haplo.glm as allele.lev=attributes(geno)$unique.alleles, see below

 my.data <- data.frame(geno=geno, age=hla.demo$age, male=hla.demo$male,
                        y=y, y.bin=y.bin)


 fit.gaus <- haplo.glm(y ~ male + geno, family = gaussian,  na.action=
               "na.geno.keep", data=my.data, locus.label=label,
               control = haplo.glm.control(haplo.freq.min=0.02))
 glmfit.gaus <- glm(y~male, family=gaussian, data=my.data)

 anova.haplo.glm(glmfit.gaus, fit.gaus)

haplo.stats

Statistical Analysis of Haplotypes with Traits and Covariates when Linkage Phase is Ambiguous

v1.8.6
GPL (>= 2)
Authors
Sinnwell JP, Schaid DJ
Initial release
2020-10-14

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.