Hi everyone! If someone could advise me, you'd be a lifesaver:
Doing Sequence analysis and trying to cluster based on similarity/ dissimilarity.
Im using Elzinga's duration-weighted spell measure (combinadd) as the method of distance (X/t)
Halpin (2017) http://teaching.sociology.ul.ie/bhal...main-local.pdf, p 6.
combinprep, state(Element) length(p) idvar(hetu_id) nspells (ööö)
local spmax = r(maxspells)
combinadd Element1-p`spmax', pwsim(xts) nspells(ööö) nstates(6) rtype(d)
This far, it works
Only, to get to sensible clustering (clustermat wards) one apparently needs to change the Elzinga method's SIMILARITY matrix into dissimilarity/ distance measures
according to Halpin (2007) http://teaching.sociology.ul.ie/seqanal/essex/labs.pdf, p 15-16.
set matsize 10000
matrix altxts = J(_N,_N,1) - xts
BUT I get "negative dissimilarities found in altxts"
What's wrong, HOW CAN I change from SIMILARITY MATRIX TO DISSILARITY MATRIX in order to move to clustering?
Appreciation and gratitude for help
ps.
I've also tried:
matrix dissimilarity altxts = xts, dissim(standard)
following https://www.stata.com/manuals13/mvma...similarity.pdf
But it doest work as this commads would be
Doing Sequence analysis and trying to cluster based on similarity/ dissimilarity.
Im using Elzinga's duration-weighted spell measure (combinadd) as the method of distance (X/t)
Halpin (2017) http://teaching.sociology.ul.ie/bhal...main-local.pdf, p 6.
combinprep, state(Element) length(p) idvar(hetu_id) nspells (ööö)
local spmax = r(maxspells)
combinadd Element1-p`spmax', pwsim(xts) nspells(ööö) nstates(6) rtype(d)
This far, it works
Only, to get to sensible clustering (clustermat wards) one apparently needs to change the Elzinga method's SIMILARITY matrix into dissimilarity/ distance measures
according to Halpin (2007) http://teaching.sociology.ul.ie/seqanal/essex/labs.pdf, p 15-16.
set matsize 10000
matrix altxts = J(_N,_N,1) - xts
BUT I get "negative dissimilarities found in altxts"
What's wrong, HOW CAN I change from SIMILARITY MATRIX TO DISSILARITY MATRIX in order to move to clustering?
Appreciation and gratitude for help

ps.
I've also tried:
matrix dissimilarity altxts = xts, dissim(standard)
following https://www.stata.com/manuals13/mvma...similarity.pdf
But it doest work as this commads would be
Comment