Many multivariate simple linear regressions coefficients | R Documentation |
Many multivariate simple linear regressions coefficients.
mvbetas(y, x, pvalue = FALSE)
y |
A matrix with the data, where rows denotes the observations and the columns contain the dependent variables. |
x |
A numerical vector with one continuous independent variable only. |
pvalue |
If you want a hypothesis test that each slope (beta coefficient) is equal to zero set this equal to TRUE. It will also produce all the correlations between y and x. |
It is a function somehow opposite to the allbetas
. Instead of having one y and many xs we have many ys and one x.
A matrix with the constant (alpha) and the slope (beta) for each simple linear regression. If the p-value is set to TRUE, the correlation of each y with the x is calculated along with the relevant p-value.
Michail Tsagris
R implementation and documentation: Michail Tsagris <mtsagris@uoc.gr> and Manos Papadakis <papadakm95@gmail.com>.
allbetas, correls, univglms
y <- matrnorm(100, 100)
x <- rnorm(100)
a <- mvbetas(y, x, pvalue = FALSE)
b <- matrix(nrow = 100, ncol = 2)
z <- cbind(1, x)
a <- mvbetas(y, x)
b[2, ] <- coef( lm.fit( z, y[, 1] ) )
b[2, ] <- coef( lm.fit( z, y[, 2] ) )
x <- NULL
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.