Description Usage Arguments Details Value
View source: R/model_fitting_functions.R
Fit the additive model to data
1 | fit.add.model(geno.matrix, fit.matrix, wts = c(2, 1))
|
geno.matrix |
Genotype matrix generated in
|
fit.matrix |
Fitness matrix generated in
|
wts |
Vector of weights to weight genotypes by. Used when
|
wts
: The coefficient estimates are obtained by weighted comparisons. The
default is to give wild type to single mutation genotype comparisons twice the weight
as all other comparisons based on the assumption that wild type is know
with much lower error than the other genotypes (actually it is assumed to be known with no error).
@examples
n.muts <- length(Khan.data[1,])-1
geno.matrix <- Khan.data[,seq(1, n.muts)]
fit.matrix <- as.matrix(Khan.data[,(n.muts+1)])
fit.add.model(geno.matrix, fit.matrix, c(2,1))
@seealso fit.stick.model.given.d
List:
[[1]] w.hats
are the estimated additive effect
coefficients;
[[2]] R2
is proportion of fitness variation
explained by model. Does not include wild type in calculation.
[[3]] sig.hat
is estimate of sigma
[[4]] logLike
is log-likelihood of the data under the fitted model.
[[5]] regression.results
List of results when regressing effects of mutations against the background fitness
of mutations (see details). [[1]] p.vals
gives p-value of each mutation, [[2]] lm.intercepts
gives
estimated intercept for mutation, [[3]] lm.slopes
gives slope for each mutation, [[4]] P
is the
sum of the log of p-values. This is the summary statistic. [[5]] fitness.of.backs
Matrix with fitness of backgrounds when each mutation (columns) is added to each genotype (rows).
[[6]] effects.matrix
Matrix with fitness effect when given mutation (column) is added to given create genotype (row).
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.