<p><div><div><div><div data-show-faces="false" data-height="21" data-width="100" data-layout="button_count" data-send="true" data-href="https://www.r-bloggers.com/power-analysis-for-longitudinal-multilevel-models-powerlmm-0-2-0-is-now-out-on-cran/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="http://rpsychologist.com/powerlmm-0-2-0"> R Psychologist - R</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<p>My R packge <em>powerlmm</em> 0.2.0 is now out on CRAN. It can be installed from CRAN <a rel="nofollow" href="https://cran.r-project.org/package=powerlmm" target="_blank">https://cran.r-project.org/package=powerlmm</a> or GitHub <a rel="nofollow" href="https://github.com/rpsychologist/powerlmm" target="_blank">https://github.com/rpsychologist/powerlmm</a>.</p>
<h1>Changes in version 0.2.0</h1>
<h2>New features</h2>
<ul>
<li>Analytical power calculations now support using Satterthwaite’s degrees of<br>
freedom approximation.</li>
<li><code>Simulate.plcp</code> will now automatically create lme4 formulas if none is<br>
supplied, see <code>?create_lmer_formula</code>.</li>
<li>You can now choose what alpha level to use.</li>
<li>Treat cluster sizes as a random variable, <code>uneqal_clusters</code> now accepts<br>
a function indicating the distribution of cluster sizes, via the new argument<br>
<code>func</code>, e.g. <code>rpois</code> or <code>rnorm</code> could be used to draw cluster sizes.</li>
<li>Expected power for designs with parameters that are random variables,<br>
can be calculated by averaging over multiple realizations, using the<br>
argument <code>R</code>.</li>
<li>Support for parallel computations on Microsoft Windows, and in GUIs/interactive<br>
environments, using <code>parallel::makeCluster</code> (PSOCK). Forking is still used for<br>
non-interactive Unix environments.</li>
</ul>
<h2>Improvements</h2>
<ul>
<li>Calculations of the variance of the treatment effect is now much faster for<br>
designs with unequal clusters and/or missing data, when cluster sizes are<br>
large. The calculations now use the much faster implementation used by lme4.</li>
<li>Cleaner print-methods for <code>plcp_multi</code>-objects.</li>
<li>Multiple power calculations can no be performed in parallel, via the<br>
argument <code>cores</code>.</li>
<li><code>simulate.plcp_multi</code> now have more options for saving intermediate results.</li>
<li><code>print.plcp_multi_power</code> now has better support for subsetting via either [],<br>
head(), or subset().</li>
</ul>
<h2>Breaking changes</h2>
<ul>
<li><code>icc_pre_subject</code> is now defined as <code>(u_0^2 + v_0^2) / (u_0^2 + v_0^2 + error^2)</code>,<br>
instead of <code>(u_0^2) / (u_0^2 + v_0^2 + error^2)</code>. This would be the subject-level ICC,<br>
if there’s no random slopes, i.e. correlation between time points for the same subject.</li>
<li><code>study_parameters()</code>: 0 and NA now means different things. If 0 is passed, the parameters<br>
is kept in the model, if you want to remove it specify it as NA instead.</li>
<li><code>study_parameters()</code>: is now less flexible, but more robust. Previously a large<br>
combination if raw and relative parameters could be combined, and the individual<br>
parameters was solved for. To make the function less bug prone and easier to maintain,<br>
it is now only possible to specify the cluster-level variance components as relative values,<br>
if the other parameters as passed as raw inputs. </li>
</ul>
<h2>Bug fixes and minor changes</h2>
<ul>
<li>Output from <code>simulate_data()</code> now includes a column <code>y_c</code> that contains the full outcome vector,<br>
without missing values added. This makes it easy to compare the complete and incomplete<br>
data set, e.g. via <code>simulate()</code>.</li>
<li><code>simulate()</code> new argument <code>batch_progress</code> enables showing progress when doing<br>
multiple simulations.</li>
<li>Fix bug in <code>summary.plcp_sim</code> where the wrong % convergence was calculated.</li>
<li>Simulation function now accepts lme4 formulas containing “||”.</li>
<li>The cluster-level intercept variance is now also set to zero in the control<br>
group, when a partially nested design is requested.</li>
<li>Fix incorrect error message from <code>study_parameters</code> when<br>
<code>icc_cluster_pre = NULL</code> and all inputs are standardized.</li>
<li>Fix bug that would cause all slopes to be zero when <code>var_ratio</code> argument was<br>
passed a vector of values including a 0, e.g. <code>var_ratio = c(0, 0.1, 0.2)</code>.</li>
<li>Fix bug for multi-sim objects that caused the wrong class the be used for,<br>
e.g. <code>res[[1]]$paras</code>, and thus the single simulation would not print<br>
correctly.</li>
<li>Results from multi-sim objects can now be summarized for all random effects<br>
in the model.</li>
<li>More support for summarizing random effects from partially nested formulas,<br>
e.g. <code>cluster_intercept</code> and <code>cluster_slope</code> is now correctly extracted from<br>
<code>(0 + treatment + treatment:time || cluster)</code>.</li>
<li>When Satterthwaite’s method fails the between clusters/subjects DFs<br>
are used to calculate <em>p</em>-values.</li>
<li><code>Power.plcp_multi</code> is now exported.</li>
<li><code>get_power.plcp_multi</code> now shows a progress bar.</li>
<li>Fix a bug that caused dropout to be wrong when one condition had 0 dropout, and<br>
<code>deterministic_dropout = FALSE</code>.</li>
</ul>
	<p>
<div>
<div>To <strong>leave a comment</strong> for the author, please follow the link and comment on their blog: <strong><a href="http://rpsychologist.com/powerlmm-0-2-0"> R Psychologist - R</a></strong>.</div>
<hr>
<a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers.com</a> offers <strong><a rel="nofollow" href="https://feedburner.google.com/fb/a/mailverify?uri=RBloggers">daily e-mail updates</a></strong> about <a rel="nofollow" href="https://www.r-project.org/" title="The R Project for Statistical Computing">R</a> news and <a rel="nofollow" href="https://www.r-bloggers.com/search/tutorial" title="R tutorials">tutorials</a> on topics such as: <a rel="nofollow" href="https://www.r-bloggers.com/search/data%20science" title="Data science">Data science</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/Big%20Data" title="Big Data">Big Data, <a rel="nofollow" href="https://www.r-users.com/" title="R jobs">R jobs</a>, visualization (<a rel="nofollow" href="https://www.r-bloggers.com/search/ggplot2" title="ggplot and ggplot2 tutorials">ggplot2</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/boxplot" title="Boxplots using lattice and ggplot2 tutorials">Boxplots</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/map" title="Maps and gis">maps</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/animation" title="Animation in R">animation</a>), programming (<a rel="nofollow" href="https://www.r-bloggers.com/search/RStudio" title="RStudio IDE for R">RStudio</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/sweave" title="Sweave and literate programming">Sweave</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/LaTeX" title="LaTeX in R">LaTeX</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/SQL" title="SQL and databases">SQL</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/eclipse" title="Eclipse IDE for R">Eclipse</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/git" title="git and github, Version Control System">git</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/hadoop" title="Large data in R using Hadoop">hadoop</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/Web+Scraping" title="Web Scraping of google, facebook, yahoo, twitter and more using R">Web Scraping</a>) statistics (<a rel="nofollow" href="https://www.r-bloggers.com/search/regression" title="Regressions and ANOVA analysis tutorials">regression</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/PCA" title="principal component analysis tutorial">PCA</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/time+series" title="Time series">time series</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/trading" title="finance trading">trading</a>) and more...
<img width="1" alt="" src="http://feeds.feedburner.com/~r/RBloggers/~4/B4sEwayRzj0" height="1"></a></div>