corres.fnc: Correspondence Analysis

Description Usage Arguments Value Author(s) References See Also Examples

Description

Correspondence analysis for a contingency table.

Usage

1
corres.fnc(xtab)

Arguments

xtab

A data frame cross-tabulating frequencies.

Value

A correspondence object with summary and plot methods. The summary method lists eigenvalue rates and coordinates, correlations and contributions for Factor 1 and Factor 2. By default, only the first six rows of the factor tables are shown. Full tables are obtained by specifying header = FALSE when calling summary. For information on higher dimensions, set the option n to the desired number (e.g., n = 3) within summary. See plot.corres for documentation of plot options.

Author(s)

Extension of the code in Murtagh (2005) by R. Harald Baayen

Radboud University Nijmegen & Max Planck Institute for Psycholinguistics

Nijmegen, The Netherlands

email: [email protected]

References

F. Murtagh (2005) Correspondence Analysis and Data Coding with JAVA and R, Chapman & Hall/CRC, Boca Raton, FL.

See Also

See corsup.fnc for adding supplementary data to a correspondence plot, and plot.corres for plot options.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
 ## Not run: 
  data(oldFrench)
  oldFrench.ca = corres.fnc(oldFrench)
  oldFrench.ca
  summary(oldFrench.ca, head = TRUE)
  plot(oldFrench.ca)

  # more readable plot
  data(oldFrenchMeta)
  plot(oldFrench.ca, rlabels = oldFrenchMeta$Genre, 
  rcol = as.numeric(oldFrenchMeta$Genre), rcex = 0.5, 
  extreme = 0.1, ccol = "blue")

  # create subset of proze texts

  prose = oldFrench[oldFrenchMeta$Genre=="prose" & 
          !is.na(oldFrenchMeta$Year),]
  proseinfo = oldFrenchMeta[oldFrenchMeta$Genre=="prose" & 
          !is.na(oldFrenchMeta$Year),]
  proseinfo$Period = as.factor(proseinfo$Year <= 1250)

  prose.ca = corres.fnc(prose)
  plot(prose.ca, addcol = FALSE, 
  rcol = as.numeric(proseinfo$Period) + 1, 
  rlabels = proseinfo$Year, rcex = 0.7)

  # and add supplementary data for texts with unknown date of composition
  proseSup = oldFrench[oldFrenchMeta$Genre == "prose" & 
          is.na(oldFrenchMeta$Year),]
  corsup.fnc(prose.ca, bycol = FALSE, supp = proseSup, font = 2, 
  cex = 0.8, labels = substr(rownames(proseSup), 1, 4)) 
 
## End(Not run)

languageR documentation built on May 30, 2017, 3:09 a.m.