<pre><code>## Warning: package 'cornet' was built under R version 4.0.2</code></pre>
</div>
</div>
<divid="example"class="section level2">
<divid="example"class="section level2">
<h2class="hasAnchor">
<h2class="hasAnchor">
<ahref="#example"class="anchor"></a>Example</h2>
<ahref="#example"class="anchor"></a>Example</h2>
<p>We simulate data for <spanclass="math inline">\(n\)</span> samples and <spanclass="math inline">\(p\)</span> features, in a high-dimensional setting (<spanclass="math inline">\(p \gg n\)</span>). The matrix <spanclass="math inline">\(\boldsymbol{X}\)</span> with <spanclass="math inline">\(n\)</span> rows and <spanclass="math inline">\(p\)</span> columns represents the features, and the vector <spanclass="math inline">\(\boldsymbol{y}\)</span> of length <spanclass="math inline">\(n\)</span> represents the continuous outcome.</p>
<p>We simulate data for <spanclass="math inline">\(n\)</span> samples and <spanclass="math inline">\(p\)</span> features, in a high-dimensional setting (<spanclass="math inline">\(p \gg n\)</span>). The matrix <spanclass="math inline">\(\boldsymbol{X}\)</span> with <spanclass="math inline">\(n\)</span> rows and <spanclass="math inline">\(p\)</span> columns represents the features, and the vector <spanclass="math inline">\(\boldsymbol{y}\)</span> of length <spanclass="math inline">\(n\)</span> represents the continuous outcome.</p>
<p>We use the function <code>cornet</code> for modelling the original continuous outcome and the artificial binary outcome. The argument <code>cutoff</code> 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.</p>
<p>We use the function <code>cornet</code> for modelling the original continuous outcome and the artificial binary outcome. The argument <code>cutoff</code> 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.</p>
<p>The function <code>coef</code> 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.</p>
<p>The function <code>coef</code> 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.</p>
<p>The function <code>predict</code> returns fitted values for training data, or predicted values for testing data. The argument <code>newx</code> specifies the feature matrix. The output is a matrix with one column for each model.</p>
<p>The function <code>predict</code> returns fitted values for training data, or predicted values for testing data. The argument <code>newx</code> specifies the feature matrix. The output is a matrix with one column for each model.</p>
<p>The function <code>cv.cornet</code> measures the predictive performance of combined regression by nested cross-validation, in comparison with logistic regression.</p>
<p>The function <code>cv.cornet</code> measures the predictive performance of combined regression by nested cross-validation, in comparison with logistic regression.</p>
<p>Here we observe that combined regression outperforms logistic regression (lower logistic deviance), and that logistic regression is only slightly better than the intercept-only model.</p>
<p>Here we observe that combined regression outperforms logistic regression (lower logistic deviance), and that logistic regression is only slightly better than the intercept-only model.</p>