Various plots based on weighted squared residuals
of each element in the weitrix.
weight*residual^2 is the Pearson residual for a gamma GLM plus one,
as used by
weitrix_calplot( weitrix, design = ~1, covar, cat, funnel = FALSE, guides = TRUE )
A weitrix object, or an object that can be converted to a weitrix
A formula in terms of
Optional. A covariate. Specify as you would with
Optional. A categorical variable to break down the data by.
Specify as you would with
Flag. Produce a funnel plot?
Show blue guide lines.
A ggplot2 plot.
This function is not memory efficient. It is suitable for typical bulk data, but generally not not for single-cell.
Defaults to a boxplot of sqrt(weight) weighted residuals. Blue guide bars are shown for the expected quartiles, these will ideally line up with the boxplot.
cat is given, it will be used to break the elements down
covar is given, sqrt(weight) weighted residuals are plotted versus
the covariate, with red trend lines for
the mean and for the mean +/- one standard deviation.
If the weitrix is calibrated, the trend lines should be horizontal lines
with y intercept close to -1, 0 and 1.
Blue guide lines are shown for this ideal outcome.
Any of the variables available with
can be used for
weitrix_calplot(simwei, ~1)weitrix_calplot(simwei, ~1, covar=mu)weitrix_calplot(simwei, ~1, cat=col)# weitrix_calplot should generally be used after calibration cal <- weitrix_calibrate_all(simwei, ~1, ~col+log(weight)) weitrix_calplot(cal, ~1, cat=col)# You can use a matrix of the same size as the weitrix as a covariate. # It will often be useful to assess vs the original weighting. weitrix_calplot(cal, ~1, covar=weitrix_weights(simwei))