This package computes the intraclass correlation, the design effect, and standard errors for the intercept for a binary-valued model with a group-level random effect, when the number of groups and number of observations per group are specified.

1 | ```
DEFFbinary(logitMean, sigma, NperGroup = NULL, Ngroups = NULL, Nsim = 1000)
``` |

`logitMean` |
The mean response, on the logit scale |

`sigma` |
The standard deviation of the group-level random effect |

`NperGroup` |
Number of observations per group, if unspecified only the ICC is computed |

`Ngroups` |
Number of groups, if unspecified standard errors are not computed. |

`Nsim` |
Number of simulations for computing the moments of the logistic-normal distribution. |

Consider the following model, where *Y_ij* is the jth observation from the ith group:

*Y_ij|P_i ~ Bernoulli(P_i)*

*logit(P_i) = mu+ U_i*

*U_i ~ N(0, sigma^2)*

`logitMean`

is *mu*, the conditional mean on the logit scale. The `sigma`

argument is *sigma* above.

A vector with the following elements

`ICC` |
The correlation |

`DEFF` |
The design effect, (the total sample size divided by the effective sample size) |

`SE` |
The standard error of the estimate |

The first and second moments of *P_i* are returned as an attribute

Patrick Brown

Brown and Jiang (2009), "Intraclass Correlation and the Design Effect for Binary Random Effects Models", unpublished.

1 2 3 4 5 6 | ```
# Design effect with conditional mean 0.5, standard deviation 1,
# 10 groups and 10 observations per group
DEFFbinary(0, 1, NperGroup=10, Ngroups = 10, Nsim=10000)
# the same with conditional mean 0.1
DEFFbinary(log(0.1/0.9), 1, NperGroup=10, Ngroups = 10, Nsim=10000)
``` |

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

All documentation is copyright its authors; we didn't write any of that.