Jekyll2018-11-13T12:18:30+01:00https://blog.jamovi.org/jamoviStats. Open. Now.jamoviIntroducing GAMLj: GLM, LME and GZLMs in jamovi2018-11-13T03:00:00+01:002018-11-13T03:00:00+01:00https://blog.jamovi.org/2018/11/13/introducing-gamlj<h3 id="tldr">tl;dr</h3>
<ul>
<li>GAMLj is a jamovi module for <a href="https://en.wikipedia.org/wiki/General_linear_model">general linear models</a>, <a href="https://en.wikipedia.org/wiki/Mixed_model">linear mixed-effects models</a>, and <a href="https://en.wikipedia.org/wiki/Generalized_linear_model">generalized linear models</a></li>
<li>GAMLj makes these classes of models accessible to a much broader audience</li>
<li>Linear mixed-effects models make a great alternative to repeated measures ANOVA</li>
</ul>
<p><!--more--></p>
<p>One of the goals of jamovi is to make more sophisticated analyses accessible to a broader audience. A great example of this is the GAMLj module introduced here. If you’ve never used these models before, hopefully today I can convince you that with GAMLj they are within your reach, and that there are advantages to using these instead of more traditional analyses, such as repeated measures ANOVA.</p>
<p>For more technical readers, here is a feature list:</p>
<ul>
<li>OLS Regression (GLM)</li>
<li>OLS ANOVA (GLM)</li>
<li>OLS ANCOVA (GLM)</li>
<li>Random coefficients regression (Mixed)</li>
<li>Random coefficients ANOVA-ANCOVA (Mixed)</li>
<li>Logistic regression (GZLM)</li>
<li>Logistic ANOVA-like model (GZLM)</li>
<li>Probit regression (GZLM)</li>
<li>Probit ANOVA-like model (GZLM)</li>
<li>Multinomial regression (GZLM)</li>
<li>Multinomial ANOVA-like model (GZLM)</li>
<li>Poisson regression (GZLM)</li>
<li>Poisson ANOVA-like model (GZLM)</li>
<li>Overdispersed Poisson regression (GZLM)</li>
<li>Overdispersed Poisson ANOVA-like model (GZLM)</li>
<li>Negative binomial regression (GZLM)</li>
<li>Negative binomial ANOVA-like model (GZLM)</li>
<li>Continuous and categorical independent variables</li>
<li>Omnibus tests and parameter estimates</li>
<li>Confidence intervals</li>
<li>Simple slopes analysis</li>
<li>Simple effects</li>
<li>Post-hoc tests</li>
<li>Plots for up to three-way interactions for both categorical and continuous independent variables.</li>
<li>Automatic selection of best estimation methods and degrees of freedom selection</li>
<li>Type III estimation</li>
</ul>
<p>If that feature-list seems a bit overwhelming, it might be easier to think “GAMLj does a lot of stuff”. But don’t be put-off, GAMLj is suitable for beginners and advanced users alike.</p>
<h2 id="repeated-measures-anova">Repeated Measures ANOVA</h2>
<p>So the repeated measures ANOVA is something of a staple of the social sciences; it’s one of the most used tests. Unfortunately, it has the drawback that it cannot handle missing values – if any of the subjects in your data set have missing values they are <em>excluded completely</em>. It’s like they never participated in your study. This can be a real problem with the smallish sample sizes common in the social sciences. Fortunately, linear mixed models provide a simple alternative to repeated measures ANOVA, which is able to make use of these participants’ data. That means more power, less time spent collecting data, and better use of tax-payer’s money. What’s not to love about LME’s?!</p>
<p>So let’s begin with the Bugs data set provided with jamovi. Actually… the bad news is that the Bugs data set in jamovi is in <strong>wide-format</strong>. It looks like this:</p>
<p><img src="https://blog.jamovi.org/assets/images/gamlj1.png" alt="BUGS" style="width: 700px; max-width: 100%;" /></p>
<p>GAMLj requires the data be in <strong>long format</strong>. It needs to look like this:</p>
<p><img src="https://blog.jamovi.org/assets/images/gamlj2.png" alt="BUGS long" style="width: 700px; max-width: 100%;" /></p>
<p>As you can see, in wide-format, each <em>subject</em> is represented as a row, with a column for each measurement of the dependent variable. In long-format, each <em>measurement</em> of the dependent variable is represented as a row, with the rows for each participant tied together by a subject id.</p>
<p>In fact, the bad news keeps getting worse, because jamovi currently doesn’t provide a facility to convert data between wide format and long format (the jamovi developers assure me this is in the works). So if your data is in wide-format, you’ll have to convert it to long format in a different piece of software before importing into jamovi. I’ve done that for you here – <a href="https://blog.jamovi.org/assets/data/bugs_long.csv">the Bugs data set in long format</a>.</p>
<p>Hopefully the first thing you’ll notice is the missing value in row 6 – this participant would simply be excluded in a repeated measures ANOVA.</p>
<p>The Bugs data set (Ryan, Wilde, and Crist, 2013) contains ratings from people about how much they want to ‘get rid of’ a variety of bugs, each classified as being <em>high</em> or <em>low</em> on “Disgustingness” and <em>high</em> or <em>low</em> on “Frighteningness” (for example, a maggot is disgusting but not frightening, and a wasp is frightening, but not disgusting – see the <a href="http://faculty.kutztown.edu/rryan/RESEARCH/PUBS/Ryan,%20Wilde,%20%26%20Crist%202013%20Web%20exp%20vs%20lab.pdf">paper</a> for details (it is a little bit amusing).</p>
<p>Now let’s analyse this data set with GAMLj. If you haven’t already, install GAMLj from the jamovi library. This is available to the top right of the Analyses tab. Once installed, a new ‘Linear Models’ entry appears alongside the other analyses. From this we can select ‘Linear Mixed Models’. In this example, <code class="highlighter-rouge">Rating</code> is our dependent variable, and <code class="highlighter-rouge">Disgust</code> and <code class="highlighter-rouge">Fright</code> are our factors, and we can just drag these into place. However, we need to tell GAMLj which of these observations belong together, or belong to the same subject – we do this by specifying the ‘cluster’ variable, in this case <code class="highlighter-rouge">Subject</code>.</p>
<p>The final step is specifying the random co-efficients (<strong>tl;dr</strong> specify <code class="highlighter-rouge">Fright | Subject</code> and <code class="highlighter-rouge">Disgust | Subject</code> as the random co-efficients). To understand these, let’s take a step back, and pretend that this is just a between subjects ANOVA. Focusing on the main effects, the equation for that would just be:</p>
<div class="equation-container">$$\hat{rating_{ij}}=a+b_{F} \times Fright_{ij} +b_{D} \times Disgust_{ij}$$</div>
<p>where each participant, <script type="math/tex">j</script>, has several scores, <script type="math/tex">i</script>. In this equation, there’s a <em>single value</em> for the coefficient representing the effect of <code class="highlighter-rouge">Fright</code>eningness (<script type="math/tex">b_F</script>) and a <em>single value</em> for the coefficient representing the effect of <code class="highlighter-rouge">Disgust</code>ingness (<script type="math/tex">b_D</script>). That is, we’re assuming frighteningness and disgustingness have <em>the same</em> effect on each participant. However, in a mixed design, we allow for variability of the effect of Frighteningness and Disgustingness <em>between subjects</em>. Rather than the effect of frighteningness and disgustingness being modeled as a fixed value for all participants (a fixed effect), we want them to be modelled as a random draw from a distribution for each participant (a random effect).</p>
<p>Our equation becomes:</p>
<div class="equation-container">$$\hat{rating_{ij}}=a+b_{Fj} \times Fright_{ij}+\bar{b}_{F} \times Fright_{ij} +b_{Dj} \times Disgust_{ij}+\bar{b}_{D} \times Disgust_{ij}$$</div>
<p>We can see that the co-efficients for the effect of Fright (<script type="math/tex">b_{Fj}</script>) and Disgust (<script type="math/tex">b_{Dj}</script>) vary across participants (there is one coefficient <script type="math/tex">b_{Fj}</script> and one <script type="math/tex">b_{Dj}</script> for each participant j). This captures the correlation between the repeated measures in the design. But we are still interested in the overall effects of Fright and Disgust, so the equation also features the fixed effects of the factors, <script type="math/tex">\bar{b}_{Fj}</script> and <script type="math/tex">\bar{b}_{Dj}</script>, which can be interpreted as the average effects of the factors, averaged across the random effects.</p>
<p>In GAMLj we specify this by assigning <code class="highlighter-rouge">Fright | Subject</code> and <code class="highlighter-rouge">Disgust | Subject</code> as random effects. These are effectively saying; ‘allow <code class="highlighter-rouge">Fright</code> to vary by subject’ and ‘allow <code class="highlighter-rouge">Disgust</code> to vary by subject’. Having specified this, all the options are specified, and our analysis runs. Let’s take a look at the results.</p>
<p><img src="https://blog.jamovi.org/assets/images/gamlj3.png" alt="BUGS" style="width: 500px; max-width: 100%;" /></p>
<p>Hopefully this table jumps straight out at you. It looks like an ANOVA table after all. They are the fixed effects, and we can interpret as fixed effects of a classical ANOVA. From this we can see a highly significant effect of <code class="highlighter-rouge">Fright</code> and <code class="highlighter-rouge">Disgust</code>, but a non-significant interaction.</p>
<p>We can compare these results with what we’d get with a repeated measures ANOVA:</p>
<p><img src="https://blog.jamovi.org/assets/images/gamlj4.png" alt="BUGS" style="width: 700px; max-width: 100%;" /></p>
<p>There’s not a huge difference here, but we can see that for the interaction effect the <em>p</em>-value is lower for the linear mixed effects model, which is likely a result of the linear mixed effects model being able to make use of those extra participants that the RM ANOVA was unable to use.</p>
<p>Let’s plot the means for each:</p>
<p><img src="https://blog.jamovi.org/assets/images/gamlj5.png" alt="BUGS" style="width: 500px; max-width: 100%;" /></p>
<p>It seems people do want to get rid of highly frightening insects and highly disgusting insects more than others.</p>
<p>But we can do more than just visualise the marginal means of <code class="highlighter-rouge">Fright</code> and <code class="highlighter-rouge">Disgust</code> — by checking the random effects box we get a plot of the estimated effect for each subject.</p>
<p><img src="https://blog.jamovi.org/assets/images/gamlj6.png" alt="BUGS" style="width: 500px; max-width: 100%;" /></p>
<p>So there we have it, an LME equivalent to Repeated measures ANOVA. Hopefully you can see how approachable these models can be, and that this class of models can become a part of your statistical toolbox. For more examples of Linear mixed models (and General linear models, and Generalised linear models), head on over to the <a href="https://mcfanda.github.io/gamlj_docs/">GAMLj docs</a>.</p>["marcello_gallucci", "jonathon_love"]tl;dr GAMLj is a jamovi module for general linear models, linear mixed-effects models, and generalized linear models GAMLj makes these classes of models accessible to a much broader audience Linear mixed-effects models make a great alternative to repeated measures ANOVALearning statistics with jamovi – a free introductory statistics textbook2018-10-25T04:00:00+02:002018-10-25T04:00:00+02:00https://blog.jamovi.org/2018/10/25/learning-statistics-with-jamovi<h3 id="tldr">tl;dr</h3>
<p><a href="https://sites.google.com/brookes.ac.uk/learning-stats-with-jamovi">learning statistics with jamovi</a> (<code class="highlighter-rouge">lsj</code> for short) is a basic, introductory statistics textbook that presents most of the topics typically seen in an introductory psychology course at undergraduate level. It is completely free to download, use, and adapt — released under a creative commons CC BY-SA 4.0 licence. Although it is geared towards psychology, the content and material is also relevant to other disciplines, for example health sciences and public health. Download <code class="highlighter-rouge">lsj</code> over <a href="https://sites.google.com/brookes.ac.uk/learning-stats-with-jamovi">here</a>.</p>
<!--more-->
<p style="text-align: center;">
<a href="https://drive.google.com/file/d/1D4SMMhbsXCozI5KywyOSYpzMp-ygylEf/view" target="_blank" style="margin: 0px auto;">
<img src="https://blog.jamovi.org/assets/images/lsj_cover.png" alt="lsj cover" style="width: 320px; max-width: 100%; display: inline; height: auto; margin: 0px auto;" />
</a>
</p>
<p><code class="highlighter-rouge">lsj</code> covers: study design, descriptive statistics, data manipulation, basic plots, statistical inference, the theory of hypothesis testing, chi-square tests, t-tests, correlation, regression, and ANOVA. Throughout the text demonstration analyses are shown using jamovi.</p>
<p><code class="highlighter-rouge">lsj</code> is a fork/adaptation of the excellent <a href="https://compcogscisydney.org/learning-statistics-with-r/">Learning Statistics with R (LSR)</a> by Danielle Navarro. What’s really neat about LSR, and by extension <code class="highlighter-rouge">lsj</code>, is that there are quite a few topics covered in the text that are missed out of most introductory stats textbooks and courses, but that are important for a good initial understanding of statistics. That’s why LSR was chosen as the basis for <code class="highlighter-rouge">lsj</code> — for us it covers the stuff that we wish we had found out about when we were first taught stats. For example, the disagreement between Neyman and Fisher about hypothesis testing is mentioned, and there is a detailed explanation of the different types of sums of squares (Types I, II and III) that is key for understanding unbalanced factorial ANOVA. Moreover, the Bayesian / frequentist divide is included, and there is some explanation and demonstration of the Bayesian approach to analysis, as a counter to the fact that just about all the inferential statistics in the book are presented from an orthodox frequentist perspective (which still fits with the tradition and requirements of many undergraduate psychology courses).</p>
<p>Although there is a lot in <code class="highlighter-rouge">lsj</code>, any statistics textbook is undoubtedly incomplete; there is just too much to cover. Ours is no exception, it’s a work in progress. If you spot any mistakes, or want to suggest some improvements, then please log an issue on github: <a href="https://github.com/davidfoxcroft/jbook/issues">https://github.com/davidfoxcroft/jbook/issues</a>.</p>
<p>Plans for the near future include adding material on repeated measures ANOVA, reliability analysis, and factor analysis. But of course there is scope to add even more. If you would like to contribute some updates to the book, or a chapter, then please get in touch via the <a href="https://sites.google.com/brookes.ac.uk/learning-stats-with-jamovi">lsj website</a>. We’ll keep all contributions in a publicly available repository, linked from the website, and will incorporate new material into the book when we update to the next version.</p>["david_foxcroft"]tl;dr learning statistics with jamovi (lsj for short) is a basic, introductory statistics textbook that presents most of the topics typically seen in an introductory psychology course at undergraduate level. It is completely free to download, use, and adapt — released under a creative commons CC BY-SA 4.0 licence. Although it is geared towards psychology, the content and material is also relevant to other disciplines, for example health sciences and public health. Download lsj over here.Transforming and recoding variables in jamovi2018-10-23T04:00:00+02:002018-10-23T04:00:00+02:00https://blog.jamovi.org/2018/10/23/transforming-variables<h3 id="tldr">tl;dr</h3>
<p><a href="https://blog.jamovi.org/2017/11/28/jamovi-formulas.html">Computed variables</a> have been available in jamovi for a while now. Although great for a lot of operations (e.g., calculating sum scores, generating data, etc.), they can be a bit tedious to use when you want to recode or transform multiple variables (e.g., when reverse-scoring multiple responses in a survey data set). Today we’re introducing ‘Transformed variables’, allowing you to easily recode existing variables and apply transforms across many variables at once.</p>
<!--more-->
<p><div class="gif-player" src="https://blog.jamovi.org/assets/images/transform_overall.png" data-anim-src="https://blog.jamovi.org/assets/images/transform_overall.gif" data-static-src="https://blog.jamovi.org/assets/images/transform_overall.png" data-title="transform_overall" data-name="GIF: Transform main" style="width: 700px; max-width: 100%; padding-bottom: 68%;"></div></p>
<h2 id="creating-transformed-variables">Creating transformed variables</h2>
<p>When transforming or recoding variables in jamovi, a second ‘transformed variable’ is created for the original ‘source variable’. This way, you will always have access to the original, untransformed data if need be. To transform a variable, first select the column(s) you would like to transform. You can select a block of columns by clicking on the first column header in the block and then clicking on the last column header in the block while holding the shift key. Alternatively, you can select/deselect individual columns by clicking on the column headers while holding down the ctrl/cmd key. Once selected, you can either select ‘Transform’ from the data tab, or right click and choose ‘Transform’ from the menu.</p>
<ul>
<li>Right-click on one of the selected variables, and click <code class="highlighter-rouge">Transform...</code>:
<img src="https://blog.jamovi.org/assets/images/transform_create1.png" alt="Transform Create 1" style="width: 400px; max-width: 100%;" /></li>
<li>Go to the <code class="highlighter-rouge">data</code> tab, and click <code class="highlighter-rouge">Transform</code>:
<img src="https://blog.jamovi.org/assets/images/transform_create2.png" alt="Transform Create 2" style="width: 400px; max-width: 100%;" /></li>
</ul>
<p>This constructs a second ‘transformed variable’ for each column that was selected. In the following example, we only had a single variable selected, so we’re only setting up the transform for one variable (called <code class="highlighter-rouge">score - log</code>), but there’s no reason we can’t do more in one go.</p>
<p><img src="https://blog.jamovi.org/assets/images/transform_create3.png" alt="Transform Create 3" style="width: 500px; max-width: 100%;" /></p>
<p>As can be seen in the figure above, each transformed variable has a ‘source variable’, representing the original untransformed variable, and a transform, representing rules to transform the source variable into the transformed variable. After a transform has been created, it’s available from the list and can be shared easily across multiple transformed variables.</p>
<p>If you don’t yet have the appropriate transform defined, you can select <code class="highlighter-rouge">Create new transform...</code> from the list.</p>
<h2 id="create-new-transformation">Create new transformation</h2>
<p>After clicking <code class="highlighter-rouge">Create new transform...</code> the transform editor slides into view:</p>
<p><img src="https://blog.jamovi.org/assets/images/transform1.png" alt="Transform 1" style="width: 600px; max-width: 100%;" /></p>
<p>Let’s take a look at each of these elements.</p>
<h4 id="1-name">1. Name</h4>
<p>The name for the transformation.</p>
<h4 id="2-description">2. Description</h4>
<p>Space for you to provide a description of the transformation so you (and others) know what it does.</p>
<h4 id="3-variable-suffix">3. Variable suffix</h4>
<p>Optional. Here, you can define the default name formatting for the transformed variable. By default, the variable suffix will be appended to the source variable name with a dash (<code class="highlighter-rouge">-</code>) in between. However, you can override this behavior by using an ellipsis (<code class="highlighter-rouge">...</code>), which will be replaced by the variable name. For instance, if you transform a variable called <code class="highlighter-rouge">Q1</code>, you could use variable suffixes to apply the following naming schemes:</p>
<ul>
<li><code class="highlighter-rouge">log</code> → <code class="highlighter-rouge">Q1 - log</code></li>
<li><code class="highlighter-rouge">..._log</code> → <code class="highlighter-rouge">Q1_log</code></li>
<li><code class="highlighter-rouge">log(...)</code> → <code class="highlighter-rouge">log(Q1)</code></li>
</ul>
<p>If left empty, the transformation name is used as the variable suffix.</p>
<h4 id="4-transformation">4. Transformation</h4>
<p>This section contains the rules and formulas for the transformation. You can use all the same functions that are available in computed variables, and to refer to the values in the source column (so you can transform them), you can use the special <code class="highlighter-rouge">$source</code> keyword. If you want to recode a variable into multiple groups, it’s easiest to use multiple conditions. To add additional conditions (i.e., if-statements), you click on the ‘Add recode condition’ button:</p>
<p><div class="gif-player" src="https://blog.jamovi.org/assets/images/transform2.png" data-anim-src="https://blog.jamovi.org/assets/images/transform2.gif" data-static-src="https://blog.jamovi.org/assets/images/transform2.png" data-title="transform2" data-name="GIF: Transform 2" style="width: 600px; max-width: 100%; padding-bottom: 26%;"></div></p>
<h4 id="5-used-by">5. Used by</h4>
<p>Indicates how many variables are using this particular transformation. If you click on the number it will list these variables.</p>
<h4 id="6-measure-type">6. Measure type</h4>
<p>By default the measure type is set to <code class="highlighter-rouge">Auto</code>, which will infer the measure type automatically from the transformation. However, if <code class="highlighter-rouge">Auto</code> doesn’t infer the measure type correctly, you can override it over here.</p>
<h2 id="example-1-reverse-scoring-of-items">Example 1: Reverse scoring of items</h2>
<p>Survey data often contains one or more items whose values need to be reversed before analyzing them. For example, we might be measuring extraversion with the questions “I like to go to parties”, “I love being around people”, and “I prefer to keep to myself”. Clearly a person responding 6 (strongly agree) to this last question shouldn’t be considered an extravert, and so 6 should be treated as 1, 5 as 2, 1 as 6, etc. To reverse score these items, we can just use the following simple transform:</p>
<p><img src="https://blog.jamovi.org/assets/images/transform_ex1.png" alt="Transform 1" style="width: 600px; max-width: 100%;" /></p>
<p>You can explore this transform by downloading and opening the file <a href="https://blog.jamovi.org/assets/data/transform_ex1.omv">transform_ex1.omv</a> in jamovi.</p>
<h2 id="example-2-recoding-continuous-variables-into-categories">Example 2: Recoding continuous variables into categories</h2>
<p>In a lot of data sets people want to recode their continuous scores into categories. For example, we may want to classify people, based on their 0-100% test scores into one of three groups, <code class="highlighter-rouge">Pass</code>, <code class="highlighter-rouge">Resit</code> and <code class="highlighter-rouge">Fail</code>.</p>
<p><img src="https://blog.jamovi.org/assets/images/transform_ex2.png" alt="Transform 2" style="width: 600px; max-width: 100%;" /></p>
<p>Note that the conditions are executed in order, and that only the first rule that matches the case is applied to that case. So this transformation basically says that if the source variable has a value below 50, the value will be <code class="highlighter-rouge">Fail</code>, if the source variable has a value between 50 and 60, the value will be <code class="highlighter-rouge">Resit</code>, and if the source variable has a value above 60, the value will be <code class="highlighter-rouge">Pass</code>. If you’d like an example data set to play around with, you can use <a href="https://blog.jamovi.org/assets/data/transform_ex2.omv">transform_ex2.omv</a>.</p>
<h2 id="example-3-replacing-missing-values">Example 3: Replacing missing values</h2>
<p>Now, let’s say your data set has a lot of missing values and removing the participants with missing values will end up in a severe loss of participants. There are a number of ways to deal with missing data, of which <a href="https://en.wikipedia.org/wiki/Imputation_(statistics)">imputation</a> is quite common. One pretty straightforward imputation method replaces the missing values with the variable mean (i.e., <a href="https://en.wikipedia.org/wiki/Imputation_(statistics)#Mean_substitution">mean substitution</a>). Although there are a bunch of problems associated with mean substitution and you should probably never do it, it does make for a neat demonstration :P</p>
<p><img src="https://blog.jamovi.org/assets/images/transform_ex3.png" alt="Transform 3" style="width: 600px; max-width: 100%;" /></p>
<p>Note that jamovi has borrowed <code class="highlighter-rouge">NA</code> from R to denote missing values. Don’t have a good data set handy? You can try it out yourself with the <a href="https://blog.jamovi.org/assets/data/transform_ex3.omv">transform_ex3.omv</a> data set.</p>
<h2 id="conclusion">Conclusion</h2>
<p>Transformed variables are a great tool for transforming and recoding data, and solve a lot of different data manipulation problems. For us, the jamovi developers, transformed variables represent a really significant milestone. jamovi is now able to service the majority of social scientists data-wrangling needs. jamovi has become far more than an educational tool, and can increasingly hold it’s own alongside the giants in the field (SPSS et al.).</p>
<p>Transformed variables are available from <a href="https://www.jamovi.org/download.html">jamovi 0.9.5 upwards</a>. We hope you will enjoy it :)</p>["ravi_selker"]tl;dr Computed variables have been available in jamovi for a while now. Although great for a lot of operations (e.g., calculating sum scores, generating data, etc.), they can be a bit tedious to use when you want to recode or transform multiple variables (e.g., when reverse-scoring multiple responses in a survey data set). Today we’re introducing ‘Transformed variables’, allowing you to easily recode existing variables and apply transforms across many variables at once.jamovi module development workshop – 31st October 20182018-09-24T04:00:00+02:002018-09-24T04:00:00+02:00https://blog.jamovi.org/2018/09/24/module-development-workshop<h3 id="tldr">tl;dr</h3>
<ul>
<li>Come join us for our first jamovi module development workshop at <a href="https://www.mq.edu.au/">Macquarie University, Sydney Australia</a>. This workshop will take place on October 31st, 2018 and is free of charge. Please <a href="https://www.ccd.edu.au/events/conferences/2018/jamovi/index.html">register over here</a> if you want to participate.</li>
</ul>
<!--more-->
<p>One of the core values of jamovi is to decentralise statistical methods as much as possible, and to empower anyone (irrespective of statistical philosophy) to publish graphical, accessible analyses for anyone to use. For this reason, <a href="https://www.jamovi.org/library.html">the jamovi library</a> is probably our favourite accomplishment; a community driven collection of graphical analyses for the masses.</p>
<p>To develop analyses, a collection of tutorials are available from our ‘developer hub’ at <a href="https://dev.jamovi.org">dev.jamovi.org</a>. However, some people prefer to
learn ‘in person’, with experts available to field any questions that arise. For this reason, we’re running the first jamovi module development workshop on the 31st of October, 2018, at <a href="https://www.mq.edu.au/">Macquarie University, Sydney Australia</a>.</p>
<p>The workshop is free of charge. Please <a href="https://www.ccd.edu.au/events/conferences/2018/jamovi/index.html">register over here</a> if you want to attend the workshop.</p>
<h3 id="program">Program</h3>
<ul>
<li><strong>11:00 - 11:15</strong> Welcome/Registration</li>
<li><strong>11:15 - 13:00</strong> Session 1:
<ul>
<li>Overview</li>
<li>What makes a good analysis?</li>
<li>‘Goal centric’ user interface design</li>
<li>Getting started with <code class="highlighter-rouge">jmvtools</code></li>
<li>Time for self-directed projects</li>
</ul>
</li>
<li><strong>13:00 - 14:00</strong> Lunch (not included)</li>
<li><strong>14:00 - 17:00</strong> Session 2:
<ul>
<li>Implementing plots</li>
<li>Implementing user interfaces</li>
<li>Time for self-directed projects</li>
</ul>
</li>
</ul>
<h2 id="details">Details</h2>
<p>This workshop works through the process of developing a module from scratch, and touches on analysis design, user interface design, and effective use of ‘state’. The workshop will have some structured talks, but most of the time will be available for people to work on their own module at their own pace, with the workshop instructors available to field any questions that arise.</p>
<p>People are encouraged to come up with an idea for a jamovi module that they would like to implement, that they can develop during the workshop (even if
they don’t intend on publishing it). Modules can extend jamovi in a number of ways - providing analyses, plots, test selection, or you could even make a little game.</p>
<p>Although not crucial, people will get the most out of this workshop if they already have an understanding of developing R packages. If this isn’t an area you have experience in, we’d encourage you to work through some online resources ahead of the workshop, such as <a href="http://r-pkgs.had.co.nz/">r-pkgs.had.co.nz/</a>.</p>
<p>We encourage people who are very keen to work through the jamovi tutorials at <a href="https://dev.jamovi.org">dev.jamovi.org</a> before the workshop.</p>
<h2 id="on-site-workshops">On-site workshops</h2>
<p>Interested in a module development workshop at your institution? Contact us at <code class="highlighter-rouge">contact@jamovi.org</code> for any questions/requests. We have instructors based in Australia and the Netherlands.</p>["jonathon_love"]tl;dr Come join us for our first jamovi module development workshop at Macquarie University, Sydney Australia. This workshop will take place on October 31st, 2018 and is free of charge. Please register over here if you want to participate.Learn jamovi with datalab.cc’s free video course2018-08-21T04:00:00+02:002018-08-21T04:00:00+02:00https://blog.jamovi.org/2018/08/21/datalab<h3 id="tldr">tl;dr</h3>
<ul>
<li><a href="https://datalab.cc"><img class="img-inline" src="https://blog.jamovi.org/assets/images/datalab_logo.png" alt="datalab.cc" style="height: 16px; max-width: 100%;" /></a> introduces a <a href="https://datalab.cc/tools/jamovi">free online introductory course on jamovi</a> that includes 52 videos – over 4.5 hours of instruction – that cover every aspect of jamovi’s base installation, from download and setup to data exploration and visualization to scale analysis and predictive modeling</li>
</ul>
<!--more-->
<p>When I learned about jamovi earlier this year, I knew I found something that could revolutionize data analysis for my students, my collaborators, and myself. Compared to SPSS, the most common choice in the social sciences, jamovi is easier, cleaner, more reliable, more powerful, more portable, and, of course, more affordable. Compared to R, one of the primary tools of data scientists, jamovi is more human-friendly, more interpretable, and better suited for exploratory and iterative analysis. jamovi has quickly become my go-to tool for analysis.</p>
<p>And while jamovi is shockingly easy to use, many people feel more comfortable having something to guide them through new software and new functions. I felt that this was a way I could show my thanks to the jamovi community and help introduce others to jamovi’s goodness.</p>
<p>Four years ago, I founded datalab.cc with the goal of helping non-technical people – students, researchers, nonprofit volunteers, and small business owners, among others – reach their goals through data-driven decision-making. We do this through free, open-source, online videos, which are available both at <a href="https://datalab.cc/tools/jamovi">datalab.cc</a> and at our <a href="https://www.youtube.com/datalabcc">YouTube channel</a>. We have already created video courses on <a href="https://datalab.cc/tools/spss01/">SPSS</a>, <a href="https://datalab.cc/tools/r01">R</a>, <a href="https://datalab.cc/tools/googlesheets/">Google Sheets</a>, the visualization tool <a href="https://datalab.cc/tools/raw01">RAW</a>, the online form tool <a href="https://datalab.cc/tools/tf01">Typeform</a>, and the <a href="https://datalab.cc/foundations/toc">principles of data science</a>. And now we’re proud to share a complete introductory course on jamovi!</p>
<p>This course includes 52 videos – over 4.5 hours of instruction – that cover every aspect of jamovi’s base installation, from download and setup to data exploration and visualization to scale analysis and predictive modeling. These videos are designed to complement training on statistical principles. For example, the videos demonstrate how to perform a multiple regression analysis or a confirmatory factor analysis in jamovi but do not go into depth on the assumptions and interpretation of each procedure. (This is the same approach that is used in datalab.cc’s other tool-focused courses like R and SPSS.)</p>
<p>We would love to see people use these videos to develop their own analytical skills, to teach students the elements of data-based reasoning, and to collaborate with others. We invite you to mix and match the videos to suit your purpose and to contact us at <code class="highlighter-rouge">hello@datalab.cc</code> to let us know what else we can do to make jamovi and data easier and more accessible.</p>
<p>As a final note, jamovi is in active development and so we will update the videos as new features and functions become available. We also plan on doing a second series in the near future on jamovi’s modules and the additional power they give.</p>
<p><div class="video-container">
<iframe width="560" height="315" src="https://www.youtube-nocookie.com/embed/videoseries?list=PLkk92zzyru5OAtc_ItUubaSSq6S_TGfRn" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen=""></iframe>
</div></p>["barton_poulson"]tl;dr introduces a free online introductory course on jamovi that includes 52 videos – over 4.5 hours of instruction – that cover every aspect of jamovi’s base installation, from download and setup to data exploration and visualization to scale analysis and predictive modelingIntroducing solid – a highly reliable, less frequent release channel2018-08-10T09:30:00+02:002018-08-10T09:30:00+02:00https://blog.jamovi.org/2018/08/10/introducing-solid<h3 id="tldr">tl;dr</h3>
<ul>
<li>jamovi <code class="highlighter-rouge">solid</code> are new, highly reliable jamovi releases, which are updated less frequently, and with a greater emphasis on stability over new features.</li>
<li>jamovi <code class="highlighter-rouge">current</code> are frequently updated releases, and contain the very latest features developed by the jamovi community</li>
</ul>
<!--more-->
<p>As jamovi has continued to grow, we’ve approached a point where more and more institutions are adopting jamovi. While a lot of jamovi’s early adopters really like the rapid development cycle and continuous addition of new features, these institutions often prefer a more conservative approach, putting stability ahead of new functionality.</p>
<p>To accommodate these users, we are now providing two release channels. The <em>solid</em> release channel will be updated less frequently with an emphasis on high reliability, whereas the <em>current</em> release channel will maintain our current focus of rapid development and delivering new features.</p>
<p>Which release is right for you? If stability and predictability is more important to you than having access to all the latest features, then try our new solid releases. If you like to stay abreast of our latest developments and new features, current is for you. Both versions are now available from the <a href="https://www.jamovi.org/download.html">download page</a>.</p>["jonathon_love"]tl;dr jamovi solid are new, highly reliable jamovi releases, which are updated less frequently, and with a greater emphasis on stability over new features. jamovi current are frequently updated releases, and contain the very latest features developed by the jamovi communityRj Editor – Analyse your data with R in jamovi2018-07-30T10:00:00+02:002018-07-30T10:00:00+02:00https://blog.jamovi.org/2018/07/30/rj<h3 id="tldr">tl;dr</h3>
<ul>
<li><code class="highlighter-rouge">Rj Editor</code> lets you analyse data in jamovi with R, and make use of your favourite R packages from within the jamovi statistical spreadsheet</li>
<li><code class="highlighter-rouge">jmvconnect</code> makes it easy to access jamovi data sets from R</li>
</ul>
<!--more-->
<p>Rj is a new module for <a href="https://www.jamovi.org">the jamovi statistical spreadsheet</a> that allows you to use the R programming language to analyse data from within jamovi. Although jamovi is already built on top of R, and all the analyses it provides are written in R, to date it hasn’t been possible to enter R code directly. Rj changes that.</p>
<p><img src="https://blog.jamovi.org/assets/images/rj.png" alt="Statkat options" style="width: 700px; max-width: 100%;" /></p>
<p>There are many reasons you might want to do this; there are a lot (thousands!) of analyses available in R packages that haven’t been <a href="https://dev.jamovi.org">made available as jamovi modules</a> (yet!), and Rj allows you to make use of these analyses from within jamovi. Additionally, you can make use of <em>loops</em> and <em>if-statements</em>, allowing (among other things) conditional analyses and simulation studies.</p>
<p>For some, using R in a spreadsheet will be an ideal place to begin learning R. For others it can be an easy way to share R analyses with less technically savvy colleagues. (And some people just prefer to code!)</p>
<h2 id="installation">Installation</h2>
<p>Rj is available from the jamovi library, and requires a recent version of jamovi. The jamovi library is accessible from in the Analyses tab -> <em>modules</em> menu at the top right of the jamovi window. Scroll down the list until you find Rj, and select install. jamovi will download Rj, install it, and then Rj will be available from the jamovi analysis menu (The menu should pulsate blue when you first install a module).</p>
<h2 id="enter-code">Enter code</h2>
<p>To run an R analysis, select <code class="highlighter-rouge">Rj Editor</code> from the R analysis menu. This will bring up the editor for entering your R code. The data set is available to you as a data frame, simply as <code class="highlighter-rouge">data</code>. To get started, you might like to run descriptives on it.</p>
<p><img src="https://blog.jamovi.org/assets/images/rj2.png" alt="Statkat options" style="width: 700px; max-width: 100%;" /></p>
<p>Or if you prefer the dplyr approach, you could go:</p>
<div class="highlighter-rouge"><pre class="highlight"><code>library(jmv)
library(dplyr)
library(magrittr)
select(data, 1:3) %>%
descriptives()
</code></pre></div>
<p>You’ll notice as you’re entering this code, Rj auto-suggests function names, like in RStudio.</p>
<p>To run the code, press Control+Shift+Enter (or ⌘+Shift+Enter if you’re on a Mac). jamovi will run the R code and the results will appear in the results panel like other analyses. You can continue to make changes to the code, and press Control+Shift+Enter to run it again.</p>
<p>By default, Rj makes use of the version of R bundled with jamovi. This includes many packages (jmv and all it’s dependencies, <a href="https://cran.r-project.org/package=jmv">see here</a>), and will be sufficient for many people, but if you need to make use of additional R packages then you’ll need to make use of the <em>System R</em> version. If you select the configuration gear to the top right of the code box, you’ll see an option to change the R version used.</p>
<p>The <em>System R</em> version uses the version of R you have installed (i.e. from CRAN). This has the advantage that your R code now has access to all of the packages you have installed for that version of R. jamovi should locate your system R installation automatically (It uses the same algorithm that RStudio uses). The last thing you will need is to have the <code class="highlighter-rouge">jmvconnect</code> R package installed in your system R library. This package allows your system R version to access the jamovi data sets. You can install it from an R terminal or from RStudio with:</p>
<div class="highlighter-rouge"><pre class="highlight"><code>install.packages('jmvconnect')
</code></pre></div>
<p>Once this is done, moving from the <em>jamovi R</em> to the <em>System R</em> should be seamless.</p>
<p>It’s worth remembering that sharing jamovi files with colleagues becomes a bit more complicated when you make use of the <em>System R</em> version. If they want to make changes and re-run your analyses, they will need to have the same R packages installed – that’s the price of flexibility!</p>
<h2 id="not-all-data">Not all data</h2>
<p>When Rj runs R code, by default it makes the whole data set available as a data frame called <code class="highlighter-rouge">data</code>. However, it’s likely that your analysis only makes use of a few columns, and doesn’t need the whole data set. You can limit the columns made available to the analysis by including a special comment at the top of your script, of the form:</p>
<div class="highlighter-rouge"><pre class="highlight"><code># (column1, column2, column3)
library(jmv)
...
</code></pre></div>
<p>In this instance, only the named columns will appear in the <code class="highlighter-rouge">data</code> data frame. This can speed the analysis up, particularly if you are working with large data sets. Additionally, this lets jamovi know that the analysis is only using these columns, and the analysis will not need to be re-run if changes are made to other columns.</p>
<h2 id="to-the-terminal">To the terminal!</h2>
<p>There may be times where you’ll want to transition to an R terminal or RStudio for analysing a data set. This is where the <a href="https://cran.r-project.org/package=jmvconnect"><code class="highlighter-rouge">jmvconnect</code> R package</a> comes in handy. <code class="highlighter-rouge">jmvconnect</code> let’s you read the data sets from a running jamovi instance into an R session. At time of writing it has two functions:</p>
<ul>
<li><code class="highlighter-rouge">what()</code></li>
<li><code class="highlighter-rouge">read()</code></li>
</ul>
<p><code class="highlighter-rouge">what()</code> lists the available data sets, and <code class="highlighter-rouge">read()</code> reads them. For example, you might go:</p>
<div class="highlighter-rouge"><pre class="highlight"><code>> library(jmvconnect)
>
> what()
Available Data Sets
─────────────────────────────────────
Title Rows Cols
─────────────────────────────────────
1 iris 150 5
2 Tooth Growth 60 3
─────────────────────────────────────
</code></pre></div>
<p>and then read the data set with:</p>
<div class="highlighter-rouge"><pre class="highlight"><code>data <- read('Tooth Growth')
</code></pre></div>
<p>or</p>
<div class="highlighter-rouge"><pre class="highlight"><code>data <- read(2)
</code></pre></div>
<p>Before you ask, we intend on adding support for reading .omv files from R too (and for saving/opening .RData files from inside jamovi).</p>
<h2 id="work-in-progress">Work in progress</h2>
<p>Auto-suggest is a work in progress, but you’ll still find it pretty useful. At present, it only suggests functions from the base packages, the recommended packages, and jmv. This is something we’ll broaden in the future. We also need to add a help system where you can access package documentation.</p>
<p>Package installation for the <em>System R</em> is <em>technically</em> possible through Rj, but is less than ideal. The UI will hang, and you won’t receive any feedback as to what’s going on. This is something we’ll improve in the future. For now, you can just use an R terminal, or RStudio.</p>
<p>On some windows machines, an R window flashes briefly when running analyses using the <em>System R</em>. I’m not sure why this is, but I think it’s a bug in the <code class="highlighter-rouge">evaluate</code> package. If anyone knows any more about the issue, I’d be keen to hear from you.</p>
<p>Finally, if you’re using jamovi on linux from the PPA, it’s currently using an older version of R, and you you <em>may</em> encounter issues with plots when using the system R. If this is a problem, we recommend using the <a href="https://flathub.org/apps/details/org.jamovi.jamovi">flatpak version from flathub</a> instead.</p>
<h2 id="in-summary">In summary</h2>
<p>Rj and jmvconnect make is easy to access R from jamovi, and jamovi from R.</p>["jonathon_love"]tl;dr Rj Editor lets you analyse data in jamovi with R, and make use of your favourite R packages from within the jamovi statistical spreadsheet jmvconnect makes it easy to access jamovi data sets from RStatkat – find the right statistical technique for your data and research question2018-06-25T11:00:00+02:002018-06-25T11:00:00+02:00https://blog.jamovi.org/2018/06/25/statkat<h3 id="tldr">tl;dr</h3>
<p>Finding a statistical technique that is suitable for your data and research question can be challenging. The Statkat module helps you to find a statistical method that suits your needs!</p>
<!--more-->
<h2 id="using-the-statkat-module">Using the Statkat module</h2>
<p>To get started, first make sure that you are working with jamovi version 0.9.1.1 or higher. Then install the Statkat module from the jamovi library and open a data set. We are going to use the <code class="highlighter-rouge">Tooth Growth</code> data set as an example data set (see Menu > Open > Examples). The Tooth Growth data set contains three variables: a numeric variable <code class="highlighter-rouge">len</code> (tooth length), a dichotomous variable <code class="highlighter-rouge">supp</code> (supplement type: vitamin C or orange juice), and a nominal variable <code class="highlighter-rouge">dose</code> (dose in milligrams per day). One question of interest could be whether there is a relationship between tooth length and supplement type. But which analysis should we use to answer this question? Let’s find out using the Statkat module. The Statkat module contains three options: Single Variable, Correlational Research, and Repeated Measurements.</p>
<p><img src="https://blog.jamovi.org/assets/images/statkatOptions.png" alt="Statkat options" style="width: 700px; max-width: 100%;" /></p>
<p>Since we are interested in whether there is a relationship between tooth length and supplement type, we choose the Correlational Research option. You should also choose this option if you want to predict a variable from other variables or if you are interested in the difference between independent (unrelated) groups on a certain variable (whether there is a difference in tooth length between the two unrelated supplement groups, is just a different formulation of the example question).</p>
<p>About the two other options:</p>
<ul>
<li>Choose the Single Variable option if you are interested in only a single variable, for instance, the mean tooth length.</li>
<li>Choose the Repeated Measurements option if you are interested in differences between related variables, like differences between repeated measurements over time, or differences between scores of women and their husbands.</li>
</ul>
<p>As long as there are no variables defined for <code class="highlighter-rouge">Variable 1/Dependent Variable</code> and <code class="highlighter-rouge">Variable 2/Independent Variables</code>, the output field contains general instructions on how to use the Statkat module. The most important instruction is that the measurement levels of the variables should be set correctly, since otherwise you will end up with wrong method recommendations.</p>
<p>For a method recommendation given our research question, we drop the tooth length variable <code class="highlighter-rouge">len</code> in the box below Variable 1/Dependent Variable field, and the supplement type variable <code class="highlighter-rouge">supp</code> in the box below Variable 2/Independent Variables.</p>
<p><img src="https://blog.jamovi.org/assets/images/statkatOutput.png" alt="Statkat output" style="width: 700px; max-width: 100%;" /></p>
<p>Based on the measurement level of the two variables, Statkat recommends to use a two sample <em>t</em> test, or, if the normality assumption is violated, the Mann-Whitney U test. If you need a quick refreshment of what the recommended methods are about, click on the relevant links provided in the output. The links will lead you to neat method-overview tables at the official <a href="https://statkat.com" target="_blank">Statkat</a> website.</p>
<h2 id="variable-1dependent-variable-or-variable-2independent-variables-which-field-to-use">Variable 1/Dependent Variable or Variable 2/Independent Variables: Which field to use?</h2>
<p>If your research question does not make a clear distinction between an independent variable and a dependent variable, the decision of which variable to define as Variable 1/Dependent Variable and which as Variable 2/Independent Variables can be arbitrary. But doesn’t this decision affect the recommended method? Well, in some cases it does affect the primary method recommendation, but if a simpler method can be performed by flipping the two variables, this is usually mentioned. It is then up to you which of the recommended methods you prefer. It is important to keep in mind here that none of the correlational statistical techniques can say anything about causality anyway (not even a method like regression analysis), so even if you do make a distinction between an independent and dependent variable, the statistical method will only say something about association, not causation.</p>
<h2 id="conclusion">Conclusion</h2>
<p>We hope that the Statkat module will make selecting an appropriate statistical method easier. If you don’t have any data yet or if you prefer a decision tree to find an appropriate method, then Statkat’s <a href="https://statkat.com/statistical-technique-selection/tool-for-selecting-a-statistical-technique.php" target="_blank">method selection tool</a> can be of help.</p>["rivka_devries"]tl;dr Finding a statistical technique that is suitable for your data and research question can be challenging. The Statkat module helps you to find a statistical method that suits your needs!Introducing filters in jamovi2018-04-25T11:00:00+02:002018-04-25T11:00:00+02:00https://blog.jamovi.org/2018/04/25/jamovi-filters<h3 id="tldr">tl;dr</h3>
<p>jamovi 0.9 and newer allow you to filter rows and columns out of your analyses. This is useful for excluding outliers, or limiting the scope of your analyses. jamovi filters are built on top of the jamovi ‘compute variables’ system, allowing great flexibility in filtering.</p>
<!--more-->
<p><em>(note, if you haven’t already updated to <a href="https://www.jamovi.org/download.html">jamovi 0.9.0.1 [or newer]</a>, we encourage you to do do so).</em></p>
<h2 id="row-filters">Row filters</h2>
<p>The jamovi 0.9 series has landed, and with it comes the ability to filter out rows that you don’t want included in your analyses. There are a number of reasons why this might be appropriate. For example, you might want to only include people’s survey responses if they explicitly consented to having their data used, or you might want to exclude all left-handed people, or perhaps people who score ‘below chance’ in an experimental task. In some cases you just want to exclude extreme scores, for example those that score more than 3 standard deviations from the mean.</p>
<p>The filters in jamovi are build on top of jamovi’s <em>computed variable</em> formula system, which allows the building of arbitrarily complex formulas. For a primer on <em>computed variables</em> in jamovi, there’s an earlier blog post on them <a href="https://blog.jamovi.org/2017/11/28/jamovi-formulas.html">here</a> (although, you should note that we’ve added quite a few new useful functions since that blog post was written.)</p>
<p>To demonstrate jamovi filters (you can follow along if you like), I’m going to open the very simple <code class="highlighter-rouge">Tooth Growth</code> data set from the examples. Next, we select the <em>Filters</em> button from the <em>Data</em> tab. This opens the filter view and creates a new filter called <code class="highlighter-rouge">Filter 1</code>. This can be seen in the following GIF:</p>
<p><div class="gif-player" src="https://blog.jamovi.org/assets/images/filter1.png" data-anim-src="https://blog.jamovi.org/assets/images/filter1.gif" data-static-src="https://blog.jamovi.org/assets/images/filter1.png" data-title="filter1" data-name="GIF: Filter 1" style="width: 700px; max-width: 100%;"></div></p>
<p>In this GIF we specify a filter to exclude the 9th row. Perhaps we know that the 9th participant was someone just testing the survey system, and not a proper participant (<code class="highlighter-rouge">Tooth Growth</code> is actually about the length of guinea pig teeth, so perhaps we know that the 9th participant was a rabbit). We can simply exclude them with the formula:</p>
<div class="highlighter-rouge"><pre class="highlight"><code>ROW() != 9
</code></pre></div>
<p>In this expression the <code class="highlighter-rouge">!=</code> means ‘does not equal’. If you’ve ever used a programming language like <em>R</em> this should be very familiar. Filters in jamovi exclude the rows for which the formula is <em>not</em> true. in this case, the expression <code class="highlighter-rouge">ROW() != 9</code> is true for all rows <em>except</em> the 9th row. When we apply this filter, the tick in the <code class="highlighter-rouge">Filter 1</code> column of the 9th row changes to a cross, and the whole row greys out. If we were to run an analysis now, it would run as though the 9th row wasn’t there. Similarly, if we already had run some analyses, they would re-run and the results would update to values not using the 9th row.</p>
<p>But we can do more complicated filters than this! The <code class="highlighter-rouge">Tooth Growth</code> example contains the length of teeth from guinea pigs (the <code class="highlighter-rouge">len</code> column) fed different dosages (the <code class="highlighter-rouge">dose</code> column) of supplements; vitamin c or orange juice (recorded in the <code class="highlighter-rouge">supp</code> column). Let’s say that we’re interested in the effect of dosage on tooth length. We might run an ANOVA with <code class="highlighter-rouge">len</code> as the dependent variable, and <code class="highlighter-rouge">dose</code> as the grouping variable. But let’s say that we’re only interested in the effects of vitamin c, and not of orange juice. we can use the formula:</p>
<div class="highlighter-rouge"><pre class="highlight"><code>supp == 'VC'
</code></pre></div>
<p>In fact we can specify this formula <em>in addition</em> to the <code class="highlighter-rouge">ROW() != 9</code> formula if we like. We can add it as another expression to <code class="highlighter-rouge">Filter 1</code> (by clicking the small <code class="highlighter-rouge">+</code> beside the first formula), or we can add it as an additional filter (by selecting the large <code class="highlighter-rouge">+</code> to the left of the filters dialog box). As we’ll see, adding an expression to an existing filter does not provide exactly the same behaviour as creating a separate filter. In this case however, it doesn’t make a difference, so we’ll just add it to the existing filter. This additional expression comes to be represented with its own column as well, and by looking at the ticks and crosses, we can see which filter or expression is responsible for excluding each row.</p>
<p><div class="gif-player" src="https://blog.jamovi.org/assets/images/filter2.png" data-anim-src="https://blog.jamovi.org/assets/images/filter2.gif" data-static-src="https://blog.jamovi.org/assets/images/filter2.png" data-title="filter2" data-name="GIF: Filter 2" style="width: 700px; max-width: 100%;"></div></p>
<p>But let’s say we want to exclude from the analysis all the tooth lengths that were more than 1.5 standard deviations from the mean. To do this, we’d take a Z-score, and check that it falls between -1.5 and 1.5. we could use the formula:</p>
<div class="highlighter-rouge"><pre class="highlight"><code>-1.5 < Z(len) < 1.5
</code></pre></div>
<p>or if we’re really keen:</p>
<div class="highlighter-rouge"><pre class="highlight"><code>-1.5 < (len - VMEAN(len)) / VSTDEV(len) < 1.5
</code></pre></div>
<p>(this last formula is a great way to demonstrate to students what a z-score is.)</p>
<p>There are a lot of functions available in jamovi, and you can see them by clicking the small <img class="img-inline" src="https://blog.jamovi.org/assets/images/variable-computed.svg" alt="variable-computed" style="width: 16px; max-width: 100%;" /> beside the formula box.</p>
<p>Now let’s add this z-score formula to a separate filter by clicking the large <code class="highlighter-rouge">+</code> to the left of the filters, and adding it to <code class="highlighter-rouge">Filter 2</code>.</p>
<p><div class="gif-player" src="https://blog.jamovi.org/assets/images/filter3.png" data-anim-src="https://blog.jamovi.org/assets/images/filter3.gif" data-static-src="https://blog.jamovi.org/assets/images/filter3.png" data-title="filter3" data-name="GIF: Filter 3" style="width: 700px; max-width: 100%;"></div></p>
<p>With multiple filters, the filtered rows cascade from one filter into the next. So only the rows allowed through by <code class="highlighter-rouge">Filter 1</code> are used in the calculations for <code class="highlighter-rouge">Filter 2</code>. In this case, the mean and standard deviation for the z-score will be based only on the Vitamin C rows (and also not on row 9). In contrast, if we’d specified our Z() filter as an additional expression in <code class="highlighter-rouge">Filter 1</code>, then the mean and standard deviation for the z-score would be based on the entire dataset.</p>
<p>In this way you can specify arbitrarily complex rules for when a row should be included in analyses or not (but you should pre-register your rules<sup><a href="#note">1</a></sup>).</p>
<p>So that is how row filters work in jamovi, which apply to the data set as a whole. However, sometimes you want to just filter individual columns. For that there are column filters.</p>
<h2 id="column-filters">Column filters</h2>
<p>Column filters come in handy when you want to filter some rows for some analyses, but not for all. This is achieved with the <em>computed variable</em> system (you can read more about computed variables in our earlier blog post <a href="https://blog.jamovi.org/2017/11/28/jamovi-formulas.html">here</a>). With the computed variables we create a copy of an existing column, but with the unwanted values excluded.</p>
<p>In the <code class="highlighter-rouge">Tooth Growth</code> example, we might want to analyse the doses of 500 and 1000, and 1000 and 2000 separately. To do this we create a new column for each subset. So in our example, we can select the <code class="highlighter-rouge">dose</code> column in the jamovi spreadsheet, and then select the <code class="highlighter-rouge">Compute</code> button from the data tab. This creates a new column to the right called <code class="highlighter-rouge">dose (2)</code>, and same as the filters, we can enter a formula. in this case we’ll enter the formula:</p>
<div class="highlighter-rouge"><pre class="highlight"><code>FILTER(dose, dose <= 1000)
</code></pre></div>
<p>Or if you prefer:</p>
<div class="highlighter-rouge"><pre class="highlight"><code>FILTER(dose, dose == 1000 or dose == 500)
</code></pre></div>
<p>The first argument to the <code class="highlighter-rouge">FILTER()</code> function (in this example <code class="highlighter-rouge">dose</code>) is what values to use in the computed column. The second argument is the condition; when this condition isn’t satisfied, the value comes across blank (or as a ‘missing value’ if you prefer). So with this formula, the <code class="highlighter-rouge">dose (2)</code> column contains all the <code class="highlighter-rouge">500</code> and <code class="highlighter-rouge">1000</code> values, but the <code class="highlighter-rouge">2000</code> values are not there.</p>
<p>We might also change the name of the column to something more descriptive, like <code class="highlighter-rouge">dose 5,10</code>. Similarly we can create a column <code class="highlighter-rouge">dose 10,20</code> with the formula <code class="highlighter-rouge">FILTER(dose, dose != 500)</code>. Now we can run two separate ANOVAs (or t-tests) using <code class="highlighter-rouge">len</code> as the dependent variable, and <code class="highlighter-rouge">dose 5,10</code> as one grouping variable in the first analysis, and <code class="highlighter-rouge">dose 10,20</code> in the other. In this way we can use different filters for different analyses. Contrast this with row filters which are applied to <em>all</em> the analyses.</p>
<p><div class="gif-player" src="https://blog.jamovi.org/assets/images/filter4.png" data-anim-src="https://blog.jamovi.org/assets/images/filter4.gif" data-static-src="https://blog.jamovi.org/assets/images/filter4.png" data-title="filter4" data-name="GIF: Filter 4" style="width: 700px; max-width: 100%;"></div></p>
<p>It may also have occurred to you, that with <code class="highlighter-rouge">FILTER()</code> we can do what might be called a ‘poor man’s <em>split variables</em>’. In the future jamovi will provide a dedicated UI for ‘splitting variables’, but in the mean time you can create splits using <code class="highlighter-rouge">FILTER()</code>. For example, we could split <code class="highlighter-rouge">len</code> into two new columns <code class="highlighter-rouge">len VC</code> and <code class="highlighter-rouge">len OJ</code> with the functions <code class="highlighter-rouge">FILTER(len, supp == 'VC')</code> and <code class="highlighter-rouge">FILTER(len, supp == 'OJ')</code> respectively. This results in two separate columns which can be analysed side-by-side.</p>
<p>So that’s column filters and row filters. We hope you find them as satisfying to use as we’ve found developing them!</p>
<p><br />
<br /></p>
<p><a name="note"><sup>1</sup></a><em>Pre-registration is the solution to <a href="https://en.wikipedia.org/wiki/Data_dredging">p-hacking</a>, not deliberately making software difficult to use! Don’t p-hack. Your p-hacking harms more people than you know.</em></p>["jonathon_love"]tl;dr jamovi 0.9 and newer allow you to filter rows and columns out of your analyses. This is useful for excluding outliers, or limiting the scope of your analyses. jamovi filters are built on top of the jamovi ‘compute variables’ system, allowing great flexibility in filtering.jmv – one R package (not just) for the social sciences2017-12-07T00:00:00+01:002017-12-07T00:00:00+01:00https://blog.jamovi.org/2017/12/07/jmv<h3 id="tldr">tl;dr</h3>
<ul>
<li>many analyses in the social sciences require many R packages</li>
<li><code class="highlighter-rouge">jmv</code> makes these common analyses available from one R package</li>
<li><code class="highlighter-rouge">jmv</code> can be used from jamovi, a graphical statistical spreadsheet, making it super-accessible</li>
</ul>
<!--more-->
<h2 id="introducing-jmv">introducing <code class="highlighter-rouge">jmv</code></h2>
<p>There are many tremendously useful R packages for the social sciences (and similar fields), such as <a href="https://cran.r-project.org/package=car"><code class="highlighter-rouge">car</code></a>, <a href="https://cran.r-project.org/package=afex"><code class="highlighter-rouge">afex</code></a> <a href="https://cran.r-project.org/package=vcd"><code class="highlighter-rouge">vcd</code></a>, etc. Although running basic analyses (such as t-tests or ANOVA) with these packages is very straight forward, it is typically necessary to perform a number of supplementary analyses to accompany them; post-hoc tests, effect-size calculations, bias-corrections, and assumption checks. These additional tests often require the use of many additional R packages, and can make reasonably standard analyses quite time-consuming to perform. For example, in the book <em>Discovering Statistics Using R</em> by Andy Field (a popular textbook in the social sciences), the chapter on ANOVA alone recommends the use of 7 packages.</p>
<p><code class="highlighter-rouge">jmv</code> simplifies this whole process by bringing all of these packages together and makes doing the following analyses with their most common supplementary tests, corrections and assumption checks as easy as possible:</p>
<ul>
<li>Descriptive statistics</li>
<li>T-Tests</li>
<li>ANOVA</li>
<li>ANCOVA</li>
<li>Repeated Measures ANOVA</li>
<li>Non-parametric ANOVAs</li>
<li>Correlation</li>
<li>Linear Regression</li>
<li>Contingency Tables</li>
<li>Proportion Tests</li>
<li>Factor Analysis</li>
</ul>
<p>and coming soon:</p>
<ul>
<li>Logistic Regression</li>
<li>Log-linear Regression</li>
</ul>
<p><code class="highlighter-rouge">jmv</code> aims to make all common statistical tests taught at an undergraduate level available from a single package.</p>
<h2 id="an-anova">An ANOVA</h2>
<p>Let’s begin with a simple, familiar analysis – an ANOVA. In this example we use the <code class="highlighter-rouge">ToothGrowth</code> dataset from R, and explore whether different food supplements and their dosage affect how much a guinea pig’s teeth grow. We’ll specify <code class="highlighter-rouge">len</code> to be the dependent variable, and <code class="highlighter-rouge">supp</code> and <code class="highlighter-rouge">dose</code> to be the factors.</p>
<div class="language-r highlighter-rouge"><pre class="highlight"><code><span class="n">library</span><span class="p">(</span><span class="s1">'jmv'</span><span class="p">)</span><span class="w">
</span><span class="n">data</span><span class="p">(</span><span class="s1">'ToothGrowth'</span><span class="p">)</span><span class="w">
</span><span class="n">jmv</span><span class="o">::</span><span class="n">anova</span><span class="p">(</span><span class="n">ToothGrowth</span><span class="p">,</span><span class="w">
</span><span class="n">dep</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s1">'len'</span><span class="p">,</span><span class="w">
</span><span class="n">factors</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nf">c</span><span class="p">(</span><span class="s1">'supp'</span><span class="p">,</span><span class="w"> </span><span class="s1">'dose'</span><span class="p">))</span><span class="w">
</span></code></pre></div>
<div class="highlighter-rouge"><pre class="highlight"><code>##
## ANOVA
##
## ANOVA
## ───────────────────────────────────────────────────────────────────────
## Sum of Squares df Mean Square F p
## ───────────────────────────────────────────────────────────────────────
## supp 205 1 205.4 15.57 < .001
## dose 2426 2 1213.2 92.00 < .001
## supp:dose 108 2 54.2 4.11 0.022
## Residuals 712 54 13.2
## ───────────────────────────────────────────────────────────────────────
</code></pre></div>
<p>This produces what should be a familiar ANOVA table. You have likely seen something like this in R before, though perhaps not as nicely formatted.</p>
<p>Where <code class="highlighter-rouge">jmv</code> really comes into its own, is with additional options. In the following example we will perform the same analysis, but additionally requesting effect-size, post-hoc tests, homogeneity of variances tests, descriptive statistics, and a descriptives plot:</p>
<div class="language-r highlighter-rouge"><pre class="highlight"><code><span class="n">library</span><span class="p">(</span><span class="s1">'jmv'</span><span class="p">)</span><span class="w">
</span><span class="n">data</span><span class="p">(</span><span class="s1">'ToothGrowth'</span><span class="p">)</span><span class="w">
</span><span class="n">jmv</span><span class="o">::</span><span class="n">anova</span><span class="p">(</span><span class="n">ToothGrowth</span><span class="p">,</span><span class="w">
</span><span class="n">dep</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s1">'len'</span><span class="p">,</span><span class="w">
</span><span class="n">factors</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nf">c</span><span class="p">(</span><span class="s1">'supp'</span><span class="p">,</span><span class="w"> </span><span class="s1">'dose'</span><span class="p">),</span><span class="w">
</span><span class="n">effectSize</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s1">'eta'</span><span class="p">,</span><span class="w">
</span><span class="n">postHoc</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nf">c</span><span class="p">(</span><span class="s1">'supp'</span><span class="p">,</span><span class="w"> </span><span class="s1">'dose'</span><span class="p">),</span><span class="w">
</span><span class="n">plotHAxis</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s1">'dose'</span><span class="p">,</span><span class="w">
</span><span class="n">plotSepLines</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s1">'supp'</span><span class="p">,</span><span class="w">
</span><span class="n">descStats</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="kc">TRUE</span><span class="p">,</span><span class="w">
</span><span class="n">homo</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="kc">TRUE</span><span class="p">)</span><span class="w">
</span></code></pre></div>
<div class="highlighter-rouge"><pre class="highlight"><code>##
## ANOVA
##
## ANOVA
## ────────────────────────────────────────────────────────────────────────────────
## Sum of Squares df Mean Square F p η²
## ────────────────────────────────────────────────────────────────────────────────
## supp 205 1 205.4 15.57 < .001 0.059
## dose 2426 2 1213.2 92.00 < .001 0.703
## supp:dose 108 2 54.2 4.11 0.022 0.031
## Residuals 712 54 13.2
## ────────────────────────────────────────────────────────────────────────────────
##
##
## ASSUMPTION CHECKS
##
## Test for Homogeneity of Variances (Levene's)
## ────────────────────────────────────────────
## F df1 df2 p
## ────────────────────────────────────────────
## 1.94 5 54 0.103
## ────────────────────────────────────────────
##
##
## POST HOC TESTS
##
## Post Hoc Comparisons - supp
## ────────────────────────────────────────────────────────────────────────────
## supp supp Mean Difference SE df t p-tukey
## ────────────────────────────────────────────────────────────────────────────
## OJ - VC 3.70 0.938 54.0 3.95 < .001
## ────────────────────────────────────────────────────────────────────────────
##
##
## Post Hoc Comparisons - dose
## ─────────────────────────────────────────────────────────────────────────────
## dose dose Mean Difference SE df t p-tukey
## ─────────────────────────────────────────────────────────────────────────────
## 0.5 - 1 -9.13 1.15 54.0 -7.95 < .001
## - 2 -15.50 1.15 54.0 -13.49 < .001
## 1 - 2 -6.37 1.15 54.0 -5.54 < .001
## ─────────────────────────────────────────────────────────────────────────────
##
##
## Descriptives
## ───────────────────────────────────────
## supp dose N Mean SD
## ───────────────────────────────────────
## OJ 0.5 10 13.23 4.46
## OJ 1 10 22.70 3.91
## OJ 2 10 26.06 2.66
## VC 0.5 10 7.98 2.75
## VC 1 10 16.77 2.52
## VC 2 10 26.14 4.80
## ───────────────────────────────────────
</code></pre></div>
<p><img src="https://blog.jamovi.org/assets/images/jmv-toothgrowth.png" alt="ToothGrowth" style="width: 550px; max-width: 100%;" /></p>
<p>As can be seen, <code class="highlighter-rouge">jmv</code> can provide many additional tests and statistics relevant to the main tests, but with far less effort.</p>
<p>You can explore additional options for the <code class="highlighter-rouge">jmv</code> ANOVA <a href="https://www.jamovi.org/jmv/anova.html">here</a>, and the other tests and their available options <a href="https://www.jamovi.org/jmv">here</a>.</p>
<h2 id="jamovi-integration">jamovi integration</h2>
<p><code class="highlighter-rouge">jmv</code> is also useable from the <a href="https://www.jamovi.org">jamovi</a> statistical spreadsheet. jamovi makes a range of analyses accessible to a broader audience by making them available from a familiar, spreadsheet user-interface. jamovi can also make the underlying R code for each analysis available, making it easy for people to learn R, and transition to R scripting if they like.</p>
<p>Here is exactly the same analysis as above, having been performed in jamovi.</p>
<p><img src="https://blog.jamovi.org/assets/images/jmv.png" alt="jamovi" style="width: 700px; max-width: 100%;" /></p>
<h2 id="summing-up">summing up</h2>
<ul>
<li><code class="highlighter-rouge">jmv</code> makes a whole suite of common analyses from the social sciences very easy to perform</li>
<li><code class="highlighter-rouge">jamovi</code> makes these <em>even</em> easier to perform</li>
</ul>
<p>jmv is available from <a href="https://cran.r-project.org/package=jmv">CRAN</a></p>
<p>jamovi is available from <a href="https://www.jamovi.org">www.jamovi.org</a></p>["jonathon_love"]tl;dr many analyses in the social sciences require many R packages jmv makes these common analyses available from one R package jmv can be used from jamovi, a graphical statistical spreadsheet, making it super-accessible