| Title: | Design Menu for Radiant: Business Analytics using R and Shiny |
|---|---|
| Description: | The Radiant Design menu includes interfaces for design of experiments, sampling, and sample size calculation. The application extends the functionality in 'radiant.data'. |
| Authors: | Vincent Nijs [aut, cre] |
| Maintainer: | Vincent Nijs <[email protected]> |
| License: | AGPL-3 | file LICENSE |
| Version: | 1.6.6 |
| Built: | 2026-05-14 07:16:14 UTC |
| Source: | https://github.com/radiant-rstats/radiant.design |
Create (partial) factorial design
doe(factors, int = "", trials = NA, seed = NA)doe(factors, int = "", trials = NA, seed = NA)
factors |
Categorical variables used as input for design |
int |
Vector of interaction terms to consider when generating design |
trials |
Number of trials to create. If NA then all feasible designs will be considered until a design with perfect D-efficiency is found |
seed |
Random seed to use as the starting point |
See https://radiant-rstats.github.io/docs/design/doe.html for an example in Radiant
A list with all variables defined in the function as an object of class doe
summary.doe to summarize results
doe(c("price; $10; $13; $16", "food; popcorn; gourmet; no food")) doe( c("price; $10; $13; $16", "food; popcorn; gourmet; no food"), int = "price:food", trials = 9, seed = 1234 )doe(c("price; $10; $13; $16", "food; popcorn; gourmet; no food")) doe( c("price; $10; $13; $16", "food; popcorn; gourmet; no food"), int = "price:food", trials = 9, seed = 1234 )
A function to determine which coefficients can be estimated based on a partial factorial design. Adapted from a function written by Blakeley McShane at https://github.com/fzettelmeyer/mktg482/blob/master/R/expdesign.R
estimable(design)estimable(design)
design |
An experimental design generated by the doe function that includes a partial and full factorial design |
design <- doe(c("price; $10; $13; $16", "food; popcorn; gourmet; no food"), trials = 6) estimable(design)design <- doe(c("price; $10; $13; $16", "food; popcorn; gourmet; no food"), trials = 6) estimable(design)
Plot method for the sample_size_comp function
## S3 method for class 'sample_size_comp' plot(x, ...)## S3 method for class 'sample_size_comp' plot(x, ...)
x |
Return value from |
... |
further arguments passed to or from other methods |
See https://radiant-rstats.github.io/docs/design/sample_size_comp.html for an example in Radiant
sample_size_comp to generate the results
sample_size_comp( type = "proportion", p1 = 0.1, p2 = 0.15, conf_lev = 0.95, power = 0.8 ) %>% plot()sample_size_comp( type = "proportion", p1 = 0.1, p2 = 0.15, conf_lev = 0.95, power = 0.8 ) %>% plot()
Launch radiant.design in the default web browser
radiant.design(state, ...)radiant.design(state, ...)
state |
Path to state file to load |
... |
additional arguments to pass to shiny::runApp (e.g, port = 8080) |
See https://radiant-rstats.github.io/docs/ for documentation and tutorials
## Not run: radiant.design() ## End(Not run)## Not run: radiant.design() ## End(Not run)
Launch radiant.design in the Rstudio viewer
radiant.design_viewer(state, ...)radiant.design_viewer(state, ...)
state |
Path to state file to load |
... |
additional arguments to pass to shiny::runApp (e.g, port = 8080) |
See https://radiant-rstats.github.io/docs/ for documentation and tutorials
## Not run: radiant.design_viewer() ## End(Not run)## Not run: radiant.design_viewer() ## End(Not run)
Launch radiant.design in an Rstudio window
radiant.design_window(state, ...)radiant.design_window(state, ...)
state |
Path to state file to load |
... |
additional arguments to pass to shiny::runApp (e.g, port = 8080) |
See https://radiant-rstats.github.io/docs/ for documentation and tutorials
## Not run: radiant.design_window() ## End(Not run)## Not run: radiant.design_window() ## End(Not run)
Randomize cases into experimental conditions
randomizer( dataset, vars, conditions = c("A", "B"), blocks = NULL, probs = NULL, label = ".conditions", seed = 1234, data_filter = "", arr = "", rows = NULL, na.rm = FALSE, envir = parent.frame() )randomizer( dataset, vars, conditions = c("A", "B"), blocks = NULL, probs = NULL, label = ".conditions", seed = 1234, data_filter = "", arr = "", rows = NULL, na.rm = FALSE, envir = parent.frame() )
dataset |
Dataset to sample from |
vars |
The variables to sample |
conditions |
Conditions to assign to |
blocks |
A vector to use for blocking or a data.frame from which to construct a blocking vector |
probs |
A vector of assignment probabilities for each treatment conditions. By default each condition is assigned with equal probability |
label |
Name to use for the generated condition variable |
seed |
Random seed to use as the starting point |
data_filter |
Expression entered in, e.g., Data > View to filter the dataset in Radiant. The expression should be a string (e.g., "price > 10000") |
arr |
Expression to arrange (sort) the data on (e.g., "color, desc(price)") |
rows |
Rows to select from the specified dataset |
na.rm |
Remove rows with missing values (FALSE or TRUE) |
envir |
Environment to extract data from |
Wrapper for the complete_ra and block_ra from the randomizr package. See https://radiant-rstats.github.io/docs/design/randomizer.html for an example in Radiant
A list of variables defined in randomizer as an object of class randomizer
summary.sampling to summarize results
randomizer(rndnames, "Names", conditions = c("test", "control")) %>% str()randomizer(rndnames, "Names", conditions = c("test", "control")) %>% str()
100 random names
data(rndnames)data(rndnames)
A data frame with 100 rows and 2 variables
A list of 100 random names. Description provided in attr(rndnames,"description")
Sample size calculation
sample_size( type, err_mean = 2, sd_mean = 10, err_prop = 0.1, p_prop = 0.5, conf_lev = 0.95, incidence = 1, response = 1, pop_correction = "no", pop_size = 1e+06 )sample_size( type, err_mean = 2, sd_mean = 10, err_prop = 0.1, p_prop = 0.5, conf_lev = 0.95, incidence = 1, response = 1, pop_correction = "no", pop_size = 1e+06 )
type |
Choose "mean" or "proportion" |
err_mean |
Acceptable Error for Mean |
sd_mean |
Standard deviation for Mean |
err_prop |
Acceptable Error for Proportion |
p_prop |
Initial proportion estimate for Proportion |
conf_lev |
Confidence level |
incidence |
Incidence rate (i.e., fraction of valid respondents) |
response |
Response rate |
pop_correction |
Apply correction for population size ("yes","no") |
pop_size |
Population size |
See https://radiant-rstats.github.io/docs/design/sample_size.html for an example in Radiant
A list of variables defined in sample_size as an object of class sample_size
summary.sample_size to summarize results
sample_size(type = "mean", err_mean = 2, sd_mean = 10)sample_size(type = "mean", err_mean = 2, sd_mean = 10)
Sample size calculation for comparisons
sample_size_comp( type, n1 = NULL, n2 = NULL, p1 = NULL, p2 = NULL, delta = NULL, sd = NULL, conf_lev = NULL, power = NULL, ratio = 1, alternative = "two.sided" )sample_size_comp( type, n1 = NULL, n2 = NULL, p1 = NULL, p2 = NULL, delta = NULL, sd = NULL, conf_lev = NULL, power = NULL, ratio = 1, alternative = "two.sided" )
type |
Choose "mean" or "proportion" |
n1 |
Sample size for group 1 |
n2 |
Sample size for group 2 |
p1 |
Proportion 1 (only used when "proportion" is selected) |
p2 |
Proportion 2 (only used when "proportion" is selected) |
delta |
Difference in means between two groups (only used when "mean" is selected) |
sd |
Standard deviation (only used when "mean" is selected) |
conf_lev |
Confidence level |
power |
Power |
ratio |
Sampling ratio (n1 / n2) |
alternative |
Two or one sided test |
See https://radiant-rstats.github.io/docs/design/sample_size_comp.html for an example in Radiant
A list of variables defined in sample_size_comp as an object of class sample_size_comp
summary.sample_size_comp to summarize results
sample_size_comp( type = "proportion", p1 = 0.1, p2 = 0.15, conf_lev = 0.95, power = 0.8 )sample_size_comp( type = "proportion", p1 = 0.1, p2 = 0.15, conf_lev = 0.95, power = 0.8 )
Simple random sampling
sampling( dataset, vars, sample_size, seed = 1234, data_filter = "", arr = "", rows = NULL, na.rm = FALSE, envir = parent.frame() )sampling( dataset, vars, sample_size, seed = 1234, data_filter = "", arr = "", rows = NULL, na.rm = FALSE, envir = parent.frame() )
dataset |
Dataset to sample from |
vars |
The variables to sample |
sample_size |
Number of units to select |
seed |
Random seed to use as the starting point |
data_filter |
Expression entered in, e.g., Data > View to filter the dataset in Radiant. The expression should be a string (e.g., "price > 10000") |
arr |
Expression to arrange (sort) the data on (e.g., "color, desc(price)") |
rows |
Rows to select from the specified dataset |
na.rm |
Remove rows with missing values (FALSE or TRUE) |
envir |
Environment to extract data from |
See https://radiant-rstats.github.io/docs/design/sampling.html for an example in Radiant
A list of class 'sampling' with all variables defined in the sampling function
summary.sampling to summarize results
sampling(rndnames, "Names", 10)sampling(rndnames, "Names", 10)
Summary method for doe function
## S3 method for class 'doe' summary(object, eff = TRUE, part = TRUE, full = TRUE, est = TRUE, dec = 3, ...)## S3 method for class 'doe' summary(object, eff = TRUE, part = TRUE, full = TRUE, est = TRUE, dec = 3, ...)
object |
Return value from |
eff |
If TRUE print efficiency output |
part |
If TRUE print partial factorial |
full |
If TRUE print full factorial |
est |
If TRUE print number of effects that will be estimable using the partial factorial design |
dec |
Number of decimals to show |
... |
further arguments passed to or from other methods. |
See https://radiant-rstats.github.io/docs/design/doe.html for an example in Radiant
doe to calculate results
c("price; $10; $13; $16", "food; popcorn; gourmet; no food") %>% doe() %>% summary()c("price; $10; $13; $16", "food; popcorn; gourmet; no food") %>% doe() %>% summary()
Summary method for the randomizer function
## S3 method for class 'randomizer' summary(object, dec = 3, ...)## S3 method for class 'randomizer' summary(object, dec = 3, ...)
object |
Return value from |
dec |
Number of decimals to show |
... |
further arguments passed to or from other methods |
See https://radiant-rstats.github.io/docs/design/randomizer.html for an example in Radiant
randomizer to generate the results
randomizer(rndnames, "Names", conditions = c("test", "control")) %>% summary()randomizer(rndnames, "Names", conditions = c("test", "control")) %>% summary()
Summary method for the sample_size function
## S3 method for class 'sample_size' summary(object, ...)## S3 method for class 'sample_size' summary(object, ...)
object |
Return value from |
... |
further arguments passed to or from other methods |
See https://radiant-rstats.github.io/docs/design/sample_size.html for an example in Radiant
sample_size to generate the results
sample_size(type = "mean", err_mean = 2, sd_mean = 10) %>% summary()sample_size(type = "mean", err_mean = 2, sd_mean = 10) %>% summary()
Summary method for the sample_size_comp function
## S3 method for class 'sample_size_comp' summary(object, ...)## S3 method for class 'sample_size_comp' summary(object, ...)
object |
Return value from |
... |
further arguments passed to or from other methods |
See https://radiant-rstats.github.io/docs/design/sample_size_comp.html for an example in Radiant
sample_size_comp to generate the results
sample_size_comp( type = "proportion", p1 = 0.1, p2 = 0.15, conf_lev = 0.95, power = 0.8 ) %>% summary()sample_size_comp( type = "proportion", p1 = 0.1, p2 = 0.15, conf_lev = 0.95, power = 0.8 ) %>% summary()
Summary method for the sampling function
## S3 method for class 'sampling' summary(object, dec = 3, ...)## S3 method for class 'sampling' summary(object, dec = 3, ...)
object |
Return value from |
dec |
Number of decimals to show |
... |
further arguments passed to or from other methods |
See https://radiant-rstats.github.io/docs/design/sampling.html for an example in Radiant
sampling to generate the results
sampling(rndnames, "Names", 10) %>% summary()sampling(rndnames, "Names", 10) %>% summary()