concurve (version 2.0)

curve_gen: Computes consonance intervals for linear models

Description

Computes thousands of consonance (confidence) intervals for the chosen parameter in the selected model(ANOVA, ANCOVA, regression, logistic regression) and places the interval limits for each interval level into a data frame along with the corresponding p-values and s-values.

Usage

curve_gen(model, var, method = "default", replicates = 1000, steps = 10000)

Arguments

model

The statistical model of interest(ANOVA, regression, logistic regression) is to be indicated here.

var

The variable of interest from the model (coefficients, intercept) for which the intervals are to be produced.

method

Chooses the method to be used to calculate the consonance intervals. There are currently four methods: "default", "wald", "lm", and "boot". The "default" method uses the profile likelihood method to compute intervals and can be used for models created by the 'lm' function. The "wald" method is typically what most people are familiar with when computing intervals based on the calculated standard error. The "lm" method allows this function to be used for specific scenarios like logistic regression and the 'glm' function. The "boot" method allows for bootstrapping at certain levels.

replicates

Indicates how many bootstrap replicates are to be performed if bootstrapping is enabled as a method.

steps

Indicates how many consonance intervals are to be calculated at various levels. For example, setting this to 100 will produce 100 compatibility intervals from 0 to 100. Setting this to 10000 will produce more consonance levels. By default, it is set to 1000. Increasing the number substantially is not recommended as it will take longer to produce all the intervals and store them into a dataframe.

References

Poole C. Beyond the confidence interval. Am J Public Health. 1987;77(2):195-199.

Sullivan KM, Foster DA. Use of the confidence interval function. Epidemiology. 1990;1(1):39-42.

Rothman KJ, Greenland S, Lash TL, Others. Modern epidemiology. 2008.

Examples

Run this code
# NOT RUN {
# Simulate random data

GroupA <- rnorm(50)
GroupB <- rnorm(50)

RandomData <- data.frame(GroupA, GroupB)

rob <- glm(GroupA ~ GroupB, data = RandomData)
bob <- curve_gen(rob, "GroupB", method = "lm")

tibble::tibble(bob)

# }

Run the code above in your browser using DataCamp Workspace