diff --git a/.Rbuildignore b/.Rbuildignore index fed679c..f39c25e 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -2,6 +2,7 @@ ^\.Rproj\.user$ ^\.travis\.yml$ ^\.gitignore$ +^\.github$ ### rsm-plots.R Readme.md diff --git a/DESCRIPTION b/DESCRIPTION index e5a7743..34ac7e5 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: rsm Type: Package Version: 2.10.5 -Date: 2024-06-08 +Date: 2024-06-09 Title: Response-Surface Analysis Authors@R: c(person("Russell", "Lenth", role = c("aut", "cre"), email = "russell-lenth@uiowa.edu")) @@ -20,6 +20,6 @@ Suggests: emmeans (> 1.3.5.1), Vdgraph, conf.design, DoE.base, FrF2, Imports: estimability License: GPL(>=2) LazyLoad: yes -bytecompile: yes +ByteCompile: yes VignetteBuilder: knitr diff --git a/inst/NEWS b/inst/NEWS index 349f326..e292ecc 100644 --- a/inst/NEWS +++ b/inst/NEWS @@ -1,8 +1,10 @@ NEWS for rsm package Changes in version 2.10.5 (9 June 2024) - * Re-did old Sweave/PDF vignettes in RMarkdown/HTML - * Made **pkgdown** site + * Re-did old Sweave/PDF vignettes in RMarkdown/HTML. + This makes the whole package easier to maintain + * Corrections to slice labels for contour and persp + * Made pkgdown site Changes in version 2.10.4 (19 September 2023) diff --git a/vignettes/article-JSS.rmd b/vignettes/article-JSS.rmd index a186965..cca3929 100644 --- a/vignettes/article-JSS.rmd +++ b/vignettes/article-JSS.rmd @@ -1,7 +1,7 @@ --- title: "Response-Surface Methods in R, Using rsm" author: "rsm package, Version `r packageVersion('rsm')`" -output: html_vignette +output: emmeans::.emm_vignette vignette: > %\VignetteIndexEntry{Response-Surface Methods in R, Using rsm} %\VignetteKeywords{response-surface methods, regression, experimental design, first-order designs, second-order designs} @@ -42,7 +42,7 @@ most standard first-and second order designs and methods for one response variab reasonably well, and it could be expanded in the future. Multiple-response optimization is not covered in this package, but the **desirability** package (Kuhn 2009) may be used in conjunction with predictions obtained using the **rsm** package. The **rsm** package is available from the Comprehensive -**R** Archive Network at http://CRAN.R-project.org/package=rsm. +**R** Archive Network at https://CRAN.R-project.org/package=rsm. Here is a general overview of **rsm**. First, it provides functions and data types that provide for the coding and decoding of factor levels, since appropriate coding is an important element of response-surface analysis. These are discussed in the [coding section]{#coding). Second, it provides functions for generating standard designs (currently, central-composite and Box-Behnken), and building blocks thereof, and examining their variance function; see the [designs section](#designs). Third the [fitting section](#fitting) extends **R**'s `lm` function to simplify the specification of standard response-surface models, and provide appropriate summaries. Fourth, the [contour section](#contour) provides a means of visualizing a fitted response surface (or in fact any `lm` object). Finally the [steepest ascent section](#steepest) provides guidance for further experimentation, e.g., along the path of steepest ascent. Most **rsm** functions take advantage of **R**'s formula capabilities to provide intuitive and transparent ways of obtaining the needed results. @@ -101,7 +101,7 @@ In the following discussion, the term "design points" refers to the non-center p The table below displays the parameters of a CCD, along with the names used by the function `ccd.pick` to be described shortly. Suppose that there are $k$ variables to be varied. For the cube blocks, we start with a given $2^{k-p}$ fractional factorial design (or full factorial, when $p=0$). We may either use this design as-is to define the design points in the cube block(s). Alternatively, we may confound one or more effects with blocks to split this design into `blks.c` smaller cube blocks, in which case each cube block contains $2^{k-p}/\mathtt{blks.c}$ distinct design points. The star blocks always contain all $2k$ distinct design points---two on each axis. |Parameter(s) | Cube block(s) | Star block(s) | -|:------------|--------------|--------------| +|:------------|:--------------|:--------------| |Design points | $(\pm1,\pm1,...,\pm1)$ |$(\pm\alpha,0,0,...,0),...,(0,0,...,\pm\alpha)$ | |Center points | $(0,0,\ldots,0)$ | $(0,0,\ldots,0)$ | | | | | @@ -337,7 +337,7 @@ Hoerl AE (1959). "Optimum Solution of Many Variables Equations." *Chemical Engin Khuri AI, Cornell JA (1996). Responses Surfaces: Design and Analyses. 2nd edition. Marcel Dekker, Monticello, NY. -Kuhn M (2009). desirability: Desirability Function Optimization and Ranking. R package version 1.02, URL http://CRAN.R-project.org/package=desirability. +Kuhn M (2009). desirability: Desirability Function Optimization and Ranking. R package version 1.02, URL https://CRAN.R-project.org/package=desirability Lenth RV (2009). "Response-Surface Methods in R, Using rsm." *Journal of Statistical Software*, **32**(7), 1--17. URL https://www.jstatsoft.org/v32/i07/. @@ -351,8 +351,8 @@ Ryan TP (2007). *Modern Experimental Design*. John Wiley & Sons, New York. SAS Institute, Inc (2009). JMP 8: Statistical Discovery Software. Cary, NC. URL http: //www.jmp.com/. -Stat-Ease, Inc (2009). *Design-Expert 7 for Windows: Software for Design of Experiments (DOE)*. Minneapolis, MN. URL http://www.statease.com/. +Stat-Ease, Inc (2009). *Design-Expert 7 for Windows: Software for Design of Experiments (DOE)*. Minneapolis, MN. URL https://www.statease.com/software/design-expert/. -StatPoint Technologies, Inc (2009). *Statgraphics Centurion: Data Analysis and Statistical Software*. Warrenton, VA. URL http://www.statgraphics.com/. +StatPoint Technologies, Inc (2009). *Statgraphics Centurion: Data Analysis and Statistical Software*. Warrenton, VA. URL https://www.statgraphics.com/. Wu CFJ, Hamada M (2000). *Experiments: Planning, Analysis, and Parameter Design Optimization*. John Wiley & Sons, New York. \ No newline at end of file diff --git a/vignettes/illus.rmd b/vignettes/illus.rmd index 418a6cb..ef74d4c 100644 --- a/vignettes/illus.rmd +++ b/vignettes/illus.rmd @@ -1,7 +1,7 @@ --- title: "Response-surface illustration" author: "rsm package, Version `r packageVersion('rsm')`" -output: html_vignette +output: emmeans::.emm_vignette vignette: > %\VignetteIndexEntry{Response-surface illustration} %\VignetteKeywords{response-surface methods, regression, experimental design, first-order designs, second-order designs} @@ -320,4 +320,4 @@ For convenience, here is a tabular summary of what we did | 6 | | SA path | 8 | Re center at distance $\sim1.5$| | 7 | $(1.25,.30,.30)$ | CCD: $2^3$; $\text{star}+2\times0$ | $8+8$ | Best recipe: (1.22,.28,.36) | -It has required 64 experimental runs to find this optimum. That is not too bad considering how much variation there is in the response measures. +It has required 64 experimental runs to find this optimum. For a home baker, 64 cakes is a lot. But for a commercial baker, that is not too bad considering how much variation there is in the response measures and the fact that now we have a better recipe. If we had just kept baking cakes with the same recipe, we can't gain knowledge. Only by varying the recipe in disciplined ways can we improve it. diff --git a/vignettes/plots.rmd b/vignettes/plots.rmd index e83f0f0..46efda0 100644 --- a/vignettes/plots.rmd +++ b/vignettes/plots.rmd @@ -1,7 +1,7 @@ --- title: "Surface Plots in the rsm Package" author: "rsm package, Version `r packageVersion('rsm')`" -output: html_vignette +output: emmeans::.emm_vignette vignette: > %\VignetteIndexEntry{Surface Plots in the rsm Package} %\VignetteKeywords{response-surface methods, regression, contour plots, perspective plots} @@ -26,7 +26,7 @@ To this end, the functions `contour.lm`, `persp.lm` and `image.lm` were develope This vignette is not meant to document the functions; please refer to the help pages for details. Our goal here is to illustrate their use. -## Models with two predictors} +## Models with two predictors Consider an example using the ubiquitous `swiss` dataset that is standard in R. Let us fit a model for `Fertility` as a polynomial function of `Agriculture` and `Education`: ```{r} swiss2.lm <- lm(Fertility ~ poly(Agriculture, Education, degree=2), data=swiss) @@ -50,7 +50,7 @@ persp(swiss2.lm, Education ~ Agriculture, col = "blue", theta = -135, phi = 35) ``` -## Three or more predictors} +## Three or more predictors When a regression model has more than two continuous predictors, some additional issues arise: 1. We can use only two predictors at a time in an image, contour, or surface plot.