Description Usage Arguments Details Value Author(s) See Also Examples

Simulates data in group testing form ready to be fit by `gtreg`.

1 2 3 4 |

`x` |
a matrix of user-submitted covariates to simulate the data with, defaults to |

`gshape` |
shape parameter of gamma distribution, must be non-negative, set to be 20 by default |

`gscale` |
scale parameter of gamma distribution, must be strictly positive, set to be 2 by default |

`par` |
the true coefficients in the linear predictor |

`sample.size` |
sample size of simulated data |

`linkf` |
a character string specifying one of the three link functions to be used: |

`group.size` |
group size in pooling individual samples |

`sens` |
sensitivity of the group tests, set to be 1 by default. |

`spec` |
specificity of the group tests, set to be 1 by default. |

`sens.ind` |
sensitivity of the individual retests, set to be equal to |

`spec.ind` |
specificity of the individual retests, set to be equal to |

`sim.gt` generates group testing data in simple pooling form. The covariates are either specified by the `x` argument or they are generated from a gamma distribution with a given `gshape` and `gscale`. The individual probabilities are calculated from the covariates, the coefficients given in `par`, and the link function specified through `linkf`. The true binary individual responses are then simulated from the individual probabilities. The true group responses are found from the individual responses within the groups (i.e., if at least one response is positive, the group is positive; otherwise, the group response is negative). Finally, the observed group responses are simulated using the given `sens` and `spec`. Individual retests are simulated from `sens.ind` and `spec.ind` for samples in observed positive groups. Note that with a given `group.size`, the last group may have less individuals.

`sim.gt` returns a data frame with the following columns:

`gres` |
the group response |

`x` |
the covariate |

`groupn` |
the group number |

`ind` |
the actual individual response |

`retest` |
the results of individual retests |

Boan Zhang

1 2 3 4 5 6 7 |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.