Guide users through weighted parametric group sequential design using the wpgsd R package. Use this skill when the user asks about: correlated test statistics across hypotheses, generate_bounds, closed_test, correlation matrices for nested populations, or parametric multiplicity adjustment with group sequential designs.
Note: This skill targets wpgsd from github.com/Merck/wpgsd.
references/llms.txt (source: local Rd man pages)references/code_patterns.mdgenerate_bounds() - Compute group sequential bounds accounting for correlations across hypothesesclosed_test() - Closed testing procedure using weighted parametric testscalc_seq_p() - Calculate sequential p-valuesgenerate_corr() - Generate correlation matrix from event counts (for nested populations)generate_event_table() - Build event count table for correlation computationfind_astar() - Find adjusted alpha for spending functionfind_xi() - Find xi parameter for boundsFor detailed code templates, read references/code_patterns.md.
Topics covered:
calc_seq_p() (WPGSD and Bonferroni)generate_bounds() type parameter: 0 = Bonferroni (baseline), 1 = fixed spending, 2 = overall spending (single SF), 3 = separate spending (per-hypothesis SFs with inflation factor xi)sf/sfparm/t are lists (one per hypothesis); for type 2, they are scalars (single overall SF)(i, i) = events for hypothesis i alone; (i, j) = events in the intersection of populations i and jn_{1∧3} = n_1 (all H1 events are also H3 events)n_{1∧2} = control arm events onlyclosed_test() is needed (not just shortcut testing)generate_corr() bug for k > 2: Incorrectly computes within-hypothesis cross-analysis entries for non-adjacent analyses. For k > 2, build the event-count matrix D manually and compute corr = diag(1/sqrt(diag(D))) %*% D %*% diag(1/sqrt(diag(D))). See code_patterns.md section on manual correlation.