View source: R/model_linear_combo.R
model_combo | R Documentation |
model_combo
calculates the linear model for a linear combination of
phenotypes as a function of a set of predictors.
model_combo(formula, phi, n, means, covs, ...)
formula |
an object of class |
phi |
named vector of linear weights for each variable in the
dependent variable in |
n |
sample size. |
means |
named vector of predictor and response means. |
covs |
named matrix of the covariance of all model predictors and the responses. |
... |
additional arguments |
an object of class "pcsslm"
.
An object of class "pcsslm"
is a list containing at least the
following components:
call |
the matched call |
terms |
the |
coefficients |
a |
sigma |
the square root of the estimated variance of the random error. |
df |
degrees of freedom, a 3-vector |
fstatistic |
a 3-vector with the value of the F-statistic with its numerator and denominator degrees of freedom. |
r.squared |
|
adj.r.squared |
the above |
cov.unscaled |
a |
Sum Sq |
a 3-vector with the model's Sum of Squares Regression (SSR), Sum of Squares Error (SSE), and Sum of Squares Total (SST). |
wolf_computationally_2020pcsstools
\insertRefgasdaska_leveraging_2019pcsstools
ex_data <- pcsstools_example[c("g1", "x1", "x2", "x3", "y1", "y2", "y3")]
head(ex_data)
means <- colMeans(ex_data)
covs <- cov(ex_data)
n <- nrow(ex_data)
phi <- c("y1" = 1, "y2" = -1, "y3" = 0.5)
model_combo(
y1 + y2 + y3 ~ g1 + x1 + x2 + x3,
phi = phi, n = n, means = means, covs = covs
)
summary(lm(y1 - y2 + 0.5 * y3 ~ g1 + x1 + x2 + x3, data = ex_data))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.