Commit 3c3ce35e authored by Armin Rauschenberger's avatar Armin Rauschenberger
Browse files

automation

parent 009ca032
## cornet 0.0.0 (2019-01-17)
## cornet 0.0.1 (2019-03-15)
* Added functions
\ No newline at end of file
* first submission
\ No newline at end of file
......@@ -88,11 +88,17 @@
#' \code{\link[=coef.cornet]{coef}} and
#' \code{\link[=predict.cornet]{predict}}.
#'
#' @references
#' A Rauschenberger, E Glaab (2019).
#' "Lasso and ridge regression with dichotomised outcomes".
#' \emph{Manuscript in preparation}.
#'
#' @examples
#' n <- 100; p <- 200
#' y <- rnorm(n)
#' X <- matrix(rnorm(n*p),nrow=n,ncol=p)
#' net <- cornet(y=y,cutoff=0,X=X)
#' net
#'
cornet <- function(y,cutoff,X,alpha=1,npi=101,pi=NULL,nsigma=99,sigma=NULL,nfolds=10,foldid=NULL,type.measure="deviance",...){
......@@ -219,7 +225,7 @@ cornet <- function(y,cutoff,X,alpha=1,npi=101,pi=NULL,nsigma=99,sigma=NULL,nfold
}
}
temp <- which(fit$cvm==min(fit$cvm),arr.ind=TRUE,useNames=TRUE)
if(nrow(temp)>1){warning("MULTIPLE!",call.=FALSE);temp <- temp[1,,drop=FALSE]}
if(nrow(temp)>1){warning("Multiple!",call.=FALSE);temp <- temp[1,,drop=FALSE]}
fit$sigma.min <- fit$sigma[temp[1]]
fit$pi.min <- fit$pi[temp[2]]
if(fit$cvm[names(fit$sigma.min),names(fit$pi.min)]!=min(fit$cvm)){stop("Internal error.")}
......
---
pagetitle: palasso
pagetitle: cornet
output: github_document
editor_options:
chunk_output_type: console
......@@ -15,31 +15,29 @@ knitr::opts_chunk$set(
)
```
[![Travis-CI Build Status](https://travis-ci.org/rauschenberger/cornet.svg)](https://travis-ci.org/rauschenberger/cornet)
[![AppVeyor build status](https://ci.appveyor.com/api/projects/status/github/rauschenberger/cornet?svg=true)](https://ci.appveyor.com/project/rauschenberger/cornet)
[![Coverage Status](https://codecov.io/github/rauschenberger/cornet/coverage.svg?branch=master)](https://codecov.io/github/rauschenberger/cornet)
## Scope
Lasso and ridge regression for dichotomised outcomes (extending [glmnet](https://CRAN.R-project.org/package=glmnet)).
## Installation
Install the current release from [CRAN](https://CRAN.R-project.org/package=cornet),
or the latest development version from [GitHub](https://github.com/rauschenberger/cornet):
Install the current release from [CRAN](https://CRAN.R-project.org/package=cornet):
```{r,eval=FALSE}
install.packages("cornet")
```
or the latest development version from [GitHub](https://github.com/rauschenberger/cornet):
```{r,eval=FALSE}
#install.packages("devtools")
devtools::install_github("rauschenberger/cornet")
```
## Reference
A Rauschenberger, and E Glaab (2019). "Lasso and ridge regression for dichotomised outcomes". Manuscript in preparation.
Armin Rauschenberger and Enrico Glaab (2019). "Lasso and ridge regression for dichotomised outcomes". *Manuscript in preparation.*
......@@ -10,11 +10,15 @@ Lasso and ridge regression for dichotomised outcomes (extending [glmnet](https:/
Installation
------------
Install the current release from [CRAN](https://CRAN.R-project.org/package=cornet), or the latest development version from [GitHub](https://github.com/rauschenberger/cornet):
Install the current release from [CRAN](https://CRAN.R-project.org/package=cornet):
``` r
install.packages("cornet")
```
or the latest development version from [GitHub](https://github.com/rauschenberger/cornet):
``` r
#install.packages("devtools")
devtools::install_github("rauschenberger/cornet")
```
......@@ -22,4 +26,4 @@ devtools::install_github("rauschenberger/cornet")
Reference
---------
A Rauschenberger, and E Glaab (2019). "Lasso and ridge regression for dichotomised outcomes". Manuscript in preparation.
Armin Rauschenberger and Enrico Glaab (2019). "Lasso and ridge regression for dichotomised outcomes". *Manuscript in preparation.*
......@@ -83,7 +83,7 @@
</a>
<ul class="dropdown-menu" role="menu">
<li>
<a href="../articles/vignette.html">Lasso and ridge regression for dichotomised outcomes</a>
<a href="../articles/vignette.html">Combined Regression</a>
</li>
</ul>
</li>
......@@ -119,7 +119,7 @@
<p class="section-desc"></p>
<ul>
<li><a href="vignette.html">Lasso and ridge regression for dichotomised outcomes</a></li>
<li><a href="vignette.html">Combined Regression</a></li>
</ul>
</div>
</div>
......
......@@ -5,11 +5,11 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Lasso and ridge regression for dichotomised outcomes • cornet</title>
<title>Combined Regression • cornet</title>
<!-- jquery --><script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script><!-- Bootstrap --><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha256-916EbMg70RQy9LHiGkXzG8hSg9EdNy97GazNG/aiY1w=" crossorigin="anonymous">
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha256-U5ZEeKfGNOja007MMD3YBI0A3OSZOQbeG6z2f2Y0hu8=" crossorigin="anonymous"></script><!-- Font Awesome icons --><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha256-eZrrJcwDc/3uDhsdt61sL2oOBY362qM3lon1gyExkL0=" crossorigin="anonymous">
<!-- clipboard.js --><script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.4/clipboard.min.js" integrity="sha256-FiZwavyI2V6+EXO1U+xzLG3IKldpiTFf3153ea9zikQ=" crossorigin="anonymous"></script><!-- sticky kit --><script src="https://cdnjs.cloudflare.com/ajax/libs/sticky-kit/1.1.3/sticky-kit.min.js" integrity="sha256-c4Rlo1ZozqTPE2RLuvbusY3+SU1pQaJC0TjuhygMipw=" crossorigin="anonymous"></script><!-- pkgdown --><link href="../pkgdown.css" rel="stylesheet">
<script src="../pkgdown.js"></script><meta property="og:title" content="Lasso and ridge regression for dichotomised outcomes">
<script src="../pkgdown.js"></script><meta property="og:title" content="Combined Regression">
<meta property="og:description" content="">
<meta name="twitter:card" content="summary">
<!-- mathjax --><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js" integrity="sha256-nvJJv9wWKEm88qvoQl9ekL2J+k/RWIsaSScxxlsrv8k=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/config/TeX-AMS-MML_HTMLorMML.js" integrity="sha256-84DKXVJXs0/F8OTMzX4UR909+jtl4G7SPypPavF+GfA=" crossorigin="anonymous"></script><!--[if lt IE 9]>
......@@ -53,7 +53,7 @@
</a>
<ul class="dropdown-menu" role="menu">
<li>
<a href="../articles/vignette.html">Lasso and ridge regression for dichotomised outcomes</a>
<a href="../articles/vignette.html">Combined Regression</a>
</li>
</ul>
</li>
......@@ -80,7 +80,7 @@
</header><div class="row">
<div class="col-md-9 contents">
<div class="page-header toc-ignore">
<h1>Lasso and ridge regression for dichotomised outcomes</h1>
<h1>Combined Regression</h1>
<small class="dont-index">Source: <a href="https://github.com/rauschenberger/cornet/blob/master/vignettes/vignette.Rmd"><code>vignettes/vignette.Rmd</code></a></small>
......@@ -93,12 +93,11 @@
<div id="installation" class="section level2">
<h2 class="hasAnchor">
<a href="#installation" class="anchor"></a>Installation</h2>
<p>Installing the current release from <a href="https://CRAN.R-project.org/package=cornet">CRAN</a>:</p>
<p>Install the current release from <a href="https://CRAN.R-project.org/package=cornet">CRAN</a>:</p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="kw"><a href="https://www.rdocumentation.org/packages/utils/topics/install.packages">install.packages</a></span>(<span class="st">"cornet"</span>)</code></pre></div>
<p>Installing the latest development version from <a href="https://github.com/rauschenberger/cornet">GitHub</a>:</p>
<p>or the latest development version from <a href="https://github.com/rauschenberger/cornet">GitHub</a>:</p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="co">#install.packages("devtools")</span>
<span class="kw"><a href="https://www.rdocumentation.org/packages/base/topics/library">library</a></span>(devtools)
<span class="kw">install_github</span>(<span class="st">"rauschenberger/cornet"</span>)</code></pre></div>
devtools<span class="op">::</span><span class="kw"><a href="https://www.rdocumentation.org/packages/devtools/topics/reexports">install_github</a></span>(<span class="st">"rauschenberger/cornet"</span>)</code></pre></div>
</div>
</div>
......
......@@ -83,7 +83,7 @@
</a>
<ul class="dropdown-menu" role="menu">
<li>
<a href="articles/vignette.html">Lasso and ridge regression for dichotomised outcomes</a>
<a href="articles/vignette.html">Combined Regression</a>
</li>
</ul>
</li>
......
......@@ -53,7 +53,7 @@
</a>
<ul class="dropdown-menu" role="menu">
<li>
<a href="articles/vignette.html">Lasso and ridge regression for dichotomised outcomes</a>
<a href="articles/vignette.html">Combined Regression</a>
</li>
</ul>
</li>
......@@ -93,16 +93,16 @@
<div id="installation" class="section level2">
<h2 class="hasAnchor">
<a href="#installation" class="anchor"></a>Installation</h2>
<p>Install the current release from <a href="https://CRAN.R-project.org/package=cornet">CRAN</a>, or the latest development version from <a href="https://github.com/rauschenberger/cornet">GitHub</a>:</p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="kw"><a href="https://www.rdocumentation.org/packages/utils/topics/install.packages">install.packages</a></span>(<span class="st">"cornet"</span>)
<span class="co">#install.packages("devtools")</span>
<p>Install the current release from <a href="https://CRAN.R-project.org/package=cornet">CRAN</a>:</p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="kw"><a href="https://www.rdocumentation.org/packages/utils/topics/install.packages">install.packages</a></span>(<span class="st">"cornet"</span>)</code></pre></div>
<p>or the latest development version from <a href="https://github.com/rauschenberger/cornet">GitHub</a>:</p>
<div class="sourceCode"><pre class="sourceCode r"><code class="sourceCode r"><span class="co">#install.packages("devtools")</span>
devtools<span class="op">::</span><span class="kw"><a href="https://www.rdocumentation.org/packages/devtools/topics/reexports">install_github</a></span>(<span class="st">"rauschenberger/cornet"</span>)</code></pre></div>
</div>
<div id="reference" class="section level2">
<h2 class="hasAnchor">
<a href="#reference" class="anchor"></a>Reference</h2>
<p>A Rauschenberger, and E Glaab (2019). “Lasso and ridge regression for dichotomised outcomes”. Manuscript in preparation.</p>
<p>Armin Rauschenberger and Enrico Glaab (2019). “Lasso and ridge regression for dichotomised outcomes”. <em>Manuscript in preparation.</em></p>
</div>
</div>
......
......@@ -83,7 +83,7 @@
</a>
<ul class="dropdown-menu" role="menu">
<li>
<a href="../articles/vignette.html">Lasso and ridge regression for dichotomised outcomes</a>
<a href="../articles/vignette.html">Combined Regression</a>
</li>
</ul>
</li>
......@@ -115,11 +115,11 @@
<small>Source: <a href='https://github.com/rauschenberger/cornet/blob/master/NEWS.md'><code>NEWS.md</code></a></small>
</div>
<div id="cornet-0-0-0-2019-01-17" class="section level2">
<div id="cornet-0-0-1-2019-03-15" class="section level2">
<h2 class="hasAnchor">
<a href="#cornet-0-0-0-2019-01-17" class="anchor"></a>cornet 0.0.0 (2019-01-17)</h2>
<a href="#cornet-0-0-1-2019-03-15" class="anchor"></a>cornet 0.0.1 (2019-03-15)</h2>
<ul>
<li>Added functions</li>
<li>first submission</li>
</ul>
</div>
</div>
......@@ -128,7 +128,7 @@
<div id="tocnav">
<h2>Contents</h2>
<ul class="nav nav-pills nav-stacked">
<li><a href="#cornet-0-0-0-2019-01-17">0.0.0</a></li>
<li><a href="#cornet-0-0-1-2019-03-15">0.0.1</a></li>
</ul>
</div>
</div>
......
pandoc: 1.19.2.1
pkgdown: 1.3.0
pkgdown_sha: ~
articles: []
articles:
vignette: vignette.html
......@@ -87,7 +87,7 @@ under the penalty parameter that minimises the cross-validated loss." />
</a>
<ul class="dropdown-menu" role="menu">
<li>
<a href="../articles/vignette.html">Lasso and ridge regression for dichotomised outcomes</a>
<a href="../articles/vignette.html">Combined Regression</a>
</li>
</ul>
</li>
......@@ -135,7 +135,7 @@ under the penalty parameter that minimises the cross-validated loss.</p>
<colgroup><col class="name" /><col class="desc" /></colgroup>
<tr>
<th>object</th>
<td><p>cornet object</p></td>
<td><p><a href='cornet.html'>cornet</a> object</p></td>
</tr>
<tr>
<th>...</th>
......
......@@ -87,7 +87,7 @@ in high-dimensional settings." />
</a>
<ul class="dropdown-menu" role="menu">
<li>
<a href="../articles/vignette.html">Lasso and ridge regression for dichotomised outcomes</a>
<a href="../articles/vignette.html">Combined Regression</a>
</li>
</ul>
</li>
......@@ -223,18 +223,29 @@ meaning that the <code>glmnet</code> argument <code>family</code> is unavailable
Even if <code>type.measure</code> equals <code>"deviance"</code>,
the loss is incomparable between linear and logistic regression.</p>
<h2 class="hasAnchor" id="references"><a class="anchor" href="#references"></a>References</h2>
<p>A Rauschenberger, E Glaab (2019).
"Lasso and ridge regression with dichotomised outcomes".
<em>Manuscript in preparation</em>.</p>
<h2 class="hasAnchor" id="see-also"><a class="anchor" href="#see-also"></a>See also</h2>
<div class='dont-index'><p>Methods for objects of class <code>cornet</code> include
<code>coef</code> and
<code>predict</code>.</p></div>
<code><a href='coef.cornet.html'>coef</a></code> and
<code><a href='predict.cornet.html'>predict</a></code>.</p></div>
<h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2>
<pre class="examples"><div class='input'><span class='no'>n</span> <span class='kw'>&lt;-</span> <span class='fl'>100</span>; <span class='no'>p</span> <span class='kw'>&lt;-</span> <span class='fl'>200</span>
<span class='no'>y</span> <span class='kw'>&lt;-</span> <span class='fu'><a href='https://www.rdocumentation.org/packages/stats/topics/Normal'>rnorm</a></span>(<span class='no'>n</span>)
<span class='no'>X</span> <span class='kw'>&lt;-</span> <span class='fu'><a href='https://www.rdocumentation.org/packages/base/topics/matrix'>matrix</a></span>(<span class='fu'><a href='https://www.rdocumentation.org/packages/stats/topics/Normal'>rnorm</a></span>(<span class='no'>n</span>*<span class='no'>p</span>),<span class='kw'>nrow</span><span class='kw'>=</span><span class='no'>n</span>,<span class='kw'>ncol</span><span class='kw'>=</span><span class='no'>p</span>)
<span class='no'>net</span> <span class='kw'>&lt;-</span> <span class='fu'>cornet</span>(<span class='kw'>y</span><span class='kw'>=</span><span class='no'>y</span>,<span class='kw'>cutoff</span><span class='kw'>=</span><span class='fl'>0</span>,<span class='kw'>X</span><span class='kw'>=</span><span class='no'>X</span>)</div><div class='output co'>#&gt; <span class='warning'>Warning: MULTIPLE!</span></div><div class='input'>
<span class='no'>net</span> <span class='kw'>&lt;-</span> <span class='fu'>cornet</span>(<span class='kw'>y</span><span class='kw'>=</span><span class='no'>y</span>,<span class='kw'>cutoff</span><span class='kw'>=</span><span class='fl'>0</span>,<span class='kw'>X</span><span class='kw'>=</span><span class='no'>X</span>)</div><div class='output co'>#&gt; <span class='warning'>Warning: Multiple!</span></div><div class='input'><span class='no'>net</span></div><div class='output co'>#&gt; cornet object:
#&gt; n = 100, p = 200
#&gt; z = I(y &gt; 0): 54+ vs 46-
#&gt; sigma.min = 0.05
#&gt; pi.min = 0
#&gt; deviance = 1.3</div><div class='input'>
</div></pre>
</div>
<div class="col-md-3 hidden-xs hidden-sm" id="sidebar">
......@@ -246,6 +257,8 @@ the loss is incomparable between linear and logistic regression.</p>
<li><a href="#details">Details</a></li>
<li><a href="#references">References</a></li>
<li><a href="#see-also">See also</a></li>
<li><a href="#examples">Examples</a></li>
......
......@@ -86,7 +86,7 @@
</a>
<ul class="dropdown-menu" role="menu">
<li>
<a href="../articles/vignette.html">Lasso and ridge regression for dichotomised outcomes</a>
<a href="../articles/vignette.html">Combined Regression</a>
</li>
</ul>
</li>
......@@ -173,7 +173,9 @@ logical</p></td>
<h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2>
<pre class="examples"><div class='input'><span class='kw pkg'>cornet</span><span class='kw ns'>:::</span><span class='fu'>.check</span>(<span class='fl'>0.5</span>,<span class='kw'>type</span><span class='kw'>=</span><span class='st'>"scalar"</span>,<span class='kw'>min</span><span class='kw'>=</span><span class='fl'>0</span>,<span class='kw'>max</span><span class='kw'>=</span><span class='fl'>1</span>)</div></pre>
<pre class="examples"><div class='input'><span class='kw pkg'>cornet</span><span class='kw ns'>:::</span><span class='fu'><a href='https://www.rdocumentation.org/packages/cornet/topics/dot-check'>.check</a></span>(<span class='fl'>0.5</span>,<span class='kw'>type</span><span class='kw'>=</span><span class='st'>"scalar"</span>,<span class='kw'>min</span><span class='kw'>=</span><span class='fl'>0</span>,<span class='kw'>max</span><span class='kw'>=</span><span class='fl'>1</span>)
<span class='co'>#.check(x=c(1,2,3,4,45),type="vector",values=1:10)</span></div></pre>
</div>
<div class="col-md-3 hidden-xs hidden-sm" id="sidebar">
<h2>Contents</h2>
......
......@@ -86,7 +86,7 @@
</a>
<ul class="dropdown-menu" role="menu">
<li>
<a href="../articles/vignette.html">Lasso and ridge regression for dichotomised outcomes</a>
<a href="../articles/vignette.html">Combined Regression</a>
</li>
</ul>
</li>
......
......@@ -86,7 +86,7 @@
</a>
<ul class="dropdown-menu" role="menu">
<li>
<a href="../articles/vignette.html">Lasso and ridge regression for dichotomised outcomes</a>
<a href="../articles/vignette.html">Combined Regression</a>
</li>
</ul>
</li>
......@@ -143,7 +143,7 @@ logical</p></td>
<h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2>
<pre class="examples"><div class='input'><span class='kw pkg'>cornet</span><span class='kw ns'>:::</span><span class='fu'>.equal</span>(<span class='fl'>1</span>,<span class='fl'>1</span>,<span class='fl'>1</span>)</div></pre>
<pre class="examples"><div class='input'><span class='kw pkg'>cornet</span><span class='kw ns'>:::</span><span class='fu'><a href='https://www.rdocumentation.org/packages/cornet/topics/dot-equal'>.equal</a></span>(<span class='fl'>1</span>,<span class='fl'>1</span>,<span class='fl'>1</span>)</div></pre>
</div>
<div class="col-md-3 hidden-xs hidden-sm" id="sidebar">
<h2>Contents</h2>
......
......@@ -86,7 +86,7 @@
</a>
<ul class="dropdown-menu" role="menu">
<li>
<a href="../articles/vignette.html">Lasso and ridge regression for dichotomised outcomes</a>
<a href="../articles/vignette.html">Combined Regression</a>
</li>
</ul>
</li>
......@@ -158,7 +158,7 @@ positive real number</p></td>
<h2 class="hasAnchor" id="examples"><a class="anchor" href="#examples"></a>Examples</h2>
<pre class="examples"><div class='input'><span class='no'>data</span> <span class='kw'>&lt;-</span> <span class='kw pkg'>cornet</span><span class='kw ns'>:::</span><span class='fu'>.simulate</span>(<span class='kw'>n</span><span class='kw'>=</span><span class='fl'>10</span>,<span class='kw'>p</span><span class='kw'>=</span><span class='fl'>20</span>,<span class='kw'>prob</span><span class='kw'>=</span><span class='fl'>0.2</span>,<span class='kw'>fac</span><span class='kw'>=</span><span class='fl'>2</span>)
<pre class="examples"><div class='input'><span class='no'>data</span> <span class='kw'>&lt;-</span> <span class='kw pkg'>cornet</span><span class='kw ns'>:::</span><span class='fu'><a href='https://www.rdocumentation.org/packages/cornet/topics/dot-simulate'>.simulate</a></span>(<span class='kw'>n</span><span class='kw'>=</span><span class='fl'>10</span>,<span class='kw'>p</span><span class='kw'>=</span><span class='fl'>20</span>,<span class='kw'>prob</span><span class='kw'>=</span><span class='fl'>0.2</span>,<span class='kw'>fac</span><span class='kw'>=</span><span class='fl'>2</span>)
<span class='fu'><a href='https://www.rdocumentation.org/packages/base/topics/names'>names</a></span>(<span class='no'>data</span>)</div><div class='output co'>#&gt; [1] "y" "X"</div><div class='input'>
</div></pre>
</div>
......
......@@ -86,7 +86,7 @@
</a>
<ul class="dropdown-menu" role="menu">
<li>
<a href="../articles/vignette.html">Lasso and ridge regression for dichotomised outcomes</a>
<a href="../articles/vignette.html">Combined Regression</a>
</li>
</ul>
</li>
......
......@@ -83,7 +83,7 @@
</a>
<ul class="dropdown-menu" role="menu">
<li>
<a href="../articles/vignette.html">Lasso and ridge regression for dichotomised outcomes</a>
<a href="../articles/vignette.html">Combined Regression</a>
</li>
</ul>
</li>
......
......@@ -87,7 +87,7 @@ scaling (sigma) and weighting (pi) parameters." />
</a>
<ul class="dropdown-menu" role="menu">
<li>
<a href="../articles/vignette.html">Lasso and ridge regression for dichotomised outcomes</a>
<a href="../articles/vignette.html">Combined Regression</a>
</li>
</ul>
</li>
......@@ -135,7 +135,7 @@ scaling (sigma) and weighting (pi) parameters.</p>
<colgroup><col class="name" /><col class="desc" /></colgroup>
<tr>
<th>x</th>
<td><p>cornet object</p></td>
<td><p><a href='cornet.html'>cornet</a> object</p></td>
</tr>
<tr>
<th>...</th>
......
......@@ -86,7 +86,7 @@
</a>
<ul class="dropdown-menu" role="menu">
<li>
<a href="../articles/vignette.html">Lasso and ridge regression for dichotomised outcomes</a>
<a href="../articles/vignette.html">Combined Regression</a>
</li>
</ul>
</li>
......@@ -133,7 +133,7 @@
<colgroup><col class="name" /><col class="desc" /></colgroup>
<tr>
<th>object</th>
<td><p>cornet object</p></td>
<td><p><a href='cornet.html'>cornet</a> object</p></td>
</tr>
<tr>
<th>newx</th>
......
......@@ -86,7 +86,7 @@
</a>
<ul class="dropdown-menu" role="menu">
<li>
<a href="../articles/vignette.html">Lasso and ridge regression for dichotomised outcomes</a>
<a href="../articles/vignette.html">Combined Regression</a>
</li>
</ul>
</li>
......@@ -133,7 +133,7 @@
<colgroup><col class="name" /><col class="desc" /></colgroup>
<tr>
<th>x</th>
<td><p>cornet object</p></td>
<td><p><a href='cornet.html'>cornet</a> object</p></td>
</tr>
<tr>
<th>...</th>
......
......@@ -80,7 +80,13 @@ n <- 100; p <- 200
y <- rnorm(n)
X <- matrix(rnorm(n*p),nrow=n,ncol=p)
net <- cornet(y=y,cutoff=0,X=X)
net
}
\references{
A Rauschenberger, E Glaab (2019).
"Lasso and ridge regression with dichotomised outcomes".
\emph{Manuscript in preparation}.
}
\seealso{
Methods for objects of class \code{cornet} include
......
#for(i in 1:100){
# data simulation
list <- cornet:::.simulate(n=100,p=200)
y <- list$y; X <- list$X
......@@ -14,6 +11,8 @@ net <- list()
net$gaussian <- glmnet::cv.glmnet(y=y,x=X,family="gaussian",foldid=foldid)
net$binomial <- glmnet::cv.glmnet(y=y>cutoff,x=X,family="binomial",foldid=foldid)
#--- cornet equals glmnet ---
for(dist in c("gaussian","binomial")){
testthat::test_that("cross-validated loss",{
......@@ -41,13 +40,45 @@ for(dist in c("gaussian","binomial")){
testthat::expect_true(all(a==b))
})
testthat::test_that("coefficients",{
a <- fit[[dist]]$beta
b <- net[[dist]]$glmnet.fit$beta
testthat::expect_true(all(a==b))
})
}
testthat::test_that("predicted values (logistic)",{
#--- other checks ---
testthat::test_that("predicted probabilities",{ # important!
a <- cornet:::predict.cornet(object=fit,newx=X)$binomial
b <- as.numeric(stats::predict(object=net$binomial,newx=X,s="lambda.min",type="response"))
testthat::expect_true(all(a==b))
})
#}
testthat::test_that("tuning parameters",{
a <- (0 <= fit$sigma.min) & is.finite(fit$sigma.min)
b <- (0 <= fit$pi.min) & (fit$pi.min <= 1)
c <- min(fit$cvm) == fit$cvm[names(fit$sigma.min),names(fit$pi.min)]
testthat::expect_true(all(a,b,c))
})
testthat::test_that("print function",{
a <- cornet:::print.cornet(fit)
testthat::expect_true(is.null(a))
})
testthat::test_that("plot function",{
a <- cornet:::plot.cornet(fit)
testthat::expect_true(is.null(a))
})
testthat::test_that("hidden compare function",{
res <- cornet:::.compare(y=y,cutoff=cutoff,X=X,nfolds=2)
cornet:::.check(x=res$resid.pvalue,min=0,max=1,type="vector")
})
testthat::test_that("hidden test function",{
p <- cornet:::.test(y=y,cutoff=cutoff,X=X)
cornet:::.check(x=p,min=0,max=1,type="scalar")
})
---
title: Lasso and ridge regression for dichotomised outcomes
title: Combined Regression
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{vignette}
......@@ -15,16 +15,15 @@ knitr::opts_chunk$set(echo = TRUE)
## Installation
Installing 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):
```{r,eval=FALSE}
install.packages("cornet")
```
Installing the latest development version from [GitHub](https://github.com/rauschenberger/cornet):
or the latest development version from [GitHub](https://github.com/rauschenberger/cornet):
```{r,eval=FALSE}
#install.packages("devtools")
library(devtools)
install_github("rauschenberger/cornet")
devtools::install_github("rauschenberger/cornet")
```
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment