allbetas: Simple linear regressions coefficients

View source: R/many_regression_models_correlations.R

Many simple linear regressions coefficientsR Documentation

Simple linear regressions coefficients


Simple linear regressions coefficients.


allbetas(y, x, pvalue = FALSE, logged = FALSE)



A numerical vector with the response variable.


A matrix with the data, where rows denotes the observations and the columns contain the independent variables.


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.


A boolean variable; it will return the logarithm of the pvalue if set to TRUE.


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 test statistic and its associated p-value.


Michail Tsagris

R implementation and documentation: Michail Tsagris <> and Manos Papadakis <>.

See Also

mvbetas, correls, univglms, colsums, colVars


x <- matrix( rnorm(100 * 50), ncol = 50 )
y <- rnorm(100)
r <- cor(y, x)  ## correlation of y with each of the xs
a <- allbetas(y, x)  ## the coefficients of each simple linear regression of y with x
x <- NULL

Rfast documentation built on March 18, 2022, 7:41 p.m.