Difference between revisions of "Filtering data with jamovi"

From Jamovi english information
Jump to: navigation, search
m (Sje025 moved page Filtering with jamovi to Filtering data with jamovi without leaving a redirect)
Line 1: Line 1:
 
=How do I create a filter variable and use it for selection?=
 
=How do I create a filter variable and use it for selection?=
[[File:CheatSheet_Filter_Shortcut.png|right]]
+
[[File:Outliers_Filter_Shortcut.png|right]]
 
* open the “Data” tab and select “Filter” (either by using the symbol in the icon bar or the one in the bottom-left corner of the jamovi window)<br>in order to access functions, press the “fx” icon in the filter settings<br>there also is a switch where you can activate or deactivate the filter (see the comment in red below)<br>you close the filter settings by pressing the arrow in the top-right corner
 
* open the “Data” tab and select “Filter” (either by using the symbol in the icon bar or the one in the bottom-left corner of the jamovi window)<br>in order to access functions, press the “fx” icon in the filter settings<br>there also is a switch where you can activate or deactivate the filter (see the comment in red below)<br>you close the filter settings by pressing the arrow in the top-right corner
 
* you can either use an function-based selection (e.g., based on z-scores)<br><code>MAXABSZ([VARIABLE1], [VARIABLE2], …) < 3.3</code>  
 
* you can either use an function-based selection (e.g., based on z-scores)<br><code>MAXABSZ([VARIABLE1], [VARIABLE2], …) < 3.3</code>  
[[File:CheatSheet_Filter_Settings.png|right]]
+
[[File:Outliers_Filter_Settings.png|right]]
* you can manually create a select variable and use that (see below)<br><code>selSbj == 1</code><br>these can be used with R-scripts to find outliers based upon the [[:File:Syntax_Outliers_IQR_R.txt|interquartile range]] (doing the same with code that you visually do with box plots) and multivariate outliers based upon the [[:File:Syntax_Outliers_Mahalanobis_R.txt|Mahalanobis distance]]<br>you do this using the [[Jamovi-module_Rj|Rj editor]]<br><span style="color: red>PLEASE NOTE: If you already filtered cases, the lines with filtered cases are not included and the line numbers when using the R-scripts get wrong. Open the filter settings by either double-clicking on the header line of the filter variable or use the symbol in the bottom-left corner of the jamovi window (only to see if you selected the tab “Data”) and deactivate the filter.</span>
+
* you can manually create a select variable and use that (see below)<br><code>selSbj == 1</code><br>you can now use with R-scripts to find outliers based upon the [[:File:Syntax_Outliers_IQR_R.txt|interquartile range]] (doing the same with code that you visually do with box plots) and multivariate outliers based upon the [[:File:Syntax_Outliers_Mahalanobis_R.txt|Mahalanobis distance]]<br>the output from those scripts tells you which lines you should de-select<br>you use the scripts within the [[Jamovi-module_Rj|Rj editor]], just copy-and-paste them and run them by hitting the "Play"-button (the little green triangle)<br><span style="color: red>PLEASE NOTE: If you already filtered cases, the lines with filtered cases are not included and the line numbers when using the R-scripts get wrong.<br>Open the filter settings by either double-clicking on the header line of the filter variable or use the symbol in the bottom-left corner of the jamovi window (only to see if you selected the tab “Data”) and deactivate the filter.</span>
 
* the filter conditions can be combined using boolean <code>and</code> / <code>or</code><:br><code>MAXABSZ([VARIABLE1], [VARIABLE2], …) < 3.3 and selSbj == 1</code>
 
* the filter conditions can be combined using boolean <code>and</code> / <code>or</code><:br><code>MAXABSZ([VARIABLE1], [VARIABLE2], …) < 3.3 and selSbj == 1</code>
 
* you can also de-select cases by setting limits to the values of variables (after visually checking the box-plots under “Descriptives”):<br><code>Revise < 50 and Anxiety > 51</code>
 
* you can also de-select cases by setting limits to the values of variables (after visually checking the box-plots under “Descriptives”):<br><code>Revise < 50 and Anxiety > 51</code>

Revision as of 11:12, 6 May 2020

How do I create a filter variable and use it for selection?

Outliers Filter Shortcut.png
  • open the “Data” tab and select “Filter” (either by using the symbol in the icon bar or the one in the bottom-left corner of the jamovi window)
    in order to access functions, press the “fx” icon in the filter settings
    there also is a switch where you can activate or deactivate the filter (see the comment in red below)
    you close the filter settings by pressing the arrow in the top-right corner
  • you can either use an function-based selection (e.g., based on z-scores)
    MAXABSZ([VARIABLE1], [VARIABLE2], …) < 3.3
Outliers Filter Settings.png
  • you can manually create a select variable and use that (see below)
    selSbj == 1
    you can now use with R-scripts to find outliers based upon the interquartile range (doing the same with code that you visually do with box plots) and multivariate outliers based upon the Mahalanobis distance
    the output from those scripts tells you which lines you should de-select
    you use the scripts within the Rj editor, just copy-and-paste them and run them by hitting the "Play"-button (the little green triangle)
    PLEASE NOTE: If you already filtered cases, the lines with filtered cases are not included and the line numbers when using the R-scripts get wrong.
    Open the filter settings by either double-clicking on the header line of the filter variable or use the symbol in the bottom-left corner of the jamovi window (only to see if you selected the tab “Data”) and deactivate the filter.
  • the filter conditions can be combined using boolean and / or<:br>MAXABSZ([VARIABLE1], [VARIABLE2], …) < 3.3 and selSbj == 1
  • you can also de-select cases by setting limits to the values of variables (after visually checking the box-plots under “Descriptives”):
    Revise < 50 and Anxiety > 51

How do I manually create a variable that I can use for selecting / deselecting cases?

Outliers AddVar selSbj.png
  • open the “Data” tab so that you see your data spreadsheet
  • go to the first column (if there are filter variables, to the first column after those)
  • right-click on the header line in that column, choose "Add variable" in the menu that opens, and then Data Variable → "Insert"
  • briefly check how many participants are contained in your file by going to the last line of your data set, remember this line number
Outliers ExcelMagic.png
  • now, we have to to a little bit of magic in Excel, LibreOffice Calc or Google sheets: open one of these programs, write "1" in the first and the second line of an empty spreadsheet, mark these two lines and then use the little black marker bottom right to drag the ones until you reached the number of participants in your data set within jamovi
  • copy the column with the "1" you just created to jamovi and paste it into the variable you just created
  • open the filter settings (either by using the symbol in the icon bar or the one in the bottom-left corner of the jamovi window) and either change an existing filter with adding:
    and [VARIABLE NAME] == 1
    or create a new filter with just writing:
    [VARIABLE NAME] == 1
    obviously you have to adjust [VARIABLE NAME] to the name of your selected variable
Outliers SelectUnselect.png
  • now you can de-select case by changing them "1" to "0" (and also select them again by changing "0" into "1")