forked from stephenslab/susieR
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add intercept and standardize functions
- Loading branch information
1 parent
74cb314
commit 338453a
Showing
7 changed files
with
65 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
Package: susieR | ||
Type: Package | ||
Title: Fit Sum of Single Effects linear regression model | ||
Version: 0.1.4 | ||
Version: 0.1.5 | ||
Author: Matthew Stephens | ||
Maintainer: <[email protected]> | ||
Description: Fits a sparse regression model with up to $L$ effects, where $L$ is user-specified. | ||
|
@@ -10,3 +10,4 @@ License: MIT | |
Encoding: UTF-8 | ||
LazyData: true | ||
RoxygenNote: 6.0.1.9000 | ||
Suggests: testthat |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
library(testthat) | ||
library(susieR) | ||
|
||
test_check("susieR") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
test_that("scaling and intercept works as expected",{ | ||
set.seed(1) | ||
x = matrix(rnorm(2000,3,4),ncol=10) | ||
b = rnorm(10) | ||
y = x %*% b + rnorm(200,0,0.1) | ||
s1 = susie(x,y,intercept= TRUE, standardize=TRUE) | ||
s2 = susie(x,y,intercept = FALSE, standardize = FALSE) | ||
s3 = susie(x,y,intercept =TRUE, standardize = FALSE) | ||
s4 = susie(x,y,intercept = FALSE,standardize = TRUE) | ||
|
||
expect_equal(predict(s2),predict(s2,x)) | ||
expect_equal(predict(s4),predict(s4,x)) | ||
expect_equal(predict(s1),predict(s1,x)) | ||
expect_equal(predict(s3),predict(s3,x)) | ||
|
||
expect_equal(s2$intercept, 0) | ||
expect_equal(s4$intercept, 0) | ||
|
||
}) |