<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Software for Exploratory Data Analysis and Statistical Modelling</title>
	<atom:link href="http://www.wekaleamstudios.co.uk/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.wekaleamstudios.co.uk</link>
	<description>Statistical Modelling with R</description>
	<lastBuildDate>Sat, 04 Sep 2010 09:37:59 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Creating a Presentation with LaTeX Beamer &#8211; Frame Transitions</title>
		<link>http://www.wekaleamstudios.co.uk/posts/creating-a-presentation-with-latex-beamer-frame-transitions/</link>
		<comments>http://www.wekaleamstudios.co.uk/posts/creating-a-presentation-with-latex-beamer-frame-transitions/#comments</comments>
		<pubDate>Sat, 04 Sep 2010 09:37:59 +0000</pubDate>
		<dc:creator>Ralph</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[frame]]></category>
		<category><![CDATA[LaTeX Typesetting]]></category>
		<category><![CDATA[transition]]></category>

		<guid isPermaLink="false">http://www.wekaleamstudios.co.uk/?p=1383</guid>
		<description><![CDATA[Transitions are often used in presentations to break up the presentation and to keep the audience awake, but often the outcome is irritation/distraction with text or other objects flying on or off the screen from different directions. As such they should be used sparingly if at all in a talk. LaTeX beamer has a simple [...]]]></description>
			<content:encoded><![CDATA[<p>Transitions are often used in presentations to break up the presentation and to keep the audience awake, but often the outcome is irritation/distraction with text or other objects flying on or off the screen from different directions. As such they should be used sparingly if at all in a talk. <strong>LaTeX</strong> beamer has a simple mechanism for including transitions in a presentation<span id="more-1383"></span></p>
<p><!--[Fast Tube]--><span id="smpGBk_d4Fc" style="display:block;"><a title="Click here to watch this video!" href="http://www.wekaleamstudios.co.uk/posts/creating-a-presentation-with-latex-beamer-frame-transitions/#smpGBk_d4Fc"><img src="http://i.ytimg.com/vi/smpGBk_d4Fc/0.jpg" alt="Fast Tube" border="0" width="320" height="240" /></a><br /><small>Fast Tube by <a title="Casper's Blog" href="http://blog.caspie.net/">Casper</a></small></span><!--[/Fast Tube]--></p>
<p>To use this transitions <strong>pdflatex</strong> needs to be used to create the document as a <strong>pdf</strong> file and the presentation needs to be viewed in full screen mode to observe the transitions. Adding a transition on a slide is as simple as adding a command like:</p>

<div class="wp_syntax"><div class="code"><pre class="latex" style="font-family:monospace;"><span style="color: #800000; font-weight: normal;">\transdissolve</span></pre></div></div>

<p>to the slide. This transition disolves the contents of the slide. The <strong>LaTeX</strong> beamer user guide has further information about the transitions that are available.</p>
<p>Other useful resources are provided on the <a href="http://www.wekaleamstudios.co.uk/supplementary-material/">Supplementary Material</a> page.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wekaleamstudios.co.uk/posts/creating-a-presentation-with-latex-beamer-frame-transitions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating a Presentation with LaTeX Beamer &#8211; Using Overlays</title>
		<link>http://www.wekaleamstudios.co.uk/posts/creating-a-presentation-with-latex-beamer-using-overlays/</link>
		<comments>http://www.wekaleamstudios.co.uk/posts/creating-a-presentation-with-latex-beamer-using-overlays/#comments</comments>
		<pubDate>Wed, 25 Aug 2010 19:00:37 +0000</pubDate>
		<dc:creator>Ralph</dc:creator>
				<category><![CDATA[Beamer]]></category>
		<category><![CDATA[LaTeX Typesetting]]></category>
		<category><![CDATA[onslide]]></category>
		<category><![CDATA[overlay]]></category>
		<category><![CDATA[pause]]></category>

		<guid isPermaLink="false">http://www.wekaleamstudios.co.uk/?p=1374</guid>
		<description><![CDATA[Overlays can be used in a LaTeX beamer presentation to reveal parts of a slide sequentially, which can be a useful way of imparting information to your audience. There are a number of different ways that overlays can be created depending on the sophistication required in the presentation.
Fast Tube by Casper
The \pause command is the [...]]]></description>
			<content:encoded><![CDATA[<p>Overlays can be used in a <strong>LaTeX</strong> beamer presentation to reveal parts of a slide sequentially, which can be a useful way of imparting information to your audience. There are a number of different ways that overlays can be created depending on the sophistication required in the presentation.<span id="more-1374"></span></p>
<p><!--[Fast Tube]--><span id="GtiMuBij7hg" style="display:block;"><a title="Click here to watch this video!" href="http://www.wekaleamstudios.co.uk/posts/creating-a-presentation-with-latex-beamer-using-overlays/#GtiMuBij7hg"><img src="http://i.ytimg.com/vi/GtiMuBij7hg/0.jpg" alt="Fast Tube" border="0" width="320" height="240" /></a><br /><small>Fast Tube by <a title="Casper's Blog" href="http://blog.caspie.net/">Casper</a></small></span><!--[/Fast Tube]--></p>
<p>The <strong>\pause</strong> command is the easiest way to create simple overlays that reveal consecutive parts of a slide.</p>

<div class="wp_syntax"><div class="code"><pre class="latex" style="font-family:monospace;"><span style="color: #C00000; font-weight: normal;">\begin</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #0000D0; font-weight: normal;">itemize</span></span><span style="color: #E02020; ">}</span>
<span style="color: #800000; font-weight: normal;">\<span style="color: #800000; font-weight: bold;">item</span></span> Total Runs Scored.
<span style="color: #800000; font-weight: normal;">\pause</span>
<span style="color: #800000; font-weight: normal;">\<span style="color: #800000; font-weight: bold;">item</span></span> Number of Innings Batted.
<span style="color: #800000; font-weight: normal;">\pause</span>
<span style="color: #800000; font-weight: normal;">\<span style="color: #800000; font-weight: bold;">item</span></span> Number of Not Out Innings.
<span style="color: #800000; font-weight: normal;">\pause</span>
<span style="color: #800000; font-weight: normal;">\<span style="color: #800000; font-weight: bold;">item</span></span> Number of 100s.
<span style="color: #800000; font-weight: normal;">\pause</span>
<span style="color: #800000; font-weight: normal;">\<span style="color: #800000; font-weight: bold;">item</span></span> Number of 50s.
<span style="color: #C00000; font-weight: normal;">\end</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #0000D0; font-weight: normal;">itemize</span></span><span style="color: #E02020; ">}</span></pre></div></div>

<p>Commands such as <strong><1-></strong> can be added after various beamer environments to allow them to appear on different slides of the overlay set to provide greater control over the display.</p>

<div class="wp_syntax"><div class="code"><pre class="latex" style="font-family:monospace;"><span style="color: #C00000; font-weight: normal;">\begin</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #0000D0; font-weight: normal;">tabular</span></span><span style="color: #E02020; ">}{</span><span style="color: #2020C0; font-weight: normal;">cccccccc</span><span style="color: #E02020; ">}</span> <span style="color: #E02020; ">\\</span> <span style="color: #800000; font-weight: normal;">\<span style="color: #800000; font-weight: bold;">hline</span></span>
Opposition <span style="color: #E02020; ">&amp;</span> Match <span style="color: #E02020; ">&amp;</span> Inns <span style="color: #E02020; ">&amp;</span> Runs <span style="color: #E02020; ">&amp;</span> NO <span style="color: #E02020; ">&amp;</span> Inns <span style="color: #E02020; ">&amp;</span> Wicket <span style="color: #E02020; ">&amp;</span> Catches <span style="color: #E02020; ">\\</span> <span style="color: #800000; font-weight: normal;">\<span style="color: #800000; font-weight: bold;">hline</span></span>
<span style="color: #800000; font-weight: normal;">\onslide</span>&lt;2-&gt; Australia <span style="color: #E02020; ">&amp;</span> 36 <span style="color: #E02020; ">&amp;</span> 49 <span style="color: #E02020; ">&amp;</span> 1673 <span style="color: #E02020; ">&amp;</span> 2 <span style="color: #E02020; ">&amp;</span> 66 <span style="color: #E02020; ">&amp;</span> 148 <span style="color: #E02020; ">&amp;</span> 57 <span style="color: #E02020; ">\\</span>
<span style="color: #800000; font-weight: normal;">\onslide</span>&lt;3-&gt; India <span style="color: #E02020; ">&amp;</span> 14 <span style="color: #E02020; ">&amp;</span> 16 <span style="color: #E02020; ">&amp;</span> 1201 <span style="color: #E02020; ">&amp;</span> 0 <span style="color: #E02020; ">&amp;</span> 23 <span style="color: #E02020; ">&amp;</span> 59 <span style="color: #E02020; ">&amp;</span> 14 <span style="color: #E02020; ">\\</span>
<span style="color: #800000; font-weight: normal;">\onslide</span>&lt;4-&gt; New Zealand <span style="color: #E02020; ">&amp;</span> 15 <span style="color: #E02020; ">&amp;</span> 22 <span style="color: #E02020; ">&amp;</span> 846 <span style="color: #E02020; ">&amp;</span> 2 <span style="color: #E02020; ">&amp;</span> 28 <span style="color: #E02020; ">&amp;</span> 64 <span style="color: #E02020; ">&amp;</span> 14 <span style="color: #E02020; ">\\</span>
<span style="color: #800000; font-weight: normal;">\onslide</span>&lt;5-&gt; Pakistan <span style="color: #E02020; ">&amp;</span> 14 <span style="color: #E02020; ">&amp;</span> 20 <span style="color: #E02020; ">&amp;</span> 647 <span style="color: #E02020; ">&amp;</span> 1 <span style="color: #E02020; ">&amp;</span> 18 <span style="color: #E02020; ">&amp;</span> 40 <span style="color: #E02020; ">&amp;</span> 14 <span style="color: #E02020; ">\\</span>
<span style="color: #800000; font-weight: normal;">\onslide</span>&lt;6-&gt; Sri Lanka <span style="color: #E02020; ">&amp;</span> 3 <span style="color: #E02020; ">&amp;</span> 3 <span style="color: #E02020; ">&amp;</span> 41 <span style="color: #E02020; ">&amp;</span> 0 <span style="color: #E02020; ">&amp;</span> 6 <span style="color: #E02020; ">&amp;</span> 11 <span style="color: #E02020; ">&amp;</span> 2 <span style="color: #E02020; ">\\</span>
<span style="color: #800000; font-weight: normal;">\onslide</span>&lt;7-&gt; West Indies <span style="color: #E02020; ">&amp;</span> 20 <span style="color: #E02020; ">&amp;</span> 37 <span style="color: #E02020; ">&amp;</span> 792 <span style="color: #E02020; ">&amp;</span> 1 <span style="color: #E02020; ">&amp;</span> 27 <span style="color: #E02020; ">&amp;</span> 61 <span style="color: #E02020; ">&amp;</span> 19 <span style="color: #E02020; ">\\</span> <span style="color: #800000; font-weight: normal;">\<span style="color: #800000; font-weight: bold;">hline</span></span>
<span style="color: #C00000; font-weight: normal;">\end</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #0000D0; font-weight: normal;">tabular</span></span><span style="color: #E02020; ">}</span></pre></div></div>

<p>The <strong>\onslide</strong> command is used to indicate a range of slides in the overlay where the information on that line should be displayed.</p>
<p>There are ways to create more complicated overlays to reveal information on a slide.</p>
<p>Other useful resources are provided on the <a href="http://www.wekaleamstudios.co.uk/supplementary-material/">Supplementary Material</a> page.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wekaleamstudios.co.uk/posts/creating-a-presentation-with-latex-beamer-using-overlays/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Charting the performance of cricket all-rounders &#8211; IT Botham</title>
		<link>http://www.wekaleamstudios.co.uk/posts/charting-the-performance-of-cricket-all-rounders-it-botham/</link>
		<comments>http://www.wekaleamstudios.co.uk/posts/charting-the-performance-of-cricket-all-rounders-it-botham/#comments</comments>
		<pubDate>Mon, 16 Aug 2010 19:59:54 +0000</pubDate>
		<dc:creator>Ralph</dc:creator>
				<category><![CDATA[Data Summary]]></category>
		<category><![CDATA[Exploratory Data Analysis]]></category>
		<category><![CDATA[Grammar of Graphics]]></category>
		<category><![CDATA[all-rounder]]></category>
		<category><![CDATA[botham]]></category>
		<category><![CDATA[catches]]></category>
		<category><![CDATA[cricket]]></category>
		<category><![CDATA[ggplot2]]></category>
		<category><![CDATA[histogram]]></category>
		<category><![CDATA[runs]]></category>
		<category><![CDATA[wickets]]></category>

		<guid isPermaLink="false">http://www.wekaleamstudios.co.uk/?p=1321</guid>
		<description><![CDATA[Cricket is a sport that generates a large volume of performance data and corresponding debate about the relative qualities of various players over their careers and in relation to their contemporaries. The cricinfo website has an extensive database of statistics for professional cricketers that can be searched to access the information in various formats.
As an [...]]]></description>
			<content:encoded><![CDATA[<p>Cricket is a sport that generates a large volume of performance data and corresponding debate about the relative qualities of various players over their careers and in relation to their contemporaries. The <a href="http://www.cricinfo.com/">cricinfo</a> website has an extensive database of statistics for professional cricketers that can be searched to access the information in various formats.<span id="more-1321"></span></p>
<p>As an initial example we will consider the English legend Sir Ian Botham who played 102 test matches for England between his debut in 1977 until his final game in 1992.</p>
<p>The first obvious breakdown is to consider how Botham performed against the six countries that he played against during his test career. A summary of his statistics are shown here:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"> Opposition Matches Bat Inns Runs NO Bowl Inns Wicket Catch
  Australia      36       49 1673  2       66     148    57
      India      14       16 1201  0       23      59    14
New Zealand      15       22  846  2       28      64    14
   Pakistan      14       20  647  1       18      40    14
  Sri Lanka       3        3   41  0        6      11     2
West Indies      20       37  792  1       27      61    19</pre></div></div>

<p>Botham only played three matches against Sri Lanka so it is difficult to properly assess his performance against them. If the above table is stored in a data frame <strong>itb.opp</strong> then we can create a histogram of the total runs (or wickets) by opposition country:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">ggplot(itb.opp, aes(Opposition, Runs)) + geom_bar() + xlab(&quot;Country&quot;) +
  ylab(&quot;Total Runs&quot;)</pre></div></div>

<p>This code produces the following graph:</p>
<div id="attachment_1355" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.wekaleamstudios.co.uk/wp-content/uploads/2010/08/ITB-Total-Runs.png"><img src="http://www.wekaleamstudios.co.uk/wp-content/uploads/2010/08/ITB-Total-Runs-300x300.png" alt="IT Botham Total Runs by Opposition" title="IT Botham Total Runs" width="300" height="300" class="size-medium wp-image-1355" /></a><p class="wp-caption-text">IT Botham Total Runs by Opposition</p></div>
<p>The total wickes graph is produced by the next code:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">ggplot(itb.opp, aes(Opposition, Wicket)) + geom_bar() + xlab(&quot;Country&quot;) +
  ylab(&quot;Total Wickets&quot;)</pre></div></div>

<div id="attachment_1356" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.wekaleamstudios.co.uk/wp-content/uploads/2010/08/ITB-Total-Wickets.png"><img src="http://www.wekaleamstudios.co.uk/wp-content/uploads/2010/08/ITB-Total-Wickets-300x300.png" alt="IT Botham Total Wickets by Opposition" title="IT Botham Total Wickets" width="300" height="300" class="size-medium wp-image-1356" /></a><p class="wp-caption-text">IT Botham Total Wickets by Opposition</p></div>
<p>We may now want to delve deeper into the performance against different nations to take into account the number of games or innings where Botham batted or bowled. The traditional way to assess performance is to calculate batting and bowling averages and we can do this by opposition which provides the following data frame:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">&gt; itb.opp.sum
 Opposition Discipline  Average
  Australia    Batting 29.35088
      India    Batting 70.64706
New Zealand    Batting 42.30000
   Pakistan    Batting 32.35000
  Sri Lanka    Batting 13.66667
West Indies    Batting 21.40541
  Australia    Bowling 27.65541
      India    Bowling 26.40678
New Zealand    Bowling 23.43750
   Pakistan    Bowling 31.77500
  Sri Lanka    Bowling 28.18182
West Indies    Bowling 35.18033</pre></div></div>

<p>This can be converted into a dot plot so we can see whether Botham had a high batting average than bowling average, which is often taken to be one of the signs of an all-rounder.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">ggplot(itb.opp.sum, aes(Average, Opposition, colour = Discipline)) +
  geom_point()+ xlab(&quot;Average&quot;) + ylab(&quot;&quot;)</pre></div></div>

<p>The graph is shown here:</p>
<div id="attachment_1362" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.wekaleamstudios.co.uk/wp-content/uploads/2010/08/ITB-Averages-Country.png"><img src="http://www.wekaleamstudios.co.uk/wp-content/uploads/2010/08/ITB-Averages-Country-300x300.png" alt="IT Botham Batting and Bowling Averages by Opposition" title="IT Botham Batting and Bowling Averages" width="300" height="300" class="size-medium wp-image-1362" /></a><p class="wp-caption-text">IT Botham Batting and Bowling Averages by Opposition</p></div>
<p>We can see the differences in performance based on the opposition. Botham&#8217;s performance against the West Indies, by far the strongest team during most of his international career, were worse than against the other countries. However, his averages were far from embarassing when compared to other players at the time. The graph also shows that Botham enjoyed batting and bowling against India.</p>
<p>We can divide this data further based on whether the matches were played in England or outside of England and this data is shown here:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">&gt; itb.opp.ha.sum
  Opposition Venue Discipline  Average
   Australia  Away    Batting 30.22581
       India  Away    Batting 61.55556
 New Zealand  Away    Batting 50.44444
    Pakistan  Away    Batting 16.00000
   Sri Lanka  Away    Batting 13.00000
 West Indies  Away    Batting 14.17647
   Australia  Home    Batting 28.30769
       India  Home    Batting 80.87500
 New Zealand  Home    Batting 35.63636
    Pakistan  Home    Batting 34.16667
   Sri Lanka  Home    Batting 14.00000
 West Indies  Home    Batting 27.55000
   Australia  Away    Bowling 28.44928
       India  Away    Bowling 25.53333
 New Zealand  Away    Bowling 27.44444
    Pakistan  Away    Bowling 45.00000
   Sri Lanka  Away    Bowling 21.66667
 West Indies  Away    Bowling 39.50000
   Australia  Home    Bowling 26.96203
       India  Home    Bowling 27.31034
 New Zealand  Home    Bowling 20.51351
    Pakistan  Home    Bowling 31.07895
   Sri Lanka  Home    Bowling 30.62500
 West Indies  Home    Bowling 31.97143</pre></div></div>

<p>A dot plot is created from this data with a separate panel for each of the six opposition countries and the averages divided into batting and bowling performances. The coloured dots in the graph indicated whether the average is for matches at home or away.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">ggplot(itb.opp.ha.sum, aes(Average, Discipline, colour = Venue)) +
  geom_point() + facet_wrap( ~ Opposition) +
  xlab(&quot;Batting Average&quot;) + ylab(&quot;&quot;)</pre></div></div>

<p>This graph is shown below:</p>
<div id="attachment_1366" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.wekaleamstudios.co.uk/wp-content/uploads/2010/08/ITB-Averages-Country-HomeAway.png"><img src="http://www.wekaleamstudios.co.uk/wp-content/uploads/2010/08/ITB-Averages-Country-HomeAway-300x300.png" alt="IT Botham Batting and Bowling Averages by Country and Home/Away" title="IT Botham Batting and Bowling Averages" width="300" height="300" class="size-medium wp-image-1366" /></a><p class="wp-caption-text">IT Botham Batting and Bowling Averages by Country and Home/Away</p></div>
<p>We can see that the difference between home and away peformance is, in general, not very large for bowling averages but in some cases there is a noticeable difference in batting averages. When looking at Botham&#8217;s performances against the West Indies his statistics at home are much better than his away performance, suggesting that his main struggles against the strong West Indies team were in the Caribbean. This might be due to his swing bowling being more suitable to English conditions compared to pitches in the West Indies.</p>
<p>To round off this brief look at the career of IT Botham let us consider some other important statistics, in particular games where he performed with the bat and ball.</p>
<ul>
<li>Overall Botham scored 14 hundreds and 22 fifties out of 161 innings so he reached fifty runs every five innings or so.</li>
<li>He also took 27 five wicket hauls and 17 four wicket hauls so he took four or more wickets every four innings or so.</li>
<li>He took 120 catches.</li>
</ul>
<p>Individual matches of excellence include five games with a century and at least five wickets:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">Year  Opposition       Ground Venue Runs Wicket
1978 New Zealand Christchurch  Away  133      8
1978    Pakistan       Lord's  Home  108      8
1980       India       Mumbai  Away  114     13
1981   Australia        Leeds  Home  199      7
1984 New Zealand   Wellington  Away  138      6</pre></div></div>

<p>These performances and others show why Botham was considered such a great player as he produced some sustained periods of excellent all-round cricket rather than having one discipline more dominant for a long period of time.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wekaleamstudios.co.uk/posts/charting-the-performance-of-cricket-all-rounders-it-botham/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Useful functions for data frames</title>
		<link>http://www.wekaleamstudios.co.uk/posts/useful-functions-for-data-frames/</link>
		<comments>http://www.wekaleamstudios.co.uk/posts/useful-functions-for-data-frames/#comments</comments>
		<pubDate>Mon, 09 Aug 2010 20:38:15 +0000</pubDate>
		<dc:creator>Ralph</dc:creator>
				<category><![CDATA[Data Manipulation]]></category>
		<category><![CDATA[data frame]]></category>
		<category><![CDATA[head]]></category>
		<category><![CDATA[str]]></category>
		<category><![CDATA[tail]]></category>

		<guid isPermaLink="false">http://www.wekaleamstudios.co.uk/?p=1344</guid>
		<description><![CDATA[The R software system is primarily command line based so when there are large sets of data it is not easy to browse the data frames. There are various useful functions for working with data frames.
For example, after loading data from a text file we might want to view the first few lines of a [...]]]></description>
			<content:encoded><![CDATA[<p>The <strong>R</strong> software system is primarily command line based so when there are large sets of data it is not easy to browse the data frames. There are various useful functions for working with data frames.<span id="more-1344"></span></p>
<p>For example, after loading data from a text file we might want to view the first few lines of a set of data. The functions <strong>head</strong> and <strong>tail</strong> <em>return the first or last parts of a vector, matrix, table, data frame or function</em>.</p>
<p>Consider the <strong>Orange</strong> data set that is available in <strong>R</strong>. We can view the first few lines</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">&gt; head(Orange)
  Tree  age circumference
1    1  118            30
2    1  484            58
3    1  664            87
4    1 1004           115
5    1 1231           120
6    1 1372           142</pre></div></div>

<p>or the last few lines:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">&gt; tail(Orange)
   Tree  age circumference
30    5  484            49
31    5  664            81
32    5 1004           125
33    5 1231           142
34    5 1372           174
35    5 1582           177</pre></div></div>

<p>Another useful function is <strong>str</strong>, which <em>compactly displays the internal structure of an R object</em>. On this set of data we get:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">&gt; str(Orange)
Classes ‘nfnGroupedData’, ‘nfGroupedData’, ‘groupedData’ and 'data.frame':      35 obs. of  3 variables:
 $ Tree         : Ord.factor w/ 5 levels &quot;3&quot;&lt;&quot;1&quot;&lt;&quot;5&quot;&lt;&quot;2&quot;&lt;..: 2 2 2 2 2 2 2 4 4 4 ...
 $ age          : num  118 484 664 1004 1231 ...
 $ circumference: num  30 58 87 115 120 142 145 33 69 111 ...
 - attr(*, &quot;formula&quot;)=Class 'formula' length 3 circumference ~ age | Tree
  .. ..- attr(*, &quot;.Environment&quot;)=&lt;environment: R_EmptyEnv&gt; 
 - attr(*, &quot;labels&quot;)=List of 2
  ..$ x: chr &quot;Time since December 31, 1968&quot;
  ..$ y: chr &quot;Trunk circumference&quot;
 - attr(*, &quot;units&quot;)=List of 2
  ..$ x: chr &quot;(days)&quot;
  ..$ y: chr &quot;(mm)&quot;</pre></div></div>

<p>There is quite a bit of additional information attached to this data frame, mainly due to it having more than one class.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wekaleamstudios.co.uk/posts/useful-functions-for-data-frames/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating a Presentation with LaTeX Beamer &#8211; Including Images from Graphics Files</title>
		<link>http://www.wekaleamstudios.co.uk/posts/creating-a-presentation-with-latex-beamer-including-images-from-graphics-files/</link>
		<comments>http://www.wekaleamstudios.co.uk/posts/creating-a-presentation-with-latex-beamer-including-images-from-graphics-files/#comments</comments>
		<pubDate>Sat, 07 Aug 2010 10:35:41 +0000</pubDate>
		<dc:creator>Ralph</dc:creator>
				<category><![CDATA[Beamer]]></category>
		<category><![CDATA[graphics]]></category>
		<category><![CDATA[graphicx]]></category>
		<category><![CDATA[images]]></category>
		<category><![CDATA[jpeg]]></category>
		<category><![CDATA[jpg]]></category>
		<category><![CDATA[latex]]></category>
		<category><![CDATA[LaTeX Typesetting]]></category>

		<guid isPermaLink="false">http://www.wekaleamstudios.co.uk/?p=1327</guid>
		<description><![CDATA[It will often be more efficient to generate graphics in an external software package and then include these files in a LaTeX beamer presentation. The standard LaTeX approach to including graphics can be utilised to perform this task.
Fast Tube by Casper
The graphicx is useful for including graphics files in a presentation and this package has [...]]]></description>
			<content:encoded><![CDATA[<p>It will often be more efficient to generate graphics in an external software package and then include these files in a <strong>LaTeX</strong> beamer presentation. The standard <strong>LaTeX</strong> approach to including graphics can be utilised to perform this task.<span id="more-1327"></span></p>
<p><!--[Fast Tube]--><span id="ZNz8RM-2vAg" style="display:block;"><a title="Click here to watch this video!" href="http://www.wekaleamstudios.co.uk/posts/creating-a-presentation-with-latex-beamer-including-images-from-graphics-files/#ZNz8RM-2vAg"><img src="http://i.ytimg.com/vi/ZNz8RM-2vAg/0.jpg" alt="Fast Tube" border="0" width="320" height="240" /></a><br /><small>Fast Tube by <a title="Casper's Blog" href="http://blog.caspie.net/">Casper</a></small></span><!--[/Fast Tube]--></p>
<p>The <strong>graphicx</strong> is useful for including graphics files in a presentation and this package has a command <strong>\includegraphics</strong> where we specify the name of the image file to be included and (optionally) some formatting information such as the dimensions of the image in our document.</p>
<p>As an example if we wanted to include a <strong>jpg</strong> file then we would include a command like this:</p>

<div class="wp_syntax"><div class="code"><pre class="latex" style="font-family:monospace;"><span style="color: #800000; font-weight: normal;">\includegraphics</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">plot</span><span style="color: #E02020; ">}</span></pre></div></div>

<p>and if we wanted to scale in the horizontal or vertical dimension then we can specify the height and width to use:</p>

<div class="wp_syntax"><div class="code"><pre class="latex" style="font-family:monospace;"><span style="color: #800000; font-weight: normal;">\includegraphics</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">height=8cm,width=12cm</span><span style="color: #E02020; ">]{</span><span style="color: #2020C0; font-weight: normal;">plot</span><span style="color: #E02020; ">}</span></pre></div></div>

<p>There are other options as part of the graphicx package that can be used to adjust the display of the image as required.</p>
<p>Other useful resources are provided on the <a href="http://www.wekaleamstudios.co.uk/supplementary-material/">Supplementary Material</a> page.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wekaleamstudios.co.uk/posts/creating-a-presentation-with-latex-beamer-including-images-from-graphics-files/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Creating a Presentation with LaTeX Beamer &#8211; Equations and tikz</title>
		<link>http://www.wekaleamstudios.co.uk/posts/creating-a-presentation-with-latex-beamer-equations-and-tikz/</link>
		<comments>http://www.wekaleamstudios.co.uk/posts/creating-a-presentation-with-latex-beamer-equations-and-tikz/#comments</comments>
		<pubDate>Fri, 23 Jul 2010 10:23:31 +0000</pubDate>
		<dc:creator>Ralph</dc:creator>
				<category><![CDATA[Beamer]]></category>
		<category><![CDATA[arrows]]></category>
		<category><![CDATA[equation]]></category>
		<category><![CDATA[item]]></category>
		<category><![CDATA[itemize]]></category>
		<category><![CDATA[latex]]></category>
		<category><![CDATA[LaTeX Typesetting]]></category>
		<category><![CDATA[overlay]]></category>
		<category><![CDATA[picture]]></category>
		<category><![CDATA[tikz]]></category>

		<guid isPermaLink="false">http://www.wekaleamstudios.co.uk/?p=1309</guid>
		<description><![CDATA[Many presentations created using LaTeX beamer included mathematical equations and these can be easily included in a presentation and in this post we will consider using the tikz package to add various interesting elements to equations, such as lines between text on a slide and part of an equation.
Fast Tube by Casper
The examples on this [...]]]></description>
			<content:encoded><![CDATA[<p>Many presentations created using <strong>LaTeX</strong> beamer included mathematical equations and these can be easily included in a presentation and in this post we will consider using the <strong>tikz</strong> package to add various interesting elements to equations, such as lines between text on a slide and part of an equation.<span id="more-1309"></span></p>
<p><!--[Fast Tube]--><span id="6mCwVSwP1hU" style="display:block;"><a title="Click here to watch this video!" href="http://www.wekaleamstudios.co.uk/posts/creating-a-presentation-with-latex-beamer-equations-and-tikz/#6mCwVSwP1hU"><img src="http://i.ytimg.com/vi/6mCwVSwP1hU/0.jpg" alt="Fast Tube" border="0" width="320" height="240" /></a><br /><small>Fast Tube by <a title="Casper's Blog" href="http://blog.caspie.net/">Casper</a></small></span><!--[/Fast Tube]--></p>
<p>The examples on this page have been inspired by the good examples on global nodes detailed on <a href="http://www.texample.net/tikz/examples/global-nodes/">texample.net</a>. The example can be adapted to apply to equations for various statistical models and we will consider the model for a general row-column experiment design.</p>
<p>To create this example we need to make <strong>tikz</strong> available in our tex file by adding the following code to the preamble:</p>

<div class="wp_syntax"><div class="code"><pre class="latex" style="font-family:monospace;"><span style="color: #800000; font-weight: normal;">\usepackage</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">tikz</span><span style="color: #E02020; ">}</span>
<span style="color: #800000; font-weight: normal;">\usetikzlibrary</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">arrows,shapes</span><span style="color: #E02020; ">}</span></pre></div></div>

<p>The second and third lines refer to particular elements of <strong>tikz</strong> that will be used in the example.</p>
<p>If we want to access nodes in different areas of our latex document we need to make use of the remember picture style and the easiest way to do this is to make a global declaration rather than on each specific picture:</p>

<div class="wp_syntax"><div class="code"><pre class="latex" style="font-family:monospace;"><span style="color: #800000; font-weight: normal;">\tikzstyle</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">every picture</span><span style="color: #E02020; ">}</span>+=<span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">remember picture</span><span style="color: #E02020; ">]</span></pre></div></div>

<p>The example will be the model for a row-column experiment design and we will have four elements in a bullet list that are linked by arrows to different parts of the equation, which in turn are highlighted in their own box.</p>
<p>We use the <strong>itemize</strong> environment to add the first bullet point:</p>

<div class="wp_syntax"><div class="code"><pre class="latex" style="font-family:monospace;"><span style="color: #C00000; font-weight: normal;">\begin</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #0000D0; font-weight: normal;">itemize</span></span><span style="color: #E02020; ">}</span>
<span style="color: #800000; font-weight: normal;">\<span style="color: #800000; font-weight: bold;">item</span></span> Overall mean <span style="color: #800000; font-weight: normal;">\tikz</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">na</span><span style="color: #E02020; ">]</span> <span style="color: #800000; font-weight: normal;">\node</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">coordinate</span><span style="color: #E02020; ">]</span> (s1) <span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #E02020; ">}</span>;
<span style="color: #C00000; font-weight: normal;">\end</span><span style="color: #E02020; ">{</span><span style="color: #0000D0; font-weight: normal;">itemize</span></span><span style="color: #E02020; ">}</span></pre></div></div>

<p>At the end of the item we add a <strong>tikz</strong> node so that we can draw a line from the end of this line to one of the boxes in the equation. We also provide a name s1 so that it can be identified by <strong>tikz</strong>. This node uses a style to shift the location where the line starts from, that we need to define in our document using this code:</p>

<div class="wp_syntax"><div class="code"><pre class="latex" style="font-family:monospace;"><span style="color: #800000; font-weight: normal;">\tikzstyle</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">na</span><span style="color: #E02020; ">}</span> = <span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">baseline=-.5ex</span><span style="color: #E02020; ">]</span></pre></div></div>

<p>The next step is to create the equation and the nodes and background boxes for each element of the equation that will be linked to the bullet list. The code for the equation is shown here:</p>

<div class="wp_syntax"><div class="code"><pre class="latex" style="font-family:monospace;"><span style="color: #C00000; font-weight: normal;">\begin</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #0000D0; font-weight: normal;">equation</span></span><span style="color: #E02020; ">}</span><span style="color: #8020E0; font-weight: normal;">
y_<span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">ijk</span><span style="color: #E02020; ">}</span> = <span style="color: #800000; font-weight: normal;">\tikz</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">baseline</span><span style="color: #E02020; ">]{</span><span style="color: #2020C0; font-weight: normal;"> <span style="color: #800000; font-weight: normal;">\node</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">fill=blue!20,anchor=base,rounded corners=2pt</span><span style="color: #E02020; ">]</span>
  (d1) <span style="color: #E02020; ">{</span><span style="color: #8020E0; font-weight: normal;">$<span style="color: #800000; font-weight: normal;">\mu</span>$</span></span><span style="color: #E02020; ">}</span>; <span style="color: #E02020; ">}</span>
+ <span style="color: #800000; font-weight: normal;">\tikz</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">baseline</span><span style="color: #E02020; ">]{</span><span style="color: #2020C0; font-weight: normal;"> <span style="color: #800000; font-weight: normal;">\node</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">fill=red!20,anchor=base,rounded corners=2pt</span><span style="color: #E02020; ">]</span>
  (d2) <span style="color: #E02020; ">{</span><span style="color: #8020E0; font-weight: normal;">$r_{i</span><span style="color: #E02020; ">}</span>$</span><span style="color: #E02020; ">}</span>; <span style="color: #E02020; ">}</span>
+ <span style="color: #800000; font-weight: normal;">\tikz</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">baseline</span><span style="color: #E02020; ">]{</span><span style="color: #2020C0; font-weight: normal;"> <span style="color: #800000; font-weight: normal;">\node</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">fill=green!20,anchor=base,rounded corners=2pt</span><span style="color: #E02020; ">]</span>
  (d3) <span style="color: #E02020; ">{</span><span style="color: #8020E0; font-weight: normal;">$c_{j</span><span style="color: #E02020; ">}</span>$</span><span style="color: #E02020; ">}</span>; <span style="color: #E02020; ">}</span>
+ <span style="color: #800000; font-weight: normal;">\tikz</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">baseline</span><span style="color: #E02020; ">]{</span><span style="color: #2020C0; font-weight: normal;"> <span style="color: #800000; font-weight: normal;">\node</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">fill=yellow!20,anchor=base,rounded corners=2pt</span><span style="color: #E02020; ">]</span>
  (d4) <span style="color: #E02020; ">{</span><span style="color: #8020E0; font-weight: normal;">$t_{k</span><span style="color: #E02020; ">}</span>$</span><span style="color: #E02020; ">}</span>; <span style="color: #E02020; ">}</span>
+ <span style="color: #800000; font-weight: normal;">\epsilon</span>_<span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">ijk</span><span style="color: #E02020; ">}</span>
</span><span style="color: #C00000; font-weight: normal;">\end</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #0000D0; font-weight: normal;">equation</span></span><span style="color: #E02020; ">}</span></pre></div></div>

<p>If we look closely at this code the <strong>latex</strong> for the equation itself is very straightforward and the complication comes from adding a <strong>tikz</strong> node to four of the elements of the equation. The nodes themselves have colours (blue/red/green/yellow) and rounded corners. They each have a label d1 to d4 so that <strong>tikz</strong> can draw lines between the bullet list and the elements of the equation.</p>
<p>We then finish off the bullet list with three more elements:</p>

<div class="wp_syntax"><div class="code"><pre class="latex" style="font-family:monospace;"><span style="color: #C00000; font-weight: normal;">\begin</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #0000D0; font-weight: normal;">itemize</span></span><span style="color: #E02020; ">}</span>
<span style="color: #800000; font-weight: normal;">\<span style="color: #800000; font-weight: bold;">item</span></span> Effect of row <span style="color: #8020E0; font-weight: normal;">$i$</span> <span style="color: #800000; font-weight: normal;">\tikz</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">na</span><span style="color: #E02020; ">]</span> <span style="color: #800000; font-weight: normal;">\node</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">coordinate</span><span style="color: #E02020; ">]</span> (s2) <span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #E02020; ">}</span>;
<span style="color: #800000; font-weight: normal;">\<span style="color: #800000; font-weight: bold;">item</span></span> Effect of column <span style="color: #8020E0; font-weight: normal;">$j$</span> <span style="color: #800000; font-weight: normal;">\tikz</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">na</span><span style="color: #E02020; ">]</span> <span style="color: #800000; font-weight: normal;">\node</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">coordinate</span><span style="color: #E02020; ">]</span> (s3) <span style="color: #E02020; ">{</span></span><span style="color: #2020C0; font-weight: normal;"><span style="color: #E02020; ">}</span>;
<span style="color: #800000; font-weight: normal;">\<span style="color: #800000; font-weight: bold;">item</span></span> Effect of treatment <span style="color: #8020E0; font-weight: normal;">$k$</span> <span style="color: #800000; font-weight: normal;">\tikz</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">na</span><span style="color: #E02020; ">]</span> <span style="color: #800000; font-weight: normal;">\node</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">coordinate</span><span style="color: #E02020; ">]</span> (s4) <span style="color: #E02020; ">{</span></span><span style="color: #2020C0; font-weight: normal;"><span style="color: #E02020; ">}</span>;
<span style="color: #C00000; font-weight: normal;">\end</span><span style="color: #E02020; ">{</span><span style="color: #0000D0; font-weight: normal;">itemize</span></span><span style="color: #E02020; ">}</span></pre></div></div>

<p>Each of the items in this bullet list have their own identifier s2 to s4 that we will use to draw arrows.</p>
<p>We create a separate picture environment for the four arrows linking the bullet list to the equation. Each element is defined as a path between two nodes with additional information about the shape of the arrow.</p>

<div class="wp_syntax"><div class="code"><pre class="latex" style="font-family:monospace;"><span style="color: #C00000; font-weight: normal;">\begin</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #0000D0; font-weight: normal;">tikzpicture</span></span><span style="color: #E02020; ">}[</span><span style="color: #C08020; font-weight: normal;">overlay</span><span style="color: #E02020; ">]</span>
<span style="color: #800000; font-weight: normal;">\path</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">-&gt;</span><span style="color: #E02020; ">]</span> (s1) edge <span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">bend left</span><span style="color: #E02020; ">]</span> (d1);
<span style="color: #800000; font-weight: normal;">\path</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">-&gt;</span><span style="color: #E02020; ">]</span> (s2) edge <span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">bend right</span><span style="color: #E02020; ">]</span> (d2);
<span style="color: #800000; font-weight: normal;">\path</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">-&gt;</span><span style="color: #E02020; ">]</span> (s3) edge <span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">out=0, in=-90</span><span style="color: #E02020; ">]</span> (d3);
<span style="color: #800000; font-weight: normal;">\path</span><span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">-&gt;</span><span style="color: #E02020; ">]</span> (s4) edge <span style="color: #E02020; ">[</span><span style="color: #C08020; font-weight: normal;">out=0, in=-90</span><span style="color: #E02020; ">]</span> (d4);
<span style="color: #C00000; font-weight: normal;">\end</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #0000D0; font-weight: normal;">tikzpicture</span></span><span style="color: #E02020; ">}</span></pre></div></div>

<p>There are many variants on this example that could be incorporated in a presentation.</p>
<p>Other useful resources are provided on the <a href="http://www.wekaleamstudios.co.uk/supplementary-material/">Supplementary Material</a> page. Also head over to <a href="http://www.texample.net/">texample.net</a> for more examples of using the <strong>tikz</strong> package.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wekaleamstudios.co.uk/posts/creating-a-presentation-with-latex-beamer-equations-and-tikz/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating a Presentation with LaTeX Beamer &#8211; Boxes</title>
		<link>http://www.wekaleamstudios.co.uk/posts/creating-a-presentation-with-latex-beamer-boxes/</link>
		<comments>http://www.wekaleamstudios.co.uk/posts/creating-a-presentation-with-latex-beamer-boxes/#comments</comments>
		<pubDate>Mon, 19 Jul 2010 17:15:29 +0000</pubDate>
		<dc:creator>Ralph</dc:creator>
				<category><![CDATA[Beamer]]></category>
		<category><![CDATA[boxes]]></category>
		<category><![CDATA[definition]]></category>
		<category><![CDATA[exampleblock]]></category>
		<category><![CDATA[latex]]></category>
		<category><![CDATA[LaTeX Typesetting]]></category>

		<guid isPermaLink="false">http://www.wekaleamstudios.co.uk/?p=1302</guid>
		<description><![CDATA[We can add coloured boxes with text or mathematics into a LaTeX beamer presentation which is particularly useful if we have definitions, theorem or computer code to highlight this information that may not be so accessible within a paragraph of text.
Fast Tube by Casper
The easiest way to create a box is to use the various [...]]]></description>
			<content:encoded><![CDATA[<p>We can add coloured boxes with text or mathematics into a <strong>LaTeX</strong> beamer presentation which is particularly useful if we have definitions, theorem or computer code to highlight this information that may not be so accessible within a paragraph of text.<span id="more-1302"></span></p>
<p><!--[Fast Tube]--><span id="TAETr3Nf3jA" style="display:block;"><a title="Click here to watch this video!" href="http://www.wekaleamstudios.co.uk/posts/creating-a-presentation-with-latex-beamer-boxes/#TAETr3Nf3jA"><img src="http://i.ytimg.com/vi/TAETr3Nf3jA/0.jpg" alt="Fast Tube" border="0" width="320" height="240" /></a><br /><small>Fast Tube by <a title="Casper's Blog" href="http://blog.caspie.net/">Casper</a></small></span><!--[/Fast Tube]--></p>
<p>The easiest way to create a box is to use the various pre-defined environments such as definition:</p>

<div class="wp_syntax"><div class="code"><pre class="latex" style="font-family:monospace;"><span style="color: #C00000; font-weight: normal;">\begin</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #0000D0; font-weight: normal;">definition</span></span><span style="color: #E02020; ">}</span>
The simple linear regression model describes the relationship between
a response variable and a single explanatory variable.
<span style="color: #C00000; font-weight: normal;">\end</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #0000D0; font-weight: normal;">definition</span></span><span style="color: #E02020; ">}</span></pre></div></div>

<p>We might want to create a box with our own title in which case the <strong>exampleblock</strong> environment can be used with the new title as an argument to this environment:</p>

<div class="wp_syntax"><div class="code"><pre class="latex" style="font-family:monospace;"><span style="color: #C00000; font-weight: normal;">\begin</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #0000D0; font-weight: normal;">exampleblock</span></span><span style="color: #E02020; ">}{</span><span style="color: #2020C0; font-weight: normal;">Linear Regression Model</span><span style="color: #E02020; ">}</span>
<span style="color: #8020E0; font-weight: normal;">$Y_{<span style="color: #2020C0; font-weight: normal;">i</span><span style="color: #E02020; ">}</span> = <span style="color: #800000; font-weight: normal;">\beta</span>_<span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">0</span><span style="color: #E02020; ">}</span> + <span style="color: #800000; font-weight: normal;">\beta</span>_<span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">1</span><span style="color: #E02020; ">}</span> X_<span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">i</span><span style="color: #E02020; ">}</span> + <span style="color: #800000; font-weight: normal;">\epsilon</span>_<span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;">i</span><span style="color: #E02020; ">}</span>$</span>
<span style="color: #C00000; font-weight: normal;">\end</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #0000D0; font-weight: normal;">exampleblock</span></span><span style="color: #E02020; ">}</span></pre></div></div>

<p>Other useful resources are provided on the <a href="http://www.wekaleamstudios.co.uk/supplementary-material/">Supplementary Material</a> page.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wekaleamstudios.co.uk/posts/creating-a-presentation-with-latex-beamer-boxes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Generating Balanced Incomplete Block Designs (BIBD)</title>
		<link>http://www.wekaleamstudios.co.uk/posts/generating-balanced-incomplete-block-designs-bibd/</link>
		<comments>http://www.wekaleamstudios.co.uk/posts/generating-balanced-incomplete-block-designs-bibd/#comments</comments>
		<pubDate>Fri, 16 Jul 2010 12:04:50 +0000</pubDate>
		<dc:creator>Ralph</dc:creator>
				<category><![CDATA[Design of Experiments]]></category>
		<category><![CDATA[Balanced Incomplete Block Design]]></category>
		<category><![CDATA[BIBD]]></category>
		<category><![CDATA[crossdes]]></category>
		<category><![CDATA[find.BIB]]></category>
		<category><![CDATA[isGYD]]></category>

		<guid isPermaLink="false">http://www.wekaleamstudios.co.uk/?p=1296</guid>
		<description><![CDATA[The Balanced Incomplete Block Design (BIBD) is a well studied experimental design that has various desirable features from a statistical perspective. The crossdes package in R provides a way to generate a block design for some given parameters and test wheter this design satisfies the BIBD conditions.
For a BIBD there are v treatments repeated r [...]]]></description>
			<content:encoded><![CDATA[<p>The Balanced Incomplete Block Design (BIBD) is a well studied experimental design that has various desirable features from a statistical perspective. The <strong>crossdes</strong> package in <strong>R</strong> provides a way to generate a block design for some given parameters and test wheter this design satisfies the BIBD conditions.<span id="more-1296"></span></p>
<p>For a BIBD there are <strong>v</strong> treatments repeated <strong>r</strong> times in <strong>b</strong> blocks of <strong>k</strong> observations. There is a fifth parameter <strong>lambda</strong> that records the number of blocks where every pair of treatment occurs in the design.</p>
<p>We first load the crossdes package in our sessions:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">require(crossdes)</pre></div></div>

<p>The function <strong>find.BIB</strong> is used to generate a block design with specific number of treatments, blocks (rows of the design) and elements per block (columns of the design).</p>
<p>Consider an example with five treatments in four blocks of three elements. We can create a block design via:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">&gt; find.BIB(5, 4, 3)
     [,1] [,2] [,3]
[1,]    1    3    4
[2,]    2    4    5
[3,]    2    3    5
[4,]    1    2    5</pre></div></div>

<p>This design is not a BIBD because the treatments are not all repeated the same number of times in the design and we can check this with the <strong>isGYD</strong> function. For this example:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">&gt; isGYD(find.BIB(5, 4, 3))
&nbsp;
[1] The design is neither balanced w.r.t. rows nor w.r.t. columns.</pre></div></div>

<p>This confirms what we can see from the design.</p>
<p>Let us instead consider a design with seven treatments and seven blocks of three elements to see whether we can create a BIBD with these parameters:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">&gt; my.design = find.BIB(7, 7, 3)
&gt; my.design
     [,1] [,2] [,3]
[1,]    1    2    5
[2,]    3    4    5
[3,]    1    3    6
[4,]    2    3    7
[5,]    2    4    6
[6,]    1    4    7
[7,]    5    6    7
&gt; isGYD(my.design)
&nbsp;
[1] The design is a balanced incomplete block design w.r.t. rows.</pre></div></div>

<p>In this situation we are able to generate a valid BIBD experiment with the specified parameters.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wekaleamstudios.co.uk/posts/generating-balanced-incomplete-block-designs-bibd/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating a Presentation with LaTeX Beamer &#8211; Tables</title>
		<link>http://www.wekaleamstudios.co.uk/posts/creating-a-presentation-with-latex-beamer-tables/</link>
		<comments>http://www.wekaleamstudios.co.uk/posts/creating-a-presentation-with-latex-beamer-tables/#comments</comments>
		<pubDate>Wed, 14 Jul 2010 18:21:32 +0000</pubDate>
		<dc:creator>Ralph</dc:creator>
				<category><![CDATA[Beamer]]></category>
		<category><![CDATA[column]]></category>
		<category><![CDATA[latex]]></category>
		<category><![CDATA[LaTeX Typesetting]]></category>
		<category><![CDATA[row]]></category>
		<category><![CDATA[table]]></category>
		<category><![CDATA[tabular]]></category>

		<guid isPermaLink="false">http://www.wekaleamstudios.co.uk/?p=1268</guid>
		<description><![CDATA[Tables of information can be included in a LaTeX beamer presentation in the same way that they would be incorporated into any other LaTeX document. The tabular environment is used and, if necessary, the tables could be numbered but this probably doesn&#8217;t make as much sense as labelling and numbering tables within an article or [...]]]></description>
			<content:encoded><![CDATA[<p>Tables of information can be included in a <strong>LaTeX</strong> beamer presentation in the same way that they would be incorporated into any other <strong>LaTeX</strong> document. The tabular environment is used and, if necessary, the tables could be numbered but this probably doesn&#8217;t make as much sense as labelling and numbering tables within an article or book.<span id="more-1268"></span></p>
<p><!--[Fast Tube]--><span id="DYfH-dnR0s4" style="display:block;"><a title="Click here to watch this video!" href="http://www.wekaleamstudios.co.uk/posts/creating-a-presentation-with-latex-beamer-tables/#DYfH-dnR0s4"><img src="http://i.ytimg.com/vi/DYfH-dnR0s4/0.jpg" alt="Fast Tube" border="0" width="320" height="240" /></a><br /><small>Fast Tube by <a title="Casper's Blog" href="http://blog.caspie.net/">Casper</a></small></span><!--[/Fast Tube]--></p>
<p>For example, if we wanted to add a table of some of the common geom elements for ggplot2 to a slide we could use the following code:</p>

<div class="wp_syntax"><div class="code"><pre class="latex" style="font-family:monospace;"><span style="color: #C00000; font-weight: normal;">\begin</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #0000D0; font-weight: normal;">frame</span></span><span style="color: #E02020; ">}{</span><span style="color: #2020C0; font-weight: normal;">Common geoms</span><span style="color: #E02020; ">}</span>
&nbsp;
<span style="color: #C00000; font-weight: normal;">\begin</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #0000D0; font-weight: normal;">tabular</span></span><span style="color: #E02020; ">}{</span><span style="color: #2020C0; font-weight: normal;">cc</span><span style="color: #E02020; ">}</span>
geom <span style="color: #E02020; ">&amp;</span> Description <span style="color: #E02020; ">\\</span> <span style="color: #800000; font-weight: normal;">\<span style="color: #800000; font-weight: bold;">hline</span></span>
geom_bar <span style="color: #E02020; ">&amp;</span> Bar chart <span style="color: #E02020; ">\\</span>
geom_boxplot <span style="color: #E02020; ">&amp;</span> Box and Whisker plot <span style="color: #E02020; ">\\</span>
geom_contour <span style="color: #E02020; ">&amp;</span> Contour plot <span style="color: #E02020; ">\\</span>
geom_point <span style="color: #E02020; ">&amp;</span> Scatter plot <span style="color: #E02020; ">\\</span>
geom_smooth <span style="color: #E02020; ">&amp;</span> Smoothed conditional mean <span style="color: #E02020; ">\\</span>
<span style="color: #C00000; font-weight: normal;">\end</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #0000D0; font-weight: normal;">tabular</span></span><span style="color: #E02020; ">}</span>
&nbsp;
<span style="color: #C00000; font-weight: normal;">\end</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #0000D0; font-weight: normal;">frame</span></span><span style="color: #E02020; ">}</span></pre></div></div>

<p>This is a basic example of creating a table and there are many examples of how the appearance of a table can be enhanced in <strong>LaTeX</strong>, see for example <a href="http://www.vision.ime.usp.br/~jmena/misc/latex/tables_with_latex.pdf">here</a> or <a href="http://en.wikibooks.org/wiki/LaTeX/Tables">here</a>.</p>
<p>Other useful resources are provided on the <a href="http://www.wekaleamstudios.co.uk/supplementary-material/">Supplementary Material</a> page.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wekaleamstudios.co.uk/posts/creating-a-presentation-with-latex-beamer-tables/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating a Presentation with LaTeX Beamer &#8211; Bullet Lists</title>
		<link>http://www.wekaleamstudios.co.uk/posts/creating-a-presentation-with-latex-beamer-bullet-lists/</link>
		<comments>http://www.wekaleamstudios.co.uk/posts/creating-a-presentation-with-latex-beamer-bullet-lists/#comments</comments>
		<pubDate>Sat, 10 Jul 2010 08:48:13 +0000</pubDate>
		<dc:creator>Ralph</dc:creator>
				<category><![CDATA[Beamer]]></category>
		<category><![CDATA[enumerate]]></category>
		<category><![CDATA[itemize]]></category>
		<category><![CDATA[latex]]></category>
		<category><![CDATA[LaTeX Typesetting]]></category>

		<guid isPermaLink="false">http://www.wekaleamstudios.co.uk/?p=1267</guid>
		<description><![CDATA[When writing a presentation we might want to use a bullet list to highlight some key points that might be lost if they are part of a large body of text. We can use the standard LaTeX environments for creating lists within a beamer presentation in a straightforward way.
Fast Tube by Casper
The bullet lists can [...]]]></description>
			<content:encoded><![CDATA[<p>When writing a presentation we might want to use a bullet list to highlight some key points that might be lost if they are part of a large body of text. We can use the standard <strong>LaTeX</strong> environments for creating lists within a beamer presentation in a straightforward way.<span id="more-1267"></span></p>
<p><!--[Fast Tube]--><span id="7HyDcaYKerk" style="display:block;"><a title="Click here to watch this video!" href="http://www.wekaleamstudios.co.uk/posts/creating-a-presentation-with-latex-beamer-bullet-lists/#7HyDcaYKerk"><img src="http://i.ytimg.com/vi/7HyDcaYKerk/0.jpg" alt="Fast Tube" border="0" width="320" height="240" /></a><br /><small>Fast Tube by <a title="Casper's Blog" href="http://blog.caspie.net/">Casper</a></small></span><!--[/Fast Tube]--></p>
<p>The bullet lists can be created using the <strong>itemize</strong> or <strong>enumerate</strong> environments depending on the type of list that we want to appear on the slides. The <strong>itemize</strong> list uses symbols and is not numbered while the <strong>enumerate</strong> list is a numbered list so the choice will depend on the elements covered by the list.</p>
<p>Within our slide we would create the list environment in exactly the same was as over <strong>LaTeX</strong> documents and the <strong>\item</strong> command. An example of creating a bullet list of assumptions for a linear statistical model is shown here:</p>

<div class="wp_syntax"><div class="code"><pre class="latex" style="font-family:monospace;"><span style="color: #C00000; font-weight: normal;">\begin</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #0000D0; font-weight: normal;">itemize</span></span><span style="color: #E02020; ">}</span>
<span style="color: #800000; font-weight: normal;">\<span style="color: #800000; font-weight: bold;">item</span></span> A linear the relationship between response and explanatory variables.
<span style="color: #800000; font-weight: normal;">\<span style="color: #800000; font-weight: bold;">item</span></span> Independence of the model errors.
<span style="color: #800000; font-weight: normal;">\<span style="color: #800000; font-weight: bold;">item</span></span> Constant variance for the model errors (a) versus time and (b) versus
  the predictions (or versus any independent variable)
<span style="color: #800000; font-weight: normal;">\<span style="color: #800000; font-weight: bold;">item</span></span> Normality of the errors.
<span style="color: #C00000; font-weight: normal;">\end</span><span style="color: #E02020; ">{</span><span style="color: #2020C0; font-weight: normal;"><span style="color: #0000D0; font-weight: normal;">itemize</span></span><span style="color: #E02020; ">}</span></pre></div></div>

<p>This can be easily changed to an <strong>enumerate</strong> environment to make it a numbered list.</p>
<p>Other useful resources are provided on the <a href="http://www.wekaleamstudios.co.uk/supplementary-material/">Supplementary Material</a> page.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.wekaleamstudios.co.uk/posts/creating-a-presentation-with-latex-beamer-bullet-lists/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
