This function performs the multi-allele version of
linear regression. It is used in singlescan
and one_singlescanDO
. It performs marker-by-marker
linear regressions for each trait and adjusts for covariates.
It collects parameters from the linear models and returns
for downstream use.
get_stats_multiallele(phenotype, genotype, covar_table, ph_family, ref_col)
a list with "stats", "pval", "score" stats is a matrix holding the t statistics and slopes (beta coefficients) from the linear model. pval holds the p value for the marker overall and score holds the test statistic for the marker overall.
A phenotype vector
genotypes of the marker being tested. If this is a vector, it will be converted into a one-column matrix. If it is a matrix, each column represents an allele, and each row represents an individual.
The covariate matrix, with each covariate in a column, and each individual in a row.
a character string for a description of the error distribution. Can be either "gaussian" or "binomial"
The column belonging to the reference allele. The reference allele is removed from the genotype matrix so that the matrix is linearly independent. There are only n-1 degrees of freedom in the genotype matrix, where n is the number of alleles.