<?xml version="1.0" encoding="UTF-8"?>
<!--
	This is an XML file so certain characters need special treatment:
		For ampersand, use &amp;
		For single quote, use &quot;
		For left angle bracket, use &lt;
		For right angle bracket, use &rt;
	Leading and trailing whitespace may be trimmed.
-->
<riskDisplay>

  <!-- one for each tab that shows in the animation. The id is used in references below -->

  <presets>

    <!-- item 1 Statins Benefits -->
    <preset title="The benefits of" subtitle="Statins" tab="Benefits" A="Statins" B="heart attack or stroke in 10 years" P0="0.1" P1="0.08" sigfigs="3">
 		<rgb
 			good ="0xffff00" 
 			bad ="0xff6000" 
 			better = "0x00ff00" 
 			worse = "0xff001e" />
    </preset>
    
     <!-- item 2 VIOXX Benefits -->
    <preset title="The VIGOR trial" subtitle="Vioxx for one year to avoid a {B}" tab="Benefits" A="Vioxx" B="GI event" P0="0.04" P1="0.02" sigfigs="3">
		<rgb
 			good ="0xffff00" 
 			bad ="0xff6000" 
 			better = "0x00ff00" 
 			worse = "0xff001e" />
    </preset>
    
    <!-- item 3 VIOXX Risks -->
    <preset title="The VIGOR trial" subtitle="Vioxx for one year risks a {B}" tab="Risks" A="Vioxx" B="heart attack" P0="0.001" P1="0.004" sigfigs="3">
		<rgb
 			good ="0xffff00" 
 			bad ="0xff6000" 
 			better = "0x00ff00" 
 			worse = "0xff001e" />
    </preset>
    
  </presets>
  
  <!--
      List of statements. These are selected by their attributes 
      - type 
        - relative
	- absolute
	- nnt 
      - format
        - chance_pc
	- chance_nf
        - population_pc
	- population_nf
      - frame
        - negative
	- positive

      In case of repeats, all statements matching an attribute set will show.
      Valid curly bracket formats are {A}, {B} or any algebraic expression
      involving P0, P1, D (D = the natural frequency denominator). 
      
      To get a suitable precision you can round(an expression).
    -->

  <legends>
  	<legend  type="relative" target="chance" format="pc" frame="negative">
  		<title>Chance of a {B}</title>
      	<Banyway rgb="bad">whether treated or not</Banyway>
       	<Bwithout rgb="bad">without {A}</Bwithout>
		<BmoreWith rgb="worse">harmed by {A}</BmoreWith>
		<BlessWith rgb="better">saved by {A}</BlessWith>
      	<Bwith rgb="bad">with {A}</Bwith>
  		<BavoidAnyway rgb="good">avoided anyway</BavoidAnyway>
  		<BavoidWith rgb="good">avoided with {A}</BavoidWith>
  		<BavoidWithout rgb="good">avoided without {A}</BavoidWithout>
  	</legend>
    
    <legend type="relative" target="chance" format="pc" frame="positive">				
  	  	<title>Chance of avoiding a {B}</title>
      	<Banyway rgb="bad">whether treated or not</Banyway>
       	<Bwithout rgb="bad">without {A}</Bwithout>
		<BmoreWith rgb="worse">harmed by {A}</BmoreWith>
		<BlessWith rgb="better">saved by {A}</BlessWith>
      	<Bwith rgb="bad">with {A}</Bwith>
  		<BavoidAnyway rgb="good">avoided anyway</BavoidAnyway>
  		<BavoidWith rgb="good">avoided with {A}</BavoidWith>
  		<BavoidWithout rgb="good">avoided without {A}</BavoidWithout>
    </legend>
    
    <legend type="relative" target="population" format="pc" frame="negative">				
  		<title>People like you with a {B}</title>
      	<Banyway rgb="bad">whether treated or not</Banyway>
       	<Bwithout rgb="bad">without {A}</Bwithout>
		<BmoreWith rgb="worse">harmed by {A}</BmoreWith>
		<BlessWith rgb="better">saved by {A}</BlessWith>
      	<Bwith rgb="bad">with {A}</Bwith>
  		<BavoidAnyway rgb="good">avoided anyway</BavoidAnyway>
  		<BavoidWith rgb="good">avoided with {A}</BavoidWith>
  		<BavoidWithout rgb="good">avoided without {A}</BavoidWithout>
    </legend>
    
    <legend type="relative" target="population" format="pc" frame="positive">				
  		<title>People like you avoiding a {B}</title>
      	<Banyway rgb="bad">whether treated or not</Banyway>
       	<Bwithout rgb="bad">without {A}</Bwithout>
		<BmoreWith rgb="worse">harmed by {A}</BmoreWith>
		<BlessWith rgb="better">saved by {A}</BlessWith>
      	<Bwith rgb="bad">with {A}</Bwith>
  		<BavoidAnyway rgb="good">avoided anyway</BavoidAnyway>
  		<BavoidWith rgb="good">avoided with {A}</BavoidWith>
  		<BavoidWithout rgb="good">avoided without {A}</BavoidWithout>
    </legend>
    
    <legend type="absolute" target="chance" format="pc" frame="negative">				
 		<title>Chance of {B}</title>
      	<Banyway rgb="bad">whether treated or not</Banyway>
       	<Bwithout rgb="bad">without {A}</Bwithout>
		<BmoreWith rgb="worse">harmed by {A}</BmoreWith>
		<BlessWith rgb="better">saved by {A}</BlessWith>
      	<Bwith rgb="bad">with {A}</Bwith>
  		<BavoidAnyway rgb=""></BavoidAnyway>
  		<BavoidWith rgb=""></BavoidWith>
  		<BavoidWithout rgb=""></BavoidWithout>
    </legend>
    
    <legend type="absolute" target="chance" format="nf" frame="negative">				
 		<title>Number out of {D} people like you with a {B}</title>
      	<Banyway rgb="bad">whether treated or not</Banyway>
       	<Bwithout rgb="bad">without {A}</Bwithout>
		<BmoreWith rgb="worse">harmed by {A}</BmoreWith>
		<BlessWith rgb="better">saved by {A}</BlessWith>
      	<Bwith rgb="bad">with {A}</Bwith>
  		<BavoidAnyway rgb=""></BavoidAnyway>
  		<BavoidWith rgb=""></BavoidWith>
  		<BavoidWithout rgb=""></BavoidWithout>
    </legend>
    
    <legend type="absolute" target="chance" format="pc" frame="positive">				
 		<title>Chance of avoiding a {B}</title>
      	<Banyway rgb=""></Banyway>
       	<Bwithout rgb=""></Bwithout>
		<BmoreWith rgb="worse">harmed by {A}</BmoreWith>
		<BlessWith rgb="better">saved by {A}</BlessWith>
      	<Bwith rgb=""></Bwith>
  		<BavoidAnyway rgb="good">avoided anyway</BavoidAnyway>
  		<BavoidWith rgb="good">avoided with {A}</BavoidWith>
  		<BavoidWithout rgb="good">avoided without {A}</BavoidWithout>
     </legend>
    
    <legend type="absolute" target="chance" format="nf" frame="positive">				
 		<title>Number out of {D} people like you avoiding a {B}</title>
      	<Banyway rgb=""></Banyway>
       	<Bwithout rgb=""></Bwithout>
		<BmoreWith rgb="worse">harmed by {A}</BmoreWith>
		<BlessWith rgb="better">saved by {A}</BlessWith>
      	<Bwith rgb=""></Bwith>
  		<BavoidAnyway rgb="good">avoided anyway</BavoidAnyway>
  		<BavoidWith rgb="good">avoided with {A}</BavoidWith>
  		<BavoidWithout rgb="good">avoided without {A}</BavoidWithout>
    </legend>
    
    <legend type="absolute" target="population" format="pc" frame="negative">				
 		<title>Percentage of people like you with a {B}</title>
      	<Banyway rgb="bad">whether treated or not</Banyway>
       	<Bwithout rgb="bad">without {A}</Bwithout>
		<BmoreWith rgb="worse">harmed by {A}</BmoreWith>
		<BlessWith rgb="better">saved by {A}</BlessWith>
      	<Bwith rgb="bad">with {A}</Bwith>
  		<BavoidAnyway rgb=""></BavoidAnyway>
  		<BavoidWith rgb=""></BavoidWith>
  		<BavoidWithout rgb=""></BavoidWithout>
    </legend>
    
    <legend type="absolute" target="population" format="nf" frame="negative">				
 		<title>Number out of {D} people like you with a {B}</title>
      	<Banyway rgb="bad">whether treated or not</Banyway>
       	<Bwithout rgb="bad">without {A}</Bwithout>
		<BmoreWith rgb="worse">harmed by {A}</BmoreWith>
		<BlessWith rgb="better">saved by {A}</BlessWith>
      	<Bwith rgb="bad">with {A}</Bwith>
  		<BavoidAnyway rgb=""></BavoidAnyway>
  		<BavoidWith rgb=""></BavoidWith>
  		<BavoidWithout rgb=""></BavoidWithout>
    </legend>
    
    <legend type="absolute" target="population" format="pc" frame="positive">				
 		<title>Percentage of people like you avoiding a {B}</title>
      	<Banyway rgb=""></Banyway>
       	<Bwithout rgb=""></Bwithout>
		<BmoreWith rgb="worse">harmed by {A}</BmoreWith>
		<BlessWith rgb="better">saved by {A}</BlessWith>
      	<Bwith rgb=""></Bwith>
  		<BavoidAnyway rgb="good">avoided anyway</BavoidAnyway>
  		<BavoidWith rgb="good">avoided with {A}</BavoidWith>
  		<BavoidWithout rgb="good">avoided without {A}</BavoidWithout>
    </legend>
    
    <legend type="absolute" target="population" format="nf" frame="positive">				
 		<title>Number out of {D} people like you avoiding a {B}</title>
      	<Banyway rgb=""></Banyway>
       	<Bwithout rgb=""></Bwithout>
		<BmoreWith rgb="worse">harmed by {A}</BmoreWith>
		<BlessWith rgb="better">saved by {A}</BlessWith>
      	<Bwith rgb=""></Bwith>
  		<BavoidAnyway rgb="good">avoided anyway</BavoidAnyway>
  		<BavoidWith rgb="good">avoided with {A}</BavoidWith>
  		<BavoidWithout rgb="good">avoided without {A}</BavoidWithout>
    </legend>
  </legends>

  <!-- statements which may appear on the Risks tab -->
  <statements tab="Risks">
    <statement type="relative" target="chance" format="pc" frame="negative">
      {A} increases your chance of getting {B} by {round((P1/P0 - 1) * 100)}%.
    </statement>
    
    <statement type="relative" target="chance" format="pc" frame="positive">				
      {A} reduces your chance of avoiding {B} by {round((P1 - P0)*100/(1 - P0))}%.
    </statement>
    
    <statement type="relative" target="population" format="pc" frame="negative">				
      By taking {A},  {round((P1/P0 - 1) * 100)}% more people like you will experience {B}.
    </statement>
    
    <statement type="relative" target="population" format="pc" frame="positive">				
      By taking {A},  {round((P1 - P0)*1000/(1 - P0))/10}% fewer people like you will avoid {B}.
    </statement>
    
    <statement type="absolute" target="chance" format="pc" frame="negative">				
      Your chance of developing {B} without {A} is {round(P0 * 1000)/10}%, which is increased to {round(P1 * 1000)/10}% with {A}.
    </statement>
    
    <statement type="absolute" target="chance" format="nf" frame="negative">				
      Your chance of developing {B} without {A} is {round(P0 * D)} in {D}, which is increased to {round(P1 * D)} in {D} with {A}.
    </statement>
    
    <statement type="absolute" target="chance" format="pc" frame="positive">				
      Your chance of avoiding {B} without {A} is {round((1-P0) * 1000)/10}%, which is reduced to {round((1-P1) * 1000)/10}% with {A}.
    </statement>
    
    <statement type="absolute" target="chance" format="nf" frame="positive">				
      Your chance of avoiding {B} without {A} is {round((1-P0) * D)} in {D}, which is reduced to {round((1-P1) * D)} in {D} with {A}.
    </statement>
    
    <statement type="absolute" target="population" format="pc" frame="negative">				
      {round(P0 * 1000)/10}% of people like you will develop {B} without {A}, while   {round(P1 * 1000)/10}% will develop {B} with {A}.
    </statement>
    
    <statement type="absolute" target="population" format="pc" frame="positive">				
      {round((1-P0)*1000)/10} percent of people like you will be free of {B} without taking {A}, while {round((1-P1)*1000)/10}   percent  will be free of {B} with {A}.
    </statement>
    
    <statement type="absolute" target="population" format="nf" frame="negative">				
      {round(P0 * D)} out of {D} people  like you will develop {B} without taking {A}, while {round(P1 * D)} out of {D}  will develop {B} with {A}. 
    </statement>
    
    <statement type="absolute" target="population" format="nf" frame="positive">				
      {round((1 - P0) * D)} out of {D} people  like you will be free of {B} without taking {A}, while {round((1 - P1) * D)} out of {D}  like you will develop {B} despite having taken {A}.
    </statement>
    
    <statement type="nnt">				
      In order to have one extra person get {B}, we would need to treat {round(1/(P1 - P0))} people like you with {A}.
    </statement>
    
  </statements>

  <!-- statements which may appear on the Benefits tab -->
  <statements tab="Benefits">
   <statement type="relative" target="chance" format="pc" frame="negative">
      {A} reduces your chance of getting {B} by {round((1 - P1/P0) * 100)}%.
    </statement>
    
    <statement type="relative" target="chance" format="pc" frame="positive">				
      {A} increases your chance of avoiding {B} by {round((P0 - P1)*100/(1 - P0))}%.
    </statement>
    
    <statement type="relative" target="population" format="pc" frame="negative">				
      By taking {A},  {round((1 - P1/P0) * 100)}% fewer people  like you will experience {B}.
    </statement>
    
    <statement type="relative" target="population" format="pc" frame="positive">				
      By taking {A},  {round((P0 - P1)*100/(1 - P0))}% more people  like you will avoid {B}.
    </statement>
    
    <statement type="absolute" target="chance" format="pc" frame="negative">				
      Your chance of developing {B} without {A} is {round(P0 * 1000)/10}%, which is reduced to {round(P1 * 1000)/10}% with {A}.
    </statement>
    
    <statement type="absolute" target="chance" format="nf" frame="negative">				
      Your chance of developing {B} without {A} is {round(P0 * D)} in {D}, which is reduced to {round(P1 * D)} in {D} with {A}.
    </statement>
    
    <statement type="absolute" target="chance" format="pc" frame="positive">				
      Your chance of avoiding {B} without {A} is {round((1-P0) * 1000)/10}%, which is increased to {round((1-P1) * 1000)/10}% with {A}.
    </statement>
    
    <statement type="absolute" target="chance" format="nf" frame="positive">				
       Your chance of avoiding {B} without {A} is {round((1-P0) * D)} in {D}, which is increased to {round((1-P1) * D)} in {D} with {A}.
    </statement>
    
    <statement type="absolute" target="population" format="pc" frame="negative">				
      {round(P0 * 1000)/10}% of people like you will develop {B} without {A}, while only {round(P1 * 1000)/10}% will develop {B} with {A}.
    </statement>
    
    <statement type="absolute" target="population" format="pc" frame="positive">				
      {round((1-P0)*1000)/10} percent of people like you will be free of {B} without taking {A}, while {round((1-P1)*1000)/10} percent of people will be free of {B} with {A}.
    </statement>
    
    <statement type="absolute" target="population" format="nf" frame="negative">				
      {round(P0 * D)} out of {D} people like you will develop {B} without taking {A}, while {round(P1 * D)} out of {D}  will develop {B} with {A}. 
    </statement>
    
    <statement type="absolute" target="population" format="nf" frame="positive">				
      {round((1 - P0) * D)} out of {D} people like you will be free of {B} without taking {A}, while {round((1 - P1) * D)} out of {D}  will develop {B} despite having taken {A}.
    </statement>
    
    <statement type="nnt">				
      In order to save one person from getting {B}, we would need to treat {round(1/(P0 - P1))} people like you with {A}.
    </statement>
    
  </statements>
  
</riskDisplay>
