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

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Aug 24 16:47:28 CEST 2012


Author: berwin
Date: 2012-08-24 16:47:28 +0200 (Fri, 24 Aug 2012)
New Revision: 38

Added:
   pkg/Sleuth3/man/case1501.Rd
   pkg/Sleuth3/man/case1502.Rd
   pkg/Sleuth3/man/case1601.Rd
   pkg/Sleuth3/man/case1602.Rd
   pkg/Sleuth3/man/case1701.Rd
   pkg/Sleuth3/man/case1702.Rd
   pkg/Sleuth3/man/case1801.Rd
   pkg/Sleuth3/man/case1802.Rd
   pkg/Sleuth3/man/case1803.Rd
   pkg/Sleuth3/man/case1901.Rd
   pkg/Sleuth3/man/case1902.Rd
   pkg/Sleuth3/man/case2001.Rd
   pkg/Sleuth3/man/case2002.Rd
   pkg/Sleuth3/man/case2101.Rd
   pkg/Sleuth3/man/case2102.Rd
   pkg/Sleuth3/man/case2201.Rd
   pkg/Sleuth3/man/case2202.Rd
   pkg/Sleuth3/man/ex0112.Rd
   pkg/Sleuth3/man/ex0116.Rd
   pkg/Sleuth3/man/ex0125.Rd
   pkg/Sleuth3/man/ex0126.Rd
   pkg/Sleuth3/man/ex0127.Rd
   pkg/Sleuth3/man/ex0211.Rd
   pkg/Sleuth3/man/ex0218.Rd
   pkg/Sleuth3/man/ex0221.Rd
   pkg/Sleuth3/man/ex0222.Rd
   pkg/Sleuth3/man/ex0223.Rd
   pkg/Sleuth3/man/ex0321.Rd
   pkg/Sleuth3/man/ex0323.Rd
   pkg/Sleuth3/man/ex0327.Rd
   pkg/Sleuth3/man/ex0330.Rd
   pkg/Sleuth3/man/ex0331.Rd
   pkg/Sleuth3/man/ex0332.Rd
   pkg/Sleuth3/man/ex0333.Rd
   pkg/Sleuth3/man/ex0428.Rd
   pkg/Sleuth3/man/ex0429.Rd
   pkg/Sleuth3/man/ex0430.Rd
   pkg/Sleuth3/man/ex0431.Rd
   pkg/Sleuth3/man/ex0432.Rd
   pkg/Sleuth3/man/ex0518.Rd
   pkg/Sleuth3/man/ex0523.Rd
   pkg/Sleuth3/man/ex0524.Rd
   pkg/Sleuth3/man/ex0525.Rd
   pkg/Sleuth3/man/ex0623.Rd
   pkg/Sleuth3/man/ex0624.Rd
   pkg/Sleuth3/man/ex0721.Rd
   pkg/Sleuth3/man/ex0722.Rd
   pkg/Sleuth3/man/ex0724.Rd
   pkg/Sleuth3/man/ex0725.Rd
   pkg/Sleuth3/man/ex0726.Rd
   pkg/Sleuth3/man/ex0727.Rd
   pkg/Sleuth3/man/ex0728.Rd
   pkg/Sleuth3/man/ex0729.Rd
   pkg/Sleuth3/man/ex0730.Rd
   pkg/Sleuth3/man/ex0816.Rd
   pkg/Sleuth3/man/ex0817.Rd
   pkg/Sleuth3/man/ex0820.Rd
   pkg/Sleuth3/man/ex0822.Rd
   pkg/Sleuth3/man/ex0823.Rd
   pkg/Sleuth3/man/ex0824.Rd
   pkg/Sleuth3/man/ex0825.Rd
   pkg/Sleuth3/man/ex0826.Rd
   pkg/Sleuth3/man/ex0828.Rd
   pkg/Sleuth3/man/ex0829.Rd
   pkg/Sleuth3/man/ex0914.Rd
   pkg/Sleuth3/man/ex0915.Rd
   pkg/Sleuth3/man/ex0918.Rd
   pkg/Sleuth3/man/ex0920.Rd
   pkg/Sleuth3/man/ex0921.Rd
   pkg/Sleuth3/man/ex0923.Rd
   pkg/Sleuth3/man/ex1014.Rd
   pkg/Sleuth3/man/ex1026.Rd
   pkg/Sleuth3/man/ex1027.Rd
   pkg/Sleuth3/man/ex1028.Rd
   pkg/Sleuth3/man/ex1029.Rd
   pkg/Sleuth3/man/ex1030.Rd
   pkg/Sleuth3/man/ex1031.Rd
   pkg/Sleuth3/man/ex1033.Rd
   pkg/Sleuth3/man/ex1111.Rd
   pkg/Sleuth3/man/ex1120.Rd
   pkg/Sleuth3/man/ex1122.Rd
   pkg/Sleuth3/man/ex1123.Rd
   pkg/Sleuth3/man/ex1124.Rd
   pkg/Sleuth3/man/ex1125.Rd
   pkg/Sleuth3/man/ex1217.Rd
   pkg/Sleuth3/man/ex1220.Rd
   pkg/Sleuth3/man/ex1221.Rd
   pkg/Sleuth3/man/ex1222.Rd
   pkg/Sleuth3/man/ex1223.Rd
   pkg/Sleuth3/man/ex1225.Rd
   pkg/Sleuth3/man/ex1317.Rd
   pkg/Sleuth3/man/ex1319.Rd
   pkg/Sleuth3/man/ex1320.Rd
   pkg/Sleuth3/man/ex1321.Rd
   pkg/Sleuth3/man/ex1416.Rd
   pkg/Sleuth3/man/ex1417.Rd
   pkg/Sleuth3/man/ex1419.Rd
   pkg/Sleuth3/man/ex1420.Rd
   pkg/Sleuth3/man/ex1507.Rd
   pkg/Sleuth3/man/ex1514.Rd
   pkg/Sleuth3/man/ex1515.Rd
   pkg/Sleuth3/man/ex1516.Rd
   pkg/Sleuth3/man/ex1517.Rd
   pkg/Sleuth3/man/ex1518.Rd
   pkg/Sleuth3/man/ex1519.Rd
   pkg/Sleuth3/man/ex1605.Rd
   pkg/Sleuth3/man/ex1611.Rd
   pkg/Sleuth3/man/ex1612.Rd
   pkg/Sleuth3/man/ex1613.Rd
   pkg/Sleuth3/man/ex1614.Rd
   pkg/Sleuth3/man/ex1615.Rd
   pkg/Sleuth3/man/ex1620.Rd
   pkg/Sleuth3/man/ex1708.Rd
   pkg/Sleuth3/man/ex1715.Rd
   pkg/Sleuth3/man/ex1716.Rd
   pkg/Sleuth3/man/ex1914.Rd
   pkg/Sleuth3/man/ex1916.Rd
   pkg/Sleuth3/man/ex1917.Rd
   pkg/Sleuth3/man/ex1918.Rd
   pkg/Sleuth3/man/ex1919.Rd
   pkg/Sleuth3/man/ex1921.Rd
   pkg/Sleuth3/man/ex1922.Rd
   pkg/Sleuth3/man/ex1923.Rd
   pkg/Sleuth3/man/ex2011.Rd
   pkg/Sleuth3/man/ex2012.Rd
   pkg/Sleuth3/man/ex2015.Rd
   pkg/Sleuth3/man/ex2016.Rd
   pkg/Sleuth3/man/ex2017.Rd
   pkg/Sleuth3/man/ex2018.Rd
   pkg/Sleuth3/man/ex2019.Rd
   pkg/Sleuth3/man/ex2115.Rd
   pkg/Sleuth3/man/ex2116.Rd
   pkg/Sleuth3/man/ex2117.Rd
   pkg/Sleuth3/man/ex2118.Rd
   pkg/Sleuth3/man/ex2119.Rd
   pkg/Sleuth3/man/ex2120.Rd
   pkg/Sleuth3/man/ex2216.Rd
   pkg/Sleuth3/man/ex2220.Rd
   pkg/Sleuth3/man/ex2222.Rd
   pkg/Sleuth3/man/ex2223.Rd
   pkg/Sleuth3/man/ex2224.Rd
   pkg/Sleuth3/man/ex2225.Rd
   pkg/Sleuth3/man/ex2226.Rd
   pkg/Sleuth3/man/ex2414.Rd
Modified:
   pkg/Sleuth3/DESCRIPTION
   pkg/Sleuth3/data/ex0721.rda
   pkg/Sleuth3/data/ex0816.rda
   pkg/Sleuth3/data/ex1516.rda
   pkg/Sleuth3/inst/doc/Sleuth3-manual.pdf
   pkg/Sleuth3/man/case0102.Rd
   pkg/Sleuth3/man/case0202.Rd
   pkg/Sleuth3/man/case0501.Rd
   pkg/Sleuth3/man/case0502.Rd
   pkg/Sleuth3/man/case0601.Rd
   pkg/Sleuth3/man/case0602.Rd
   pkg/Sleuth3/man/case0701.Rd
   pkg/Sleuth3/man/case0702.Rd
   pkg/Sleuth3/man/case0801.Rd
   pkg/Sleuth3/man/case0902.Rd
   pkg/Sleuth3/man/case1101.Rd
   pkg/Sleuth3/man/case1102.Rd
   pkg/Sleuth3/man/case1201.Rd
   pkg/Sleuth3/man/case1202.Rd
Log:
Sleuth3:
Replaced .Rd files with new versions provided by Dan and added all the
new .Rd files.
Changed names in data files to agree with documentation, or to delete
variables that contained only NA's.
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-08-03 16:26:35 UTC (rev 37)
+++ pkg/Sleuth3/DESCRIPTION	2012-08-24 14:47:28 UTC (rev 38)
@@ -1,7 +1,7 @@
 Package: Sleuth3
 Title: Data sets from Ramsey and Schafer's "Statistical Sleuth (3rd ed)"
-Version: 0.0-5
-Date: 2012-08-03
+Version: 0.0-6
+Date: 2012-08-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. (2013), "The
@@ -9,7 +9,7 @@
     ed)", Cengage Learning. 
 Maintainer: Berwin A Turlach <Berwin.Turlach at gmail.com>
 LazyData: yes
-Depends: R (>= 2.12.0)
-Suggests: lattice, multcomp, car, leaps
+Depends: R (>= 2.15.0)
+Suggests: lattice, multcomp, car, leaps, CCA, Hmisc
 License: GPL (>= 2)
 URL: http://r-forge.r-project.org/projects/sleuth2/

Modified: pkg/Sleuth3/data/ex0721.rda
===================================================================
(Binary files differ)

Modified: pkg/Sleuth3/data/ex0816.rda
===================================================================
(Binary files differ)

Modified: pkg/Sleuth3/data/ex1516.rda
===================================================================
(Binary files differ)

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

Modified: pkg/Sleuth3/man/case0102.Rd
===================================================================
--- pkg/Sleuth3/man/case0102.Rd	2012-08-03 16:26:35 UTC (rev 37)
+++ pkg/Sleuth3/man/case0102.Rd	2012-08-24 14:47:28 UTC (rev 38)
@@ -27,7 +27,7 @@
   School of Business.
 }
 \seealso{
-  \code{\link{case1202}}
+  \code{\link{case1202}}, \code{\link{ex1216}}
 }
 \examples{
 attach(case0102)

Modified: pkg/Sleuth3/man/case0202.Rd
===================================================================
--- pkg/Sleuth3/man/case0202.Rd	2012-08-03 16:26:35 UTC (rev 37)
+++ pkg/Sleuth3/man/case0202.Rd	2012-08-24 14:47:28 UTC (rev 38)
@@ -37,7 +37,7 @@
 
 diff <- Unaffected-Affected    
 summary(diff)
-t.test(diff) # Paired t-test is a one-sample t-test on differnces 
+t.test(diff) # Paired t-test is a one-sample t-test on differences 
 t.test(Unaffected,Affected,pair=TRUE)  # Alternative coding for the same test 
 
 boxplot(diff,       

Modified: pkg/Sleuth3/man/case0501.Rd
===================================================================
--- pkg/Sleuth3/man/case0501.Rd	2012-08-03 16:26:35 UTC (rev 37)
+++ pkg/Sleuth3/man/case0501.Rd	2012-08-24 14:47:28 UTC (rev 38)
@@ -68,9 +68,9 @@
           "dietRR50  - dietNR50 = 0",
           "dietlopro - dietNR50 = 0",
           "dietNN85  - dietNP   = 0")   ) 
+ }
   summary(myComparisons,test=adjusted("none")) # No multiple comparison adjust.
   confint(myComparisons, calpha = univariate_calpha()) # No adjustment
- }
 
 ## EXAMPLE 5: BOXPLOTS FOR PRESENTATION  
 boxplot(Lifetime ~ myDiet, ylab= "Lifetime (months)", names=myNames,

Modified: pkg/Sleuth3/man/case0502.Rd
===================================================================
--- pkg/Sleuth3/man/case0502.Rd	2012-08-03 16:26:35 UTC (rev 37)
+++ pkg/Sleuth3/man/case0502.Rd	2012-08-24 14:47:28 UTC (rev 38)
@@ -37,6 +37,9 @@
   Women: Statistics and the Law \emph{in} Tanur, J.M. et al. (eds.)
   \emph{Statistics: A Guide to the Unknown}, Holden-Day. 
 }
+\seealso{
+  \code{\link{ex2214}}
+}
 \examples{
 str(case0502)  
 attach(case0502) 
@@ -63,9 +66,9 @@
   myContrast    <- rbind(c(1/6, 1/6, 1/6, 1/6, 1/6, 1/6, - 1))
 if(require(multcomp)){  # use multcomp library
   myComparison  <- glht(myAov3, linfct=myContrast) 
+}
   summary(myComparison, test=adjusted("none"))   
   confint(myComparison) 
-}
 
 ## BOXPLOTS FOR PRESENTATION   
 boxplot(Percent ~ Judge,  ylab= "Percent of Women on Judges' Venires",

Modified: pkg/Sleuth3/man/case0601.Rd
===================================================================
--- pkg/Sleuth3/man/case0601.Rd	2012-08-03 16:26:35 UTC (rev 37)
+++ pkg/Sleuth3/man/case0601.Rd	2012-08-24 14:47:28 UTC (rev 38)
@@ -49,29 +49,29 @@
 ## COMPARE MEAN QUALIFICATION SCORE OF EVERY HANDICAP GROUP TO "NONE"  
 if(require(multcomp)){     # Use the multcomp library
   myDunnett  <- glht(myAov, linfct = mcp(myHandicap = "Dunnett"))  
-  summary(myDunnett) 
-  confint(myDunnett,level=.95) 
-  opar <- par(no.readonly=TRUE)  # Save current graphics parameter settings
-  par(mar=c(4.1,8.1,4.1,1.1)) # Change margins 
-  plot(myDunnett, 
-    xlab="Difference in Mean Qualification Score (and Dunnet-adjusted CIs)") 
-  par(opar)  # Restore original graphics parameter settings
-}
+} 
+summary(myDunnett) 
+confint(myDunnett,level=.95) 
+opar <- par(no.readonly=TRUE)  # Save current graphics parameter settings
+par(mar=c(4.1,8.1,4.1,1.1)) # Change margins 
+plot(myDunnett, 
+  xlab="Difference in Mean Qualification Score (and Dunnet-adjusted CIs)") 
+par(opar)  # Restore original graphics parameter settings
 
 ## COMPARE EVERY MEAN TO EVERY OTHER MEAN
 if(require(multcomp)){   # Use the multcomp library
   myTukey   <- glht(myAov, linfct = mcp(myHandicap = "Tukey"))  
+}
 summary(myTukey) 
-}
 
 ## TEST THE CONTRAST OF DISPLAY 6.4
 myAov2        <- aov(Score ~ myHandicap - 1)    
 myContrast    <- rbind(c(0, -1/2, 1/2, -1/2, 1/2)) 
 if(require(multcomp)){   # Use the multcomp library
   myComparison  <- glht(myAov2, linfct=myContrast)
-  summary(myComparison, test=adjusted("none"))  
-  confint(myComparison)  
-}  
+  }  
+summary(myComparison, test=adjusted("none"))  
+confint(myComparison)  
 
 
 # BOXPLOTS FOR PRESENTATION   

Modified: pkg/Sleuth3/man/case0602.Rd
===================================================================
--- pkg/Sleuth3/man/case0602.Rd	2012-08-03 16:26:35 UTC (rev 37)
+++ pkg/Sleuth3/man/case0602.Rd	2012-08-24 14:47:28 UTC (rev 38)
@@ -34,6 +34,9 @@
   Basolo, A.L. (1990).  Female Preference Predates the Evolution of the
   Sword in Swordtail Fish, \emph{Science} \bold{250}: 808--810.  
 }
+\seealso{
+  \code{\link{ex0821}}
+}
 \examples{
 str(case0602)  
 attach(case0602)   
@@ -53,8 +56,8 @@
 myContrast    <- rbind(c(5, -3, 1, 3, -9, 3))  
 if(require(multcomp)){   # Use the multcomp library  
   myComparison  <- glht(myAov2, linfct=myContrast)    
-  summary(myComparison, test=adjusted("none")) 
 }
+summary(myComparison, test=adjusted("none")) 
 
 
 # Simpler exploration of linear effect, via regression (Ch. 7)

Modified: pkg/Sleuth3/man/case0701.Rd
===================================================================
--- pkg/Sleuth3/man/case0701.Rd	2012-08-03 16:26:35 UTC (rev 37)
+++ pkg/Sleuth3/man/case0701.Rd	2012-08-24 14:47:28 UTC (rev 38)
@@ -23,7 +23,7 @@
     of Science} \bold{15}: 168--173.
 }
 \seealso{
-  \code{\link{ex0727}}
+  \code{\link{ex0725}}
 }
 \examples{
 str(case0701) 

Modified: pkg/Sleuth3/man/case0702.Rd
===================================================================
--- pkg/Sleuth3/man/case0702.Rd	2012-08-03 16:26:35 UTC (rev 37)
+++ pkg/Sleuth3/man/case0702.Rd	2012-08-24 14:47:28 UTC (rev 38)
@@ -26,7 +26,7 @@
   Extended to Nonlinear Models, \emph{Biometrics} \bold{47}(2): 563--574.
 }
 \seealso{
-  \code{\link{ex0816}}
+  \code{\link{ex0816}}, \code{\link{ex0913}}
 }
 \examples{
 str(case0702)

Modified: pkg/Sleuth3/man/case0801.Rd
===================================================================
--- pkg/Sleuth3/man/case0801.Rd	2012-08-03 16:26:35 UTC (rev 37)
+++ pkg/Sleuth3/man/case0801.Rd	2012-08-24 14:47:28 UTC (rev 38)
@@ -21,6 +21,9 @@
 \references{
   Wilson, E.O., 1992, \bold{The Diversity of Life}, W. W. norton, N.Y.
 }
+\seealso{
+  \code{\link{ex0815}}
+}
 \examples{
 str(case0801)
 attach(case0801)

Modified: pkg/Sleuth3/man/case0902.Rd
===================================================================
--- pkg/Sleuth3/man/case0902.Rd	2012-08-03 16:26:35 UTC (rev 37)
+++ pkg/Sleuth3/man/case0902.Rd	2012-08-24 14:47:28 UTC (rev 38)
@@ -23,7 +23,7 @@
     Course in Methods of Data Analysis (3rd ed)}, Cengage Learning.
 }
 \seealso{
-  \code{\link{case0902}}
+  \code{\link{ex0912}}, \code{\link{ex0913}}
 }
 \examples{
 str(case0902)
@@ -33,7 +33,7 @@
 myMatrix      <- cbind(Brain, Body, Litter, Gestation)  
 if(require(car)){   # Use the car library
 scatterplotMatrix(myMatrix,   # Matrix of scatterplots
-  smooth=F,    # Omit scatterplot smoother on plots
+  smooth=FALSE,    # Omit scatterplot smoother on plots
   diagonal="histogram") # Draw histograms on diagonals
   } 
 myLm <- lm(Brain ~ Body + Litter + Gestation)
@@ -43,7 +43,7 @@
 logGestation  <- log(Gestation)
 myMatrix2 <- cbind(logBrain,logBody,Litter, logGestation) 
 if(require(car)){   # Use the car library
-  scatterplotMatrix(myMatrix2, smooth=F, diagonal="histogram")  
+  scatterplotMatrix(myMatrix2, smooth=FALSE, diagonal="histogram")  
 }
 myLm2 <- lm(logBrain ~ logBody + Litter + logGestation)
 plot(myLm2,which=1)  # Residual plot.

Modified: pkg/Sleuth3/man/case1101.Rd
===================================================================
--- pkg/Sleuth3/man/case1101.Rd	2012-08-03 16:26:35 UTC (rev 37)
+++ pkg/Sleuth3/man/case1101.Rd	2012-08-24 14:47:28 UTC (rev 38)
@@ -24,6 +24,9 @@
   Ramsey, F.L. and Schafer, D.W. (2013). \emph{The Statistical Sleuth: A
     Course in Methods of Data Analysis (3rd ed)}, Cengage Learning.
 }
+\seealso{
+  \code{\link{ex1116}}
+}
 \examples{
 str(case1101)
 attach(case1101)
@@ -85,4 +88,4 @@
 
 detach(case1101)
 }
-\keyword{datasets}
\ No newline at end of file
+\keyword{datasets}

Modified: pkg/Sleuth3/man/case1102.Rd
===================================================================
--- pkg/Sleuth3/man/case1102.Rd	2012-08-03 16:26:35 UTC (rev 37)
+++ pkg/Sleuth3/man/case1102.Rd	2012-08-24 14:47:28 UTC (rev 38)
@@ -28,6 +28,9 @@
   Ramsey, F.L. and Schafer, D.W. (2013). \emph{The Statistical Sleuth: A
     Course in Methods of Data Analysis (3rd ed)}, Cengage Learning.
 }
+\seealso{
+  \code{\link{ex1117}}, \code{\link{ex1118}}, \code{\link{ex1119}}, \code{\link{ex1214}}, \code{\link{ex1215}}
+}
 \examples{
 str(case1102)
 attach(case1102)
@@ -38,7 +41,7 @@
 myMatrix <- cbind (logRatio, Days, Weight, Loss, Tumor, logTime)
 if(require(car)){   # Use the car library
 scatterplotMatrix(myMatrix,groups=Treatment,
-  smooth=F, diagonal="histogram", col=c("green","blue"),pch=c(16,17),cex=1.5)
+  smooth=FALSE, diagonal="histogram", col=c("green","blue"), pch=c(16,17), cex=1.5)
 }
  
 myLm1 <- lm(logRatio ~ Treatment + logTime + Days + Sex + Weight + Loss + Tumor)

Modified: pkg/Sleuth3/man/case1201.Rd
===================================================================
--- pkg/Sleuth3/man/case1201.Rd	2012-08-03 16:26:35 UTC (rev 37)
+++ pkg/Sleuth3/man/case1201.Rd	2012-08-24 14:47:28 UTC (rev 38)
@@ -39,7 +39,7 @@
 logTakers  <- log(Takers)
 myMatrix   <- cbind(SAT, logTakers,Income, Years, Public, Expend, Rank)
 if(require(car)){   # Use the car library   
-scatterplotMatrix(myMatrix, diagonal="histogram", smooth=F)  
+scatterplotMatrix(myMatrix, diagonal="histogram", smooth=FALSE)  
   }                  
 State[Public < 50] # Identify state with low Public (Louisiana)
 State[Expend > 40] # Alaska

Modified: pkg/Sleuth3/man/case1202.Rd
===================================================================
--- pkg/Sleuth3/man/case1202.Rd	2012-08-03 16:26:35 UTC (rev 37)
+++ pkg/Sleuth3/man/case1202.Rd	2012-08-24 14:47:28 UTC (rev 38)
@@ -31,7 +31,7 @@
   School of Business.
 }
 \seealso{
-  \code{\link{case0102}}
+  \code{\link{case0102}}, \code{\link{ex1216}}
 }
 \examples{
 str(case1202)
@@ -41,7 +41,7 @@
 logSal <- log(Bsal)    
 myMatrix <- cbind (logSal, Senior,Age, Educ, Exper)   
 if(require(car)){   # Use the car library
-  scatterplotMatrix(myMatrix, smooth=F, diagonal="histogram",
+  scatterplotMatrix(myMatrix, smooth=FALSE, diagonal="histogram",
                     groups=Sex, col=c("red","blue") )   
 }                                
 myLm1 <- lm(logSal ~ Senior + Age + Educ + Exper + Sex)

Added: pkg/Sleuth3/man/case1501.Rd
===================================================================
--- pkg/Sleuth3/man/case1501.Rd	                        (rev 0)
+++ pkg/Sleuth3/man/case1501.Rd	2012-08-24 14:47:28 UTC (rev 38)
@@ -0,0 +1,99 @@
+\name{case1501}
+\alias{case1501}
+\docType{data}
+\title{Logging and Water Quality}
+\description{
+  Data from an observational study of nitrate levels measured at three
+  week intervals for five years in two watersheds. One of the watersheds
+  was undisturbed and the other had been logged with a patchwork
+  pattern. 
+}
+\usage{case1501}
+\format{
+  A data frame with 88 observations on the following 3 variables.
+  \describe{
+    \item{\code{Week}}{week after the start of the study}
+    \item{\code{Patch}}{natural logarithm of nitrate level (ppm) in 
+       the logged watershed (ppm)} 
+    \item{\code{NoCut}}{natural logarithm of nitrate level in the 
+       undisturbed watershed (ppm)} 
+  }
+}
+\source{
+  Ramsey, F.L. and Schafer, D.W. (2013). \emph{The Statistical Sleuth: A
+    Course in Methods of Data Analysis (3rd ed)}, Cengage Learnings.
+}
+\references{
+  Harr, R.D., Friderksen, R.L., and Rothacher, J. (1979). Changes in
+  Streamflow Following Timber Harvests in Southwestern Oregon, USDA/USFS
+  Research Paper PNW-249, Pacific NW Forest and Range Experiment
+  Station, Portland, Oregon. 
+}
+\examples{
+str(case1501)
+attach(case1501)
+
+## EXPLORATION
+opar <- par(no.readonly=TRUE)  # Store current graphics parameters settings
+par(mfrow=c(2,1))   # Set graphics parameters: 2 row, 1 column layout
+plot(NoCut ~ Week,  type="b", ylab="Log of Nitrate Concentration; NoCut")
+abline(h=mean(NoCut))  # Horizontal line at the mean
+plot(Patch ~ Week,  type="b", ylab="Log of Nitrate Concentration; Patch Cut")         
+abline(h=mean(Patch))
+ 
+par(opar) # Restore previous graphics settings
+lag.plot(NoCut,do.lines=FALSE)  # Lag plot for NoCut
+lag.plot(Patch,do.lines=FALSE)  # Lag plot for Patch
+pacf(NoCut)  # partial autocorrelation function plot; noCut
+pacf(Patch)  # partial autocorrelation function plot; Patch
+
+## INFERENCE  (2-sample comparison, accounting for first serial correlation)
+diff     <- mean(Patch) - mean(NoCut)
+nPatch   <- length(Patch)  # length of Patch series
+nNoCut   <- length(NoCut)   # length of NoCut series
+acfPatch <- acf(Patch, type="covariance")  # auto covariances for Patch series
+c0Patch  <- acfPatch$acf[1]*nPatch/(nPatch-1) # variance; n-1 divisor (Patch) 
+c1Patch  <- acfPatch$acf[2]*nPatch/(nPatch-1) # autocov; n-1 divisor (Patch)  
+acfNoCut <- acf(NoCut, type="covariance") # auto covariances for NoCut series
+c0NoCut  <- acfNoCut$acf[1]*nNoCut/(nNoCut - 1) # variance; n-1 divisor (NoCut)
+c1NoCut  <- acfNoCut$acf[2]*nNoCut/(nNoCut - 1) # autocov; n-1 divisor (NoCut) 
+dfPatch  <- nPatch - 1     # DF (n-1); Patch
+dfNoCut  <- nNoCut - 1     # DF (n-1); NoCut
+
+c0Pooled   <- (dfPatch*c0Patch + dfNoCut*c0NoCut)/(dfPatch + dfNoCut)
+c0Pooled   #[1] 1.413295  = pooled estimate of variance
+c1Pooled   <- (dfPatch*c1Patch + dfNoCut*c1NoCut)/(dfPatch + dfNoCut)
+c1Pooled   #[1] 0.9103366 = pooled estimate of lag 1 covariance
+
+# Pooled estimate of first serial correlation coefficient:
+r1 <- c1Pooled/c0Pooled                  #[1] 0.6441233
+SEdiff  <- sqrt((1 + r1)/(1-r1))*sqrt(c0Pooled*(1/nPatch + 1/nNoCut))    
+
+# t-test and confidence interval
+tStat      <- diff/SEdiff #[1] 0.2713923
+pValue     <- 1 - pt(tStat,dfPatch + dfNoCut)     # One-sided p-value   
+halfWidth  <- qt(.975,dfPatch + dfNoCut)*SEdiff   # half width of 95% CI
+diff + c(-1,1)*halfWidth  #95% CI -0.6557578  0.8648487
+
+## GRAPHICAL DISPLAY FOR PRESENTATION  
+par(mfrow=c(1,1))                   # Reset mfrow to a single plot per page
+plot(exp(Patch) ~ Week, # Use exp(Patch) to show results in original units
+  log="y", type="b", xlab="Weeks After Logging",
+  ylab="Nitrate Concentration in Watershed Runoff (ppm)",
+  main="Nitrate Series in Patch-Cut and Undisturbed Watersheds",
+  pch=21, col="dark green", lwd=3, bg="green", cex=1.3 ) 
+points(exp(NoCut) ~ Week, pch=24, col="dark blue", lwd=3, bg="orange",cex=1.3)
+lines(exp(NoCut) ~ Week, lwd=3, col="dark blue",lty=3)            
+abline(h=exp(mean(Patch)),col="dark green",lwd=2)
+abline(h=exp(mean(NoCut)),col="dark blue", lwd=2,lty=2)
+legend(205,100,legend=c("Patch Cut", "Undisturbed"),
+  pch=c(21,24), col=c("dark green","dark blue"), pt.bg = c("green","orange"),
+  pt.cex=c(1.3,1.3), lty=c(1,3), lwd=c(3,3))
+text(-1, 8.5, "Mean",col="dark green")
+text(-1,6.3,"Mean", col="dark blue")
+
+
+detach(case1501)
+}
+\keyword{datasets}
+


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

Added: pkg/Sleuth3/man/case1502.Rd
===================================================================
--- pkg/Sleuth3/man/case1502.Rd	                        (rev 0)
+++ pkg/Sleuth3/man/case1502.Rd	2012-08-24 14:47:28 UTC (rev 38)
@@ -0,0 +1,75 @@
+\name{case1502}
+\alias{case1502}
+\docType{data}
+\title{Global Warming}
+\description{
+  The data are the temperatures (in degrees Celsius) averaged for the
+  northern hemisphere over a full year, for years 1850 to 2010. The
+  161-year average temperature has been subtracted, so each observation
+  is the temperature difference from the series average. 
+}
+\usage{case1502}
+\format{
+  A data frame with 161 observations on the following 2 variables.
+  \describe{
+    \item{\code{Year}}{year in which yearly average temperature was computed,
+      from 1850 to 2010} 
+    \item{\code{Temperature}}{northern hemisphere temperature minus the 161-year
+      average (degrees Celsius)} 
+  }
+}
+\source{
+  Ramsey, F.L. and Schafer, D.W. (2013). \emph{The Statistical Sleuth: A
+    Course in Methods of Data Analysis (3rd ed)}, Cengage Learning.
+}
+\references{
+  Jones, P.D., D. E. Parker, T. J. Osborn, and K. R. Briffa, (2011) Global 
+  and Hemispheric Temperature Anomalies and and Marine Instrumental Records,
+  CDIAC, http://cdiac.ornl.gov/trends/temp/jonescru/jones.html, August 4, 2011. 
+}
+\seealso{
+  \code{\link{ex1519}}
+}
+\examples{
+str(case1502)
+attach(case1502)
+
+## EXPLORATION AND MODEL BUILDING
+plot(Temperature ~ Year, type="b")  # Type = "b" for *both* points and lines
+
+yearSquared <- Year^2
+yearCubed <- Year^3
+myLm1 <- lm(Temperature ~ Year + yearSquared + yearCubed)
+res1 <- myLm1$res
+myPacf <- pacf(res1)  # Partial autocorrelation from residuals
+r1 <- myPacf$acf[1]  #First serial correlation coefficient    
+n <- length(Temperature)   # Series length = 161
+v <- Temperature[2:n]  -  r1*Temperature[1:(n-1)]   # Filtered response
+ones <- rep(1-r1, n-1)   # make a variable of all 1's
+u1 <- Year[2:n]          -  r1*Year[1:(n-1)]   # Filtered "ones"
+u2 <- yearSquared[2:n]  -  r1*yearSquared[1:(n-1)]  # Filtered X1
+u3 <- yearCubed[2:n]    -  r1*yearCubed[1:(n-1)]  # Filtered X2
+myLm2 <- lm(v ~  u1 + u2 + u3 )
+res2 <- myLm2$res                                       
+pacf(res2)   # Looks fine; don't worry about lag 4 marginal significance
+plot(myLm2, which=1)  # Residual plot
+summary(myLm2) # Cubic term isn't needed.
+myLm3    <- update(myLm2, ~ . - u3) # Drop cubic term
+
+## INFERENCE
+summary(myLm3) # Everything remaining is statistically significant.
+
+## GRAPHICAL DISPLAY FOR PRESENTATION
+plot(Temperature ~ Year, xlab="Year",
+  ylab=expression(paste("Annual Average Temperature (Difference From Average), ",
+  degree,"C")),main="Annual Average Temperature in Northern Hemisphere; 1850-2010",
+  type="b", pch=21, lwd=2, bg="green", cex=1.5)    
+myFits <- myLm3$fit
+lines(myFits ~ Year[2:161], col="blue", lwd=2)  
+legend(1850,0.6,"Quadratic Regression Fit, Adjusted for AR(1) Serial Correlation",
+  col="blue", lwd=2, box.lty=0)
+
+detach(case1502)
+
+}
+\keyword{datasets}


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

Added: pkg/Sleuth3/man/case1601.Rd
===================================================================
--- pkg/Sleuth3/man/case1601.Rd	                        (rev 0)
+++ pkg/Sleuth3/man/case1601.Rd	2012-08-24 14:47:28 UTC (rev 38)
@@ -0,0 +1,110 @@
+\name{case1601}
+\alias{case1601}
+\docType{data}
+\title{Sites of Short- and Long-Term Memory}
+\description{
+  Researchers taught 18 monkeys to distinguish each of 100 pairs of
+  objects, 20 pairs each at 16, 12, 8, 4, and 2 weeks prior to a
+  treatment.  After this training, they blocked access to the
+  hippocampal formation in 11 of the monkeys. All monkeys were then
+  tested on their ability to distinguish the objects. The
+  five-dimensional response for each monkey is the number of correct
+  objects distinguished among those taught at 16, 12, 8, 4, and 2 weeks
+  prior to treatment. 
+}
+\usage{case1601}
+\format{
+  A data frame with 18 observations on the following 7 variables.
+  \describe{
+    \item{\code{Monkey}}{Monkey name}
+    \item{\code{Treatment}}{a treatment factor with levels \code{"Control"} and
+      \code{"Treated"}} 
+    \item{\code{Week2}}{percentage of 20 objects taught 2 weeks prior to
+      treatment that were correctly distinguished in the test} 
+    \item{\code{Week4}}{percentage of 20 objects taught 4 weeks prior to
+      treatment that were correctly distinguished in the test} 
+    \item{\code{Week8}}{percentage of 20 objects taught 8 weeks prior to
+      treatment that were correctly distinguished in the test} 
+    \item{\code{Week12}}{ percentage of 20 objects taught 12 weeks prior to
+      treatment that were correctly distinguished in the test} 
+    \item{\code{Week16}}{percentage of 20 objects taught 16 weeks prior to
+      treatment that were correctly distinguished in the test} 
+  }
+}
+\source{
+  Ramsey, F.L. and Schafer, D.W. (2013). \emph{The Statistical Sleuth: A
+    Course in Methods of Data Analysis (3rd ed)}, Cengage Learning.
+}
+\references{
+  Sola-Morgan, S. M. and Squire, L. R. (1990). The Primate Hippocampal
+  Formation: Evidence for a Time-limited Role in Memory Storage, \emph{Science}
+  \bold{250}: 288--290. 
+}
+\examples{
+str(case1601)
+attach(case1601)
+
+## EXPLORATION 
+short <- (Week2 + Week4)/2
+long  <- (Week8 + Week12 + Week16)/3
+myPointCode <- ifelse(Treatment=="Control",15,16)
+myPointColor <- ifelse(Treatment=="Control","orange","green")
+plot(long ~ short, pch=myPointCode, col=myPointColor, cex=2)
+abline(h=mean(long),lty=2)
+abline(v=mean(short),lty=2)
+identify(short,long,labels=Monkey)   # Identify outliers; press Esc when done
+
+## INFERENCE USING HOTELLING's T-SQUARED TEST
+myLm1     <- lm(cbind(short,long) ~ Treatment)  # Full model
+myLm2     <- lm(cbind(short,long) ~ 1) # Reduced model, with only intercept
+anova(myLm2, myLm1, test="Hotelling") # p-value for Treatment effect
+# confidence intervals
+n1  <- sum(Treatment=="Control")  # 7 control monkeys
+n2  <- sum(Treatment=="Treated")  # 11 treated monkeys
+multiplier    <- sqrt(2*((n1+n2-2)/(n1+n2-3))*qf(.95,2,n1+n2-3)) # Sleuth p. 492
+summary(myLm1)
+shortEffect   <- myLm1$coef[2,1] # Difference in sample averages; Short
+seShortEffect <- 3.352   # Read this from summary(myLm1)
+halfWidth <- multiplier*seShortEffect  # Half width of 95\% confidence interval
+shortEffect + c(-1,1)*halfWidth #95\% CI for effect of treatment on Short
+ longEffect    <- myLm1$coef[2,2] # Difference in sample averages; Long
+seLongEffect  <- 3.2215  # Read this from summary(myLm1)
+halfWidth     <- multiplier*seLongEffect # Half width of 95\% confidence interval  
+longEffect + c(-1,1)*halfWidth  #95\% CI for effect of treatment on Long
+
+
+## GRAPHICAL DISPLAY FOR PRESENTATION
+myPointCode   <- ifelse(Treatment=="Control",21,22)
+myPointColor  <- ifelse(Treatment=="Control","green","orange")
+plot(long ~ jitter(short),
+  xlab="Short-Term Memory Score (Percent Correct)",
+  ylab="Long-Term Memory Score (Percent Correct)",
+  main="Memory Scores for 11 Hippocampus-Blocked and 7 Control Monkeys",
+  pch=myPointCode, bg=myPointColor, cex=2.5, lwd=3)
+identify(short,long,labels=Monkey)  #  Label the outliers; press Esc when done
+legend(52,54,legend=c("Control","Hippocampus Blocked"), pch=c(21,22), 
+  pt.bg=c("green","orange"), pt.cex=c(2.5,2.5), pt.lwd=c(3,3), cex=1.5)
+
+  
+## ADVANCED: RANDOMIZATION TEST FOR EQUALITY OF BIVARIATE RESPONSES  
+myAnova <- anova(myLm2, myLm1, test="Hotelling") #Hotelling Test for Treatment 
+myAnova$approx[2]        #[1] 12.32109:  F-statistic 
+numRep <- 50 # Number of random regroupings (change to 50,000)
+FStats <- rep(0,numRep)  # Initialize a variable for storing the F-statistics
+myLmReduced <- lm(cbind(short,long) ~ 1)# Fit the reduced model once
+for (rep in 1:numRep) {  # Do the following commands in parenthese num.rep times
+  randomGroup <- rep("Group1",18) # Set randomGroup initially to all "Group1" 
+  randomGroup[sample(1:18,7)]  <- "Group2" # Change 7 at random to "Group2"
+  randomGroup <- factor(randomGroup)  # Make the character variable a factor
+  myLmFull <- lm(cbind(short,long) ~ randomGroup)  # Fit full model
+  myAnova2  <- anova(myLmReduced, myLmFull, test="Hotelling") # Hotelling's T-Squared test 
+  FStats[rep] <- myAnova2$approx[2]   # Store the F-statistic 
+}  # If numRep = 50,000, go get a cup of coffee while you wait for this.
+hist(FStats, main="Approx. Randomizatin Dist of F-stat if No Treatment Effect")          # Histogram of F-statistics from random regroupings 
+abline(v=12.32109)    # Show actually observed Hotelling F-statistic
+pValue <- sum(FStats >= 12.32109)/numRep
+pValue  # Approximate randomization test p-value (no distributional assumptions)
+
+detach(case1601)
+}
+\keyword{datasets}


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

Added: pkg/Sleuth3/man/case1602.Rd
===================================================================
--- pkg/Sleuth3/man/case1602.Rd	                        (rev 0)
+++ pkg/Sleuth3/man/case1602.Rd	2012-08-24 14:47:28 UTC (rev 38)
@@ -0,0 +1,84 @@
+\name{case1602}
+\alias{case1602}
+\docType{data}
+\title{Oat Bran and Cholesterol}
+\description{
+  In a randomized, double-blind, crossover experiment, researchers
+  randomly assigned 20 volunteer hospital employees to either a
+  low-fiber or low-fiber treatment group. The subjects followed the
+  diets for six weeks. After two weeks on their normal diet, all
+  patients crossed over to the other treatment group for another six
+  weeks.  The total serum cholesterol (in mg/dl) was measured on each
+  patient before the first treatment, at the end of the first six week
+  treatment, and at the end of the second six week treatment. 
+}
+\usage{case1602}
+\format{
+  A data frame with 20 observations on the following 4 variables.
+  \describe{
+    \item{\code{Baseline}}{total serum cholesterol before treatment}
+    \item{\code{HiFiber}}{total serum cholesterol after the high fiber diet}
+    \item{\code{LoFiber}}{total serum cholesterol after the low fiber diet}
+    \item{\code{Order}}{factor to identify order of treatment, with two
+      levels \code{"HL"} and \code{"LH"}}
+  }
+}
+\source{
+  Ramsey, F.L. and Schafer, D.W. (2013). \emph{The Statistical Sleuth: A
+    Course in Methods of Data Analysis (3rd ed)}, Cengage Learning.
+}
+\references{
+  Swain, J.F., Rouse, I.L., Curley, C.B., and Sacks, F.M. (1990).
+  Comparison of the Effects of Oat Bran and Low-fiber 
+  Wheat on Serum Lipoprotein Levels and Blood Pressure, \emph{New England
+  Journal of Medicine} \bold{320}: 1746--1747. 
+}
+\examples{
+str(case1602)
+attach(case1602)
+   
+## EXPLORATION
+highMinusBase <- HiFiber-Baseline  
+highMinusLow  <- HiFiber-LoFiber  
+plot(highMinusBase ~ highMinusLow)
+abline(h=0) # Horizontal line at 0
+abline(v=0) # Vertical line at 0
+# Hotelling 2-sample t-test for order effect on bivariate response:
+myLm1    <- lm(cbind(highMinusBase,highMinusLow) ~ Order )   # Full model
+myLm2    <- update(myLm1, ~ . - Order)  # Reduced model withour Order effect
+anova(myLm2, myLm1, test="Hotelling") # p-value for Order effect
+
+
+## INFERENCE: HOTELLING ONE-SAMPLE TEST THAT MEAN OF BIVARIATE RESPONSE IS (0,0)
+myLm3    <- lm(cbind(highMinusBase, highMinusLow) ~ 1)   # Full model 
+myLm4    <- update(myLm3, ~ . - 1) # Reduced model (with both means = 0)
+anova(myLm4, myLm3, test="Hotelling")  # test that the bivariate mean is (0,0)
+# Confidence intervals
+summary(myLm3)  
+HighMinusBase <-  myLm3$coef[1] # -13.850
+seHighMinusBase <- 3.533  # Standard error, read from summary(myLm3)
+HighMinusLow <- myLm3$coef[2] #  -0.850
+seHighMinusLow <- 3.527 # Standard error, read from summary(myLm3)
+n <- length(highMinusBase)  # 20: sample size
+multiplier <-    sqrt(2*((n-1)/(n-2))*qf(.95,2,n-2))   # See Sleuth, page 495 
+HighMinusBase + c(-1,1)*multiplier*seHighMinusBase # 95% CI for High - Base
+HighMinusLow + c(-1,2)*multiplier*seHighMinusLow   # 95% CI for High - Low)
+
+
+## GRAPHICAL DISPLAY FOR PRESENTATION
+lowMinusBase  <- LoFiber - Baseline    
+myPointCode   <- ifelse(Order== "HL",21,22) 
+myPointColor  <- ifelse(Order== "HL","green","light blue")  
+plot(highMinusBase ~ lowMinusBase,
+  xlab="Cholesterol Change (from Baseline) After High Fiber Diet (mg/dl)",
+  ylab="Cholesterol Change (From Baseline) After Low Fiber Diet (mg/dl)",
+  main="Cholesterol Effects of High- and Low-Cholesterol Diets on 20 Subjects",
+  ylim=c(-45,20), pch=myPointCode, bg=myPointColor, cex=2.5, lwd=2)  
+abline(h=0)  # Horizontal line at 0
+abline(v=0) # Vertical line at 0
+legend(-43,22,c("High Fiber Given First","Low Fiber Given First"), pch=c(21,22),
+  pt.bg =c("green","light blue"),pt.cex =c(2.5,2.5), lw = c(2,2), lty=c(0,0))
+
+detach(case1602)
+}
+\keyword{datasets}


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

Added: pkg/Sleuth3/man/case1701.Rd
===================================================================
--- pkg/Sleuth3/man/case1701.Rd	                        (rev 0)
+++ pkg/Sleuth3/man/case1701.Rd	2012-08-24 14:47:28 UTC (rev 38)
@@ -0,0 +1,111 @@
+\name{case1701}
+\alias{case1701}
+\docType{data}
+\title{Magnetic Force on Printer Rods}
+\description{
+  Engineers manipulated three factors (with 3, 2, and 4 levels each) in
+  the construction and operation of printer rods, to see if they
+  influenced the magnetic force around the rod. 
+}
+\usage{case1701}
+\format{
+  A data frame with 44 observations on the following 14 variables.
+  \tabular{rl}{
+    Name \tab Description\cr
+    \code{L1}, \code{L2},\dots, \code{L11} \tab the magnetic force at
+      each of the equally-spaces positions 1, 2, \dots, 11 on the
+      printer rod\cr 
+    \code{Current} \tab electric current passing through the rod, with
+      three levels \code{"0"}, \code{"250"} and \code{"500"} (milliamperes)\cr 
+    \code{Configur} \tab a factor identifying the configuration, with
+      two levels \code{"0"} and \code{"1"}\cr
+    \code{Material}\tab a factor identifying the type of metal from
+      which the rod was made, with four levels  \code{"1"}, \code{"2"},
+      \code{"3"} and \code{"4"}\cr 
+  }
+}
+\source{
+  Ramsey, F.L. and Schafer, D.W. (2013). \emph{The Statistical Sleuth: A
+    Course in Methods of Data Analysis (3rd ed)}, Cengage Learning.
+}
+\examples{
+str(case1701)
+attach(case1701)
+   
+## EXPLORATION
+MagneticForces  <- cbind(L1,L2,L3,L4,L5,L6,L7,L8,L9,L10,L11)
+mfCor <- cor(MagneticForces)
+round(mfCor,2)  # Show correlations, rounded to two digits 
+
+mfPca     <- prcomp(MagneticForces)  # principal components 
+summary(mfPca) # Show the proportion of variance explained by each PC
+plot(mfPca)  # Graph proportion of variances explained by each PC (Scree Plot)
+mfCoefs   <- mfPca$rotation   # Extract the coefficients
+dim(mfCoefs)  #   #11 rows and 11 columns
+round(mfCoefs[,1:3],3)  # Show the first 3 columns of the score matrix, rounded 
+
+# Explore a possible meaningful linear combination suggested by first PC  
+round(mfCoefs[,1],1)  # Show coefficients of 1st pc, rounded to 1 digit  
+# Coefficients are all very similar, suggesting a constant coefficient; use 1/11 
+mfAve     <- (L1 + L2 + L3 + L4 + L5 + L6 + L7 + L8 + L9 + L10 + L11)/11
+mfScores  <- mfPca$x
+pc1       <- mfScores[,1]  # Values for first principal component of MagneticForces
+cor(mfAve,pc1) # correlation of the average and the first PC (=0.999567)
+plot(pc1 ~ mfAve)
+
+# Explore a possible meningful linear combination suggested by second PC 
+round(mfCoefs[,2],1) # Show coefficients of 2nd pc, rounded to 1 digit 
+# Second set of coefficients are negative on the left end of the rod and 
+# positive on the right end. Try Ave(L9 + L10 + L11) - Ave(L1 + L2 + L3). 
+mfEnds    <- (L9 + L10 + L11)/3 - (L1 + L2 + L3)/3    
+pc2       <- mfScores[,2]
+residualEnds  <- lm(mfEnds ~ mfAve)$residual   # Ends with average effect removed
+plot(pc2 ~ residualEnds)
+cor(residualEnds, pc2)                 # 0.973
+ 
+# Explore a possible meaningful linear combination suggested by third PC
+round(mfCoefs[,3],1)                   # Show doefficients of 3rd pc, rounded to 1 digit
[TRUNCATED]

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


More information about the Sleuth2-commits mailing list