<?xml version="1.0" encoding="utf-8"?><!DOCTYPE article  PUBLIC '-//OASIS//DTD DocBook XML V4.4//EN'  'http://www.docbook.org/xml/4.4/docbookx.dtd'><article><articleinfo><title>ToolsAndTricks</title><revhistory><revision><revnumber>9</revnumber><date>2013-03-08 10:17:39</date><authorinitials>localhost</authorinitials><revremark>converted to 1.6 markup</revremark></revision><revision><revnumber>8</revnumber><date>2006-07-02 14:46:30</date><authorinitials>cmbg-cache-2.server.ntli.net</authorinitials></revision><revision><revnumber>7</revnumber><date>2006-07-02 10:36:39</date><authorinitials>cmbg-cache-2.server.ntli.net</authorinitials></revision><revision><revnumber>6</revnumber><date>2006-07-02 10:25:05</date><authorinitials>cmbg-cache-2.server.ntli.net</authorinitials></revision><revision><revnumber>5</revnumber><date>2006-07-02 10:07:51</date><authorinitials>cmbg-cache-2.server.ntli.net</authorinitials></revision><revision><revnumber>4</revnumber><date>2006-07-02 08:44:22</date><authorinitials>cmbg-cache-2.server.ntli.net</authorinitials></revision><revision><revnumber>3</revnumber><date>2006-06-30 22:57:00</date><authorinitials>Scripting Subsystem</authorinitials></revision><revision><revnumber>2</revnumber><date>2006-06-30 22:55:28</date><authorinitials>Scripting Subsystem</authorinitials></revision><revision><revnumber>1</revnumber><date>2006-06-30 21:37:52</date><authorinitials>Scripting Subsystem</authorinitials></revision></revhistory></articleinfo><section><title>Tools and tricks for manipulating data files</title><section><title>PivotTables in Excel</title><para>If you want to produce cross-tabulated summaries of your data in an Excel spreadsheet, then it is worth exploring the use of Excel's <emphasis role="strong"><ulink url="https://lsr-wiki-02.mrc-cbu.cam.ac.uk/statswiki/ToolsAndTricks/statswiki/PivotTable#">PivotTable</ulink> Reports</emphasis>. </para><itemizedlist><listitem override="none"><para><code>Data -&gt; PivotTable Report ...</code>  </para></listitem></itemizedlist><para>or the keystroke sequence  </para><itemizedlist><listitem override="none"><para><emphasis role="strong">Alt-T Alt-P</emphasis> </para></listitem></itemizedlist><para>There is a special toolbar for pivot tables. It can be switched on <emphasis>via</emphasis> the Menu sequence  </para><itemizedlist><listitem override="none"><para><code>Tools -&gt; Customise ...</code> </para></listitem></itemizedlist></section><section><title>Data Restructure (SPSS 11)</title><para>This seems to be the perfect tool for all those occasion when you want ... </para><orderedlist numeration="arabic"><listitem><para>To combine data from two or more rows (cases) of a data matrix in a single row (case). The Restructure Wizard calls this <emphasis role="strong">Restructure selected cases into variables');</emphasis><listitem><para>To split a single row (case) into two or more rows (cases). The Restructure Wizard calls this Restructure selected variables into cases');</para></listitem> </para></listitem><listitem><para>To swap rows and columns (i.e. simply tanspose the data matrix). </para></listitem></orderedlist><itemizedlist><listitem override="none"><para>The Data Restructure procedure in splitting mode (2) will create new variables to tell where the data came from. </para><para><!--"~-smaller-~" is not applicable to DocBook-->For instance, <emphasis role="strong">a dataset contains information on the state of 18 structures in 44 MRI brain scans as assessed by 3 raters. The question asked relates to the amount of inter-rater agreement. The original data is organised as 18 rows (cases), 1 per brain scan, and 132 columns (variables), being the 3 ratings for each of the 44 structures. Each Rater gives ratings on 44 x 18 Items (scans x structures), and we want to restructure the data into an Item x Rater matrix.</emphasis>   </para><itemizedlist><listitem><para><!--"~-smaller-~" is not applicable to DocBook-->Select <emphasis>Restructure selected variables into cases.</emphasis>    </para></listitem><listitem><para><!--"~-smaller-~" is not applicable to DocBook-->We want to create variables Rater1, Rater2 and Rater3, each of which contain each rater's scores for the items. Each Rater corresponds to a what SPSS calls a <emphasis>variable group.</emphasis> There are thus 3 variable groups that we want to restructure. We can use the case number (Scan number) for SPSS's <emphasis>Case Group Identification.</emphasis>    </para></listitem><listitem><para><!--"~-smaller-~" is not applicable to DocBook-->We select the 44 Rater 1 variables (scans) as the <emphasis>Variables to be Transposed</emphasis> and call the <emphasis>Target Variable</emphasis> <emphasis role="strong">Rater1</emphasis> instead of the default <emphasis role="strong">trans1</emphasis>.    </para></listitem><listitem><para><!--"~-smaller-~" is not applicable to DocBook-->Now move to Target Variable <emphasis role="strong">trans2</emphasis>, rename it <emphasis role="strong">Rater2</emphasis> and select the 44 variables for Rater2 (NB the orders of the variables selected need to correspond).    </para></listitem><listitem><para><!--"~-smaller-~" is not applicable to DocBook-->Then set up Rater3 the same way.    </para></listitem><listitem><para><!--"~-smaller-~" is not applicable to DocBook-->Next we create an <emphasis>Index Variable</emphasis> which will indicate which Scan the data correspond to.   </para></listitem></itemizedlist><para>There is are additional options which allow for other ('fixed') variables to be replicated across the new split cases. </para></listitem></itemizedlist><!--rule (<hr>) is not applicable to DocBook--><para><ulink url="https://lsr-wiki-02.mrc-cbu.cam.ac.uk/statswiki/ToolsAndTricks/statswiki/CbuStatistics#">Return to Statistics main page</ulink> </para><para><ulink url="http://www.mrc-cbu.cam.ac.uk/">Return to CBU main page</ulink> </para><para>These pages are maintained by <ulink url="mailto:ian.nimmo-smith@mrc-cbu.cam.ac.uk">Ian Nimmo-Smith</ulink> and <ulink url="mailto:peter.watson@mrc-cbu.cam.ac.uk">Peter Watson</ulink> </para><para><!--"~-smaller-~" is not applicable to DocBook-->Last updated on 2 July 2006  </para></section></section></article>