######################################################################
### Package and data ###
######################################################################
data(shoplifting)
######################################################################
### Correspondence Analysis ###
######################################################################
dataCA <- shoplifting[, 1:9]
### CA without supplementary elements
CorrAn.out <- CorrAn(data=dataCA)
### CA with supplementary rows/columns
CorrAn.out <- CorrAn(data=dataCA, sr=13)
CorrAn.out <- CorrAn(data=dataCA, sc=9)
CorrAn.out <- CorrAn(data=dataCA, sr=13, sc=9)
### CA with supplementary columns and without output for rows
CorrAn.out <- CorrAn(data = dataCA, sc=9, oac=0, oar = 0)
### Summary
summary(CorrAn.out)
### Graphs on screen
plot(CorrAn.out, s1=1, s2=2, screen=TRUE)
### Graphs on a pdf file
pdf('CAGr.pdf', paper="a4r", width=12, height=9)
plot(CorrAn.out, s1=1, s2=2, screen=FALSE)
dev.off()
###other
args(CorrAn)
names(CorrAn.out)
CorrAn.out
CorrAn.out$totalin
CorrAn.out$Gs
######################################################################
### Simultaneous Analysis ###
######################################################################
dataSA <- shoplifting
### SA without supplementary elements
SimAn.out <- SimAn(data=dataSA, G=2, acg=list(1:9,10:18), weight= 2,
nameg=c("M", "F"))
### SA with supplementary rows/columns
SimAn.out <- SimAn(data=dataSA, G=2, acg=list(1:8,10:17), weight= 2,
nameg=c("M", "F"), sr= 13)
SimAn.out <- SimAn(data=dataSA, G=2, acg=list(1:8,10:17), weight= 2,
nameg=c("M", "F"), sr= 13, sc=c(9,18))
## Multiple SA with supplementary rows and without output for columns)
SimAn.out <- SimAn(data = t(dataSA), G = 2, arg = list(1:9, 10:18),
weight = 2, nameg=c("M", "F"), sr = 11, oac=0, multiple = 1)
### Summary
summary(SimAn.out)
### Graphs on screen
plot(SimAn.out)
### Graphs on a pdf file
pdf('SAGr.pdf', paper="a4r", width=12, height=9)
plot(SimAn.out, s1=1, s2=2, screen=FALSE)
dev.off()
###other
args(SimAn)
names(SimAn.out)
SimAn.out
SimAn.out$I
SimAn.out$resi
Run the code above in your browser using DataLab