<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 12 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
{font-family:"Lucida Console";
panose-1:2 11 6 9 4 5 4 2 2 4;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p
{mso-style-priority:99;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
pre
{mso-style-priority:99;
mso-style-link:"HTML Preformatted Char";
margin:0cm;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";}
span.gd
{mso-style-name:gd;}
span.HTMLPreformattedChar
{mso-style-name:"HTML Preformatted Char";
mso-style-priority:99;
mso-style-link:"HTML Preformatted";
font-family:Consolas;}
span.wrc0
{mso-style-name:wrc0;}
span.EmailStyle22
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-GB" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">This is perfect. Many thanks Hugo!<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Kind regards,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Mat<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> traminer-users-bounces@lists.r-forge.r-project.org [mailto:traminer-users-bounces@lists.r-forge.r-project.org]
<b>On Behalf Of </b>Hugo Varet<br>
<b>Sent:</b> 09 July 2012 18:33<br>
<b>To:</b> Users questions<br>
<b>Subject:</b> Re: [Traminer-users] clustering event sequence data<o:p></o:p></span></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal" style="margin-bottom:12.0pt">Hello Mat,<br>
<br>
a few months ago, I wanted to perform clustering of event sequences and <span class="gd">
Matthias Studer told me how to do this with the TraMineRextras package. I think you can find his message in the archives of the mailing list (he sent it on march 16th 2012).</span><br>
<br>
To extract association rules from event sequences and to get the corresponding hazard ratios, you have to use the seqerulesdisc function available in the same package.<br>
<br>
<span class="gd">Hope this helps, best regards,</span><br>
<br>
<span class="gd">Hugo</span><br>
<br>
<o:p></o:p></p>
<div>
<p class="MsoNormal">2012/7/9 Weldon, Mat <<a href="mailto:m.weldon@lancaster.ac.uk" target="_blank">m.weldon@lancaster.ac.uk</a>><o:p></o:p></p>
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Hello,<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">I’m doing a project with a set of criminal histories (ie. Lists of age-stamped offences). Here is an example: oftype is the type of crime, and sid is the subject ID:<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:10.0pt;font-family:"Lucida Console";background:#E1E2E5"> sid oftype age</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:10.0pt;font-family:"Lucida Console";background:#E1E2E5">5556.1 5556 B&E 18</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:10.0pt;font-family:"Lucida Console";background:#E1E2E5">5556.2 5556 motor vehicle 18</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:10.0pt;font-family:"Lucida Console";background:#E1E2E5">5556.3 5556 motor vehicle 18</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:10.0pt;font-family:"Lucida Console";background:#E1E2E5">5556.4 5556 B&E 22</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:10.0pt;font-family:"Lucida Console";background:#E1E2E5">5556.5 5556 alcohol 24</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:10.0pt;font-family:"Lucida Console";background:#E1E2E5">5556.6 5556 miscellaneous 29</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Since these are events, I’m using the event methods in TraMineR to analyse them. I’ve created a seqe object, and run a frequent sub-sequence analysis. Here is the top 10:<o:p></o:p></p>
<pre><span style="font-family:"Lucida Console";background:#E1E2E5"> Subsequence Support Count</span><o:p></o:p></pre>
<pre><span style="font-family:"Lucida Console";background:#E1E2E5">1 (assault) 0.6261261 417</span><o:p></o:p></pre>
<pre><span style="font-family:"Lucida Console";background:#E1E2E5">2 (child molestation) 0.6246246 416</span><o:p></o:p></pre>
<pre><span style="font-family:"Lucida Console";background:#E1E2E5">3 (rape) 0.5000000 333</span><o:p></o:p></pre>
<pre><span style="font-family:"Lucida Console";background:#E1E2E5">4 (theft) 0.4429429 295</span><o:p></o:p></pre>
<pre><span style="font-family:"Lucida Console";background:#E1E2E5">5 (B&E) 0.4159159 277</span><o:p></o:p></pre>
<pre><span style="font-family:"Lucida Console";background:#E1E2E5">6 (noncontact SO) 0.3963964 264</span><o:p></o:p></pre>
<pre><span style="font-family:"Lucida Console";background:#E1E2E5">7 (public order) 0.3858859 257</span><o:p></o:p></pre>
<pre><span style="font-family:"Lucida Console";background:#E1E2E5">8 (alcohol) 0.3183183 212</span><o:p></o:p></pre>
<pre><span style="font-family:"Lucida Console";background:#E1E2E5">9 (assault)-(assault) 0.3018018 201</span><o:p></o:p></pre>
<pre><span style="font-family:"Lucida Console";background:#E1E2E5">10 (assault)-(rape) 0.2882883 192</span><o:p></o:p></pre>
<pre><span style="font-family:"Lucida Console";background:#E1E2E5"> </span><o:p></o:p></pre>
<pre><span style="font-family:"Lucida Console";background:#E1E2E5">Computed on 666 event sequences</span><o:p></o:p></pre>
<pre><span style="font-family:"Lucida Console";background:#E1E2E5"> Constraint Value</span><o:p></o:p></pre>
<pre><span style="font-family:"Lucida Console";background:#E1E2E5"> countMethod COBJ</span><o:p></o:p></pre>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">I’d like to compute clusters of sequences, either using agnes or pam algorithms, and then run a discriminating sequence analysis on the clusters (as demonstrated by Studer et al.
2010). However, I’m a bit stuck and I haven’t been able to find any help in the documentation. I have a few questions:<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p>1.<span style="font-size:7.0pt"> </span>Is there a function for computing dissimilarity measures, like seqdist, that works with event sequences? Something that I can feed into a clustering algorithm? I don’t know how Studer et al. did it because no
code was provided.<o:p></o:p></p>
<p>2.<span style="font-size:7.0pt"> </span>Is there a way to constrain frequent subsequences to be maximal, in the sense that if “(assault)-(assault)” is frequent then “(assault)” will not be listed, for example?<o:p></o:p></p>
<p>3.<span style="font-size:7.0pt"> </span>Is there a way to calculate association rules for sequences using a hazard ratio measure similar to that described in Muller et al. (2010)?<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Many thanks in advance. Best wishes,<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Mat<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Mat Weldon<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Department of Mathematics and Statistics<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Room B18, Fylde College
<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Lancaster University<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Lancaster, LA1 4YF<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Tel: 07929 310475<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Email:
<a href="mailto:m.weldon@lancaster.ac.uk" target="_blank">m.weldon@lancaster.ac.uk</a><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><br>
_______________________________________________<br>
Traminer-users mailing list<br>
<a href="mailto:Traminer-users@lists.r-forge.r-project.org">Traminer-users@lists.r-forge.r-project.org</a><br>
<a href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/traminer-users" target="_blank">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/traminer-users</a><o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>