add_settings: Add analysis settings to the blueprint

Description Usage Arguments Value Examples

View source: R/add_settings.R

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
add_settings(data, ...)

## S3 method for class 'gee_bp'
add_settings(
  data,
  cluster.id,
  family,
  corstr = c("independence", "exchangeable", "ar1"),
  conf.int = TRUE,
  conf.level = 0.95,
  ...
)

## S3 method for class 'cor_bp'
add_settings(
  data,
  method = c("pearson", "kendall", "spearman"),
  use = c("complete.obs", "all.obs", "pairwise.complete.obs", "everything",
    "na.or.complete"),
  hclust.order = FALSE,
  ...
)

## S3 method for class 'glm_bp'
add_settings(data, family, conf.int = TRUE, conf.level = 0.95, ...)

## S3 method for class 'pls_bp'
add_settings(
  data,
  ncomp = NULL,
  scale = TRUE,
  validation = c("none", "CV", "LOO"),
  cv.data = TRUE,
  cv.seed = 1234,
  ...
)

## S3 method for class 't.test_bp'
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 geepack::geeglm().

conf.int

Logical indicating whether or not to include a confidence interval in the tidied output. Defaults to FALSE.

conf.level

The confidence level to use for the confidence interval if conf.int = TRUE. Must be strictly greater than 0 and less than 1. Defaults to 0.95, which corresponds to a 95 percent confidence interval.

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 stats::hclust() algorithm.

ncomp

the number of components to include in the model (see below).

scale

numeric vector, or logical. If numeric vector, X is scaled by dividing each variable with the corresponding element of scale. If scale is TRUE, X is scaled by dividing each variable by its sample standard deviation. If cross-validation is selected, scaling by the standard deviation is done for every segment.

validation

character. What kind of (internal) validation to use. See below.

cv.data

Whether to cross-validate the dataset into training and testing sets.

cv.seed

Seed to set for cv.data.

paired

a logical indicating whether you want a paired t-test.

Value

Settings for the analysis are added to the blueprint

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## Not run: 
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)

## End(Not run)

lwjohnst86/mason documentation built on June 7, 2020, 3:08 a.m.