# A function for calculating the number of surrogate variables to estimate in a model

### Description

This function estimates the number of surrogate variables that should be included in a differential expression model. The default approach is based on a permutation procedure originally prooposed by Buja and Eyuboglu 1992. The function also provides an interface to the asymptotic approach proposed by Leek 2011 Biometrics.

### Usage

1 2 |

### Arguments

`dat` |
The transformed data matrix with the variables in rows and samples in columns |

`mod` |
The model matrix being used to fit the data |

`method` |
One of "be" or "leek" as described in the details section |

`vfilter` |
You may choose to filter to the vfilter most variable rows before performing the analysis |

`B` |
The number of permutaitons to use if method = "be" |

`seed` |
Set a seed when using the permutation approach |

### Value

n.sv The number of surrogate variables to use in the sva software