oned: Compute oned correction

Description Usage Arguments Details Value Examples

View source: R/oned.R

Description

This function takes a data.frame with bin information and returns a vector of biases to correct for

Usage

1
2
3
4
5
6
7
oned(
  dat,
  form = tot ~ s(map) + s(cg) + s(res),
  p_fit = NA,
  seed = 1,
  model = FALSE
)

Arguments

dat

A data.frame with one bin per row containing the total number of contacts and the potential biases as columns.

form

A formula describing the total number of contacts on LHS and the smoothed biases on the RHS (should be compatible with mgcv::gam)

p_fit

The proportion of data used to fit the model. NA or NULL will use the entire data set

seed

Seed number for the sub-sampling (if needed)

model

Logical indicating if model should be returned as attribute "model"

Details

Please note that the biases returned are the squarerooted so one can directly apply correct_mat_from_b

Value

A vector of length nrow(dat) with the biases to correct for.

Examples

1
plot(0)

qenvio/dryhic documentation built on March 17, 2020, 8:37 p.m.