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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Jul 24 18:20:24 CEST 2012


Author: berwin
Date: 2012-07-24 18:20:24 +0200 (Tue, 24 Jul 2012)
New Revision: 36

Modified:
   pkg/Sleuth3/DESCRIPTION
   pkg/Sleuth3/inst/doc/Sleuth3-manual.pdf
   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
Log:
Sleuth3:
Replaced .Rd files with new versions provided by Dan.
Updated publication date in DESCRIPTION file.
Bumped version number, hence also updated inst/doc/Sleuth3-manual.pdf


Modified: pkg/Sleuth3/DESCRIPTION
===================================================================
--- pkg/Sleuth3/DESCRIPTION	2012-06-22 06:20:46 UTC (rev 35)
+++ pkg/Sleuth3/DESCRIPTION	2012-07-24 16:20:24 UTC (rev 36)
@@ -1,7 +1,7 @@
 Package: Sleuth3
 Title: Data sets from Ramsey and Schafer's "Statistical Sleuth (3rd ed)"
-Version: 0.0-3
-Date: 2012-06-22
+Version: 0.0-4
+Date: 2012-06-24
 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. (2012), "The
@@ -9,7 +9,7 @@
     ed)", Duxbury. 
 Maintainer: Berwin A Turlach <Berwin.Turlach at gmail.com>
 LazyData: yes
-Depends: R (>= 2.12.0), multcomp
-Suggests: lattice
+Depends: R (>= 2.12.0)
+Suggests: lattice, multcomp
 License: GPL (>= 2)
 URL: http://r-forge.r-project.org/projects/sleuth2/

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

Modified: pkg/Sleuth3/man/case0101.Rd
===================================================================
--- pkg/Sleuth3/man/case0101.Rd	2012-06-22 06:20:46 UTC (rev 35)
+++ pkg/Sleuth3/man/case0101.Rd	2012-07-24 16:20:24 UTC (rev 36)
@@ -13,7 +13,8 @@
   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"}
+    \item{\code{Treatment}}{factor denoting the treatment group, with
+      levels "Extrinsic" and "Intrinsic"}
   }
 }
 \source{
@@ -26,16 +27,16 @@
     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.
+attach(case0101)  
+str(case0101)  
+boxplot(Score ~ Treatment)  
 
-boxplot(Score ~ Treatment)                                                      # Draw a boxplot of Score for each level of Treatment. (Syntax: boxplot(numerical variable ~ factor).)
+boxplot(Score ~ Treatment, 
+  ylab= "Average Creativity Score From 11 Judges (on a 40-point scale)",  
+  names=c("23 'Extrinsic' Group Students","24 'Intrinsic' Group Students"), 
+  main= "Haiku Creativity Scores for 47 Creative Writing Students") 
 
-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.
+detach(case0101)
 }
 \keyword{datasets}
+

Modified: pkg/Sleuth3/man/case0102.Rd
===================================================================
--- pkg/Sleuth3/man/case0102.Rd	2012-06-22 06:20:46 UTC (rev 35)
+++ pkg/Sleuth3/man/case0102.Rd	2012-07-24 16:20:24 UTC (rev 36)
@@ -12,7 +12,8 @@
   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"}
+    \item{\code{Sex}}{sex of the clerical employee, with levels "Female"
+      and "Male"} 
   }
 }
 \source{
@@ -29,26 +30,23 @@
   \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.
+attach(case0102)
+str(case0102)
 
-boxplot(Salary ~ Sex)                                                           # Draw boxplots of Salary for each level of Sex. 
+boxplot(Salary ~ Sex, 
+  ylab= "Starting Salary (U.S. Dollars)", 
+  names=c("61 Females","32 Males"),
+  main= "Harris Bank Entry Level Clerical Workers, 1969-1971")
 
-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"]) 
+dev.new()
+hist(Salary[Sex=="Male"])
 
-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.
+t.test(Salary ~ Sex, var.equal=TRUE) # Equal var. version; 2-sided by default  
+t.test(Salary ~ Sex, var.equal=TRUE, 
+  alternative = "less")  # 1-sided; that group 1 (females) mean is less 
+  
+detach(case0102)  
 }
 
 \keyword{datasets}

Modified: pkg/Sleuth3/man/case0201.Rd
===================================================================
--- pkg/Sleuth3/man/case0201.Rd	2012-06-22 06:20:46 UTC (rev 35)
+++ pkg/Sleuth3/man/case0201.Rd	2012-07-24 16:20:24 UTC (rev 36)
@@ -3,7 +3,17 @@
 \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). 
+  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}
@@ -21,7 +31,8 @@
 }
 
 \references{
-  Grant, P. (1986). \bold{Ecology and Evolution of Darwin's Finches}, Princeton University Press, Princeton, N.J.
+  Grant, P. (1986). \bold{Ecology and Evolution of Darwin's Finches},
+  Princeton University Press, Princeton, N.J. 
 }
 
 \seealso{
@@ -29,43 +40,38 @@
 }
 
 \examples{
-attach(case0201)                                              # Attach the data frame case0201 to the R search path.
-str(case0201)                                                 # Show the structure of the data frame case0201. 
+attach(case0201)   
+str(case0201)
+                                         
+mean(Depth[Year==1978]) - mean(Depth[Year==1976])  
 
-boxplot(Depth ~ Year)                                         # Draw boxplots of Depth for each level of Year.
+yearFactor <- factor(Year) 
+t.test(Depth ~ yearFactor, var.equal=TRUE)  
+t.test(Depth ~ yearFactor, var.equal=TRUE, alternative = "less") 
 
-mean(Depth[Year==1978]) - mean(Depth[Year==1976])             # Calculate the average Depth in Year 1978 minus the average Depth in 1976.                                                              
+boxplot(Depth ~ Year,  
+  ylab= "Beak Depth (mm)",   
+  names=c("89 Finches in 1976","89 Finches in 1978"), 
+  main= "Beak Depths of Darwin Finches in 1976 and 1978")  
 
-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.
+boxplot(Depth ~ Year,             
+        ylab="Beak Depth (mm)",  
+        names=c("89 Finches in 1976","89 Finches in 1978"),  
+        main="Beak Depths of Darwin Finches in 1976 and 1978",
+        col="green", 
+        boxlwd=2,   
+        medlwd=2, 
+        whisklty=1, 
+        whisklwd=2, 
+        staplewex=.2, 
+        staplelwd=2,  
+        outlwd=2, 
+        outpch=21,
+        outbg="green", 
+        outcex=1.5)       
+        
+detach(case0201)  
 }
 
 \keyword{datasets}

Modified: pkg/Sleuth3/man/case0202.Rd
===================================================================
--- pkg/Sleuth3/man/case0202.Rd	2012-06-22 06:20:46 UTC (rev 35)
+++ pkg/Sleuth3/man/case0202.Rd	2012-07-24 16:20:24 UTC (rev 36)
@@ -15,8 +15,10 @@
 \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})}
+    \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{
@@ -30,42 +32,38 @@
   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. 
+attach(case0202) 
+str(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.                       
+diff <- Unaffected-Affected    
+summary(diff)
+t.test(diff) # Paired t-test is a one-sample t-test on differnces 
+t.test(Unaffected,Affected,pair=TRUE)   # same thing 
 
-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).
+boxplot(diff,       
+        ylab="Difference in Hippocampus Volume (cubic cm)", 
+        xlab="15 Sets of Twins, One Affected with Schizophrenia", 
+        main="Hippocampus Difference: Unaffected Twin Minus Affected Twin") 
+abline(h=0,lty=2)   # Draw a dashed (lty=2) horizontal line at 0    
   
-## 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
+## BOXPLOT FOR PRESENTATION:
+boxplot(diff, 
+        ylab="Difference in Hippocampus Volume (cubic cm)", 
+        xlab="15 Sets of Twins, One Affected with Schizophrenia",
+        main="Hippocampus Difference: Unaffected Minus Affected Twin",  
+        col="green",  
+        boxlwd=2, 
+        medlwd=2, 
+        whisklty=1,
+        whisklwd=2,  
+        staplewex=.2, 
+        staplelwd=2, 
+        outlwd=2, 
+        outpch=21,
+        outbg="green",
+        outcex=1.5)      
+abline(h=0,lty=2) 
 
-detach(case0202)                                                      # Detach the data frame from the R search path.
+detach(case0202)  
 }
 \keyword{datasets}

Modified: pkg/Sleuth3/man/case0301.Rd
===================================================================
--- pkg/Sleuth3/man/case0301.Rd	2012-06-22 06:20:46 UTC (rev 35)
+++ pkg/Sleuth3/man/case0301.Rd	2012-07-24 16:20:24 UTC (rev 36)
@@ -13,7 +13,8 @@
 \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{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.}
   }
@@ -28,50 +29,45 @@
 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.
+attach(case0301) 
+str(case0301)
 
-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.
+boxplot(Rainfall ~ Treatment) 
+boxplot(log(Rainfall) ~ 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. 
+t.test(log(Rainfall) ~ Treatment, alternative="greater", var.equal=TRUE)
+        
+# Use 2-sided alternative to get a 2-sided confidence interval:
+myTest <- t.test(log(Rainfall) ~ Treatment, alternative="two.sided", var.equal=TRUE) 
+exp(myTest$est[1] - myTest$est[2])  # Back-transform estimate on log scale 
+exp(myTest$conf) # Back transform endpoints of 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.
+boxplot(log(Rainfall) ~ Treatment, 
+  ylab="Log of Rainfall Volume in Target Area (Acre Feet)", 
+  names=c("On 26 Seeded Days", "On 26 Unseeded Days"), 
+  main="Distributions of Rainfalls from Cloud Seeding Experiment") 
 
-## 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.
+## POLISHED BOXPLOTS FOR PRESENTATION:
+par(mar=c(4,4,4,4))
+boxplot(log(Rainfall) ~ Treatment, 
+        ylab="Log Rainfall (Acre-Feet)",
+        names=c("on 26 seeded days","on 26 unseeded days"), 
+        main="Boxplots of Rainfall on Log Scale",
+        col="green", 
+        boxlwd=2,
+        medlwd=2, 
+        whisklty=1, 
+        whisklwd=2,
+        staplewex=.2, 
+        staplelwd=2,
+        outlwd=2, 
+        outpch=21, 
+        outbg="green",  
+        outcex=1.5      )        
+myTicks <- c(1,5,10,100,500,1000,2000,3000) # Create some tick marks for original scale 
+axis(4, at=log(myTicks), label=myTicks)   # Add original-scale axis on right    
+mtext("Rainfall (Acre Feet)", side=4, line=2.5) # Add right-side axis label 
+
+detach(case0301) 
 }
 \keyword{datasets}

Modified: pkg/Sleuth3/man/case0302.Rd
===================================================================
--- pkg/Sleuth3/man/case0302.Rd	2012-06-22 06:20:46 UTC (rev 35)
+++ pkg/Sleuth3/man/case0302.Rd	2012-07-24 16:20:24 UTC (rev 36)
@@ -29,54 +29,29 @@
   \bold{260}: 1249--1254. 
 }
 \examples{
-attach(case0302)                                                                            # Attach data frame case0302 to R search path.
-str(case0302)                                                                               # Show the structure of the data frame.
+attach(case0302)  
+str(case0302) 
+boxplot(Dioxin ~ Veteran)  
 
-boxplot(Dioxin ~ Veteran)                                                                   # Draw boxplots of Dioxin for each level of Veteran.
+t.test(Dioxin ~ Veteran, alternative="less", var.equal=TRUE)  
+t.test(Dioxin ~ Veteran, alternative="less", var.equal=TRUE, subset=(Dioxin < 40))  
+t.test(Dioxin ~ Veteran, alternative="less", var.equal=TRUE, subset=(Dioxin < 20))    
+t.test(Dioxin ~ Veteran, var.equal=TRUE)  
 
-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)")
+## HISTOGRAMS FOR PRESENTATION  
+par(mfrow=c(2,1), mar=c(3,3,1,1))     
+myBreaks <- (0:46) - .5    # Make breaks for histogram bins  
+hist(Dioxin[Veteran=="Other"], breaks=myBreaks, xlim=range(Dioxin),
+     col="green", xlab="", ylab="", main="")     
[TRUNCATED]

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


More information about the Sleuth2-commits mailing list