Calculate Rao-Scott Adjusted Values for Clustered Binary Data
Source:R/RSCABS_AO.R
get_RS_adj_val.RdThis function calculates the Rao-Scott adjustment for clustered binary data to account for intra-cluster correlation when analyzing dose-response relationships.
Value
A tibble containing the following columns:
- grp
Treatment group identifier
- x
Total number of affected subjects in the treatment group
- n
Total number of subjects in the treatment group
- m
Number of replicates in the treatment group
- p_hat
Estimated proportion of affected subjects in the treatment group
- b
Binomial variance of p_hat
- v
Estimated variance accounting for clustering
- D
Design effect (ratio of cluster-adjusted variance to binomial variance)
- n_tilde
Adjusted sample size accounting for clustering
- x_tilde
Adjusted number of affected subjects accounting for clustering
Details
The function is modified based on the function written by Allen Olmstead. It first aggregates data by treatment group to calculate overall proportions. It then computes the variance within each treatment group accounting for clustering, and calculates a design effect (D) as the ratio of cluster-adjusted variance to binomial variance. The sample size and affected counts are then adjusted by dividing by this design effect.