...
 
Commits (2)
Package: cornet Package: cornet
Version: 0.0.3 Version: 0.0.4
Title: Elastic Net with Dichotomised Outcomes Title: Elastic Net with Dichotomised Outcomes
Description: Implements lasso and ridge regression for dichotomised outcomes (Rauschenberger et al. 2019). Such outcomes are not naturally but artificially binary. They indicate whether an underlying measurement is greater than a threshold. Description: Implements lasso and ridge regression for dichotomised outcomes (Rauschenberger et al. 2019). Such outcomes are not naturally but artificially binary. They indicate whether an underlying measurement is greater than a threshold.
Depends: R (>= 3.0.0) Depends: R (>= 3.0.0)
......
## cornet 0.0.4 (2020-03-17)
* updated documentation
## cornet 0.0.3 (2019-11-12) ## cornet 0.0.3 (2019-11-12)
* changed glmnet exports * changed glmnet exports
......
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="index.html">cornet</a> <a class="navbar-link" href="index.html">cornet</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.0.3</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.0.4</span>
</span> </span>
</div> </div>
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">cornet</a> <a class="navbar-link" href="../index.html">cornet</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.0.3</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.0.4</span>
</span> </span>
</div> </div>
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">cornet</a> <a class="navbar-link" href="../index.html">cornet</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.0.3</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.0.4</span>
</span> </span>
</div> </div>
......
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">cornet</a> <a class="navbar-link" href="../index.html">cornet</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.0.3</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.0.4</span>
</span> </span>
</div> </div>
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">cornet</a> <a class="navbar-link" href="../index.html">cornet</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.0.3</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.0.4</span>
</span> </span>
</div> </div>
......
This diff is collapsed.
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="index.html">cornet</a> <a class="navbar-link" href="index.html">cornet</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.0.3</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.0.4</span>
</span> </span>
</div> </div>
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="index.html">cornet</a> <a class="navbar-link" href="index.html">cornet</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.0.3</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.0.4</span>
</span> </span>
</div> </div>
......
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">cornet</a> <a class="navbar-link" href="../index.html">cornet</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.0.3</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.0.4</span>
</span> </span>
</div> </div>
...@@ -122,6 +122,13 @@ ...@@ -122,6 +122,13 @@
<small>Source: <a href='https://github.com/rauschenberger/cornet/blob/master/NEWS.md'><code>NEWS.md</code></a></small> <small>Source: <a href='https://github.com/rauschenberger/cornet/blob/master/NEWS.md'><code>NEWS.md</code></a></small>
</div> </div>
<div id="cornet-004-2020-03-17" class="section level2">
<h2 class="hasAnchor">
<a href="#cornet-004-2020-03-17" class="anchor"></a>cornet 0.0.4 (2020-03-17)</h2>
<ul>
<li>updated documentation</li>
</ul>
</div>
<div id="cornet-003-2019-11-12" class="section level2"> <div id="cornet-003-2019-11-12" class="section level2">
<h2 class="hasAnchor"> <h2 class="hasAnchor">
<a href="#cornet-003-2019-11-12" class="anchor"></a>cornet 0.0.3 (2019-11-12)</h2> <a href="#cornet-003-2019-11-12" class="anchor"></a>cornet 0.0.3 (2019-11-12)</h2>
...@@ -158,6 +165,7 @@ ...@@ -158,6 +165,7 @@
<div id="tocnav"> <div id="tocnav">
<h2>Contents</h2> <h2>Contents</h2>
<ul class="nav nav-pills nav-stacked"> <ul class="nav nav-pills nav-stacked">
<li><a href="#cornet-004-2020-03-17">0.0.4</a></li>
<li><a href="#cornet-003-2019-11-12">0.0.3</a></li> <li><a href="#cornet-003-2019-11-12">0.0.3</a></li>
<li><a href="#cornet-003-2019-10-02">0.0.3</a></li> <li><a href="#cornet-003-2019-10-02">0.0.3</a></li>
<li><a href="#cornet-002-2019-09-26">0.0.2</a></li> <li><a href="#cornet-002-2019-09-26">0.0.2</a></li>
......
...@@ -70,7 +70,7 @@ under the penalty parameter that minimises the cross-validated loss." /> ...@@ -70,7 +70,7 @@ under the penalty parameter that minimises the cross-validated loss." />
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">cornet</a> <a class="navbar-link" href="../index.html">cornet</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.0.3</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.0.4</span>
</span> </span>
</div> </div>
......
...@@ -71,7 +71,7 @@ They indicate whether an underlying measurement is greater than a threshold." /> ...@@ -71,7 +71,7 @@ They indicate whether an underlying measurement is greater than a threshold." />
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">cornet</a> <a class="navbar-link" href="../index.html">cornet</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.0.3</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.0.4</span>
</span> </span>
</div> </div>
......
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">cornet</a> <a class="navbar-link" href="../index.html">cornet</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.0.3</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.0.4</span>
</span> </span>
</div> </div>
......
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">cornet</a> <a class="navbar-link" href="../index.html">cornet</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.0.3</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.0.4</span>
</span> </span>
</div> </div>
......
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">cornet</a> <a class="navbar-link" href="../index.html">cornet</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.0.3</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.0.4</span>
</span> </span>
</div> </div>
......
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">cornet</a> <a class="navbar-link" href="../index.html">cornet</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.0.3</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.0.4</span>
</span> </span>
</div> </div>
......
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">cornet</a> <a class="navbar-link" href="../index.html">cornet</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.0.3</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.0.4</span>
</span> </span>
</div> </div>
......
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">cornet</a> <a class="navbar-link" href="../index.html">cornet</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.0.3</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.0.4</span>
</span> </span>
</div> </div>
......
...@@ -70,7 +70,7 @@ scaling (sigma) and weighting (pi) parameters." /> ...@@ -70,7 +70,7 @@ scaling (sigma) and weighting (pi) parameters." />
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">cornet</a> <a class="navbar-link" href="../index.html">cornet</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.0.3</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.0.4</span>
</span> </span>
</div> </div>
......
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">cornet</a> <a class="navbar-link" href="../index.html">cornet</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.0.3</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.0.4</span>
</span> </span>
</div> </div>
......
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
</button> </button>
<span class="navbar-brand"> <span class="navbar-brand">
<a class="navbar-link" href="../index.html">cornet</a> <a class="navbar-link" href="../index.html">cornet</a>
<span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.0.3</span> <span class="version label label-default" data-toggle="tooltip" data-placement="bottom" title="Released version">0.0.4</span>
</span> </span>
</div> </div>
......
...@@ -13,7 +13,7 @@ editor_options: ...@@ -13,7 +13,7 @@ editor_options:
knitr::opts_chunk$set(echo = TRUE) knitr::opts_chunk$set(echo = TRUE)
``` ```
# Installation ## Installation
Install the current release from [CRAN](https://CRAN.R-project.org/package=cornet): Install the current release from [CRAN](https://CRAN.R-project.org/package=cornet):
...@@ -34,11 +34,60 @@ Then load and attach the package: ...@@ -34,11 +34,60 @@ Then load and attach the package:
library(cornet) library(cornet)
``` ```
## Simulation
We simulate data for $n=100$ samples and $p=500$ features. The vector $\boldsymbol{y}$ of length $n$ represents the outcome, and the matrix $\boldsymbol{X}$ with $n$ rows and $p$ columns represents the features. As outlined in the manuscript, it is considered bad statistical practice to dichotomise continuous outcomes, but there might be practical reasons to do so. We recommend to model the original continuous outcome with *linear regression* (default), or the artificial binary outcome with *combined regression* (exception).
```{r,eval=FALSE}
set.seed(1)
n <- 100; p <- 500
X <- matrix(rnorm(n*p),nrow=n,ncol=p)
beta <- rbinom(n=p,size=1,prob=0.05)
mean <- X %*% beta
y <- rnorm(n=n,mean=mean)
```
## Application
We use the function `cornet` for modelling the underlying continuous outcome and the artifial binary outcome. The argument `cutoff` splits the samples into two groups, those with an outcome less than or equal to the cutoff, and those with an outcome greater than the cutoff.
```{r,eval=FALSE}
model <- cornet(y=y,cutoff=0,X=X)
model
```
The function `coef` returns the estimated coefficients. The first column is for the linear model (beta), and the second column is for the logistic model (gamma). The first row includes the estimated intercepts, and the other rows include the estimated slopes.
```{r,eval=FALSE}
coef <- coef(model)
```
The function `predict` returns fitted values for training data, or predicted values for testing data. The argument `newx` specifies the feature matrix. The output is a matrix with one column for each model.
```{r,eval=FALSE}
predict <- predict(model,newx=X)
```
The function `cv.cornet` measures the predictive performance of combined regression by nested cross-validation, in comparison with logistic regression.
```{r,eval=FALSE}
cv.cornet(y=y,cutoff=0,X=X)
```
Here we observe that combined regression outperforms logistic regression (lower logistic deviance). Logistic regression is only slightly better than the intercept-only model.
# References
Rauschenberger A, and Glaab E (2019). "Predicting artificial binary outcomes from high-dimensional data". *Manuscript in preparation.*
<!--
# Example # Example
This is a confusing example because we would normally use ordinal regression!
Here we analyse the data from Pinho et al. (2016), available under the Gene Expression Omnibus ([GEO](https://www.ncbi.nlm.nih.gov/geo/)) accession number [GSE80599](https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSE80599). Our aim is to predict disease progression from gene expression. Here we analyse the data from Pinho et al. (2016), available under the Gene Expression Omnibus ([GEO](https://www.ncbi.nlm.nih.gov/geo/)) accession number [GSE80599](https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSE80599). Our aim is to predict disease progression from gene expression.
The ordinal outcome $\boldsymbol{y}$ (MDS-UPDRS item 3.12, postural instability) ranges from $0$ (normal) to $4$ (severe), but Pinho et al. (2016) model the binary outcome $\boldsymbol{z}=\mathbb{I}(\boldsymbol{y} \geq 1)$, which indicates slow $(0)$ or rapid $(1)$ progression. The ordinal outcome $\boldsymbol{y}$ (MDS-UPDRS item 3.12, postural instability) ranges from $0$ (normal) to $4$ (severe), but Pinho et al. (2016) model the binary outcome $\boldsymbol{z}=\mathbb{I}(\boldsymbol{y} \geq 1)$, which indicates slow $(0)$ or rapid $(1)$ progression.
## Data ## Data
...@@ -74,45 +123,8 @@ cor <- abs(cor(y,X,method="spearman")) ...@@ -74,45 +123,8 @@ cor <- abs(cor(y,X,method="spearman"))
X <- X[,cor>0.3] # forbidden! X <- X[,cor>0.3] # forbidden!
``` ```
<!-- Pearson correlation test is equivalent to $t$-test in simple regression -->
## Model
We use the function `cornet` for modelling the artifial binary outcome. The argument `cutoff` splits the samples into two groups, those with an outcome less than or equal to the cutoff, and those with an outcome greater than the cutoff.
```{r,eval=FALSE}
model <- cornet(y=y,cutoff=0,X=X)
model
```
The function `coef` returns the estimated coefficients. The first column is for the linear model (beta), and the second column is for the logistic model (gamma). The first row includes the estimated intercepts, and the other rows include the estimated slopes.
```{r,eval=FALSE}
coef <- coef(model)
```
The function `predict` returns fitted values for training data, or predicted values for testing data. The argument `newx` specifies the feature matrix. The output is a matrix with one column for each model.
```{r,eval=FALSE}
predict <- predict(model,newx=X)
```
The function `cv.cornet` measures the predictive performance of combined regression by nested cross-validation, in comparison with logistic regression.
```{r,eval=FALSE}
cv.cornet(y=y,cutoff=0,X=X)
```
Here we observe that combined regression outperforms logistic regression (lower logistic deviance). Logistic regression is only slightly better than the intercept-only model.
# References
Pinho R, Guedes LC, Soreq L, Lobo PP, Mestre T, Coelho M, et al. (2016). "Gene Expression Differences in Peripheral Blood of Parkinson’s Disease Patients with Distinct Progression Profiles". *PLoS ONE* 11(6):e0157852. [doi:10.1371/journal.pone.0157852](https://doi.org/10.1371/journal.pone.0157852) Pinho R, Guedes LC, Soreq L, Lobo PP, Mestre T, Coelho M, et al. (2016). "Gene Expression Differences in Peripheral Blood of Parkinson’s Disease Patients with Distinct Progression Profiles". *PLoS ONE* 11(6):e0157852. [doi:10.1371/journal.pone.0157852](https://doi.org/10.1371/journal.pone.0157852)
Rauschenberger A, and Glaab E (2019). "Predicting artificial binary outcomes from high-dimensional data". *Manuscript in preparation.*
<!--
# Cognitive impairment # Cognitive impairment
Rani et al. (2017): GSE97644 Rani et al. (2017): GSE97644
......
This diff is collapsed.