data(mvad)
mvad.seq <- seqdef(mvad[1:100, 17:41])
alphabet(mvad.seq)
head(labels(mvad.seq))
## Computing distance
mvad.emlt <- seqemlt(mvad.seq)
## typology1 with kmeans in 3 clusters
km <- kmeans(mvad.emlt$coord, 3)
##Plotting by clusters of typology1
seqdplot(mvad.seq, group=km$cluster)
## typology2: 3 clusters by applying hierarchical ward
## on the centers of the 25 group kmeans solution
km<-kmeans(mvad.emlt$coord, 25)
hc<-hclust(dist(km$centers, method="euclidean"), method="ward")
zz<-cutree(hc, k=3)
##Plotting by clusters of typology2
seqdplot(mvad.seq, group=zz[km$cluster])
## Plotting the evolution of the correlation between states
plot(mvad.emlt, from="employment", to="joblessness", type="cor")
plot(mvad.emlt, from=c("employment","HE", "school", "FE"), to="joblessness", delay=0, leg=TRUE)
plot(mvad.emlt, from="joblessness", to="employment", delay=6)
plot(mvad.emlt, type="pca", cex=0.4, compx=1, compy=2)
Run the code above in your browser using DataLab