equiv_change_mean: Equivalency based on change in mean value

Description Usage Arguments Details Value References See Also Examples

View source: R/equiv.R

Description

Checks for change in the mean value between a qualification data set and a sample. This is normally used to check for properties such as modulus. This function is a wrapper for a two-sample t–test.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
equiv_change_mean(
  df_qual = NULL,
  data_qual = NULL,
  n_qual = NULL,
  mean_qual = NULL,
  sd_qual = NULL,
  data_sample = NULL,
  n_sample = NULL,
  mean_sample = NULL,
  sd_sample = NULL,
  alpha,
  modcv = FALSE
)

Arguments

df_qual

(optional) a data.frame containing the qualification data. Defaults to NULL.

data_qual

(optional) a vector of observations from the "qualification" data to which equivalency is being tested. Or the column of df_qual that contains this data. Defaults to NULL

n_qual

the number of observations in the qualification data to which the sample is being compared for equivalency

mean_qual

the mean from the qualification data to which the sample is being compared for equivalency

sd_qual

the standard deviation from the qualification data to which the sample is being compared for equivalency

data_sample

a vector of observations from the sample being compared for equivalency

n_sample

the number of observations in the sample being compared for equivalency

mean_sample

the mean of the sample being compared for equivalency

sd_sample

the standard deviation of the sample being compared for equivalency

alpha

the acceptable probability of a Type I error

modcv

a logical value indicating whether the modified CV approach should be used. Defaults to FALSE

Details

There are several optional arguments to this function. Either (but not both) data_sample or all of n_sample, mean_sample and sd_sample must be supplied. And, either (but not both) data_qual (and also df_qual if data_qual is a column name and not a vector) or all of n_qual, mean_qual and sd_qual must be supplied. If these requirements are violated, warning(s) or error(s) will be issued.

This function uses a two-sample t-test to determine if there is a difference in the mean value of the qualification data and the sample. A pooled standard deviation is used in the t-test. The procedure is per CMH-17-1G.

If modcv is TRUE, the standard deviation used to calculate the thresholds will be replaced with a standard deviation calculated using the Modified Coefficient of Variation (CV) approach. The Modified CV approach is a way of adding extra variance to the qualification data in the case that the qualification data has less variance than expected, which sometimes occurs when qualification testing is performed in a short period of time. Using the Modified CV approach, the standard deviation is calculated by multiplying CV_star * mean_qual where mean_qual is either the value supplied or the value calculated by mean(data_qual) and CV* is determined using calc_cv_star().

Note that the modified CV option should only be used if that data passes the Anderson–Darling test.

Value

References

“Composite Materials Handbook, Volume 1. Polymer Matrix Composites Guideline for Characterization of Structural Materials,” SAE International, CMH-17-1G, Mar. 2012.

See Also

calc_cv_star()

stats::t.test()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
equiv_change_mean(alpha = 0.05, n_sample = 9, mean_sample = 9.02,
                  sd_sample = 0.15785, n_qual = 28, mean_qual = 9.24,
                  sd_qual = 0.162, modcv = TRUE)

## Call:
## equiv_change_mean(n_qual = 28, mean_qual = 9.24, sd_qual = 0.162,
##                   n_sample = 9, mean_sample = 9.02, sd_sample = 0.15785,
##                   alpha = 0.05,modcv = TRUE)
##
## For alpha = 0.05
## Modified CV used
##                   Qualification        Sample
##           Number        28               9
##             Mean       9.24             9.02
##               SD      0.162           0.15785
##           Result               PASS
##    Passing Range       8.856695 to 9.623305

cmstatr documentation built on Sept. 30, 2021, 5:08 p.m.