Skip to content

Commit

Permalink
Merge pull request #322 from insightsengineering/cran-release
Browse files Browse the repository at this point in the history
fixed spelling, fix url
  • Loading branch information
gowerc authored Mar 2, 2022
2 parents 7a4f1da + 97b54f9 commit 895edb1
Show file tree
Hide file tree
Showing 7 changed files with 95 additions and 45 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@

^CRAN-SUBMISSION$
^cran-comments\.md$
^.vscode$
21 changes: 21 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "Build Vignettes",
"type": "shell",
"command": "Rscript vignettes/build.R",
"problemMatcher": {},
"presentation": {
"echo": true,
"reveal": "always",
"focus": true,
"panel": "dedicated",
"showReuseMessage": true,
"clear": true
}
}
]
}
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Authors@R: c(
person("Marcel", "Wolbers", email = "[email protected]", role = "ctb"),
person("Roche", role = c("cph", "fnd"))
)
Description: Implements reference based multiple imputation allowing for the imputation of longitudinal datasets using pre-defined strategies.
Description: Implements reference based multiple imputation allowing for the imputation of longitudinal datasets using predefined strategies.
Encoding: UTF-8
LazyData: true
Roxygen: list(markdown = TRUE)
Expand Down
59 changes: 33 additions & 26 deletions vignettes/advanced.html
Original file line number Diff line number Diff line change
Expand Up @@ -462,31 +462,38 @@ <h1><span class="header-section-number">2</span> Data simulation using function
<span id="cb1-57"><a href="#cb1-57" aria-hidden="true" tabindex="-1"></a>)</span>
<span id="cb1-58"><a href="#cb1-58" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb1-59"><a href="#cb1-59" aria-hidden="true" tabindex="-1"></a><span class="fu">head</span>(data)</span>
<span id="cb1-60"><a href="#cb1-60" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; id visit group outcome_bl outcome_noICE ind_ice1 ind_ice2 dropout_ice1 outcome</span></span>
<span id="cb1-61"><a href="#cb1-61" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; 1 id_1 0 Control 57.32704 57.32704 0 0 0 57.32704</span></span>
<span id="cb1-62"><a href="#cb1-62" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; 2 id_1 1 Control 57.32704 54.69751 1 0 1 NA</span></span>
<span id="cb1-63"><a href="#cb1-63" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; 3 id_1 2 Control 57.32704 58.60702 1 0 1 NA</span></span>
<span id="cb1-64"><a href="#cb1-64" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; 4 id_1 3 Control 57.32704 61.50119 1 0 1 NA</span></span>
<span id="cb1-65"><a href="#cb1-65" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; 5 id_1 4 Control 57.32704 56.68363 1 0 1 NA</span></span>
<span id="cb1-66"><a href="#cb1-66" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; 6 id_1 5 Control 57.32704 66.14799 1 0 1 NA</span></span>
<span id="cb1-67"><a href="#cb1-67" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb1-68"><a href="#cb1-68" aria-hidden="true" tabindex="-1"></a><span class="co"># As a simple descriptive of the simulated data, summarize the number of subjects with ICEs and missing data </span></span>
<span id="cb1-69"><a href="#cb1-69" aria-hidden="true" tabindex="-1"></a>data <span class="sc">%&gt;%</span></span>
<span id="cb1-70"><a href="#cb1-70" aria-hidden="true" tabindex="-1"></a> <span class="fu">group_by</span>(id) <span class="sc">%&gt;%</span></span>
<span id="cb1-71"><a href="#cb1-71" aria-hidden="true" tabindex="-1"></a> <span class="fu">summarise</span>(</span>
<span id="cb1-72"><a href="#cb1-72" aria-hidden="true" tabindex="-1"></a> <span class="at">group =</span> group[<span class="dv">1</span>],</span>
<span id="cb1-73"><a href="#cb1-73" aria-hidden="true" tabindex="-1"></a> <span class="at">any_ICE =</span> (<span class="fu">any</span>(ind_ice1 <span class="sc">==</span> <span class="dv">1</span>)),</span>
<span id="cb1-74"><a href="#cb1-74" aria-hidden="true" tabindex="-1"></a> <span class="at">any_NA =</span> <span class="fu">any</span>(<span class="fu">is.na</span>(outcome))) <span class="sc">%&gt;%</span></span>
<span id="cb1-75"><a href="#cb1-75" aria-hidden="true" tabindex="-1"></a> <span class="fu">group_by</span>(group) <span class="sc">%&gt;%</span></span>
<span id="cb1-76"><a href="#cb1-76" aria-hidden="true" tabindex="-1"></a> <span class="fu">summarise</span>(</span>
<span id="cb1-77"><a href="#cb1-77" aria-hidden="true" tabindex="-1"></a> <span class="at">subjects_with_ICE =</span> <span class="fu">sum</span>(any_ICE),</span>
<span id="cb1-78"><a href="#cb1-78" aria-hidden="true" tabindex="-1"></a> <span class="at">subjects_with_missings =</span> <span class="fu">sum</span>(any_NA)</span>
<span id="cb1-79"><a href="#cb1-79" aria-hidden="true" tabindex="-1"></a> )</span>
<span id="cb1-80"><a href="#cb1-80" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; # A tibble: 2 × 3</span></span>
<span id="cb1-81"><a href="#cb1-81" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; group subjects_with_ICE subjects_with_missings</span></span>
<span id="cb1-82"><a href="#cb1-82" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; &lt;fct&gt; &lt;int&gt; &lt;int&gt;</span></span>
<span id="cb1-83"><a href="#cb1-83" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; 1 Control 18 8</span></span>
<span id="cb1-84"><a href="#cb1-84" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; 2 Intervention 25 14</span></span></code></pre></div>
<span id="cb1-60"><a href="#cb1-60" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; id visit group outcome_bl outcome_noICE ind_ice1 ind_ice2 dropout_ice1</span></span>
<span id="cb1-61"><a href="#cb1-61" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; 1 id_1 0 Control 57.32704 57.32704 0 0 0</span></span>
<span id="cb1-62"><a href="#cb1-62" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; 2 id_1 1 Control 57.32704 54.69751 1 0 1</span></span>
<span id="cb1-63"><a href="#cb1-63" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; 3 id_1 2 Control 57.32704 58.60702 1 0 1</span></span>
<span id="cb1-64"><a href="#cb1-64" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; 4 id_1 3 Control 57.32704 61.50119 1 0 1</span></span>
<span id="cb1-65"><a href="#cb1-65" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; 5 id_1 4 Control 57.32704 56.68363 1 0 1</span></span>
<span id="cb1-66"><a href="#cb1-66" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; 6 id_1 5 Control 57.32704 66.14799 1 0 1</span></span>
<span id="cb1-67"><a href="#cb1-67" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; outcome</span></span>
<span id="cb1-68"><a href="#cb1-68" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; 1 57.32704</span></span>
<span id="cb1-69"><a href="#cb1-69" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; 2 NA</span></span>
<span id="cb1-70"><a href="#cb1-70" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; 3 NA</span></span>
<span id="cb1-71"><a href="#cb1-71" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; 4 NA</span></span>
<span id="cb1-72"><a href="#cb1-72" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; 5 NA</span></span>
<span id="cb1-73"><a href="#cb1-73" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; 6 NA</span></span>
<span id="cb1-74"><a href="#cb1-74" aria-hidden="true" tabindex="-1"></a></span>
<span id="cb1-75"><a href="#cb1-75" aria-hidden="true" tabindex="-1"></a><span class="co"># As a simple descriptive of the simulated data, summarize the number of subjects with ICEs and missing data </span></span>
<span id="cb1-76"><a href="#cb1-76" aria-hidden="true" tabindex="-1"></a>data <span class="sc">%&gt;%</span></span>
<span id="cb1-77"><a href="#cb1-77" aria-hidden="true" tabindex="-1"></a> <span class="fu">group_by</span>(id) <span class="sc">%&gt;%</span></span>
<span id="cb1-78"><a href="#cb1-78" aria-hidden="true" tabindex="-1"></a> <span class="fu">summarise</span>(</span>
<span id="cb1-79"><a href="#cb1-79" aria-hidden="true" tabindex="-1"></a> <span class="at">group =</span> group[<span class="dv">1</span>],</span>
<span id="cb1-80"><a href="#cb1-80" aria-hidden="true" tabindex="-1"></a> <span class="at">any_ICE =</span> (<span class="fu">any</span>(ind_ice1 <span class="sc">==</span> <span class="dv">1</span>)),</span>
<span id="cb1-81"><a href="#cb1-81" aria-hidden="true" tabindex="-1"></a> <span class="at">any_NA =</span> <span class="fu">any</span>(<span class="fu">is.na</span>(outcome))) <span class="sc">%&gt;%</span></span>
<span id="cb1-82"><a href="#cb1-82" aria-hidden="true" tabindex="-1"></a> <span class="fu">group_by</span>(group) <span class="sc">%&gt;%</span></span>
<span id="cb1-83"><a href="#cb1-83" aria-hidden="true" tabindex="-1"></a> <span class="fu">summarise</span>(</span>
<span id="cb1-84"><a href="#cb1-84" aria-hidden="true" tabindex="-1"></a> <span class="at">subjects_with_ICE =</span> <span class="fu">sum</span>(any_ICE),</span>
<span id="cb1-85"><a href="#cb1-85" aria-hidden="true" tabindex="-1"></a> <span class="at">subjects_with_missings =</span> <span class="fu">sum</span>(any_NA)</span>
<span id="cb1-86"><a href="#cb1-86" aria-hidden="true" tabindex="-1"></a> )</span>
<span id="cb1-87"><a href="#cb1-87" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; # A tibble: 2 × 3</span></span>
<span id="cb1-88"><a href="#cb1-88" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; group subjects_with_ICE subjects_with_missings</span></span>
<span id="cb1-89"><a href="#cb1-89" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; &lt;fct&gt; &lt;int&gt; &lt;int&gt;</span></span>
<span id="cb1-90"><a href="#cb1-90" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; 1 Control 18 8</span></span>
<span id="cb1-91"><a href="#cb1-91" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; 2 Intervention 25 14</span></span></code></pre></div>
</div>
<div id="sec:postICEobs" class="section level1" number="3">
<h1><span class="header-section-number">3</span> Handling of observed post-ICE data in <code>rbmi</code> under reference-based imputation</h1>
Expand Down Expand Up @@ -779,7 +786,7 @@ <h1><span class="header-section-number">6</span> Custom imputation strategies</h
<span id="cb9-17"><a href="#cb9-17" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; pars &lt;- list(mu = mu, sigma = sigma)</span></span>
<span id="cb9-18"><a href="#cb9-18" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; return(pars)</span></span>
<span id="cb9-19"><a href="#cb9-19" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; }</span></span>
<span id="cb9-20"><a href="#cb9-20" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; &lt;bytecode: 0x7fe91cf7a468&gt;</span></span>
<span id="cb9-20"><a href="#cb9-20" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; &lt;bytecode: 0x7f8093c266c8&gt;</span></span>
<span id="cb9-21"><a href="#cb9-21" aria-hidden="true" tabindex="-1"></a><span class="co">#&gt; &lt;environment: namespace:rbmi&gt;</span></span></code></pre></div>
<p>To further illustrate this for a simple example, assume that a new strategy is to be implemented as follows:
- The marginal mean of the imputation distribution is equal to the marginal mean trajectory for the subject according to their assigned group and covariates up to the ICE.
Expand Down
Loading

0 comments on commit 895edb1

Please sign in to comment.