File: barNest.svyprop.Rd

package info (click to toggle)
r-cran-plotrix 2.9-3-2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 960 kB
  • sloc: makefile: 3
file content (55 lines) | stat: -rw-r--r-- 3,024 bytes parent folder | download | duplicates (2)
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
\name{barNest.svyprop}
\alias{barNest.svyprop}
\title{Display a nested breakdown of numeric proportions}
\description{Displays a nested breakdown as a bar plot of proportions from
 the output of svyby (survey package) using svytotal as the function.}
\usage{
 barNest.svyprop(x,truevar,falsevar,xlim=NULL,ylim=NULL,
  main="",xlab="",ylab="",yticks=NULL,start=0,end=1,shrink=0.02,
  errbars=FALSE,col=NA,labelcex=1,lineht=NA,showall=TRUE,barlabels=NULL,
  showbrklab=TRUE,mar=NULL)
}
\arguments{
 \item{x}{The output of the \samp{svyby} function using \samp{svytotal} when
  there are two outcomes. See Details.}
 \item{truevar}{The name of the column containing the count of TRUE values.}
 \item{falsevar}{The name of the column containing the count of FALSE values.}
 \item{xlim,ylim}{Optional x and y limits for the plot.}
 \item{main}{Title for the plot.}
 \item{xlab,ylab}{Axis labels for the plot.}
 \item{yticks}{Optional tick labels for the y-axis.}
 \item{start,end}{The start and end values of the initial display. The user will
  almost certainly not want to change these.}
 \item{shrink}{The proportion to shrink the width of the bars as more levels are
  added. This proportion increases with the number of levels.}
 \item{errbars}{Whether to display error bars on the lowest level of breakdown.}
 \item{col}{The colors to use to fill the bars. See Details.}
 \item{labelcex}{Character size for the group labels.}
 \item{lineht}{The height of a line of text in the lower margin of the plot in user
  units. This will be calculated by the function if a value is not passed.}
 \item{showall}{Whether to display bars for the entire breakdown.}
 \item{barlabels}{Optional group labels that may be useful if the factors used to
  break down the numeric variable are fairly long strings.}
 \item{showbrklab}{Whether to display the labels for the lowest level of breakdown.}
 \item{mar}{If not NULL, a four element vector to set the plot margins. If new margins
  are set, the user must reset the margins after the function exits.}
}
\value{nil}
\details{
 \samp{barNest.svyprop} displays a bar plot illustrating the breakdown of
 a binary outcome as proportions. This can be useful in visualizing the relationship
 between groups and subgroups in a compact format. While the function can be used
 with just the output of the \samp{svyby} and \samp{svytotal} functions, the user
 will almost certainly have the \pkg{survey} package installed.

 The colors of the bars are determined by \samp{col}. A list with
 as many elements as there are levels in the breakdown should be passed. Each
 element should be a vector of colors, again usually the same length as the number
 of categories. As the categorical variables are likely to be factors, it is
 important to remember that the colors must be in the correct order for the levels
 of the factors. When the levels are not in the default alphanumeric order, it is
 quite easy to get this wrong.
}
\author{Jim Lemon}
\seealso{\link{barNest}, \link{barp}}
\keyword{misc}