Produces a data.frame containing the sample size and mean for each condition. If a reference condition (e.g. "RTD") is specified, the ratio of each condition mean value to the mean value for the reference condition is also calculated. If a basis object returned by one of the basis_pooled functions is given as an argument, this table also contains the basis value for each condition.

condition_summary(data, ...)

# S3 method for class 'data.frame'
condition_summary(data, x, condition, ref_condition = NULL, ...)

# S3 method for class 'basis'
condition_summary(data, ref_condition = NULL, ...)

Arguments

data

a data.frame or a basis object

...

not used

x

the column name of the variable of interest (usually strength)

condition

the column name for the condition

ref_condition

a character representing the reference condition

Value

a data.frame

Examples

library(dplyr)
carbon.fabric.2 %>%
  filter(test == "WT") %>%
  condition_summary(strength, condition, "RTD")
#>   condition  n     mean mean_fraction
#> 1       CTD 19 135.4719     0.9702503
#> 2       RTD 28 139.6257     1.0000000
#> 3       ETW 18 134.1009     0.9604312
#> 4      ETW2 21 130.1545     0.9321673

##   condition  n     mean mean_fraction
## 1       CTD 19 135.4719     0.9702503
## 2       RTD 28 139.6257     1.0000000
## 3       ETW 18 134.1009     0.9604312
## 4      ETW2 21 130.1545     0.9321673

carbon.fabric %>%
  filter(test == "FT") %>%
  basis_pooled_sd(strength, condition, batch) %>%
  condition_summary("RTD")
#>   condition  n     mean mean_fraction    basis basis_fraction
#> 1       RTD 18 127.6211     1.0000000 116.8894      1.0000000
#> 2       ETW 18 117.8080     0.9231072 107.0762      0.9160476
#> 3       CTD 18 125.9629     0.9870063 115.2311      0.9858133

##   condition  n     mean mean_fraction    basis basis_fraction
## 1       RTD 18 127.6211     1.0000000 116.8894      1.0000000
## 2       ETW 18 117.8080     0.9231072 107.0762      0.9160476
## 3       CTD 18 125.9629     0.9870063 115.2311      0.9858133