From jeremyr at uga.edu Fri May 1 01:58:49 2015 From: jeremyr at uga.edu (Jeremy Reynolds) Date: Thu, 30 Apr 2015 19:58:49 -0400 Subject: [Traminer-users] multi-channel sequence analysis with aggregated sequences Message-ID: Dear TraMineR Users, I would like to perform a multi-channel sequence analysis with cases that are aggregated using the WeightedCluster procedure. It appears that I have too many cases to perform the analysis without aggregation. I get stuck, however, when calculating the distance matrix. R issues the warning, " [!] sequence objects have different numbers of rows". Does anyone know a way to solve this problem? I have pasted some example code below. Thanks, Jeremy data(biofam) ## Building one channel per type of event left, children or married bf <- as.matrix(biofam[, 10:25]) head(bf) children <- bf==4 | bf==5 | bf==6 children <- children*1 married <- bf == 2 | bf== 3 | bf==6 married <- married*1 #build aggregated sequence objects for children and married aggchildren <- wcAggregateCases(children[,1:16]) # identify identical cases aggchildren.seq <- seqdef(children[aggchildren$aggIndex, 1:16], weights = aggchildren$aggWeights) aggmarried <- wcAggregateCases(married[,1:16]) # identify identical cases aggmarried.seq <- seqdef(married[aggmarried$aggIndex, 1:16], weights = aggmarried$aggWeights) ## calculate multichannel distance matrix with aggregated sequences mcdist <- seqdistmc(channels=list(aggchildren.seq, aggmarried.seq), method="OM", sm =list("TRATE", "TRATE")) -- ******************** Dr. Jeremy Reynolds Associate Professor Department of Sociology 116 Baldwin Hall University of Georgia Athens, GA 30602-1611 Phone: (706) 583-8072 Web: http://uga.edu/soc/people/faculty/reynolds_jeremy.php Fax: (706) 542-4320 -------------- next part -------------- An HTML attachment was scrubbed... URL: From Matthias.Studer at unige.ch Fri May 1 08:26:17 2015 From: Matthias.Studer at unige.ch (Matthias Studer) Date: Fri, 1 May 2015 06:26:17 +0000 Subject: [Traminer-users] multi-channel sequence analysis with aggregated sequences In-Reply-To: References: Message-ID: <367AEF503B1B6A4EA602FB66D71A3EC72002FB4F@kilo.isis.unige.ch> Dear Jeremy, The problem is that you will need to identify unique sequences as the combination of your channels. You cannot look for unique sequences separately for each channels (otherwise we do not know how to matches the different sequences for a given individual). Unfortunately, there is no easy way to do that. Moreover, it is highly likely that you don?t have many replicates once you combine the sequences. Best, Matthias De : traminer-users-bounces at lists.r-forge.r-project.org [mailto:traminer-users-bounces at lists.r-forge.r-project.org] De la part de Jeremy Reynolds Envoy? : vendredi 1 mai 2015 01:59 ? : traminer-users at lists.r-forge.r-project.org Objet : [Traminer-users] multi-channel sequence analysis with aggregated sequences Dear TraMineR Users, I would like to perform a multi-channel sequence analysis with cases that are aggregated using the WeightedCluster procedure. It appears that I have too many cases to perform the analysis without aggregation. I get stuck, however, when calculating the distance matrix. R issues the warning, " [!] sequence objects have different numbers of rows". Does anyone know a way to solve this problem? I have pasted some example code below. Thanks, Jeremy data(biofam) ## Building one channel per type of event left, children or married bf <- as.matrix(biofam[, 10:25]) head(bf) children <- bf==4 | bf==5 | bf==6 children <- children*1 married <- bf == 2 | bf== 3 | bf==6 married <- married*1 #build aggregated sequence objects for children and married aggchildren <- wcAggregateCases(children[,1:16]) # identify identical cases aggchildren.seq <- seqdef(children[aggchildren$aggIndex, 1:16], weights = aggchildren$aggWeights) aggmarried <- wcAggregateCases(married[,1:16]) # identify identical cases aggmarried.seq <- seqdef(married[aggmarried$aggIndex, 1:16], weights = aggmarried$aggWeights) ## calculate multichannel distance matrix with aggregated sequences mcdist <- seqdistmc(channels=list(aggchildren.seq, aggmarried.seq), method="OM", sm =list("TRATE", "TRATE")) -- ******************** Dr. Jeremy Reynolds Associate Professor Department of Sociology 116 Baldwin Hall University of Georgia Athens, GA 30602-1611 Phone: (706) 583-8072 Web: http://uga.edu/soc/people/faculty/reynolds_jeremy.php Fax: (706) 542-4320 -------------- next part -------------- An HTML attachment was scrubbed... URL: From ju.bourdais at gmail.com Wed May 27 12:38:12 2015 From: ju.bourdais at gmail.com (Julien Bourdais) Date: Wed, 27 May 2015 12:38:12 +0200 Subject: [Traminer-users] mean age evolution Message-ID: <55659E94.9090603@gmail.com> Dear Traminer users, I had a database in a spell format listing the periods over which 480 people were hospitalized in a given medical institution (it represents approximatively 1100 periods) from the 1960's to nowadays. I converted it into a STS format sequence data. The presence of each individual is described through two different states (depending on whether they're hospitalized 24/7 or just for daytime) and when they're leaving the hospital I coded their absence with "missing values" and not with "void elements" (consequently most of the sequences consist of "missing values" but it allowed me to keep a calendar axis time). I also have informations about individual birthdates and I'd like to demonstrate that the mean age of the people hospitalized at a given time is rising through the historical period I consider (from 1960 to 2014). But I don't know whether there's a tool for that in Traminer ? Thanks for your help, Julien