Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

assign_missingness

Assignment of missingness types


Description

The type of missingness (missing at random, missing not at random) is assigned based on the comparison of a reference condition and every other condition.

Usage

assign_missingness(
  data,
  sample,
  condition,
  grouping,
  intensity,
  ref_condition = "control",
  completeness_MAR = 0.7,
  completeness_MNAR = 0.2,
  retain_columns = NULL
)

Arguments

data

A data frame containing at least the input variables.

sample

The column in the data data frame containing the sample name.

condition

The column in the data data frame containing the conditions.

grouping

The column in the data data frame containing precursor or peptide identifiers.

intensity

The column in the data data frame containing intensity values.

ref_condition

The condition that is used as a reference for missingness determination. By default ref_condition = "control".

completeness_MAR

The minimal degree of data completeness to be considered as MAR. Value has to be between 0 and 1, default is 0.7. It is multiplied with the number of replicates and then adjusted downward. The resulting number is the minimal number of observations for each condition to be considered as MAR. This number is always at least 1.

completeness_MNAR

The maximal degree of data completeness to be considered as MNAR. Value has to be between 0 and 1, default is 0.20. It is multiplied with the number of replicates and then adjusted downward. The resulting number is the maximal number of observations for one condition to be considered as MNAR when the other condition is complete.

retain_columns

A vector indicating if certain columns should be retained from the input data frame. Default is not retaining additional columns retain_columns = NULL. Specific columns can be retained by providing their names (not in quotations marks, just like other column names, but in a vector).

Value

A data frame that contains the reference condition paired with each treatment condition. The comparison column contains the comparison name for the specific treatment/reference pair. The missingness column reports the type of missingness.

  • "complete": No missing values for every replicate of this reference/treatment pair for the specific grouping variable.

  • "MNAR": Missing not at random. All replicates of either the reference or treatment condition have missing values for the specific grouping variable.

  • "MAR": Missing at random. At least n-1 replicates have missing values for the reference/treatment pair for the specific grouping varible.

Examples

## Not run: 
assign_missingness(
  data,
  sample = r_file_name,
  condition = r_condition,
  grouping = eg_precursor_id,
  intensity = normalised_intensity_log2,
  retain_columns = c(pg_protein_accessions)
)

## End(Not run)

protti

Bottom-Up Proteomics and LiP-MS Quality Control and Data Analysis Tools

v0.1.1
MIT + file LICENSE
Authors
Jan-Philipp Quast [aut, cre], Dina Schuster [aut], ETH Zurich [cph, fnd]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.