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

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

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 |

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

`n.row` |
a vector that specifies the number of rows in each matrix, a scalar if only one matrix is simulated |

`n.col` |
a vector that specifies the number of columns in each matrix, a scalar if only one matrix is simulated |

`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 sens if not specified otherwise. |

`spec.ind` |
specificity of the individual retests, set to be equal to spec if not specified otherwise. |

`sim.mp` generates group testing data in matrix 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 individuals are organized into (by column) one or more matrices specified by `n.row` and `n.col`, and the true group responses are found (i.e., if at least one response is positive, the group is positive; otherwise, the group response is negative). The observed row and column group responses are then simulated using the given `sens` and `spec` values. Individual retests are simulated from `sens.ind` and `spec.ind` for individuals that lie on the intersection of an observed positive row and an observed positive column. In the case where no column (row) tests positive in a matrix, all the individuals in any observed positive rows (columns) will be assigned a simulated retest result. If no column or row is observed positive, `NULL` is returned.

`sim.mp` returns a list with the components
`dframe`: the data frame that is actually to be fit,
`ind`: the true individual responses presented in matrices and
`prob`: the individual probabilities.

`dframe` is a data frame with columns

`col.resp` |
the column group response |

`row.resp` |
the row group response |

`x` |
the covariate |

`arrayn` |
the array number |

`coln` |
the column group number |

`rown` |
the row group number |

`retest` |
the results of individual retests |

Boan Zhang

`gtreg.mp`

for the corresponding function to fit the model.

1 2 3 4 5 |

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.