# big_univLinReg: Column-wise linear regression In bigstatsr: Statistical Tools for Filebacked Big Matrices

## Description

Slopes of column-wise linear regressions of each column of a Filebacked Big Matrix, with some other associated statistics. Covariates can be added to correct for confounders.

## Usage

 ```1 2 3 4 5 6 7 8 9``` ```big_univLinReg( X, y.train, ind.train = rows_along(X), ind.col = cols_along(X), covar.train = NULL, thr.eigval = 1e-04, ncores = 1 ) ```

## Arguments

 `X` An object of class FBM. `y.train` Vector of responses, corresponding to `ind.train`. `ind.train` An optional vector of the row indices that are used, for the training part. If not specified, all rows are used. Don't use negative indices. `ind.col` An optional vector of the column indices that are used. If not specified, all columns are used. Don't use negative indices. `covar.train` Matrix of covariables to be added in each model to correct for confounders (e.g. the scores of PCA), corresponding to `ind.train`. Default is `NULL` and corresponds to only adding an intercept to each model. You can use `covar_from_df()` to convert from a data frame. `thr.eigval` Threshold to remove "insignificant" singular vectors. Default is `1e-4`. `ncores` Number of cores used. Default doesn't use parallelism. You may use nb_cores.

## Value

A data.frame with 3 elements:

1. the slopes of each regression,

2. the standard errors of each slope,

3. the t-scores associated with each slope. This is also an object of class `mhtest`. See `methods(class = "mhtest")`.

 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33``` ```set.seed(1) X <- big_attachExtdata() n <- nrow(X) y <- rnorm(n) covar <- matrix(rnorm(n * 3), n) X1 <- X[, 1] # only first column of the Filebacked Big Matrix # Without covar test <- big_univLinReg(X, y) ## New class `mhtest` class(test) attr(test, "transfo") attr(test, "predict") ## plot results plot(test) plot(test, type = "Volcano") ## To get p-values associated with the test test\$p.value <- predict(test, log10 = FALSE) str(test) summary(lm(y ~ X1))\$coefficients[2, ] # With all data str(big_univLinReg(X, y, covar = covar)) summary(lm(y ~ X1 + covar))\$coefficients[2, ] # With only half of the data ind.train <- sort(sample(n, n/2)) str(big_univLinReg(X, y[ind.train], covar.train = covar[ind.train, ], ind.train = ind.train)) summary(lm(y ~ X1 + covar, subset = ind.train))\$coefficients[2, ] ```
{"ft_lang_label":"__label__en","ft_lang_prob":0.5579296,"math_prob":0.899499,"size":2271,"snap":"2021-31-2021-39","text_gpt3_token_len":693,"char_repetition_ratio":0.09660344,"word_repetition_ratio":0.052910052,"special_character_ratio":0.30955526,"punctuation_ratio":0.15913978,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.99305964,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2021-09-20T21:26:09Z\",\"WARC-Record-ID\":\"<urn:uuid:bc24a967-4f94-475f-a50b-b9ea77ea9dfe>\",\"Content-Length\":\"58983\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:d84c2dd7-06ee-4a6a-a7d4-2a598cb8e783>\",\"WARC-Concurrent-To\":\"<urn:uuid:5e3e1aa1-d3e6-4d93-ad5c-c1aeb583ddcf>\",\"WARC-IP-Address\":\"51.81.83.12\",\"WARC-Target-URI\":\"https://rdrr.io/cran/bigstatsr/man/big_univLinReg.html\",\"WARC-Payload-Digest\":\"sha1:DFYZZBVQMJC6Y6SM2ZW3AW4RZMPAOJJY\",\"WARC-Block-Digest\":\"sha1:2MAJOP5JYPTUY6ZGJ2EZWM7XFNGSCSGT\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2021/CC-MAIN-2021-39/CC-MAIN-2021-39_segments_1631780057091.31_warc_CC-MAIN-20210920191528-20210920221528-00442.warc.gz\"}"}