[Sleuth2-commits] r30 - in pkg/Sleuth3: . inst/doc man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Jun 22 06:41:35 CEST 2012


Author: berwin
Date: 2012-06-22 06:41:35 +0200 (Fri, 22 Jun 2012)
New Revision: 30

Added:
   pkg/Sleuth3/man/case0101.Rd
   pkg/Sleuth3/man/case0102.Rd
   pkg/Sleuth3/man/case0201.Rd
   pkg/Sleuth3/man/case0202.Rd
   pkg/Sleuth3/man/case0301.Rd
   pkg/Sleuth3/man/case0302.Rd
   pkg/Sleuth3/man/case0401.Rd
   pkg/Sleuth3/man/case0402.Rd
   pkg/Sleuth3/man/case0501.Rd
   pkg/Sleuth3/man/case0502.Rd
Modified:
   pkg/Sleuth3/DESCRIPTION
   pkg/Sleuth3/inst/doc/Sleuth3-manual.pdf
Log:
Sleuth3:
Copied extended case Rd files provided by Dan into man/directory and
made necessary modification such that "R CMD check/build" would run.
Updated file DESCRIPTION and inst/doc/Sleuth3-manual.pdf.


Modified: pkg/Sleuth3/DESCRIPTION
===================================================================
--- pkg/Sleuth3/DESCRIPTION	2012-06-19 16:49:33 UTC (rev 29)
+++ pkg/Sleuth3/DESCRIPTION	2012-06-22 04:41:35 UTC (rev 30)
@@ -1,15 +1,15 @@
 Package: Sleuth3
 Title: Data sets from Ramsey and Schafer's "Statistical Sleuth (3rd ed)"
-Version: 0.0-1
-Date: 2012-06-20
+Version: 0.0-2
+Date: 2012-06-22
 Author:  Original by F.L. Ramsey and D.W. Schafer,
     modifications by Daniel W. Schafer, Jeannie Sifneos and Berwin A. Turlach
 Description: Data sets from Ramsey, F.L. and Schafer, D.W. (2002), "The
-    Statistical Sleuth: A Course in Methods of Data Analysis (3rd ed)"
-    Duxbury. 
+    Statistical Sleuth: A Course in Methods of Data Analysis (3rd
+    ed)", Duxbury. 
 Maintainer: Berwin A Turlach <Berwin.Turlach at gmail.com>
 LazyData: yes
-Depends: R (>= 2.12.0)
+Depends: R (>= 2.12.0), multcomp
 Suggests: lattice
 License: GPL (>= 2)
 URL: http://r-forge.r-project.org/projects/sleuth2/

Modified: pkg/Sleuth3/inst/doc/Sleuth3-manual.pdf
===================================================================
(Binary files differ)

Added: pkg/Sleuth3/man/case0101.Rd
===================================================================
--- pkg/Sleuth3/man/case0101.Rd	                        (rev 0)
+++ pkg/Sleuth3/man/case0101.Rd	2012-06-22 04:41:35 UTC (rev 30)
@@ -0,0 +1,41 @@
+\name{case0101}
+\alias{case0101}
+\docType{data}
+\title{Motivation and Creativity}
+\description{
+  Data from an experiment concerning the effects of intrinsic and
+  extrinsic motivation on creativity.  Subjects with considerable
+  experience in creative writing were randomly assigned to on of two
+  treatment groups.
+}
+\usage{case0101}
+\format{
+  A data frame with 47 observations on the following 2 variables.
+  \describe{
+    \item{\code{Score}}{creativity score}
+    \item{\code{Treatment}}{factor denoting the treatment group, with levels "Extrinsic" and "Intrinsic"}
+  }
+}
+\source{
+  Ramsey, F.L. and Schafer, D.W. (2012). \emph{The Statistical Sleuth: A
+    Course in Methods of Data Analysis (3rd ed)}, Duxbury.
+}
+\references{
+  Amabile, T. (1985). Motivation and Creativity: Effects of Motivational
+  Orientation on Creative Writers, \emph{Journal of Personality and
+    Social Psychology} \bold{48}(2): 393--399.
+}
+\examples{
+attach(case0101)                                                                # Attach the data frame case0101 to the R search path.
+str(case0101)                                                                   # Show the structure of the data frame case0101.
+
+boxplot(Score ~ Treatment)                                                      # Draw a boxplot of Score for each level of Treatment. (Syntax: boxplot(numerical variable ~ factor).)
+
+boxplot(Score ~ Treatment,                                                      # Draw boxplots, with ...
+  ylab= "Average Creativity Score From 11 Judges (on a 40-point scale)",        # ...y-axis label,
+  names=c("23 'Extrinsic' Group Students","24 'Intrinsic' Group Students"),     # ...names below the boxplots,and
+  main= "Haiku Creativity Scores for 47 Creative Writing Students")             # ...main title.
+
+detach(case0101)                                                                # Detach the data frame from the R search path.
+}
+\keyword{datasets}


Property changes on: pkg/Sleuth3/man/case0101.Rd
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native

Added: pkg/Sleuth3/man/case0102.Rd
===================================================================
--- pkg/Sleuth3/man/case0102.Rd	                        (rev 0)
+++ pkg/Sleuth3/man/case0102.Rd	2012-06-22 04:41:35 UTC (rev 30)
@@ -0,0 +1,54 @@
+\name{case0102}
+\alias{case0102}
+\docType{data}
+\title{Sex Discrimination in Employment}
+\description{
+  The data are the beginning salaries for all 32 male and all 61 female
+  skilled, entry--level clerical employees hired by a bank between 1969
+  and 1977.
+}
+\usage{case0102}
+\format{
+  A data frame with 93 observations on the following 2 variables.
+  \describe{
+    \item{\code{Salary}}{starting salaries (in US\eqn{\$}{$})}
+    \item{\code{Sex}}{sex of the clerical employee, with levels "Female" and "Male"}
+  }
+}
+\source{
+  Ramsey, F.L. and Schafer, D.W. (2012). \emph{The Statistical Sleuth: A
+    Course in Methods of Data Analysis (3rd ed)}, Duxbury.
+}
+\references{
+  Roberts, H.V. (1979). Harris Trust and Savings Bank: An Analysis of
+  Employee Compensation, \emph{Report 7946}, Center for Mathematical
+  Studies in Business and Economics, University of Chicago Graduate
+  School of Business.
+}
+\seealso{
+  \code{\link{case1202}}
+}
+\examples{
+attach(case0102)                                                                # Attach the data frame case0102 to the R search path.
+str(case0102)                                                                   # Show the structure of the data frame case0102.
+
+boxplot(Salary ~ Sex)                                                           # Draw boxplots of Salary for each level of Sex. 
+
+boxplot(Salary ~ Sex,                                                           # Draw boxplots, with...
+  ylab= "Starting Salary (U.S. Dollars)",                                       # ...y-axis label,
+  names=c("61 Females","32 Males"),                                             # ...names below the boxplots, and
+  main= "Harris Bank Entry Level Clerical Workers, 1969-1971")                  # ...main title.
+
+hist(Salary[Sex=="Female"])                                                     # Draw a histogram of Salary for females only.
+if(interactive()) dev.new()                                                     # Open a new graphic window.
+hist(Salary[Sex=="Male"])                                                       # Draw a histogram of Salary for males only
+
+t.test(Salary ~ Sex,                                                            # Perform the two-sample t-test...
+  var.equal=TRUE)                                                                  # ...using the equal variance version.
+t.test(Salary ~ Sex,                                                            # Perform the two-sample t-test...
+  var.equal=TRUE,                                                                  # ...using the equal variance version...
+  alternative = "less")                                                         # ...and with alternative hypothesis that Group 1 mean (female) is less than Group 2 mean.
+detach(case0102)                                                                # Detach the data frame from the R search path.
+}
+
+\keyword{datasets}


Property changes on: pkg/Sleuth3/man/case0102.Rd
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native

Added: pkg/Sleuth3/man/case0201.Rd
===================================================================
--- pkg/Sleuth3/man/case0201.Rd	                        (rev 0)
+++ pkg/Sleuth3/man/case0201.Rd	2012-06-22 04:41:35 UTC (rev 30)
@@ -0,0 +1,71 @@
+\name{case0201}
+\alias{case0201}
+\docType{data}
+\title{Peter and Rosemary Grant's Finch Beak Data}
+\description{
+In the 1980s, biologists Peter and Rosemary Grant caught and measured all the birds from more than 20 generations of finches on the Galapagos island of Daphne Major. In one of those years, 1977, a severe drought caused vegetation to wither, and the only remaining food source was a large, tough seed, which the finches ordinarily ignored. Were the birds with larger and stronger beaks for opening these tough seeds more likely to survive that year, and did they tend to pass this characteristic to their offspring? The data are beak depths (height of the beak at its base) of 89 finches caught the year before the drought (1976) and 89 finches captured the year after the drought (1978). 
+}
+
+\usage{case0201}
+\format{
+  A data frame with 178 observations on the following 2 variables.
+  \describe{
+    \item{\code{Year}}{Year the finch was caught, 1976 or 1978}
+    \item{\code{Depth}}{Beak depth of the finch (mm)}
+  }
+}
+
+\source{
+  Ramsey, F.L. and Schafer, D.W. (2012). \emph{The Statistical Sleuth: A
+    Course in Methods of Data Analysis (3rd ed)}, Duxbury.
+}
+
+\references{
+  Grant, P. (1986). \bold{Ecology and Evolution of Darwin's Finches}, Princeton University Press, Princeton, N.J.
+}
+
+\seealso{
+  \code{\link{ex2018}}
+}
+
+\examples{
+attach(case0201)                                              # Attach the data frame case0201 to the R search path.
+str(case0201)                                                 # Show the structure of the data frame case0201. 
+
+boxplot(Depth ~ Year)                                         # Draw boxplots of Depth for each level of Year.
+
+mean(Depth[Year==1978]) - mean(Depth[Year==1976])             # Calculate the average Depth in Year 1978 minus the average Depth in 1976.                                                              
+
+yearFactor <- factor(Year)                                    # Create a factor with 2 levels ("1976" and "1978") from the numerical variable Year.
+t.test(Depth ~ yearFactor,                                    # Perform the two-sample t-test (Syntax: numerical variable ~ factor with 2 levels)...
+  var.equal=TRUE)                                                # ...using the equal variance version ("T" means TRUE).                      
+t.test(Depth ~ yearFactor,                                    # Perform the two-sample t-test,
+  var.equal=TRUE,                                                # ...using the equal-variance version, and 
+  alternative = "less")                                       # ...with alternative hypothesis that the Group 1 (1976, which comes first alpha-numerically) mean is less thn Group 2.
+
+boxplot(Depth ~ Year,                                         # Draw boxplots of Depth for each level of Year, with ...
+  ylab= "Beak Depth (mm)",                                    # ...y-axis label
+  names=c("89 Finches in 1976","89 Finches in 1978"),         # ...names below the boxplots, and
+  main= "Beak Depths of Darwin Finches in 1976 and 1978")     # ...main title.
+
+## BOXPLOTS FOR PRESENTATION
+boxplot(Depth ~ Year,                                         # Draw boxplots of Depth for each level of Year, with
+	ylab="Beak Depth (mm)",                                     # ...y-axis label,
+	names=c("89 Finches in 1976","89 Finches in 1978"),         # ...names below the two boxplots,
+	main="Beak Depths of Darwin Finches in 1976 and 1978",      # ...main title,
+	col="green",                                                # ...green fill color,
+  boxlwd=2,                                                   # ...line widths in box equal to twice their default value,
+	medlwd=2,                                                   # ...line widths of horizontal lines at medians equal twice their default value,
+	whisklty=1,                                                 # ...solid (=1) (not dashed =2) whiskers (lines extending from boxes),
+	whisklwd=2,                                                 # ...line width of whiskers equal to twice their default value,
+	staplewex=.2,                                               # ...length of staple (horizontal line at end of whisker) 0.2 times its default value, 
+	staplelwd=2,                                                # ...line width of staple equal to twice its default value,
+	outlwd=2,                                                   # ...line width of outliers (plotted points beyond whiskers) equal to twice their default value.
+	outpch=21,                                                  # ...plotting character for outlier set to be a circle (21 is the code for circle),
+	outbg="green",                                              # ...background (fill) color for the outlier set to green, and
+	outcex=1.5	)	                                              # ...outlier size set to be 1.5 times the default value.
+	
+detach(case0201)                                              # Detach the data frame from the R search path.
+}
+
+\keyword{datasets}


Property changes on: pkg/Sleuth3/man/case0201.Rd
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native

Added: pkg/Sleuth3/man/case0202.Rd
===================================================================
--- pkg/Sleuth3/man/case0202.Rd	                        (rev 0)
+++ pkg/Sleuth3/man/case0202.Rd	2012-06-22 04:41:35 UTC (rev 30)
@@ -0,0 +1,71 @@
+\name{case0202}
+\alias{case0202}
+\docType{data}
+\title{Anatomical Abnormalities Associated with Schizophrenia}
+\description{
+  Are any physiological indicators associated with schizophrenia?  In a
+  1990 article, researchers reported the results of a study that
+  controlled for genetic and socioeconomic differences by examining 15
+  pairs of monozygotic twins, where one of the twins was schizophrenic
+  and the other was not.  The researchers used magnetic resonance
+  imaging to measure the volumes (in cm$^3$) of several regions and
+  subregions of the twins' brains.
+}
+\usage{case0202}
+\format{
+  A data frame with 15 observations on the following 2 variables.
+  \describe{
+    \item{\code{Unaffected}}{volume of left hippocampus of unaffected twin (in cm\eqn{^3})}
+    \item{\code{Affected}}{volume of left hippocampus of affected twin (in cm\eqn{^3})}
+  }
+}
+\source{
+  Ramsey, F.L. and Schafer, D.W. (2012). \emph{The Statistical Sleuth: A
+    Course in Methods of Data Analysis (3rd ed)}, Duxbury.
+}
+\references{
+  Suddath, R.L., Christison, G.W., Torrey, E.F., Casanova, M.F. and
+  Weinberger, D.R. (1990).  Anatomical Abnormalities in the Brains of
+  Monozygotic Twins Discordant for Schizophrenia, \emph{New England
+  Journal of Medicine} \bold{322}(12): 789--794.
+}
+\examples{
+attach(case0202)                                                      # Attach the data frame case0201 to the R search path.
+str(case0202)                                                         # Show the structure of the data frame case0202. 
+
+diff <- Unaffected-Affected                                           # Calculate the difference from each pair.
+summary(diff)                                                         # Show summary statistics for the variable "diff".
+boxplot(diff)                                                         # Draw a boxplot of diff. (Note syntax: boxplot(oneVariable) draws a single boxplot of oneVariable.)
+abline(h=0)                                                           # Draw a horizontal line at 0 on the plot.                       
+
+t.test(diff)                                                          # Perform a one-sample t-test on differences (Syntax: t.test(oneVariable) performs a one-sample t-test).
+t.test(Unaffected,Affected,pair=TRUE)                                 # Perform a paired t-test on Unaffected and Affected (equivalent to t.test(diff)).
+
+boxplot(diff,                                                         # Draw a boxplot of diff, with 
+	ylab="Difference in Hippocampus Volume (cubic cm)",                 # ...y-axis label,
+	xlab="15 Sets of Twins, One Affected with Schizophrenia",           # ...x-axis label, and
+	main="Hippocampus Difference: Unaffected Twin Minus Affected Twin") # ...main title. 
+abline(h=0,                                                           # Draw a horizontal line at 0, with
+  lty=2)                                                              # ...line type 2 (a dashed line).
+  
+## Example of a polished boxplot for presentation:
+boxplot(diff,                                                         # Draw a boxplot of diff, with
+	ylab="Difference in Hippocampus Volume (cubic cm)",                 # ...y-axis label,
+	xlab="15 Sets of Twins, One Affected with Schizophrenia",           # ...x-axis label,
+	main="Hippocampus Difference: Unaffected Minus Affected Twin",      # ...main title,
+	col="green",                                                        # ...green fill color,
+  boxlwd=2,                                                           # ...line widths in box equal to twice their default value,
+	medlwd=2,                                                           # ...line widths of horizontal lines at medians equal twice their default value,
+	whisklty=1,                                                         # ...solid (=1) (not dashed =2) whiskers (lines extending from boxes),
+	whisklwd=2,                                                         # ...line width of whiskers equal to twice their default value,
+	staplewex=.2,                                                       # ...length of staple (horizontal line at end of whisker) 0.2 times its default value, 
+	staplelwd=2,                                                        # ...line width of staple equal to twice its default value,
+	outlwd=2,                                                           # ...line width of outliers (plotted points beyond whiskers) equal to twice their default value.
+	outpch=21,                                                          # ...plotting character for outlier set to be a circle (21 is the code for circle),
+	outbg="green",                                                      # ...background (fill) color for the outlier set to green, and
+	outcex=1.5	)	                                                      # ...outlier size set to be 1.5 times the default value.
+abline(h=0,lty=2)                                                     # Draw a dashed (lty=2) horizontal line (h=...) at 0 for reference
+
+detach(case0202)                                                      # Detach the data frame from the R search path.
+}
+\keyword{datasets}


Property changes on: pkg/Sleuth3/man/case0202.Rd
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native

Added: pkg/Sleuth3/man/case0301.Rd
===================================================================
--- pkg/Sleuth3/man/case0301.Rd	                        (rev 0)
+++ pkg/Sleuth3/man/case0301.Rd	2012-06-22 04:41:35 UTC (rev 30)
@@ -0,0 +1,77 @@
+\name{case0301}
+\alias{case0301}
+\docType{data}
+\title{Cloud Seeding}
+\description{
+  Does dropping silver iodide onto clouds increase the amount of
+  rainfall they produce? In a randomized experiment, researchers
+  measured the volume of rainfall in a target area (in acre-feet) on 26
+  suitable days in which the clouds were seeded and on 26 suitble days
+  in which the clouds were not seeded.  
+}
+\usage{case0301}
+\format{
+  A data frame with 52 observations on the following 2 variables.
+  \describe{
+    \item{\code{Rainfall}}{the volume of rainfall in the target area (in acre-feet)}
+    \item{\code{Treatment}}{a factor with levels \code{"Unseeded"} and
+      \code{"Seeded"} indicating whether the clouds were unseeded or seeded.}
+  }
+}
+\source{
+  Ramsey, F.L. and Schafer, D.W. (2012). \emph{The Statistical Sleuth: A
+    Course in Methods of Data Analysis (3rd ed)}, Duxbury.
+}
+\references{
+Simpson, J., Olsen, A., and Eden, J. (1975). A Bayesian Analysis of a
+Multiplicative Treatment Effect in Weather
+Modification. \emph{Technometrics} \bold{17}: 161--166.
+}
+\examples{
+attach(case0301)                                                   # Attach the data frame case0301 to the R search path.
+str(case0301)                                                      # Show the structure of the data frame.
+
+boxplot(Rainfall ~ Treatment)                                      # Draw boxplots of Rainfall for each level of Treatment.
+boxplot(log(Rainfall) ~ Treatment)                                 # Draw boxplots of the natural logarithm of Rainfall for each levl of Treatment.
+
+t.test(log(Rainfall) ~ Treatment,                                  # Perform the two-sample t-test of the null hypothesis that the means of log(Rainfall) are equal for the two levels of Treatment, with
+	alternative="greater",                                           # ...alternative hypothesis that group 1 mean (Seeded, which comes first alpha-numerically) is greater, and
+	var.equal=TRUE)                                                     # ...use the equal variance version.
+	
+myTest <- t.test(log(Rainfall) ~ Treatment,                        # Perform two-sample t-test and store results in object myTest, with
+  alternative="two.sided",                                         # ...alternative that group means differ (for getting a2-sided confidence interval), and
+  var.equal=TRUE)                                                     # ...use the equal-variance version.
+exp(myTest$est[1] - myTest$est[2])                                 # Back-transform the estimated difference in means on the log scale.
+exp(myTest$conf)                                                   # Back-transform the endpoints of the confidence interval. 
+
+boxplot(log(Rainfall) ~ Treatment,                                 # Draw boxplots of log(Rainfall) for each level of Treatment, with
+  ylab="Log of Rainfall Volume in Target Area (Acre Feet)",        # ...y-axis label,
+  names=c("On 26 Seeded Days", "On 26 Unseeded Days"),             # ...names below boxes, and
+  main="Distributions of Rainfalls from Cloud Seeding Experiment") # ...main title.
+
+## Example of polished display for presentation:
+boxplot(log(Rainfall) ~ Treatment,                                 # Draw boxplots of log(Rainfall) for each level of Treatment, with
+	ylab="Log Rainfall (Acre-Feet)",                                 # ...y-axis label,
+	names=c("on 26 seeded days","on 26 unseeded days"),              # ...names below boxes,
+	main="Boxplots of Rainfall on Log Scale",                        # ...main title
+	col="green",                                                     # ...green fill color,
+  boxlwd=2,                                                        # ...line widths in box equal to twice their default value,
+	medlwd=2,                                                        # ...line widths of horizontal lines at medians equal twice their default value,
+	whisklty=1,                                                      # ...solid (=1) (not dashed =2) whiskers (lines extending from boxes),
+	whisklwd=2,                                                      # ...line width of whiskers equal to twice their default value,
+	staplewex=.2,                                                    # ...length of staple (horizontal line at end of whisker) 0.2 times its default value, 
+	staplelwd=2,                                                     # ...line width of staple equal to twice its default value,
+	outlwd=2,                                                        # ...line width of outliers (plotted points beyond whiskers) equal to twice their default value.
+	outpch=21,                                                       # ...plotting character for outlier set to be a circle (21 is the code for circle),
+	outbg="green",                                                   # ...background (fill) color for the outlier set to green, and
+	outcex=1.5	)	                                                   # ...outlier size set to be 1.5 times the default value.
+myTicks <- c(1,5, 10,100,500,1000,2000,3000)                       # Create values for y-axis ticks on the original scale of Rainfall, which ranges from 1 to about 3,000
+axis(4, at=log(myTicks),                                           # Add tick marks at log(myTicks) to the right hand side of the plot (side= 4), and
+  label=myTicks)                                                   # ...use MyTicks as labels.
+mtext("Rainfall (Acre Feet)",                                      # Add this text outside of the plotting region,
+  side=4,                                                          #...on side 4 (right hand side), and
+  line=2.5)                                                        #...2.5 lines outside the plot boundary.
+  
+detach(case0301)                                                   # Detach case0301 form R Search path.
+}
+\keyword{datasets}


Property changes on: pkg/Sleuth3/man/case0301.Rd
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native

Added: pkg/Sleuth3/man/case0302.Rd
===================================================================
--- pkg/Sleuth3/man/case0302.Rd	                        (rev 0)
+++ pkg/Sleuth3/man/case0302.Rd	2012-06-22 04:41:35 UTC (rev 30)
@@ -0,0 +1,82 @@
+\name{case0302}
+\alias{case0302}
+\docType{data}
+\title{Agent Orange}
+\description{
+  In 1987, researchers measured the TCDD concentration in blood samples
+  from 646 U.S. veterans of the Vietnam War and from 97 U.S. veterans
+  who did not serve in Vietnam. TCDD is a carcinogenic dioxin in the
+  herbicide called Agent Orange, which was used to clear jungle hiding
+  areas by the U.S. military in the Vietnam War between 1962 and 1970.
+}
+\usage{data(case0302)}
+\format{
+  A data frame with 743 observations on the following 2 variables.
+  \describe{
+    \item{\code{Dioxin}}{the concentration of TCDD, in parts per trillion}
+    \item{\code{Veteran}}{factor variable with two levels,
+      \code{"Vietnam"} and \code{"Other"}, to indicate the type of veteran}
+  }
+}
+\source{
+  Ramsey, F.L. and Schafer, D.W. (2012). \emph{The Statistical Sleuth: A
+    Course in Methods of Data Analysis (3rd ed)}, Duxbury.
+}
+\references{
+  Centers for Disease Control Veterans Health Studies: Serum
+  2,3,7,8-Tetraclorodibenzo-p-dioxin Levels in U.S. Army Vietnam-era
+  Veterans.  \emph{Journal of the American Medical Association}
+  \bold{260}: 1249--1254. 
+}
+\examples{
+attach(case0302)                                                                            # Attach data frame case0302 to R search path.
+str(case0302)                                                                               # Show the structure of the data frame.
+
+boxplot(Dioxin ~ Veteran)                                                                   # Draw boxplots of Dioxin for each level of Veteran.
+
+t.test(Dioxin ~ Veteran,                                                                    # Perform two-sample t-test of the null hypothesis that mean Dioxin is the same for each level of Veteran,
+  alternative="less",                                                                       # ...with the alternative hypothesis that group 1 (Other, which comes first alphanumerically) mean is less, and
+  var.equal=TRUE)                                                                              # ...use the equal variance version of the test.
+t.test(Dioxin ~ Veteran,                                                                    # Perform the two-sample t-test,
+  subset=(Dioxin < 40),                                                                     # ...applied to the subset of observations for which Dioxin < 40,
+  alternative="less",                                                                       # ...with alternative that group 1 mean is less than group 2 mean, and
+  var.equal=TRUE)                                                                              # ...using the equal variance version of the test.
+t.test(Dioxin ~ Veteran,                                                                    # Perform the two-sample t-test, with 
+  subset=(Dioxin < 20),                                                                     # ...the subset of observations for which Dioxin < 20,
+  alternative="less",                                                                       # ...with alternative that group 1 mean is less, and
+  var.equal=TRUE)                                                                              # ...using the equal variance version of the test.
+t.test(Dioxin ~ Veteran,                                                                    # Perform the two-sample t-test (with default 2-sided alternative in order to get confidence interval),
+  var.equal=TRUE)                                                                              # ...using the equal variance version of the test.
+
+## Example of polished histograms for presentation                                          # Note: histograms seem to reveal the distributions better than boxplots for this data set.
+par(mfrow=c(2,1),                                                                           # Set graphical parameters, with mfrow=c(2,1) for a panel of graphs in 2 rows and 1 column, and
+  mar=c(2,2,1,1))                                                                           # ...with margins of 2 lines below and to the left, and 1 line above and to the right of the plot.
+myBreaks <- (0:46) - .5                                                                     # Create a variable of breaks at -.5, 1.5,...,45.5 for specifying customized histogram bins.
+hist(Dioxin[Veteran=="Other"],                                                              # Draw a histogram of Dioxin for Other veterans,
+  breaks=myBreaks,                                                                          # ...using myBreaks to define histogram bins,
+  xlim=range(Dioxin),                                                                       # ...with the x-axis spanning the entire range of Dioxin,
+  col="green",                                                                              # ...with green fill color,
+  xlab="",                                                                                  # ...with no x-axis label,
+  ylab="",                                                                                  # ...with no y-axis label,
+  main="")                                                                                  # ...and no main title.
+text(6,25,                                                                                  # Write the following text at x=6, y=25:
+  "Dioxin in 97 'Other' Veterans; Estimated mean =  4.19 ppt (95\% CI: 3.72 to 4.65 ppt)",   
+  pos=4,                                                                                    # ...so that text is left justified at that point (not centered, for example), and
+  cex=.75)                                                                                  # ...using character expansion factor 0.75.
+hist(Dioxin[Veteran=="Vietnam"],                                                            # Draw a histogram of Dioxin for Vietnam veterans,
+  breaks=myBreaks,                                                                          # ...using myBreaks to define histogram bins,
+  xlim=range(Dioxin),                                                                       # ...with the x-axis spanning the entire range of Dioxin,
+  col="green",                                                                              # ...with green fill color,
+  xlab="",                                                                                  # ...with no x-axis label,
+  ylab="",                                                                                  # ...with no y-axis label,
+  main="")                                                                                  # ...and no main title.
+text(6,145,                                                                                 # Write the following text at x=6, y=145:
+  "Dioxin in 646 Vietnam Veterans; Estimated mean =  4.26 ppt (95\% CI: 4.06 to 4.64 ppt)",
+  pos=4,                                                                                    # ...so that text is left justified at that point (not centered, for example), and
+  cex=.75)                                                                                  # ...using character expansion factor 0.75.
+text(25,70,                                                                                 # Write the following text at x=25, y = 70:
+  "Estimated Difference in Means: 0.07 ppt (95\% CI: -0.63 to 0.48 ppt)")
+  
+detach(case0302)                                                                            # Detach case0302 from the R search path.
+}
+\keyword{datasets}


Property changes on: pkg/Sleuth3/man/case0302.Rd
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native

Added: pkg/Sleuth3/man/case0401.Rd
===================================================================
--- pkg/Sleuth3/man/case0401.Rd	                        (rev 0)
+++ pkg/Sleuth3/man/case0401.Rd	2012-06-22 04:41:35 UTC (rev 30)
@@ -0,0 +1,64 @@
+\name{case0401}
+\alias{case0401}
+\docType{data}
+\title{Space Shuttle}
+\description{
+  The number of space shuttle O-ring incidents for 4 space shuttle
[TRUNCATED]

To get the complete diff run:
    svnlook diff /svnroot/sleuth2 -r 30


More information about the Sleuth2-commits mailing list