betabinase: Helper function to fit betabin model while handling common...

View source: R/betabinase.R

betabinaseR Documentation

Helper function to fit betabin model while handling common warnings/errors

Description

This function fits a beta-binomial model from the package aod and wraps it so that warnings and/or errors are output.

Usage

betabinase(y, total, mod.mat = NULL)

Arguments

y

vector of counts to be modeled

total

vector of total counts

mod.mat

optional model matrix that contains the design matrix of interest. Used for adding the thin plate regression spline basis functions in the 'spase' function and for adding cell type as a covariate. Note that we assume there is an intercept column in mod.mat.

Details

Just wraps betabin to return either the fit or warning description. Warnings and errors occur when the model doesn't converge. These will be flagged for removing downstream.

Value

A list the result, warnings, and errors


lulizou/spASE documentation built on May 22, 2024, 5:24 a.m.