Learn R Programming

mason (version 0.2.4)

add_settings: Add analysis settings to the blueprint

Description

Most statistical techniques need to specify some settings for them to run. This function sets those settings in the blueprint, before the statistical method is used at the construction phase.

Usage

add_settings(data, ...)
"add_settings"(data, cluster.id, family, corstr = c("independence", "exchangeable", "ar1"), conf.int = TRUE, conf.level = 0.95, ...)
"add_settings"(data, method = c("pearson", "kendall", "spearman"), use = c("complete.obs", "all.obs", "pairwise.complete.obs", "everything", "na.or.complete"), hclust.order = FALSE, ...)
"add_settings"(data, family, conf.int = TRUE, conf.level = 0.95, ...)
"add_settings"(data, paired = FALSE, ...)

Arguments

data
The blueprint data object.
...
Additional args.
cluster.id
Variable that represents the cluster for GEE.
family
a description of the error distribution and link function to be used in the model. For glm this can be a character string naming a family function, a family function or the result of a call to a family function. For glm.fit only the third option is supported. (See family for details of family functions.)
corstr
The correlation structure. See geeglm.
conf.int
whether to include a confidence interval
conf.level
confidence level of the interval, used only if conf.int=TRUE
method
the method to be used in fitting the model. The default method "glm.fit" uses iteratively reweighted least squares (IWLS): the alternative "model.frame" returns the model frame and does no fitting.

User-supplied fitting functions can be supplied either as a function or a character string naming a function, with a function which takes the same arguments as glm.fit. If specified as a character string it is looked up from within the stats namespace.

use
an optional character string giving a method for computing covariances in the presence of missing values. This must be (an abbreviation of) one of the strings "everything", "all.obs", "complete.obs", "na.or.complete", or "pairwise.complete.obs".
hclust.order
Whether to order the correlation data based on the hclust algorithm.
paired
a logical indicating whether you want a paired t-test.

Value

Settings for the analysis are added to the blueprint

Examples

Run this code

design(iris, 'gee') %>%
 add_settings('Species', family = binomial('logit'), conf.int = FALSE)

ds <- design(iris, 'cor')
ds <- add_settings(ds, method = 'spearman')

ds <- design(iris, 't.test')
add_settings(ds, paired = TRUE)
add_settings(ds)

Run the code above in your browser using DataLab